brepjs 20.11.3 → 20.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brepjs.cjs +4 -3
- package/dist/brepjs.js +4 -4
- package/dist/{drawFns-CccVnQU5.cjs → drawFns-C_YnK4Ar.cjs} +1 -1
- package/dist/{drawFns-OR6Hjs8g.js → drawFns-D6YK0JbH.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/text/fontRegistry.d.ts +12 -1
- package/dist/text.cjs +3 -2
- package/dist/text.d.ts +1 -1
- package/dist/text.js +3 -3
- package/dist/{textBlueprints-BRr35eaP.cjs → textBlueprints-C38JfUeN.cjs} +32 -8
- package/dist/{textBlueprints-BxoVq7Fr.js → textBlueprints-TLU7rjuN.js} +27 -9
- package/dist/{textMetrics-DaNriztv.js → textMetrics-CEnX8GBe.js} +1 -1
- package/dist/{textMetrics-DwMUM6GY.cjs → textMetrics-r9ldmBb5.cjs} +1 -1
- package/package.json +1 -1
package/dist/brepjs.cjs
CHANGED
|
@@ -24,18 +24,18 @@ const require_threadFns = require("./threadFns-BzxB-0i5.cjs");
|
|
|
24
24
|
const require_blueprintSketcher = require("./blueprintSketcher-CG4H8A6M.cjs");
|
|
25
25
|
const require_helpers = require("./helpers-GZyqAK5c.cjs");
|
|
26
26
|
const require_blueprint = require("./blueprint-CHBjfXQO.cjs");
|
|
27
|
-
const require_drawFns = require("./drawFns-
|
|
27
|
+
const require_drawFns = require("./drawFns-C_YnK4Ar.cjs");
|
|
28
28
|
const require_measureFns = require("./measureFns-Cyjpl2Kl.cjs");
|
|
29
29
|
const require_cornerFinder = require("./cornerFinder-Bg67ivza.cjs");
|
|
30
30
|
const require_boolean2D = require("./boolean2D-DjJogOY-.cjs");
|
|
31
31
|
const require_blueprintFns = require("./blueprintFns-DOdzDcPX.cjs");
|
|
32
32
|
const require_importFns = require("./importFns-C3LbWc6X.cjs");
|
|
33
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
33
|
+
const require_textBlueprints = require("./textBlueprints-C38JfUeN.cjs");
|
|
34
34
|
const require_loftFns = require("./loftFns-BsFinbgs.cjs");
|
|
35
35
|
const require_refResolveFns = require("./refResolveFns-awGNYa3x.cjs");
|
|
36
36
|
const require_adjacencyFns = require("./adjacencyFns-Cibtcqdl.cjs");
|
|
37
37
|
const require_cameraFns = require("./cameraFns-CUX8VNKT.cjs");
|
|
38
|
-
const require_textMetrics = require("./textMetrics-
|
|
38
|
+
const require_textMetrics = require("./textMetrics-r9ldmBb5.cjs");
|
|
39
39
|
const require_principalBoxFns = require("./principalBoxFns-uZrBoGLA.cjs");
|
|
40
40
|
const require_workerPool = require("./workerPool-D5tiNXrI.cjs");
|
|
41
41
|
// src/kernel/types.ts
|
|
@@ -9831,6 +9831,7 @@ exports.sdfTorus = torus;
|
|
|
9831
9831
|
exports.section = section;
|
|
9832
9832
|
exports.sectionToFace = sectionToFace;
|
|
9833
9833
|
exports.serializeHistory = require_threadFns.serializeHistory;
|
|
9834
|
+
exports.setFallbackFont = require_textBlueprints.setFallbackFont;
|
|
9834
9835
|
exports.setJointValue = require_threadFns.setJointValue;
|
|
9835
9836
|
exports.setJointValues = require_threadFns.setJointValues;
|
|
9836
9837
|
exports.setShapeOrigin = require_originTrackingFns.setShapeOrigin;
|
package/dist/brepjs.js
CHANGED
|
@@ -22,18 +22,18 @@ import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as plan
|
|
|
22
22
|
import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-CQPC4SEF.js";
|
|
23
23
|
import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-CBXclBes.js";
|
|
24
24
|
import { _ as approximateAsSvgCompatibleCurve, o as ellipseArcFlags } from "./blueprint-CN5dNZ1h.js";
|
|
25
|
-
import { A as sketchEllipse, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
25
|
+
import { A as sketchEllipse, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-D6YK0JbH.js";
|
|
26
26
|
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-DukwjzUl.js";
|
|
27
27
|
import { t as cornerFinder } from "./cornerFinder-utEooGH7.js";
|
|
28
28
|
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-tR_2N_Vy.js";
|
|
29
29
|
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, n as createCompoundBlueprint, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns--26Mr3Lm.js";
|
|
30
30
|
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-CcPhunG6.js";
|
|
31
|
-
import { a as
|
|
31
|
+
import { S as revolve$2, a as Sketches, b as extrude$2, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, i as setFallbackFont, l as compoundSketchLoft, m as sketchRevolve, n as getFont, o as Sketch, p as sketchLoft, r as loadFont, s as compoundSketchExtrude, t as textBlueprints, u as compoundSketchRevolve, x as extrudeAll, y as CompoundSketch } from "./textBlueprints-TLU7rjuN.js";
|
|
32
32
|
import { a as multiSectionSweep, c as twistExtrude, i as guidedSweep, n as loftAll, o as supportExtrude, r as complexExtrude, s as sweep$1, t as loft$2 } from "./loftFns-pMh0ET-J.js";
|
|
33
33
|
import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BvQkLKLw.js";
|
|
34
34
|
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns-C0YD3Zrp.js";
|
|
35
35
|
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-xUCRxpsa.js";
|
|
36
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-
|
|
36
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CEnX8GBe.js";
|
|
37
37
|
import { t as principalBoundingBox } from "./principalBoxFns-ClynMQMo.js";
|
|
38
38
|
import { _ as isSuccessResponse, a as createWorkerClient, c as enqueueTask, d as rejectAll, f as isBatchRequest, g as isOperationRequest, h as isInitRequest, i as registerHandler, l as isEmpty$1, m as isErrorResponse, n as createOperationRegistry, o as createTaskQueue, p as isDisposeRequest, r as createWorkerHandler, s as dequeueTask, t as createWorkerPool, u as pendingCount } from "./workerPool-Bc5hmJc4.js";
|
|
39
39
|
// \0rolldown/runtime.js
|
|
@@ -9303,4 +9303,4 @@ var csg_exports = /* @__PURE__ */ __exportAll({
|
|
|
9303
9303
|
zShapeProfile: () => zShapeProfile
|
|
9304
9304
|
});
|
|
9305
9305
|
/* v8 ignore file */
|
|
9306
|
-
export { BaseSketcher2d, BlueprintSketcher, BrepBugError, BrepErrorCode, BrepWrapperError, BrepkitAdapter, CompoundSketch, DEFAULT_CAPABILITIES, DEG2RAD, DisposalScope, EXACT_BREP_CAPABILITIES, FaceSketcher, GeometryCleanupError, HASH_CODE_MAX, OK, OcctWasmAdapter, RAD2DEG, Sketch, Sketcher, Sketches, addChild, addHoles, addJoint, addMate, addStep, adjacentFaces, all, andThen, applyGlue, applyMatrix, approximateCurve, as2D, as3D, asTopo, assignRoles, autoHeal, bezier, blueprintToContour, blueprintToDXF, booleanPipeline, booleans_exports as booleans, boss, box, bsplineApprox, bug, cameraFromPlane, cameraLookAt, captureHint, cast, castShape, castShape3D, chamfer, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkAllInterferences, checkBoolean, checkInterference, circle, circularPattern, classifyPointOnFace, clearMeshCache, clone, closedWire, collect, collectShapes, colorFaces, colorShape, complexExtrude, composeTransforms, compound, compoundSketchExtrude, compoundSketchFace, compoundSketchLoft, compoundSketchRevolve, computationError, computeStraightSkeleton, cone, construction_exports as construction, convexHull, cornerFinder, countNodes, createAssembly, createAssemblyNode, createBlueprint, createCamera, createCompound, createCompoundBlueprint, createDerivedFaceRef, createDistanceQuery, createEdge, createEdgeRef, createFace, createHandle, createHistory, createKernelHandle, createMeshCache, createNamedPlane, createOperationRegistry, createPlane, createRef, createRegistry, createShell, createSolid, createTaskQueue, createVertex, createVertexRef, createWire, createWorkerClient, createWorkerHandler, createWorkerPool, csg_exports as csg, currentQuality, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cut, cut2D, cutAll, cutAllBisect, cutBlueprints, cutWithEvolution, cylinder, cylindricalJoint, defaultScorer, dequeueTask, describe, deserializeDrawing, deserializeHistory, fromBREP as deserializeShape, downcast, draft, draw, drawCircle, drawEllipse, drawFaceOutline, drawParametricFunction, drawPointsInterpolation, drawPolysides, drawProjection, drawRectangle, drawRoundedRectangle, drawSingleCircle, drawSingleEllipse, drawText, drawingChamfer, drawingCut, drawingFillet, drawingFuse, drawingIntersect, drawingToSketchOnPlane, drill, edgeFinder, edgesOfFace, ellipse, ellipseArc, ellipsoid, enqueueTask, err, exportAssemblySTEP, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, exportURDF, extrude, extrudeAll, face, faceAxis, faceCenter, faceFinder, faceGeomType, faceOrientation, facesOfEdge, facesOfVertex, fieldBoolean, fieldContour, fieldOffset, fieldReinit, fieldShell, fill, filledFace, fillet, filletWithEvolution, findFacesByTag, findNode, findStep, fixSelfIntersection, fixShape, flatMap, flatten, flipFaceOrientation, flipOrientation, fontMetrics, forwardKinematics, fromBREP$1 as fromBREP, fromKernelDir, fromKernelPnt, fromKernelVec, fromNullable, fuse, fuse2D, fuseAll, fuseAllBisect, fuseBlueprints, fuseWithEvolution, gearGeometry, getActiveVoxelId, getBounds, getBounds2D, getCompSolids, getCurveType, getDisposalStats, getEdges, getFaceColor, getFaceOrigins, getFaceTags, getFaces, getFont, getHashCode, getShape as getHistoryShape, getKernel, getKernelCapabilities, getKernelTier, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getOrientation2D, getPerformanceStats, getShapeColor, getShapeKind, getShells, getSingleFace, getSolids, getSurfaceType, getTagMetadata, getVertices, getVoxel, getWires, gridPattern, guidedSweep, heal, healFace, healSolid, healWire, helix, hull, importDXF, importGLB, importIGES, importOBJ, importSTEP, importSTL, importSVG, importSVGPathD, importThreeMF, importURDF, init, initFromManifold, initFromOC, initVoxel, innerWires, instance, instanceCount, instanceGrid, instancedMesh, interpolateCurve, intersect, intersect2D, intersectBlueprints, intersectWithEvolution, invalidateShapeCache, inverseKinematics, ioNs_exports as io, ioError, is2D, is3D, isBatchRequest, isChamferRadius, isClosedWire, isCompSolid, isCompound, isDerivedFaceRef, isDisposeRequest, isEdge, isEdgeRef, isEmpty, isEqualShape, isErr, isErrorResponse, isFace, isFaceRef, isFilletRadius, isInitRequest, isInside2D, isInstanced, isLineageRef, isLive, isManifoldShell, isNumber, isOk, isOperationRequest, isOrientedFace, isPlanarFace, isPlanarWire, isProjectionPlane, isEmpty$1 as isQueueEmpty, isSameShape, isShape1D, isShape3D, isShell, isSolid, isSuccessResponse, isValid, isValidSolid, isVertex, isVertexRef, isWire, iterCompSolids, iterEdges, iterFaces, iterShells, iterSolids, iterTopo, iterVertices, iterWires, jointTrajectory, jointTransform, jointsFromDH, kernelCall, kernelCallRaw, kernelCallScoped, kernelError, latticeInfill, latticeInfillShape, line, linearPattern, loadFont, locate, loft, loftAll, makeBaseBox, makeExternalGear, makeInternalGear, makePlane, makePlanetaryGear, makeProjectedEdges, manifoldShell, map, mapBoth, mapErr, match, materialize, measureArea, measureCurvatureAt, measureCurvatureAtMid, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, measurement_exports as measurement, mechanismDOF, mesh, meshEdges, meshLODs, meshLODsProgressive, meshMultiLOD, minkowski, mirror, mirror2D, mirrorDrawing, mirrorJoin, modifiers_exports as modifiers, modifyStep, moduleInitError, multiSectionSweep, normalAt, offset, offsetFace, offsetMesh, offsetShape, offsetWire2D, ok, or, orElse, organiseBlueprints, orientedFace, outerWire, patterns_exports as patterns, pendingCount, pipeline, pivotPlane, planarFace, planarJoint, planarWire, planetPlacements, pocket, pointOnSurface, pointsInside, polygon, polyhedron, polysideInnerRadius, polysidesBlueprint, positionOnCurve, prewarm, primitives_exports as primitives, principalBoundingBox, prismaticJoint, projectEdges, projectPointOnFace, query_exports as query, queryError, rectangularPattern, registerHandler, registerKernel, registerKernelTier, registerOperation, registerShape, registerVoxel, rejectAll, removeChild, removeFaces, removeHolesFromFace, repairMesh, replayFrom, replayHistory, resetDisposalStats, resetPerformanceStats, resize, resolve, resolve3D, resolveDerivedFaceRef, resolveDirection, resolveEdgeRef, resolveLineageRef, resolvePlane, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, reverseCurve, revoluteJoint, revolve, roof, rotate, rotate2D, rotateDrawing, roundedRectangleBlueprint, scale, scale2D, scaleDrawing, box$1 as sdfBox, capsule as sdfCapsule, cone$1 as sdfCone, cylinder$1 as sdfCylinder, fieldAxialRamp as sdfFieldAxialRamp, fieldClamp as sdfFieldClamp, fieldConst as sdfFieldConst, fieldFromSdf as sdfFieldFromSdf, fieldRadialRamp as sdfFieldRadialRamp, lattice as sdfLattice, plane as sdfPlane, roundedBox as sdfRoundedBox, sphere as sdfSphere, strutLattice as sdfStrutLattice, sweep as sdfSweep, torus as sdfTorus, section, sectionToFace, serializeHistory, setJointValue, setJointValues, setShapeOrigin, setTagMetadata, sewShells, shape, shapeToMeshInput, shapeType, sharedEdges, shell, shellMesh, shellShape, shellWithEvolution, simplify, sketchCircle, sketchEllipse, sketchExtrude, sketchFace, sketchFaceOffset, sketchHelix, sketchLoft, sketchOnFace2D, sketchOnPlane2D, sketchParametricFunction, sketchPolysides, sketchRectangle, sketchRevolve, sketchRoundedRectangle, sketchSweep, sketchText, sketchWires, sketcherStateError, slice, solid, solidFromShell, solveAssembly, sphere$1 as sphere, sphericalJoint, split, stepCount, stepsFrom, stretch2D, subFace, supportExtrude, supportsConstraintSketch, supportsProjection, surfaceFromGrid, surfaceFromImage, sweep$1 as sweep, tagFaces, tangentArc, tap, tapErr, textBlueprints, textMetrics, thicken, thread, threePointArc, toBREP, toBufferGeometryData, toGroupedBufferGeometryData, toKernelVec, toLODGeometryData, toLODGeometryLevels, toLineGeometryData, toSVGPathD, toVec2, toVec3, torus$1 as torus, tpmsLattice, transformCopy, transforms_exports as transforms, translate, translate2D, translateDrawing, translatePlane, tryCatch, tryCatchAsync, twistExtrude, typeCastError, undoLast, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, updateNode, updateRoles, uvBounds, uvCoordinates, validSolid, validatePlanetary, validationError, variableFillet, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, vertex, vertexFinder, vertexPosition, verticesOfEdge, verticesOfFace, voxelBoolean, voxelBooleanField, voxelBooleanFieldShapes, voxelBooleanShapes, voxelField, voxelFieldFromShape, walkAssembly, windingNumbers, wire, wireFinder, wireLoop, wiresOfFace, withKernel, withKernelDir, withKernelPnt, withKernelVec, withQuality, withScope, withScopeResult, withScopeResultAsync, withTier, zip as zipResults };
|
|
9306
|
+
export { BaseSketcher2d, BlueprintSketcher, BrepBugError, BrepErrorCode, BrepWrapperError, BrepkitAdapter, CompoundSketch, DEFAULT_CAPABILITIES, DEG2RAD, DisposalScope, EXACT_BREP_CAPABILITIES, FaceSketcher, GeometryCleanupError, HASH_CODE_MAX, OK, OcctWasmAdapter, RAD2DEG, Sketch, Sketcher, Sketches, addChild, addHoles, addJoint, addMate, addStep, adjacentFaces, all, andThen, applyGlue, applyMatrix, approximateCurve, as2D, as3D, asTopo, assignRoles, autoHeal, bezier, blueprintToContour, blueprintToDXF, booleanPipeline, booleans_exports as booleans, boss, box, bsplineApprox, bug, cameraFromPlane, cameraLookAt, captureHint, cast, castShape, castShape3D, chamfer, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkAllInterferences, checkBoolean, checkInterference, circle, circularPattern, classifyPointOnFace, clearMeshCache, clone, closedWire, collect, collectShapes, colorFaces, colorShape, complexExtrude, composeTransforms, compound, compoundSketchExtrude, compoundSketchFace, compoundSketchLoft, compoundSketchRevolve, computationError, computeStraightSkeleton, cone, construction_exports as construction, convexHull, cornerFinder, countNodes, createAssembly, createAssemblyNode, createBlueprint, createCamera, createCompound, createCompoundBlueprint, createDerivedFaceRef, createDistanceQuery, createEdge, createEdgeRef, createFace, createHandle, createHistory, createKernelHandle, createMeshCache, createNamedPlane, createOperationRegistry, createPlane, createRef, createRegistry, createShell, createSolid, createTaskQueue, createVertex, createVertexRef, createWire, createWorkerClient, createWorkerHandler, createWorkerPool, csg_exports as csg, currentQuality, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cut, cut2D, cutAll, cutAllBisect, cutBlueprints, cutWithEvolution, cylinder, cylindricalJoint, defaultScorer, dequeueTask, describe, deserializeDrawing, deserializeHistory, fromBREP as deserializeShape, downcast, draft, draw, drawCircle, drawEllipse, drawFaceOutline, drawParametricFunction, drawPointsInterpolation, drawPolysides, drawProjection, drawRectangle, drawRoundedRectangle, drawSingleCircle, drawSingleEllipse, drawText, drawingChamfer, drawingCut, drawingFillet, drawingFuse, drawingIntersect, drawingToSketchOnPlane, drill, edgeFinder, edgesOfFace, ellipse, ellipseArc, ellipsoid, enqueueTask, err, exportAssemblySTEP, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, exportURDF, extrude, extrudeAll, face, faceAxis, faceCenter, faceFinder, faceGeomType, faceOrientation, facesOfEdge, facesOfVertex, fieldBoolean, fieldContour, fieldOffset, fieldReinit, fieldShell, fill, filledFace, fillet, filletWithEvolution, findFacesByTag, findNode, findStep, fixSelfIntersection, fixShape, flatMap, flatten, flipFaceOrientation, flipOrientation, fontMetrics, forwardKinematics, fromBREP$1 as fromBREP, fromKernelDir, fromKernelPnt, fromKernelVec, fromNullable, fuse, fuse2D, fuseAll, fuseAllBisect, fuseBlueprints, fuseWithEvolution, gearGeometry, getActiveVoxelId, getBounds, getBounds2D, getCompSolids, getCurveType, getDisposalStats, getEdges, getFaceColor, getFaceOrigins, getFaceTags, getFaces, getFont, getHashCode, getShape as getHistoryShape, getKernel, getKernelCapabilities, getKernelTier, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getOrientation2D, getPerformanceStats, getShapeColor, getShapeKind, getShells, getSingleFace, getSolids, getSurfaceType, getTagMetadata, getVertices, getVoxel, getWires, gridPattern, guidedSweep, heal, healFace, healSolid, healWire, helix, hull, importDXF, importGLB, importIGES, importOBJ, importSTEP, importSTL, importSVG, importSVGPathD, importThreeMF, importURDF, init, initFromManifold, initFromOC, initVoxel, innerWires, instance, instanceCount, instanceGrid, instancedMesh, interpolateCurve, intersect, intersect2D, intersectBlueprints, intersectWithEvolution, invalidateShapeCache, inverseKinematics, ioNs_exports as io, ioError, is2D, is3D, isBatchRequest, isChamferRadius, isClosedWire, isCompSolid, isCompound, isDerivedFaceRef, isDisposeRequest, isEdge, isEdgeRef, isEmpty, isEqualShape, isErr, isErrorResponse, isFace, isFaceRef, isFilletRadius, isInitRequest, isInside2D, isInstanced, isLineageRef, isLive, isManifoldShell, isNumber, isOk, isOperationRequest, isOrientedFace, isPlanarFace, isPlanarWire, isProjectionPlane, isEmpty$1 as isQueueEmpty, isSameShape, isShape1D, isShape3D, isShell, isSolid, isSuccessResponse, isValid, isValidSolid, isVertex, isVertexRef, isWire, iterCompSolids, iterEdges, iterFaces, iterShells, iterSolids, iterTopo, iterVertices, iterWires, jointTrajectory, jointTransform, jointsFromDH, kernelCall, kernelCallRaw, kernelCallScoped, kernelError, latticeInfill, latticeInfillShape, line, linearPattern, loadFont, locate, loft, loftAll, makeBaseBox, makeExternalGear, makeInternalGear, makePlane, makePlanetaryGear, makeProjectedEdges, manifoldShell, map, mapBoth, mapErr, match, materialize, measureArea, measureCurvatureAt, measureCurvatureAtMid, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, measurement_exports as measurement, mechanismDOF, mesh, meshEdges, meshLODs, meshLODsProgressive, meshMultiLOD, minkowski, mirror, mirror2D, mirrorDrawing, mirrorJoin, modifiers_exports as modifiers, modifyStep, moduleInitError, multiSectionSweep, normalAt, offset, offsetFace, offsetMesh, offsetShape, offsetWire2D, ok, or, orElse, organiseBlueprints, orientedFace, outerWire, patterns_exports as patterns, pendingCount, pipeline, pivotPlane, planarFace, planarJoint, planarWire, planetPlacements, pocket, pointOnSurface, pointsInside, polygon, polyhedron, polysideInnerRadius, polysidesBlueprint, positionOnCurve, prewarm, primitives_exports as primitives, principalBoundingBox, prismaticJoint, projectEdges, projectPointOnFace, query_exports as query, queryError, rectangularPattern, registerHandler, registerKernel, registerKernelTier, registerOperation, registerShape, registerVoxel, rejectAll, removeChild, removeFaces, removeHolesFromFace, repairMesh, replayFrom, replayHistory, resetDisposalStats, resetPerformanceStats, resize, resolve, resolve3D, resolveDerivedFaceRef, resolveDirection, resolveEdgeRef, resolveLineageRef, resolvePlane, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, reverseCurve, revoluteJoint, revolve, roof, rotate, rotate2D, rotateDrawing, roundedRectangleBlueprint, scale, scale2D, scaleDrawing, box$1 as sdfBox, capsule as sdfCapsule, cone$1 as sdfCone, cylinder$1 as sdfCylinder, fieldAxialRamp as sdfFieldAxialRamp, fieldClamp as sdfFieldClamp, fieldConst as sdfFieldConst, fieldFromSdf as sdfFieldFromSdf, fieldRadialRamp as sdfFieldRadialRamp, lattice as sdfLattice, plane as sdfPlane, roundedBox as sdfRoundedBox, sphere as sdfSphere, strutLattice as sdfStrutLattice, sweep as sdfSweep, torus as sdfTorus, section, sectionToFace, serializeHistory, setFallbackFont, setJointValue, setJointValues, setShapeOrigin, setTagMetadata, sewShells, shape, shapeToMeshInput, shapeType, sharedEdges, shell, shellMesh, shellShape, shellWithEvolution, simplify, sketchCircle, sketchEllipse, sketchExtrude, sketchFace, sketchFaceOffset, sketchHelix, sketchLoft, sketchOnFace2D, sketchOnPlane2D, sketchParametricFunction, sketchPolysides, sketchRectangle, sketchRevolve, sketchRoundedRectangle, sketchSweep, sketchText, sketchWires, sketcherStateError, slice, solid, solidFromShell, solveAssembly, sphere$1 as sphere, sphericalJoint, split, stepCount, stepsFrom, stretch2D, subFace, supportExtrude, supportsConstraintSketch, supportsProjection, surfaceFromGrid, surfaceFromImage, sweep$1 as sweep, tagFaces, tangentArc, tap, tapErr, textBlueprints, textMetrics, thicken, thread, threePointArc, toBREP, toBufferGeometryData, toGroupedBufferGeometryData, toKernelVec, toLODGeometryData, toLODGeometryLevels, toLineGeometryData, toSVGPathD, toVec2, toVec3, torus$1 as torus, tpmsLattice, transformCopy, transforms_exports as transforms, translate, translate2D, translateDrawing, translatePlane, tryCatch, tryCatchAsync, twistExtrude, typeCastError, undoLast, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, updateNode, updateRoles, uvBounds, uvCoordinates, validSolid, validatePlanetary, validationError, variableFillet, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, vertex, vertexFinder, vertexPosition, verticesOfEdge, verticesOfFace, voxelBoolean, voxelBooleanField, voxelBooleanFieldShapes, voxelBooleanShapes, voxelField, voxelFieldFromShape, walkAssembly, windingNumbers, wire, wireFinder, wireLoop, wiresOfFace, withKernel, withKernelDir, withKernelPnt, withKernelVec, withQuality, withScope, withScopeResult, withScopeResultAsync, withTier, zip as zipResults };
|
|
@@ -15,7 +15,7 @@ const require_helpers = require("./helpers-GZyqAK5c.cjs");
|
|
|
15
15
|
const require_blueprint = require("./blueprint-CHBjfXQO.cjs");
|
|
16
16
|
const require_cornerFinder = require("./cornerFinder-Bg67ivza.cjs");
|
|
17
17
|
const require_boolean2D = require("./boolean2D-DjJogOY-.cjs");
|
|
18
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
18
|
+
const require_textBlueprints = require("./textBlueprints-C38JfUeN.cjs");
|
|
19
19
|
const require_cameraFns = require("./cameraFns-CUX8VNKT.cjs");
|
|
20
20
|
// src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
@@ -15,7 +15,7 @@ import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoin
|
|
|
15
15
|
import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-CN5dNZ1h.js";
|
|
16
16
|
import { t as cornerFinder } from "./cornerFinder-utEooGH7.js";
|
|
17
17
|
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-tR_2N_Vy.js";
|
|
18
|
-
import { _ as
|
|
18
|
+
import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-TLU7rjuN.js";
|
|
19
19
|
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-xUCRxpsa.js";
|
|
20
20
|
// src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export { drawProjection, drawFaceOutline } from './sketching/draw3d.js';
|
|
|
66
66
|
export type { DrawingInterface, SketchData } from './2d/blueprints/lib.js';
|
|
67
67
|
export { sketchExtrude, sketchRevolve, sketchLoft, sketchSweep, sketchFace, sketchWires, compoundSketchExtrude, compoundSketchRevolve, compoundSketchFace, compoundSketchLoft, } from './sketching/sketchFns.js';
|
|
68
68
|
export { drawingToSketchOnPlane, drawingFuse, drawingCut, drawingIntersect, drawingFillet, drawingChamfer, translateDrawing, rotateDrawing, scaleDrawing, mirrorDrawing, } from './sketching/drawFns.js';
|
|
69
|
-
export { loadFont, getFont } from './text/fontRegistry.js';
|
|
69
|
+
export { loadFont, getFont, setFallbackFont } from './text/fontRegistry.js';
|
|
70
70
|
export { textBlueprints } from './text/textBlueprints.js';
|
|
71
71
|
export { sketchText } from './text/sketchText.js';
|
|
72
72
|
export { textMetrics, fontMetrics, type TextMetricsResult, type FontMetricsResult, } from './text/textMetrics.js';
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_blueprintSketcher = require("./blueprintSketcher-CG4H8A6M.cjs");
|
|
3
|
-
const require_drawFns = require("./drawFns-
|
|
4
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
+
const require_drawFns = require("./drawFns-C_YnK4Ar.cjs");
|
|
4
|
+
const require_textBlueprints = require("./textBlueprints-C38JfUeN.cjs");
|
|
5
5
|
// src/sketching.ts
|
|
6
6
|
/**
|
|
7
7
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-CQPC4SEF.js";
|
|
2
|
-
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
3
|
-
import { a as
|
|
2
|
+
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-D6YK0JbH.js";
|
|
3
|
+
import { a as Sketches, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, l as compoundSketchLoft, m as sketchRevolve, o as Sketch, p as sketchLoft, s as compoundSketchExtrude, u as compoundSketchRevolve, y as CompoundSketch } from "./textBlueprints-TLU7rjuN.js";
|
|
4
4
|
// src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
|
@@ -13,10 +13,21 @@ import { OpenTypeFont } from '../kernel/occt/wasmTypes/externals.js';
|
|
|
13
13
|
* @returns The parsed opentype.js Font object.
|
|
14
14
|
*/
|
|
15
15
|
export declare function loadFont(fontPath: string | ArrayBuffer, fontFamily?: string, force?: boolean): Promise<Result<OpenTypeFont>>;
|
|
16
|
+
/**
|
|
17
|
+
* Register a font that text functions use when no font has been loaded.
|
|
18
|
+
*
|
|
19
|
+
* Unlike {@link loadFont}, this does not occupy the `'default'` family: once any font is
|
|
20
|
+
* loaded, it takes precedence over the fallback.
|
|
21
|
+
*
|
|
22
|
+
* @param fontData - Raw OpenType/TrueType font bytes.
|
|
23
|
+
* @returns The parsed opentype.js Font object.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setFallbackFont(fontData: ArrayBuffer): Result<OpenTypeFont>;
|
|
16
26
|
/**
|
|
17
27
|
* Retrieve a previously loaded font by family name.
|
|
18
28
|
*
|
|
19
29
|
* @param fontFamily - Registry key (defaults to `'default'`).
|
|
20
|
-
* @returns The opentype.js Font object, or `undefined` if not loaded.
|
|
30
|
+
* @returns The opentype.js Font object, or `undefined` if not loaded. `'default'` resolves
|
|
31
|
+
* to the fallback font when no font has been loaded.
|
|
21
32
|
*/
|
|
22
33
|
export declare const getFont: (fontFamily?: string) => OpenTypeFont | undefined;
|
package/dist/text.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_textMetrics = require("./textMetrics-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-C38JfUeN.cjs");
|
|
3
|
+
const require_textMetrics = require("./textMetrics-r9ldmBb5.cjs");
|
|
4
4
|
exports.fontMetrics = require_textMetrics.fontMetrics;
|
|
5
5
|
exports.getFont = require_textBlueprints.getFont;
|
|
6
6
|
exports.loadFont = require_textBlueprints.loadFont;
|
|
7
|
+
exports.setFallbackFont = require_textBlueprints.setFallbackFont;
|
|
7
8
|
exports.sketchText = require_textMetrics.sketchText;
|
|
8
9
|
exports.textBlueprints = require_textBlueprints.textBlueprints;
|
|
9
10
|
exports.textMetrics = require_textMetrics.textMetrics;
|
package/dist/text.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* import { loadFont, sketchText } from 'brepjs/text';
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
export { loadFont, getFont } from './text/fontRegistry.js';
|
|
9
|
+
export { loadFont, getFont, setFallbackFont } from './text/fontRegistry.js';
|
|
10
10
|
export { textBlueprints } from './text/textBlueprints.js';
|
|
11
11
|
export { sketchText } from './text/sketchText.js';
|
|
12
12
|
export { textMetrics, fontMetrics, type TextMetricsResult, type FontMetricsResult, } from './text/textMetrics.js';
|
package/dist/text.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-
|
|
2
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-
|
|
3
|
-
export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
|
|
1
|
+
import { i as setFallbackFont, n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-TLU7rjuN.js";
|
|
2
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CEnX8GBe.js";
|
|
3
|
+
export { fontMetrics, getFont, loadFont, setFallbackFont, sketchText, textBlueprints, textMetrics };
|
|
@@ -824,25 +824,43 @@ async function loadFont(fontPath, fontFamily = "default", force = false) {
|
|
|
824
824
|
if (!response.ok) return require_errors.err(require_errors.ioError(require_errors.BrepErrorCode.FONT_FETCH_FAILED, `Failed to fetch font from ${fontPath}: HTTP ${response.status} ${response.statusText}`));
|
|
825
825
|
fontData = await response.arrayBuffer();
|
|
826
826
|
} else fontData = fontPath;
|
|
827
|
-
|
|
827
|
+
const parsed = parseFont(fontData);
|
|
828
|
+
if (!parsed.ok) return parsed;
|
|
829
|
+
FONT_REGISTER[fontFamily] = parsed.value;
|
|
830
|
+
if (!FONT_REGISTER["default"]) FONT_REGISTER["default"] = parsed.value;
|
|
831
|
+
return parsed;
|
|
832
|
+
}
|
|
833
|
+
function parseFont(fontData) {
|
|
828
834
|
try {
|
|
829
|
-
|
|
835
|
+
return require_errors.ok(opentype_js.default.parse(fontData));
|
|
830
836
|
} catch (e) {
|
|
831
837
|
return require_errors.err(require_errors.ioError(require_errors.BrepErrorCode.FONT_PARSE_FAILED, `Failed to parse font data: ${e instanceof Error ? e.message : String(e)}`, e));
|
|
832
838
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
839
|
+
}
|
|
840
|
+
var fallbackFont;
|
|
841
|
+
/**
|
|
842
|
+
* Register a font that text functions use when no font has been loaded.
|
|
843
|
+
*
|
|
844
|
+
* Unlike {@link loadFont}, this does not occupy the `'default'` family: once any font is
|
|
845
|
+
* loaded, it takes precedence over the fallback.
|
|
846
|
+
*
|
|
847
|
+
* @param fontData - Raw OpenType/TrueType font bytes.
|
|
848
|
+
* @returns The parsed opentype.js Font object.
|
|
849
|
+
*/
|
|
850
|
+
function setFallbackFont(fontData) {
|
|
851
|
+
const parsed = parseFont(fontData);
|
|
852
|
+
if (parsed.ok) fallbackFont = parsed.value;
|
|
853
|
+
return parsed;
|
|
837
854
|
}
|
|
838
855
|
/**
|
|
839
856
|
* Retrieve a previously loaded font by family name.
|
|
840
857
|
*
|
|
841
858
|
* @param fontFamily - Registry key (defaults to `'default'`).
|
|
842
|
-
* @returns The opentype.js Font object, or `undefined` if not loaded.
|
|
859
|
+
* @returns The opentype.js Font object, or `undefined` if not loaded. `'default'` resolves
|
|
860
|
+
* to the fallback font when no font has been loaded.
|
|
843
861
|
*/
|
|
844
862
|
var getFont = (fontFamily = "default") => {
|
|
845
|
-
return FONT_REGISTER[fontFamily];
|
|
863
|
+
return FONT_REGISTER[fontFamily] ?? (fontFamily === "default" ? fallbackFont : void 0);
|
|
846
864
|
};
|
|
847
865
|
// src/text/textBlueprints.ts
|
|
848
866
|
var sketchFontCommands = function* (commands) {
|
|
@@ -960,6 +978,12 @@ Object.defineProperty(exports, "revolve", {
|
|
|
960
978
|
return revolve;
|
|
961
979
|
}
|
|
962
980
|
});
|
|
981
|
+
Object.defineProperty(exports, "setFallbackFont", {
|
|
982
|
+
enumerable: true,
|
|
983
|
+
get: function() {
|
|
984
|
+
return setFallbackFont;
|
|
985
|
+
}
|
|
986
|
+
});
|
|
963
987
|
Object.defineProperty(exports, "sketchExtrude", {
|
|
964
988
|
enumerable: true,
|
|
965
989
|
get: function() {
|
|
@@ -822,25 +822,43 @@ async function loadFont(fontPath, fontFamily = "default", force = false) {
|
|
|
822
822
|
if (!response.ok) return err(ioError(BrepErrorCode.FONT_FETCH_FAILED, `Failed to fetch font from ${fontPath}: HTTP ${response.status} ${response.statusText}`));
|
|
823
823
|
fontData = await response.arrayBuffer();
|
|
824
824
|
} else fontData = fontPath;
|
|
825
|
-
|
|
825
|
+
const parsed = parseFont(fontData);
|
|
826
|
+
if (!parsed.ok) return parsed;
|
|
827
|
+
FONT_REGISTER[fontFamily] = parsed.value;
|
|
828
|
+
if (!FONT_REGISTER["default"]) FONT_REGISTER["default"] = parsed.value;
|
|
829
|
+
return parsed;
|
|
830
|
+
}
|
|
831
|
+
function parseFont(fontData) {
|
|
826
832
|
try {
|
|
827
|
-
|
|
833
|
+
return ok(opentype.parse(fontData));
|
|
828
834
|
} catch (e) {
|
|
829
835
|
return err(ioError(BrepErrorCode.FONT_PARSE_FAILED, `Failed to parse font data: ${e instanceof Error ? e.message : String(e)}`, e));
|
|
830
836
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
837
|
+
}
|
|
838
|
+
var fallbackFont;
|
|
839
|
+
/**
|
|
840
|
+
* Register a font that text functions use when no font has been loaded.
|
|
841
|
+
*
|
|
842
|
+
* Unlike {@link loadFont}, this does not occupy the `'default'` family: once any font is
|
|
843
|
+
* loaded, it takes precedence over the fallback.
|
|
844
|
+
*
|
|
845
|
+
* @param fontData - Raw OpenType/TrueType font bytes.
|
|
846
|
+
* @returns The parsed opentype.js Font object.
|
|
847
|
+
*/
|
|
848
|
+
function setFallbackFont(fontData) {
|
|
849
|
+
const parsed = parseFont(fontData);
|
|
850
|
+
if (parsed.ok) fallbackFont = parsed.value;
|
|
851
|
+
return parsed;
|
|
835
852
|
}
|
|
836
853
|
/**
|
|
837
854
|
* Retrieve a previously loaded font by family name.
|
|
838
855
|
*
|
|
839
856
|
* @param fontFamily - Registry key (defaults to `'default'`).
|
|
840
|
-
* @returns The opentype.js Font object, or `undefined` if not loaded.
|
|
857
|
+
* @returns The opentype.js Font object, or `undefined` if not loaded. `'default'` resolves
|
|
858
|
+
* to the fallback font when no font has been loaded.
|
|
841
859
|
*/
|
|
842
860
|
var getFont = (fontFamily = "default") => {
|
|
843
|
-
return FONT_REGISTER[fontFamily];
|
|
861
|
+
return FONT_REGISTER[fontFamily] ?? (fontFamily === "default" ? fallbackFont : void 0);
|
|
844
862
|
};
|
|
845
863
|
// src/text/textBlueprints.ts
|
|
846
864
|
var sketchFontCommands = function* (commands) {
|
|
@@ -886,4 +904,4 @@ function textBlueprints(text, { startX = 0, startY = 0, fontSize = 16, fontFamil
|
|
|
886
904
|
const blueprints = Array.from(sketchFontCommands(writtenText.commands));
|
|
887
905
|
return organiseBlueprints(blueprints).mirror([0, 0]);
|
|
888
906
|
}
|
|
889
|
-
export {
|
|
907
|
+
export { revolve as S, wrapSketchData as _, Sketches as a, extrude as b, compoundSketchFace as c, sketchExtrude as d, sketchFace as f, sketchWires as g, sketchSweep as h, setFallbackFont as i, compoundSketchLoft as l, sketchRevolve as m, getFont as n, Sketch as o, sketchLoft as p, loadFont as r, compoundSketchExtrude as s, textBlueprints as t, compoundSketchRevolve as u, wrapSketchDataArray as v, extrudeAll as x, CompoundSketch as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
2
|
-
import {
|
|
2
|
+
import { _ as wrapSketchData, a as Sketches, n as getFont, t as textBlueprints, y as CompoundSketch } from "./textBlueprints-TLU7rjuN.js";
|
|
3
3
|
// src/text/sketchText.ts
|
|
4
4
|
/**
|
|
5
5
|
* Render text as 3D sketch outlines on a plane.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-C38JfUeN.cjs");
|
|
3
3
|
// src/text/sketchText.ts
|
|
4
4
|
/**
|
|
5
5
|
* Render text as 3D sketch outlines on a plane.
|