brepjs 18.6.0 → 18.14.3
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/README.md +6 -0
- package/dist/{sketching/sketcher2d.d.ts → 2d/blueprints/baseSketcher2d.d.ts} +4 -91
- package/dist/2d/blueprints/blueprint.d.ts +0 -1
- package/dist/2d/blueprints/blueprintApproximations.d.ts +0 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts +0 -1
- package/dist/2d/blueprints/blueprintFns.d.ts +0 -1
- package/dist/2d/blueprints/blueprintOffset.d.ts +0 -1
- package/dist/2d/blueprints/blueprintSketcher.d.ts +29 -0
- package/dist/2d/blueprints/blueprints.d.ts +0 -1
- package/dist/2d/blueprints/boolean2D.d.ts +0 -1
- package/dist/2d/blueprints/booleanHelpers.d.ts +0 -1
- package/dist/2d/blueprints/booleanOperations.d.ts +0 -1
- package/dist/2d/blueprints/cannedBlueprints.d.ts +0 -1
- package/dist/2d/blueprints/compoundBlueprint.d.ts +0 -1
- package/dist/{sketching → 2d/blueprints}/ellipseUtils.d.ts +19 -2
- package/dist/{sketching/sketcherlib.d.ts → 2d/blueprints/genericSketcher.d.ts} +1 -20
- package/dist/2d/blueprints/index.d.ts +0 -1
- package/dist/2d/blueprints/intersectionSegments.d.ts +0 -1
- package/dist/2d/blueprints/lib.d.ts +0 -1
- package/dist/2d/blueprints/segmentAssembly.d.ts +0 -1
- package/dist/2d/blueprints/svg.d.ts +0 -1
- package/dist/2d/curve2dGeometryFns.d.ts +0 -1
- package/dist/2d/curves.d.ts +0 -1
- package/dist/2d/lib/approximations.d.ts +0 -1
- package/dist/2d/lib/boundingBox2d.d.ts +0 -1
- package/dist/2d/lib/curve2D.d.ts +0 -1
- package/dist/2d/lib/curve2dFns.d.ts +0 -1
- package/dist/2d/lib/customCorners.d.ts +0 -1
- package/dist/2d/lib/definitions.d.ts +0 -1
- package/dist/2d/lib/index.d.ts +0 -1
- package/dist/2d/lib/intersections.d.ts +0 -1
- package/dist/2d/lib/makeCurves.d.ts +0 -1
- package/dist/2d/lib/offset.d.ts +0 -1
- package/dist/2d/lib/precision.d.ts +0 -1
- package/dist/2d/lib/stitching.d.ts +0 -1
- package/dist/2d/lib/svgPath.d.ts +0 -1
- package/dist/2d/lib/utils.d.ts +0 -1
- package/dist/2d/lib/vectorOperations.d.ts +0 -1
- package/dist/2d.cjs +20 -19
- package/dist/2d.d.ts +0 -1
- package/dist/2d.js +7 -6
- package/dist/{blueprint-CscZ0-wr.cjs → blueprint-B8ogGJiQ.cjs} +16 -15
- package/dist/{blueprint-BCoJbaQN.js → blueprint-Dv45Evnu.js} +16 -15
- package/dist/{blueprintFns-DQP4KQHE.cjs → blueprintFns-BK3FYYjO.cjs} +4 -4
- package/dist/{blueprintFns-BZlx6BjG.js → blueprintFns-a9C2g8_E.js} +3 -3
- package/dist/{boolean2D-k1AJmCMp.cjs → blueprintSketcher-Bei866Bt.cjs} +65 -1383
- package/dist/{boolean2D-JvgjbESt.js → blueprintSketcher-xDsl9GXO.js} +70 -1316
- package/dist/boolean2D-DGuiEJHA.cjs +902 -0
- package/dist/boolean2D-Z7P0c012.js +855 -0
- package/dist/{booleanFns-D13Pb-NO.js → booleanFns-CRa80qMX.js} +9 -9
- package/dist/{booleanFns-DQW4lt7H.cjs → booleanFns-qmgMQyDl.cjs} +12 -12
- package/dist/brepjs.cjs +772 -112
- package/dist/brepjs.js +692 -42
- package/dist/cameraFns-1y1NyACI.cjs +315 -0
- package/dist/cameraFns-CUzI5RKS.js +274 -0
- package/dist/core/constants.d.ts +0 -1
- package/dist/core/curve2dHandle.d.ts +0 -1
- package/dist/core/dimensionTypes.d.ts +0 -1
- package/dist/core/disposal.d.ts +0 -1
- package/dist/core/errors.d.ts +0 -1
- package/dist/core/kernelBoundary.d.ts +0 -1
- package/dist/core/kernelCall.d.ts +0 -1
- package/dist/core/kernelErrorTranslation.d.ts +0 -1
- package/dist/core/planeOps.d.ts +0 -1
- package/dist/core/planeTypes.d.ts +0 -1
- package/dist/core/result.d.ts +0 -1
- package/dist/core/shapeTypeCache.d.ts +0 -1
- package/dist/core/shapeTypes.d.ts +0 -1
- package/dist/core/typeDiscriminants.d.ts +0 -1
- package/dist/core/types.d.ts +0 -1
- package/dist/core/validityTypes.d.ts +0 -1
- package/dist/core/vecOps.d.ts +0 -1
- package/dist/core.cjs +6 -6
- package/dist/core.d.ts +0 -1
- package/dist/core.js +6 -6
- package/dist/{cornerFinder-5BYE2cbd.cjs → cornerFinder-CC8EBRCR.cjs} +3 -3
- package/dist/{cornerFinder-Zg7pf2s0.js → cornerFinder-Dix2ghke.js} +3 -3
- package/dist/{curveFns-DhqUp0EI.js → curveFns-B4tWuinR.js} +2 -2
- package/dist/{curveFns-DrT54cm8.cjs → curveFns-CD20-4fM.cjs} +2 -2
- package/dist/{drawFns-lUXjhTYL.js → drawFns-BsarLfUN.js} +163 -769
- package/dist/{drawFns-DmP2o1oF.cjs → drawFns-LlOZoFyp.cjs} +203 -985
- package/dist/{errors-DboJwVCf.js → errors-0fYW_YnO.js} +2 -1
- package/dist/{errors-CXRNVCec.cjs → errors-Dv6pfNct.cjs} +2 -1
- package/dist/{extrudeFns-B9bVCt3C.js → extrudeFns-7pE8dIWz.js} +3 -3
- package/dist/{extrudeFns-BtblHdaJ.cjs → extrudeFns-DD36mWKv.cjs} +3 -3
- package/dist/faceFns-BFWz17_E.js +218 -0
- package/dist/faceFns-DP7i60yJ.cjs +343 -0
- package/dist/gear/gearFns.d.ts +129 -0
- package/dist/gear/gearMath.d.ts +88 -0
- package/dist/gear/gearProfile.d.ts +16 -0
- package/dist/gear/index.d.ts +3 -0
- package/dist/{helpers-BpXNcxuJ.cjs → helpers-Cyj6gaqy.cjs} +14 -13
- package/dist/{helpers-S_Ht6gwX.js → helpers-vV2ONZwD.js} +9 -8
- package/dist/{historyFns-B01hrkcJ.js → historyFns-DGb61ETW.js} +6 -6
- package/dist/{historyFns-RHO-QvEZ.cjs → historyFns-DfyrPjnK.cjs} +6 -6
- package/dist/{importFns-CG49lyTm.cjs → importFns-C-p0vl_h.cjs} +11 -19
- package/dist/{importFns-C0tUyeiW.js → importFns-Ci-L2iB3.js} +11 -19
- package/dist/index.d.ts +16 -8
- package/dist/io/dxfExportFns.d.ts +0 -1
- package/dist/io/dxfImportFns.d.ts +0 -1
- package/dist/io/gltfExportFns.d.ts +0 -1
- package/dist/io/gltfImportFns.d.ts +0 -1
- package/dist/io/importFns.d.ts +0 -1
- package/dist/io/ioUtils.d.ts +0 -1
- package/dist/io/objExportFns.d.ts +0 -1
- package/dist/io/objImportFns.d.ts +0 -1
- package/dist/io/stepConfigFns.d.ts +0 -1
- package/dist/io/svgImportFns.d.ts +0 -1
- package/dist/io/threemfExportFns.d.ts +0 -1
- package/dist/io/threemfImportFns.d.ts +0 -1
- package/dist/io.cjs +2 -2
- package/dist/io.d.ts +0 -1
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/booleanOps.d.ts +23 -1
- package/dist/kernel/brepkit/brepkitAdapter.d.ts +21 -408
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +0 -1
- package/dist/kernel/brepkit/constructionOps.d.ts +51 -1
- package/dist/kernel/brepkit/evolutionOps.d.ts +34 -3
- package/dist/kernel/brepkit/geometryOps.d.ts +63 -2
- package/dist/kernel/brepkit/helpers.d.ts +6 -1
- package/dist/kernel/brepkit/internalOps.d.ts +0 -1
- package/dist/kernel/brepkit/ioOps.d.ts +47 -9
- package/dist/kernel/brepkit/kernel2dOps.d.ts +113 -1
- package/dist/kernel/brepkit/measureOps.d.ts +39 -1
- package/dist/kernel/brepkit/meshOps.d.ts +7 -1
- package/dist/kernel/brepkit/modifierOps.d.ts +15 -1
- package/dist/kernel/brepkit/repairOps.d.ts +14 -1
- package/dist/kernel/brepkit/sketchOps.d.ts +3 -1
- package/dist/kernel/brepkit/sweepOps.d.ts +37 -1
- package/dist/kernel/brepkit/topologyOps.d.ts +16 -1
- package/dist/kernel/brepkit/transformOps.d.ts +18 -1
- package/dist/kernel/geometry2d.d.ts +0 -1
- package/dist/kernel/index.d.ts +0 -1
- package/dist/kernel/interfaces/booleanOps.d.ts +0 -1
- package/dist/kernel/interfaces/builderOps.d.ts +0 -1
- package/dist/kernel/interfaces/core.d.ts +0 -1
- package/dist/kernel/interfaces/curveOps.d.ts +0 -1
- package/dist/kernel/interfaces/evolutionOps.d.ts +0 -1
- package/dist/kernel/interfaces/index.d.ts +0 -1
- package/dist/kernel/interfaces/ioOps.d.ts +0 -1
- package/dist/kernel/interfaces/measureOps.d.ts +0 -1
- package/dist/kernel/interfaces/meshOps.d.ts +0 -1
- package/dist/kernel/interfaces/modifierOps.d.ts +0 -1
- package/dist/kernel/interfaces/primitiveOps.d.ts +0 -1
- package/dist/kernel/interfaces/repairOps.d.ts +0 -1
- package/dist/kernel/interfaces/surfaceOps.d.ts +0 -1
- package/dist/kernel/interfaces/sweepOps.d.ts +0 -1
- package/dist/kernel/interfaces/topologyOps.d.ts +0 -1
- package/dist/kernel/interfaces/transformOps.d.ts +0 -1
- package/dist/kernel/kernel2dTypes.d.ts +0 -1
- package/dist/kernel/occt/advancedOps.d.ts +126 -24
- package/dist/kernel/occt/booleanBatchOps.d.ts +0 -1
- package/dist/kernel/occt/booleanOps.d.ts +11 -1
- package/dist/kernel/occt/booleanPipelineOps.d.ts +10 -1
- package/dist/kernel/occt/constructorOps.d.ts +14 -1
- package/dist/kernel/occt/curveOps.d.ts +13 -1
- package/dist/kernel/occt/defaultAdapter.d.ts +10 -441
- package/dist/kernel/occt/evolutionOps.d.ts +0 -1
- package/dist/kernel/occt/extendedConstructorOps.d.ts +31 -1
- package/dist/kernel/occt/geometryQueryOps.d.ts +40 -1
- package/dist/kernel/occt/healingOps.d.ts +6 -1
- package/dist/kernel/occt/historyOps.d.ts +17 -1
- package/dist/kernel/occt/hullOps.d.ts +14 -1
- package/dist/kernel/occt/ioOps.d.ts +9 -1
- package/dist/kernel/occt/kernel2dOps.d.ts +113 -1
- package/dist/kernel/occt/measureOps.d.ts +19 -1
- package/dist/kernel/occt/meshOps.d.ts +5 -1
- package/dist/kernel/occt/modifierOps.d.ts +24 -1
- package/dist/kernel/occt/nurbsQueryOps.d.ts +5 -1
- package/dist/kernel/occt/sweepOps.d.ts +23 -1
- package/dist/kernel/occt/topologyOps.d.ts +10 -1
- package/dist/kernel/occt/transformOps.d.ts +14 -4
- package/dist/kernel/occt/wasmTypes/externals.d.ts +0 -1
- package/dist/kernel/occt/wasmTypes/index.d.ts +0 -1
- package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts +0 -1
- package/dist/kernel/occtWasm/adapterShims.d.ts +4 -0
- package/dist/kernel/occtWasm/booleanOps.d.ts +11 -0
- package/dist/kernel/occtWasm/constructionOps.d.ts +36 -0
- package/dist/kernel/occtWasm/curveOps.d.ts +23 -0
- package/dist/kernel/occtWasm/evolutionOps.d.ts +17 -0
- package/dist/kernel/occtWasm/helpers.d.ts +31 -0
- package/dist/kernel/occtWasm/hullOps.d.ts +12 -0
- package/dist/kernel/occtWasm/ioOps.d.ts +52 -0
- package/dist/kernel/occtWasm/kernel2dOps.d.ts +90 -0
- package/dist/kernel/occtWasm/measureOps.d.ts +31 -0
- package/dist/kernel/occtWasm/meshOps.d.ts +6 -0
- package/dist/kernel/occtWasm/modifierOps.d.ts +14 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +30 -31
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +0 -1
- package/dist/kernel/occtWasm/primitiveOps.d.ts +10 -0
- package/dist/kernel/occtWasm/repairOps.d.ts +10 -0
- package/dist/kernel/occtWasm/surfaceOps.d.ts +28 -0
- package/dist/kernel/occtWasm/sweepOps.d.ts +38 -0
- package/dist/kernel/occtWasm/topologyOps.d.ts +14 -0
- package/dist/kernel/occtWasm/transformOps.d.ts +27 -0
- package/dist/kernel/perfStats.d.ts +0 -1
- package/dist/kernel/solverAdapter.d.ts +0 -1
- package/dist/kernel/types.d.ts +0 -1
- package/dist/{measureFns-C751QGI1.cjs → measureFns-6ifSQfJt.cjs} +6 -5
- package/dist/{measureFns-B8C85hbT.js → measureFns-Io2nHE1k.js} +4 -3
- package/dist/measurement/interferenceFns.d.ts +0 -1
- package/dist/measurement/measureCache.d.ts +0 -1
- package/dist/measurement/measureFns.d.ts +0 -1
- package/dist/measurement/measureTypes.d.ts +0 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.d.ts +0 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-Cdhtbrhm.cjs → meshFns-BCRVZgPi.cjs} +3 -3
- package/dist/{meshFns-BgvsA-xA.js → meshFns-DSdkRFWq.js} +3 -3
- package/dist/ns/booleans.d.ts +0 -1
- package/dist/ns/construction.d.ts +0 -1
- package/dist/ns/ioNs.d.ts +0 -1
- package/dist/ns/measurement.d.ts +0 -1
- package/dist/ns/modifiers.d.ts +0 -1
- package/dist/ns/patterns.d.ts +0 -1
- package/dist/ns/primitives.d.ts +0 -1
- package/dist/ns/query.d.ts +0 -1
- package/dist/ns/transforms.d.ts +0 -1
- package/dist/occtWasmAdapter--TZGP9DX.js +4606 -0
- package/dist/occtWasmAdapter-C2VW-uYg.cjs +4719 -0
- package/dist/operations/api.d.ts +0 -1
- package/dist/operations/assemblyFns.d.ts +0 -1
- package/dist/operations/compoundOpsFns.d.ts +0 -1
- package/dist/operations/convexHullFns.d.ts +0 -1
- package/dist/operations/exporterFns.d.ts +0 -1
- package/dist/operations/exporterUtils.d.ts +0 -1
- package/dist/operations/exporters.d.ts +0 -1
- package/dist/operations/extrudeFns.d.ts +0 -1
- package/dist/operations/extrudeUtils.d.ts +0 -1
- package/dist/operations/guidedSweepFns.d.ts +0 -1
- package/dist/operations/historyFns.d.ts +0 -1
- package/dist/operations/loftFns.d.ts +0 -1
- package/dist/operations/mateFns.d.ts +0 -1
- package/dist/operations/multiSweepFns.d.ts +0 -1
- package/dist/operations/patternFns.d.ts +0 -1
- package/dist/operations/roofFns.d.ts +0 -1
- package/dist/operations/straightSkeleton.d.ts +0 -1
- package/dist/operations/sweepFns.d.ts +0 -1
- package/dist/operations.cjs +2 -2
- package/dist/operations.d.ts +0 -1
- package/dist/operations.js +2 -2
- package/dist/{planeOps-sTrM3dcQ.js → planeOps-4i2qEraD.js} +4 -4
- package/dist/{planeOps-BJOIbn4K.cjs → planeOps-CH4ruLuj.cjs} +4 -4
- package/dist/{primitiveFns-BLxaJ40A.cjs → primitiveFns-BH-JQPzh.cjs} +20 -19
- package/dist/{primitiveFns-fR9sWOEb.js → primitiveFns-C1p92ZcD.js} +8 -7
- package/dist/projection/cameraFns.d.ts +0 -1
- package/dist/projection/makeProjectedEdges.d.ts +0 -1
- package/dist/projection/projectionPlanes.d.ts +0 -1
- package/dist/projection.cjs +9 -0
- package/dist/projection.d.ts +11 -0
- package/dist/projection.js +2 -0
- package/dist/query/cornerFinder.d.ts +0 -1
- package/dist/query/directionUtils.d.ts +0 -1
- package/dist/query/edgeFinder.d.ts +0 -1
- package/dist/query/faceFinder.d.ts +0 -1
- package/dist/query/finderCore.d.ts +0 -1
- package/dist/query/finderFns.d.ts +0 -1
- package/dist/query/helpers.d.ts +0 -1
- package/dist/query/shapeDistanceFilter.d.ts +0 -1
- package/dist/query/shapeFinders.d.ts +0 -1
- package/dist/query/vertexFinder.d.ts +0 -1
- package/dist/query/wireFinder.d.ts +0 -1
- package/dist/query.cjs +2 -2
- package/dist/query.d.ts +0 -1
- package/dist/query.js +2 -2
- package/dist/result.cjs +1 -1
- package/dist/result.d.ts +0 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-183zCtMc.cjs → shapeFns-B7x82K11.cjs} +17 -17
- package/dist/{shapeFns-2X3VOi1a.js → shapeFns-BhZ9weSI.js} +4 -4
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.d.ts +0 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-CU1Jwq9C.js → shapeRefFns-B9PsEqWf.js} +6 -4
- package/dist/{shapeRefFns-CFyv5cdW.cjs → shapeRefFns-wDY88A8u.cjs} +8 -6
- package/dist/{shapeTypes-C0MDggKf.cjs → shapeTypes-BTt_LLbk.cjs} +6922 -7884
- package/dist/{shapeTypes-CN0GUoHr.js → shapeTypes-C--1jaT1.js} +6900 -7862
- package/dist/sketching/cannedSketches.d.ts +0 -1
- package/dist/sketching/compoundSketch.d.ts +8 -7
- package/dist/sketching/draw3d.d.ts +1 -2
- package/dist/sketching/drawFns.d.ts +4 -3
- package/dist/sketching/{draw.d.ts → drawing.d.ts} +2 -127
- package/dist/sketching/drawingFactories.d.ts +94 -0
- package/dist/sketching/drawingPen.d.ts +34 -0
- package/dist/sketching/faceSketcher.d.ts +52 -0
- package/dist/sketching/shortcuts.d.ts +0 -1
- package/dist/sketching/sketch.d.ts +64 -10
- package/dist/sketching/sketchFns.d.ts +42 -95
- package/dist/sketching/sketcher.d.ts +2 -3
- package/dist/sketching/sketches.d.ts +5 -6
- package/dist/sketching.cjs +19 -18
- package/dist/sketching.d.ts +8 -5
- package/dist/sketching.js +3 -2
- package/dist/{solidBuilders-DACzFqvX.cjs → solidBuilders-CX_197Xm.cjs} +3 -3
- package/dist/{solidBuilders-BuS5ByIl.js → solidBuilders-Xs7VDMGD.js} +3 -3
- package/dist/{surfaceBuilders-CbH4FIW5.cjs → surfaceBuilders-CYeTNW33.cjs} +25 -3
- package/dist/{surfaceBuilders-BVH2SL-z.js → surfaceBuilders-CinmHCbZ.js} +20 -4
- package/dist/text/fontRegistry.d.ts +22 -0
- package/dist/text/sketchText.d.ts +30 -0
- package/dist/text/textBlueprints.d.ts +0 -91
- package/dist/text/textMetrics.d.ts +39 -0
- package/dist/text.cjs +9 -0
- package/dist/text.d.ts +12 -0
- package/dist/text.js +3 -0
- package/dist/textBlueprints-Do6xNsLt.js +643 -0
- package/dist/textBlueprints-oWhiABaY.cjs +800 -0
- package/dist/textMetrics-BjJ8sn_e.js +69 -0
- package/dist/textMetrics-CUvtglQE.cjs +86 -0
- package/dist/topology/adjacencyFns.d.ts +0 -1
- package/dist/topology/api.d.ts +0 -1
- package/dist/topology/apiTypes.d.ts +0 -1
- package/dist/topology/booleanDiagnosticFns.d.ts +0 -1
- package/dist/topology/booleanFns.d.ts +0 -1
- package/dist/topology/cast.d.ts +0 -1
- package/dist/topology/chamferAngleFns.d.ts +0 -1
- package/dist/topology/compoundOpsFns.d.ts +0 -1
- package/dist/topology/curveBuilders.d.ts +12 -1
- package/dist/topology/curveFns.d.ts +0 -1
- package/dist/topology/evolutionFns.d.ts +0 -1
- package/dist/topology/faceFns.d.ts +0 -1
- package/dist/topology/healingFns.d.ts +0 -1
- package/dist/topology/hullFns.d.ts +0 -1
- package/dist/topology/index.d.ts +0 -1
- package/dist/topology/meshCache.d.ts +0 -1
- package/dist/topology/meshFns.d.ts +0 -1
- package/dist/topology/metadata/colorFns.d.ts +0 -1
- package/dist/topology/metadata/faceTagFns.d.ts +0 -1
- package/dist/topology/metadata/metadataPropagation.d.ts +0 -1
- package/dist/topology/metadata/originTrackingFns.d.ts +0 -1
- package/dist/topology/minkowskiFns.d.ts +0 -1
- package/dist/topology/modifierFns.d.ts +0 -1
- package/dist/topology/nurbsFns.d.ts +0 -1
- package/dist/topology/polyhedronFns.d.ts +0 -1
- package/dist/topology/positionFns.d.ts +0 -1
- package/dist/topology/primitiveFns.d.ts +0 -1
- package/dist/topology/shapeBooleans.d.ts +0 -1
- package/dist/topology/shapeFns.d.ts +0 -1
- package/dist/topology/shapeHelpers.d.ts +0 -1
- package/dist/topology/shapeModifiers.d.ts +0 -1
- package/dist/topology/shapeRef/index.d.ts +0 -1
- package/dist/topology/shapeRef/scoring.d.ts +0 -1
- package/dist/topology/shapeRef/shapeRefFns.d.ts +0 -1
- package/dist/topology/shapeRef/shapeRefTypes.d.ts +0 -1
- package/dist/topology/shapeUtils.d.ts +0 -1
- package/dist/topology/solidBuilders.d.ts +0 -1
- package/dist/topology/surfaceBuilders.d.ts +0 -1
- package/dist/topology/surfaceFns.d.ts +0 -1
- package/dist/topology/threeHelpers.d.ts +0 -1
- package/dist/topology/topologyQueryFns.d.ts +0 -1
- package/dist/topology/transformFns.d.ts +0 -1
- package/dist/topology/wrapperFns.d.ts +0 -1
- package/dist/topology.cjs +18 -17
- package/dist/topology.d.ts +0 -1
- package/dist/topology.js +7 -6
- package/dist/{faceFns-22idS-ht.cjs → topologyQueryFns-BU0qdNJP.cjs} +2 -342
- package/dist/{faceFns-NbWd8-iR.js → topologyQueryFns-Dhf85ZBK.js} +3 -217
- package/dist/utils/arrayAccess.d.ts +0 -1
- package/dist/utils/bug.d.ts +0 -1
- package/dist/utils/ioFilename.d.ts +0 -1
- package/dist/utils/precisionRound.d.ts +0 -1
- package/dist/utils/range.d.ts +0 -1
- package/dist/utils/uuid.d.ts +0 -1
- package/dist/utils/vec2d.d.ts +0 -1
- package/dist/utils/vec3.d.ts +8 -1
- package/dist/utils/zip.d.ts +0 -1
- package/dist/vec3-BRj3eI54.js +25 -0
- package/dist/vec3-S4Oh59IX.cjs +36 -0
- package/dist/vectors.cjs +4 -4
- package/dist/vectors.d.ts +0 -1
- package/dist/vectors.js +4 -4
- package/dist/worker/index.d.ts +0 -1
- package/dist/worker/protocol.d.ts +0 -1
- package/dist/worker/taskQueue.d.ts +0 -1
- package/dist/worker/workerClient.d.ts +0 -1
- package/dist/worker/workerHandler.d.ts +0 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.ts +0 -1
- package/dist/worker.js +1 -1
- package/package.json +35 -14
- package/dist/2d/blueprints/blueprint.d.ts.map +0 -1
- package/dist/2d/blueprints/blueprintApproximations.d.ts.map +0 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +0 -1
- package/dist/2d/blueprints/blueprintFns.d.ts.map +0 -1
- package/dist/2d/blueprints/blueprintOffset.d.ts.map +0 -1
- package/dist/2d/blueprints/blueprints.d.ts.map +0 -1
- package/dist/2d/blueprints/boolean2D.d.ts.map +0 -1
- package/dist/2d/blueprints/booleanHelpers.d.ts.map +0 -1
- package/dist/2d/blueprints/booleanOperations.d.ts.map +0 -1
- package/dist/2d/blueprints/cannedBlueprints.d.ts.map +0 -1
- package/dist/2d/blueprints/compoundBlueprint.d.ts.map +0 -1
- package/dist/2d/blueprints/index.d.ts.map +0 -1
- package/dist/2d/blueprints/intersectionSegments.d.ts.map +0 -1
- package/dist/2d/blueprints/lib.d.ts.map +0 -1
- package/dist/2d/blueprints/segmentAssembly.d.ts.map +0 -1
- package/dist/2d/blueprints/svg.d.ts.map +0 -1
- package/dist/2d/curve2dGeometryFns.d.ts.map +0 -1
- package/dist/2d/curves.d.ts.map +0 -1
- package/dist/2d/lib/approximations.d.ts.map +0 -1
- package/dist/2d/lib/boundingBox2d.d.ts.map +0 -1
- package/dist/2d/lib/curve2D.d.ts.map +0 -1
- package/dist/2d/lib/curve2dFns.d.ts.map +0 -1
- package/dist/2d/lib/customCorners.d.ts.map +0 -1
- package/dist/2d/lib/definitions.d.ts.map +0 -1
- package/dist/2d/lib/index.d.ts.map +0 -1
- package/dist/2d/lib/intersections.d.ts.map +0 -1
- package/dist/2d/lib/makeCurves.d.ts.map +0 -1
- package/dist/2d/lib/offset.d.ts.map +0 -1
- package/dist/2d/lib/precision.d.ts.map +0 -1
- package/dist/2d/lib/stitching.d.ts.map +0 -1
- package/dist/2d/lib/svgPath.d.ts.map +0 -1
- package/dist/2d/lib/utils.d.ts.map +0 -1
- package/dist/2d/lib/vectorOperations.d.ts.map +0 -1
- package/dist/2d.d.ts.map +0 -1
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/curve2dHandle.d.ts.map +0 -1
- package/dist/core/dimensionTypes.d.ts.map +0 -1
- package/dist/core/disposal.d.ts.map +0 -1
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/kernelBoundary.d.ts.map +0 -1
- package/dist/core/kernelCall.d.ts.map +0 -1
- package/dist/core/kernelErrorTranslation.d.ts.map +0 -1
- package/dist/core/planeOps.d.ts.map +0 -1
- package/dist/core/planeTypes.d.ts.map +0 -1
- package/dist/core/result.d.ts.map +0 -1
- package/dist/core/shapeTypeCache.d.ts.map +0 -1
- package/dist/core/shapeTypes.d.ts.map +0 -1
- package/dist/core/typeDiscriminants.d.ts.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/validityTypes.d.ts.map +0 -1
- package/dist/core/vecOps.d.ts.map +0 -1
- package/dist/core.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/io/dxfExportFns.d.ts.map +0 -1
- package/dist/io/dxfImportFns.d.ts.map +0 -1
- package/dist/io/gltfExportFns.d.ts.map +0 -1
- package/dist/io/gltfImportFns.d.ts.map +0 -1
- package/dist/io/importFns.d.ts.map +0 -1
- package/dist/io/ioUtils.d.ts.map +0 -1
- package/dist/io/objExportFns.d.ts.map +0 -1
- package/dist/io/objImportFns.d.ts.map +0 -1
- package/dist/io/stepConfigFns.d.ts.map +0 -1
- package/dist/io/svgImportFns.d.ts.map +0 -1
- package/dist/io/threemfExportFns.d.ts.map +0 -1
- package/dist/io/threemfImportFns.d.ts.map +0 -1
- package/dist/io.d.ts.map +0 -1
- package/dist/kernel/brepkit/booleanOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/brepkitAdapter.d.ts.map +0 -1
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts.map +0 -1
- package/dist/kernel/brepkit/constructionOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/geometryOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/helpers.d.ts.map +0 -1
- package/dist/kernel/brepkit/internalOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/ioOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/kernel2dOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/measureOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/meshOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/modifierOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/repairOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/sketchOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/sweepOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/topologyOps.d.ts.map +0 -1
- package/dist/kernel/brepkit/transformOps.d.ts.map +0 -1
- package/dist/kernel/geometry2d.d.ts.map +0 -1
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/interfaces/booleanOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/builderOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/core.d.ts.map +0 -1
- package/dist/kernel/interfaces/curveOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/evolutionOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/index.d.ts.map +0 -1
- package/dist/kernel/interfaces/ioOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/measureOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/meshOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/modifierOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/primitiveOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/repairOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/surfaceOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/sweepOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/topologyOps.d.ts.map +0 -1
- package/dist/kernel/interfaces/transformOps.d.ts.map +0 -1
- package/dist/kernel/kernel2dTypes.d.ts.map +0 -1
- package/dist/kernel/occt/advancedOps.d.ts.map +0 -1
- package/dist/kernel/occt/booleanBatchOps.d.ts.map +0 -1
- package/dist/kernel/occt/booleanOps.d.ts.map +0 -1
- package/dist/kernel/occt/booleanPipelineOps.d.ts.map +0 -1
- package/dist/kernel/occt/constructorOps.d.ts.map +0 -1
- package/dist/kernel/occt/curveOps.d.ts.map +0 -1
- package/dist/kernel/occt/defaultAdapter.d.ts.map +0 -1
- package/dist/kernel/occt/evolutionOps.d.ts.map +0 -1
- package/dist/kernel/occt/extendedConstructorOps.d.ts.map +0 -1
- package/dist/kernel/occt/geometryQueryOps.d.ts.map +0 -1
- package/dist/kernel/occt/healingOps.d.ts.map +0 -1
- package/dist/kernel/occt/historyOps.d.ts.map +0 -1
- package/dist/kernel/occt/hullOps.d.ts.map +0 -1
- package/dist/kernel/occt/ioOps.d.ts.map +0 -1
- package/dist/kernel/occt/kernel2dOps.d.ts.map +0 -1
- package/dist/kernel/occt/measureOps.d.ts.map +0 -1
- package/dist/kernel/occt/meshOps.d.ts.map +0 -1
- package/dist/kernel/occt/modifierOps.d.ts.map +0 -1
- package/dist/kernel/occt/nurbsQueryOps.d.ts.map +0 -1
- package/dist/kernel/occt/sweepOps.d.ts.map +0 -1
- package/dist/kernel/occt/topologyOps.d.ts.map +0 -1
- package/dist/kernel/occt/transformOps.d.ts.map +0 -1
- package/dist/kernel/occt/wasmTypes/externals.d.ts.map +0 -1
- package/dist/kernel/occt/wasmTypes/index.d.ts.map +0 -1
- package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts.map +0 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts.map +0 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts.map +0 -1
- package/dist/kernel/perfStats.d.ts.map +0 -1
- package/dist/kernel/solverAdapter.d.ts.map +0 -1
- package/dist/kernel/types.d.ts.map +0 -1
- package/dist/measurement/interferenceFns.d.ts.map +0 -1
- package/dist/measurement/measureCache.d.ts.map +0 -1
- package/dist/measurement/measureFns.d.ts.map +0 -1
- package/dist/measurement/measureTypes.d.ts.map +0 -1
- package/dist/measurement.d.ts.map +0 -1
- package/dist/ns/booleans.d.ts.map +0 -1
- package/dist/ns/construction.d.ts.map +0 -1
- package/dist/ns/ioNs.d.ts.map +0 -1
- package/dist/ns/measurement.d.ts.map +0 -1
- package/dist/ns/modifiers.d.ts.map +0 -1
- package/dist/ns/patterns.d.ts.map +0 -1
- package/dist/ns/primitives.d.ts.map +0 -1
- package/dist/ns/query.d.ts.map +0 -1
- package/dist/ns/transforms.d.ts.map +0 -1
- package/dist/occtWasmAdapter-CuZRRioz.cjs +0 -3947
- package/dist/occtWasmAdapter-DIhUXubY.js +0 -3834
- package/dist/operations/api.d.ts.map +0 -1
- package/dist/operations/assemblyFns.d.ts.map +0 -1
- package/dist/operations/compoundOpsFns.d.ts.map +0 -1
- package/dist/operations/convexHullFns.d.ts.map +0 -1
- package/dist/operations/exporterFns.d.ts.map +0 -1
- package/dist/operations/exporterUtils.d.ts.map +0 -1
- package/dist/operations/exporters.d.ts.map +0 -1
- package/dist/operations/extrudeFns.d.ts.map +0 -1
- package/dist/operations/extrudeUtils.d.ts.map +0 -1
- package/dist/operations/guidedSweepFns.d.ts.map +0 -1
- package/dist/operations/historyFns.d.ts.map +0 -1
- package/dist/operations/loftFns.d.ts.map +0 -1
- package/dist/operations/mateFns.d.ts.map +0 -1
- package/dist/operations/multiSweepFns.d.ts.map +0 -1
- package/dist/operations/patternFns.d.ts.map +0 -1
- package/dist/operations/roofFns.d.ts.map +0 -1
- package/dist/operations/straightSkeleton.d.ts.map +0 -1
- package/dist/operations/sweepFns.d.ts.map +0 -1
- package/dist/operations.d.ts.map +0 -1
- package/dist/projection/cameraFns.d.ts.map +0 -1
- package/dist/projection/makeProjectedEdges.d.ts.map +0 -1
- package/dist/projection/projectionPlanes.d.ts.map +0 -1
- package/dist/query/cornerFinder.d.ts.map +0 -1
- package/dist/query/directionUtils.d.ts.map +0 -1
- package/dist/query/edgeFinder.d.ts.map +0 -1
- package/dist/query/faceFinder.d.ts.map +0 -1
- package/dist/query/finderCore.d.ts.map +0 -1
- package/dist/query/finderFns.d.ts.map +0 -1
- package/dist/query/helpers.d.ts.map +0 -1
- package/dist/query/shapeDistanceFilter.d.ts.map +0 -1
- package/dist/query/shapeFinders.d.ts.map +0 -1
- package/dist/query/vertexFinder.d.ts.map +0 -1
- package/dist/query/wireFinder.d.ts.map +0 -1
- package/dist/query.d.ts.map +0 -1
- package/dist/quick.d.ts.map +0 -1
- package/dist/result.d.ts.map +0 -1
- package/dist/shapeRef.d.ts.map +0 -1
- package/dist/sketching/cannedSketches.d.ts.map +0 -1
- package/dist/sketching/compoundSketch.d.ts.map +0 -1
- package/dist/sketching/draw.d.ts.map +0 -1
- package/dist/sketching/draw3d.d.ts.map +0 -1
- package/dist/sketching/drawFns.d.ts.map +0 -1
- package/dist/sketching/ellipseUtils.d.ts.map +0 -1
- package/dist/sketching/shortcuts.d.ts.map +0 -1
- package/dist/sketching/sketch.d.ts.map +0 -1
- package/dist/sketching/sketchFns.d.ts.map +0 -1
- package/dist/sketching/sketchLib.d.ts +0 -47
- package/dist/sketching/sketchLib.d.ts.map +0 -1
- package/dist/sketching/sketchUtils.d.ts +0 -8
- package/dist/sketching/sketchUtils.d.ts.map +0 -1
- package/dist/sketching/sketcher.d.ts.map +0 -1
- package/dist/sketching/sketcher2d.d.ts.map +0 -1
- package/dist/sketching/sketcherlib.d.ts.map +0 -1
- package/dist/sketching/sketches.d.ts.map +0 -1
- package/dist/sketching.d.ts.map +0 -1
- package/dist/text/textBlueprints.d.ts.map +0 -1
- package/dist/topology/adjacencyFns.d.ts.map +0 -1
- package/dist/topology/api.d.ts.map +0 -1
- package/dist/topology/apiTypes.d.ts.map +0 -1
- package/dist/topology/booleanDiagnosticFns.d.ts.map +0 -1
- package/dist/topology/booleanFns.d.ts.map +0 -1
- package/dist/topology/cast.d.ts.map +0 -1
- package/dist/topology/chamferAngleFns.d.ts.map +0 -1
- package/dist/topology/compoundOpsFns.d.ts.map +0 -1
- package/dist/topology/curveBuilders.d.ts.map +0 -1
- package/dist/topology/curveFns.d.ts.map +0 -1
- package/dist/topology/evolutionFns.d.ts.map +0 -1
- package/dist/topology/faceFns.d.ts.map +0 -1
- package/dist/topology/healingFns.d.ts.map +0 -1
- package/dist/topology/hullFns.d.ts.map +0 -1
- package/dist/topology/index.d.ts.map +0 -1
- package/dist/topology/meshCache.d.ts.map +0 -1
- package/dist/topology/meshFns.d.ts.map +0 -1
- package/dist/topology/metadata/colorFns.d.ts.map +0 -1
- package/dist/topology/metadata/faceTagFns.d.ts.map +0 -1
- package/dist/topology/metadata/metadataPropagation.d.ts.map +0 -1
- package/dist/topology/metadata/originTrackingFns.d.ts.map +0 -1
- package/dist/topology/minkowskiFns.d.ts.map +0 -1
- package/dist/topology/modifierFns.d.ts.map +0 -1
- package/dist/topology/nurbsFns.d.ts.map +0 -1
- package/dist/topology/polyhedronFns.d.ts.map +0 -1
- package/dist/topology/positionFns.d.ts.map +0 -1
- package/dist/topology/primitiveFns.d.ts.map +0 -1
- package/dist/topology/shapeBooleans.d.ts.map +0 -1
- package/dist/topology/shapeFns.d.ts.map +0 -1
- package/dist/topology/shapeHelpers.d.ts.map +0 -1
- package/dist/topology/shapeModifiers.d.ts.map +0 -1
- package/dist/topology/shapeRef/index.d.ts.map +0 -1
- package/dist/topology/shapeRef/scoring.d.ts.map +0 -1
- package/dist/topology/shapeRef/shapeRefFns.d.ts.map +0 -1
- package/dist/topology/shapeRef/shapeRefTypes.d.ts.map +0 -1
- package/dist/topology/shapeUtils.d.ts.map +0 -1
- package/dist/topology/solidBuilders.d.ts.map +0 -1
- package/dist/topology/surfaceBuilders.d.ts.map +0 -1
- package/dist/topology/surfaceFns.d.ts.map +0 -1
- package/dist/topology/threeHelpers.d.ts.map +0 -1
- package/dist/topology/topologyQueryFns.d.ts.map +0 -1
- package/dist/topology/transformFns.d.ts.map +0 -1
- package/dist/topology/wrapperFns.d.ts.map +0 -1
- package/dist/topology.d.ts.map +0 -1
- package/dist/utils/arrayAccess.d.ts.map +0 -1
- package/dist/utils/bug.d.ts.map +0 -1
- package/dist/utils/ioFilename.d.ts.map +0 -1
- package/dist/utils/precisionRound.d.ts.map +0 -1
- package/dist/utils/range.d.ts.map +0 -1
- package/dist/utils/uuid.d.ts.map +0 -1
- package/dist/utils/vec2d.d.ts.map +0 -1
- package/dist/utils/vec3.d.ts.map +0 -1
- package/dist/utils/zip.d.ts.map +0 -1
- package/dist/vectors.d.ts.map +0 -1
- package/dist/worker/index.d.ts.map +0 -1
- package/dist/worker/protocol.d.ts.map +0 -1
- package/dist/worker/taskQueue.d.ts.map +0 -1
- package/dist/worker/workerClient.d.ts.map +0 -1
- package/dist/worker/workerHandler.d.ts.map +0 -1
- package/dist/worker.d.ts.map +0 -1
- /package/dist/{arrayAccess-DsnQpdSD.cjs → arrayAccess-7pTWqkJu.cjs} +0 -0
- /package/dist/{arrayAccess-tCIbjLs5.js → arrayAccess-C5IWcxs9.js} +0 -0
- /package/dist/{constants-csSEYddm.js → constants-Ci5CA3aZ.js} +0 -0
- /package/dist/{constants-BNP_xnBN.cjs → constants-DTorLmes.cjs} +0 -0
- /package/dist/{types--GD-LVc6.js → types-BIdk_GJY.js} +0 -0
- /package/dist/{types-gLi9wL0N.cjs → types-CDkxah-M.cjs} +0 -0
- /package/dist/{vecOps-CODplJp3.cjs → vecOps-D7xplSx8.cjs} +0 -0
- /package/dist/{vecOps-B-PCHgyB.js → vecOps-DVROrqTV.js} +0 -0
- /package/dist/{workerHandler-C-3cFcsQ.cjs → workerHandler-C7seK7H-.cjs} +0 -0
- /package/dist/{workerHandler-Dm0_0F8Z.js → workerHandler-DaulgMax.js} +0 -0
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
//#endregion
|
|
32
|
+
const require_shapeTypes = require("./shapeTypes-BTt_LLbk.cjs");
|
|
33
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
34
|
+
const require_types = require("./types-CDkxah-M.cjs");
|
|
35
|
+
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
36
|
+
const require_planeOps = require("./planeOps-CH4ruLuj.cjs");
|
|
37
|
+
const require_faceFns = require("./faceFns-DP7i60yJ.cjs");
|
|
38
|
+
const require_curveFns = require("./curveFns-CD20-4fM.cjs");
|
|
39
|
+
const require_arrayAccess = require("./arrayAccess-7pTWqkJu.cjs");
|
|
40
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CYeTNW33.cjs");
|
|
41
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Bei866Bt.cjs");
|
|
42
|
+
const require_solidBuilders = require("./solidBuilders-CX_197Xm.cjs");
|
|
43
|
+
const require_extrudeFns = require("./extrudeFns-DD36mWKv.cjs");
|
|
44
|
+
let opentype_js = require("opentype.js");
|
|
45
|
+
opentype_js = __toESM(opentype_js, 1);
|
|
46
|
+
//#region src/operations/loftFns.ts
|
|
47
|
+
/**
|
|
48
|
+
* Functional loft operation using branded shape types.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* Loft through a set of wire profiles to create a 3D shape.
|
|
52
|
+
*
|
|
53
|
+
* Builds a `BRepOffsetAPI_ThruSections` surface through the given wires,
|
|
54
|
+
* optionally starting and/or ending at point vertices. Produces a solid
|
|
55
|
+
* by default, or a shell when `returnShell` is `true`.
|
|
56
|
+
*
|
|
57
|
+
* @param wires - Ordered wire profiles to loft through.
|
|
58
|
+
* @param config - Loft configuration (ruled interpolation, start/end points).
|
|
59
|
+
* @param returnShell - When `true`, return a shell instead of a solid.
|
|
60
|
+
* @returns `Result` containing the lofted 3D shape, or an error on failure.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @see {@link loft!loft | loft} for the OOP API equivalent.
|
|
68
|
+
*/
|
|
69
|
+
function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
70
|
+
if (wires.length === 0 && !startPoint && !endPoint) return require_errors.err(require_errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
71
|
+
const kernel = require_shapeTypes.getKernel();
|
|
72
|
+
const startVertex = startPoint ? kernel.makeVertex(...require_types.toVec3(startPoint)) : void 0;
|
|
73
|
+
const endVertex = endPoint ? kernel.makeVertex(...require_types.toVec3(endPoint)) : void 0;
|
|
74
|
+
try {
|
|
75
|
+
const result = require_shapeTypes.castShape(kernel.loftAdvanced(wires.map((w) => w.wrapped), {
|
|
76
|
+
solid: !returnShell,
|
|
77
|
+
ruled,
|
|
78
|
+
tolerance,
|
|
79
|
+
...startVertex ? { startVertex } : {},
|
|
80
|
+
...endVertex ? { endVertex } : {}
|
|
81
|
+
}));
|
|
82
|
+
if (!require_shapeTypes.isShape3D(result)) return require_errors.err(require_errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
83
|
+
return require_errors.ok(result);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return require_errors.err(require_errors.kernelError("LOFT_FAILED", "Loft operation failed", e, void 0, "Common causes: wire profiles with different edge counts, self-intersecting result, or profiles too far apart. Ensure profiles are compatible and ordered."));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Batch loft: build N independent lofts in a single kernel call.
|
|
90
|
+
*
|
|
91
|
+
* Uses the C++ LoftBatch extractor when available (single WASM call),
|
|
92
|
+
* falling back to N individual loft operations otherwise.
|
|
93
|
+
*
|
|
94
|
+
* @returns Array of 3D shapes, one per entry.
|
|
95
|
+
*/
|
|
96
|
+
function loftAll(entries) {
|
|
97
|
+
if (entries.length === 0) return require_errors.ok([]);
|
|
98
|
+
const kernel = require_shapeTypes.getKernel();
|
|
99
|
+
const verticesToDelete = [];
|
|
100
|
+
const kernelEntries = entries.map((e) => {
|
|
101
|
+
const startVertex = e.startPoint ? kernel.makeVertex(...require_types.toVec3(e.startPoint)) : void 0;
|
|
102
|
+
const endVertex = e.endPoint ? kernel.makeVertex(...require_types.toVec3(e.endPoint)) : void 0;
|
|
103
|
+
if (startVertex) verticesToDelete.push(startVertex);
|
|
104
|
+
if (endVertex) verticesToDelete.push(endVertex);
|
|
105
|
+
return {
|
|
106
|
+
wires: e.wires.map((w) => w.wrapped),
|
|
107
|
+
solid: true,
|
|
108
|
+
ruled: e.ruled ?? true,
|
|
109
|
+
tolerance: e.tolerance ?? 1e-6,
|
|
110
|
+
startVertex,
|
|
111
|
+
endVertex
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
try {
|
|
115
|
+
const shapes = kernel.loftBatch?.(kernelEntries) ?? kernelEntries.map((e) => kernel.loftAdvanced(e.wires, {
|
|
116
|
+
solid: e.solid,
|
|
117
|
+
ruled: e.ruled,
|
|
118
|
+
tolerance: e.tolerance,
|
|
119
|
+
startVertex: e.startVertex,
|
|
120
|
+
endVertex: e.endVertex
|
|
121
|
+
}));
|
|
122
|
+
const results = [];
|
|
123
|
+
for (const shape of shapes) {
|
|
124
|
+
const cast = require_shapeTypes.castShape(shape);
|
|
125
|
+
if (!require_shapeTypes.isShape3D(cast)) return require_errors.err(require_errors.typeCastError("LOFT_ALL_NOT_3D", "Batch loft entry did not produce a 3D shape"));
|
|
126
|
+
results.push(cast);
|
|
127
|
+
}
|
|
128
|
+
return require_errors.ok(results);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
return require_errors.err(require_errors.kernelError("LOFT_ALL_FAILED", "Batch loft operation failed", e));
|
|
131
|
+
} finally {
|
|
132
|
+
for (const v of verticesToDelete) kernel.dispose(v);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/sketching/compoundSketch.ts
|
|
137
|
+
/**
|
|
138
|
+
* Represent a face with holes as a group of sketches (one outer + zero or more inner).
|
|
139
|
+
*
|
|
140
|
+
* All contained sketches must share the same base surface. The first sketch is
|
|
141
|
+
* treated as the outer boundary; subsequent sketches define holes.
|
|
142
|
+
*
|
|
143
|
+
* Typically produced from a {@link CompoundBlueprint} via `sketchOnPlane`.
|
|
144
|
+
*
|
|
145
|
+
* The class methods are thin delegations to the canonical functions in
|
|
146
|
+
* `sketchFns.ts` (`compoundSketchExtrude`, `compoundSketchRevolve`, etc.).
|
|
147
|
+
*
|
|
148
|
+
* @see {@link Sketch} for single-wire profiles without holes.
|
|
149
|
+
* @category Sketching
|
|
150
|
+
*/
|
|
151
|
+
var CompoundSketch = class {
|
|
152
|
+
sketches;
|
|
153
|
+
constructor(sketches) {
|
|
154
|
+
if (sketches.length === 0) require_errors.bug("CompoundSketch", "Cannot create CompoundSketch with an empty array of sketches");
|
|
155
|
+
this.sketches = sketches;
|
|
156
|
+
}
|
|
157
|
+
/** Release all kernel resources held by every sub-sketch. */
|
|
158
|
+
delete() {
|
|
159
|
+
this.sketches.forEach((sketch) => {
|
|
160
|
+
sketch.delete();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** Get the outer boundary sketch (the first in the array). */
|
|
164
|
+
get outerSketch() {
|
|
165
|
+
return require_arrayAccess.firstOrThrow(this.sketches);
|
|
166
|
+
}
|
|
167
|
+
/** Get the hole sketches (all but the first). */
|
|
168
|
+
get innerSketches() {
|
|
169
|
+
return this.sketches.slice(1);
|
|
170
|
+
}
|
|
171
|
+
/** Return all wires (outer + holes) combined into a compound shape. */
|
|
172
|
+
get wires() {
|
|
173
|
+
return compoundSketchWires(this);
|
|
174
|
+
}
|
|
175
|
+
/** Build a face from the outer boundary with inner wires subtracted as holes. */
|
|
176
|
+
face() {
|
|
177
|
+
return compoundSketchFace(this);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Extrude the compound face (with holes) along the default or given direction.
|
|
181
|
+
*
|
|
182
|
+
* Supports twist and profile extrusions. For twist/profile modes each
|
|
183
|
+
* sub-sketch is extruded as a shell, then capped into a solid.
|
|
184
|
+
*/
|
|
185
|
+
extrude(extrusionDistance, config = {}) {
|
|
186
|
+
return compoundSketchExtrude(this, extrusionDistance, config);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
190
|
+
* (defaults to the sketch origin)
|
|
191
|
+
*/
|
|
192
|
+
revolve(revolutionAxis, config = {}) {
|
|
193
|
+
return compoundSketchRevolve(this, revolutionAxis, config);
|
|
194
|
+
}
|
|
195
|
+
/** Loft between this compound sketch and another with matching sub-sketch counts. */
|
|
196
|
+
loftWith(otherCompound, loftConfig) {
|
|
197
|
+
return compoundSketchLoft(this, otherCompound, loftConfig);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/sketching/sketchFns.ts
|
|
202
|
+
/** Wrap SketchData into a Sketch instance. */
|
|
203
|
+
function wrapSketchData(data) {
|
|
204
|
+
const opts = {};
|
|
205
|
+
if (data.defaultOrigin) opts.defaultOrigin = data.defaultOrigin;
|
|
206
|
+
if (data.defaultDirection) opts.defaultDirection = data.defaultDirection;
|
|
207
|
+
const sketch = new Sketch(data.wire, opts);
|
|
208
|
+
if (data.baseFace) sketch.baseFace = data.baseFace;
|
|
209
|
+
return sketch;
|
|
210
|
+
}
|
|
211
|
+
/** Wrap an array of SketchData into a CompoundSketch. */
|
|
212
|
+
function wrapSketchDataArray(dataArr) {
|
|
213
|
+
return new CompoundSketch(dataArr.map(wrapSketchData));
|
|
214
|
+
}
|
|
215
|
+
/** Build a face from a sketch's closed planar wire. */
|
|
216
|
+
function sketchFace(sketch) {
|
|
217
|
+
let face;
|
|
218
|
+
if (!sketch.baseFace) face = require_errors.unwrap(require_surfaceBuilders.makeFace(sketch.wire));
|
|
219
|
+
else face = require_surfaceBuilders.makeNewFaceWithinFace(sketch.baseFace, sketch.wire);
|
|
220
|
+
return face;
|
|
221
|
+
}
|
|
222
|
+
/** Return an independent clone of the sketch's wire. */
|
|
223
|
+
function sketchWires(sketch) {
|
|
224
|
+
return require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(sketch.wire.wrapped)));
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Revolve a sketch around an axis to produce a solid of revolution.
|
|
228
|
+
*
|
|
229
|
+
* @remarks Consumes the sketch — calling twice throws on the second call.
|
|
230
|
+
*/
|
|
231
|
+
function sketchRevolve(sketch, revolutionAxis, { origin } = {}) {
|
|
232
|
+
const face = require_errors.unwrap(require_surfaceBuilders.makeFace(sketch.wire));
|
|
233
|
+
const solid = require_errors.unwrap(require_extrudeFns.revolve(face, origin ? require_types.toVec3(origin) : sketch.defaultOrigin, revolutionAxis ? require_types.toVec3(revolutionAxis) : [
|
|
234
|
+
0,
|
|
235
|
+
0,
|
|
236
|
+
1
|
|
237
|
+
]));
|
|
238
|
+
face.delete();
|
|
239
|
+
sketch.delete();
|
|
240
|
+
return solid;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Extrude a sketch to a given distance.
|
|
244
|
+
*
|
|
245
|
+
* Supports profile (taper) extrusion via `extrusionProfile`, twist extrusion
|
|
246
|
+
* via `twistAngle`, and direction/origin overrides.
|
|
247
|
+
*
|
|
248
|
+
* @remarks Consumes the sketch — calling twice throws on the second call.
|
|
249
|
+
*/
|
|
250
|
+
function sketchExtrude(sketch, extrusionDistance, { extrusionDirection, extrusionProfile, twistAngle, origin } = {}) {
|
|
251
|
+
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : sketch.defaultDirection), extrusionDistance);
|
|
252
|
+
const originVec = origin ? require_types.toVec3(origin) : sketch.defaultOrigin;
|
|
253
|
+
if (extrusionProfile && !twistAngle) {
|
|
254
|
+
const solid = require_errors.unwrap(require_extrudeFns.complexExtrude(sketch.wire, [...originVec], [...extrusionVec], extrusionProfile));
|
|
255
|
+
sketch.delete();
|
|
256
|
+
return solid;
|
|
257
|
+
}
|
|
258
|
+
if (twistAngle) {
|
|
259
|
+
const solid = require_errors.unwrap(require_extrudeFns.twistExtrude(sketch.wire, twistAngle, [...originVec], [...extrusionVec], extrusionProfile));
|
|
260
|
+
sketch.delete();
|
|
261
|
+
return solid;
|
|
262
|
+
}
|
|
263
|
+
const solid = require_errors.unwrap(require_extrudeFns.extrude(require_errors.unwrap(require_surfaceBuilders.makeFace(sketch.wire)), [...extrusionVec]));
|
|
264
|
+
sketch.delete();
|
|
265
|
+
return solid;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Sweep a profile sketch (built by `sketchOnPlane`) along this sketch's wire path.
|
|
269
|
+
*
|
|
270
|
+
* @remarks Consumes both this sketch and the one returned by `sketchOnPlane` —
|
|
271
|
+
* calling either twice throws on the second call.
|
|
272
|
+
*/
|
|
273
|
+
function sketchSweep(sketch, sketchOnPlane, sweepConfig = {}) {
|
|
274
|
+
const startPoint = require_curveFns.curveStartPoint(sketch.wire);
|
|
275
|
+
const normal = require_vecOps.vecNormalize(require_vecOps.vecScale(require_curveFns.curveTangentAt(sketch.wire, 1e-9), -1));
|
|
276
|
+
const defaultDir = sketch.defaultDirection;
|
|
277
|
+
const xDir = require_vecOps.vecScale(require_vecOps.vecCross(normal, defaultDir), -1);
|
|
278
|
+
const result = sketchOnPlane(require_planeOps.createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
|
|
279
|
+
let profile;
|
|
280
|
+
if ("sketches" in result && Array.isArray(result.sketches)) {
|
|
281
|
+
const pieces = result.sketches;
|
|
282
|
+
profile = pieces[0];
|
|
283
|
+
for (let i = 1; i < pieces.length; i++) pieces[i]?.delete();
|
|
284
|
+
} else profile = result;
|
|
285
|
+
const config = {
|
|
286
|
+
forceProfileSpineOthogonality: true,
|
|
287
|
+
...sweepConfig
|
|
288
|
+
};
|
|
289
|
+
if (sketch.baseFace) config.support = sketch.baseFace.wrapped;
|
|
290
|
+
const shape = require_errors.unwrap(require_extrudeFns.sweep(profile.wire, sketch.wire, config));
|
|
291
|
+
sketch.delete();
|
|
292
|
+
return shape;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Loft between this sketch and one or more other sketches.
|
|
296
|
+
*
|
|
297
|
+
* @remarks Consumes all input sketches — calling twice throws on the second call.
|
|
298
|
+
*/
|
|
299
|
+
function sketchLoft(sketch, otherSketches, loftConfig = {}, returnShell = false) {
|
|
300
|
+
const sketchArray = Array.isArray(otherSketches) ? [sketch, ...otherSketches] : [sketch, otherSketches];
|
|
301
|
+
const shape = require_errors.unwrap(loft(sketchArray.map((s) => s.wire), loftConfig, returnShell));
|
|
302
|
+
sketchArray.forEach((s) => {
|
|
303
|
+
s.delete();
|
|
304
|
+
});
|
|
305
|
+
return shape;
|
|
306
|
+
}
|
|
307
|
+
var guessFaceFromWires = (wires) => {
|
|
308
|
+
const wireShapes = wires.map((w) => w.wrapped);
|
|
309
|
+
const newFace = require_errors.unwrap(require_faceFns.cast(require_shapeTypes.getKernel().fillSurface(wireShapes)));
|
|
310
|
+
if (!require_shapeTypes.isFace(newFace)) require_errors.bug("guessFaceFromWires", "Failed to create a face");
|
|
311
|
+
return newFace;
|
|
312
|
+
};
|
|
313
|
+
var fixWire = (wire, baseFace) => {
|
|
314
|
+
return require_shapeTypes.createWire(require_shapeTypes.getKernel().fixWireOnFace(wire.wrapped, baseFace.wrapped, 1e-9));
|
|
315
|
+
};
|
|
316
|
+
var faceFromWires = (wires) => {
|
|
317
|
+
let baseFace;
|
|
318
|
+
let holeWires;
|
|
319
|
+
const faceResult = require_surfaceBuilders.makeFace(require_arrayAccess.firstOrThrow(wires));
|
|
320
|
+
if (require_errors.isOk(faceResult)) {
|
|
321
|
+
baseFace = faceResult.value;
|
|
322
|
+
holeWires = wires.slice(1);
|
|
323
|
+
} else {
|
|
324
|
+
baseFace = guessFaceFromWires(wires);
|
|
325
|
+
holeWires = wires.slice(1).map((w) => fixWire(w, baseFace));
|
|
326
|
+
}
|
|
327
|
+
return require_surfaceBuilders.addHolesInFace(baseFace, holeWires);
|
|
328
|
+
};
|
|
329
|
+
var solidFromShellGenerator = (sketches, shellGenerator) => {
|
|
330
|
+
const shells = [];
|
|
331
|
+
const startWires = [];
|
|
332
|
+
const endWires = [];
|
|
333
|
+
sketches.forEach((sketch) => {
|
|
334
|
+
const [shell, startWire, endWire] = require_errors.unwrap(shellGenerator(sketch));
|
|
335
|
+
shells.push(shell);
|
|
336
|
+
startWires.push(startWire);
|
|
337
|
+
endWires.push(endWire);
|
|
338
|
+
});
|
|
339
|
+
const startFace = faceFromWires(startWires);
|
|
340
|
+
const endFace = faceFromWires(endWires);
|
|
341
|
+
return require_errors.unwrap(require_solidBuilders.makeSolid([
|
|
342
|
+
startFace,
|
|
343
|
+
...shells,
|
|
344
|
+
endFace
|
|
345
|
+
]));
|
|
346
|
+
};
|
|
347
|
+
/** Build a face from a compound sketch (outer boundary with holes). */
|
|
348
|
+
function compoundSketchFace(sketch) {
|
|
349
|
+
return require_surfaceBuilders.addHolesInFace(sketch.outerSketch.face(), sketch.innerSketches.map((s) => s.wire));
|
|
350
|
+
}
|
|
351
|
+
/** Return all wires (outer + holes) combined into a compound shape. */
|
|
352
|
+
function compoundSketchWires(sketch) {
|
|
353
|
+
return require_solidBuilders.makeCompound(sketch.sketches.map((s) => s.wire));
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Extrude a compound sketch (outer + holes) along the default or given direction.
|
|
357
|
+
*
|
|
358
|
+
* Supports twist and profile extrusions. For twist/profile modes each
|
|
359
|
+
* sub-sketch is extruded as a shell, then capped into a solid.
|
|
360
|
+
*/
|
|
361
|
+
function compoundSketchExtrude(sketch, extrusionDistance, { extrusionDirection, extrusionProfile, twistAngle, origin } = {}) {
|
|
362
|
+
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : sketch.outerSketch.defaultDirection), extrusionDistance);
|
|
363
|
+
if (extrusionProfile && !twistAngle) return solidFromShellGenerator(sketch.sketches, (s) => require_extrudeFns.complexExtrude(s.wire, origin ? require_types.toVec3(origin) : sketch.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
364
|
+
if (twistAngle) return solidFromShellGenerator(sketch.sketches, (s) => require_extrudeFns.twistExtrude(s.wire, twistAngle, origin ? require_types.toVec3(origin) : sketch.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
365
|
+
return require_errors.unwrap(require_extrudeFns.extrude(compoundSketchFace(sketch), extrusionVec));
|
|
366
|
+
}
|
|
367
|
+
/** Revolve a compound sketch (outer + holes) around an axis. */
|
|
368
|
+
function compoundSketchRevolve(sketch, revolutionAxis, { origin } = {}) {
|
|
369
|
+
const center = origin ? require_types.toVec3(origin) : sketch.outerSketch.defaultOrigin;
|
|
370
|
+
const dir = revolutionAxis ? require_types.toVec3(revolutionAxis) : [
|
|
371
|
+
0,
|
|
372
|
+
0,
|
|
373
|
+
1
|
|
374
|
+
];
|
|
375
|
+
return require_errors.unwrap(require_extrudeFns.revolve(compoundSketchFace(sketch), center, dir));
|
|
376
|
+
}
|
|
377
|
+
/** Loft between two compound sketches with matching sub-sketch counts. */
|
|
378
|
+
function compoundSketchLoft(sketch, other, loftConfig) {
|
|
379
|
+
if (sketch.sketches.length !== other.sketches.length) require_errors.bug("CompoundSketch.loftWith", "You need to loft with another compound with the same number of sketches");
|
|
380
|
+
const shells = sketch.sketches.map((base, cIndex) => {
|
|
381
|
+
const outer = require_arrayAccess.getAtOrThrow(other.sketches, cIndex);
|
|
382
|
+
const loftOpts = {};
|
|
383
|
+
if (loftConfig.ruled !== void 0) loftOpts.ruled = loftConfig.ruled;
|
|
384
|
+
return base.clone().loftWith(outer.clone(), loftOpts, true);
|
|
385
|
+
});
|
|
386
|
+
const baseFace = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(compoundSketchFace(sketch).wrapped)));
|
|
387
|
+
shells.push(baseFace, compoundSketchFace(other));
|
|
388
|
+
return require_errors.unwrap(require_solidBuilders.makeSolid(shells));
|
|
389
|
+
}
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/sketching/sketch.ts
|
|
392
|
+
/**
|
|
393
|
+
* Represent a closed or open wire profile with a default extrusion origin and direction.
|
|
394
|
+
*
|
|
395
|
+
* A Sketch wraps a single {@link Wire} and carries metadata (origin, direction,
|
|
396
|
+
* optional base face) so that downstream operations like {@link Sketch.extrude},
|
|
397
|
+
* {@link Sketch.revolve}, {@link Sketch.sweepSketch}, and {@link Sketch.loftWith}
|
|
398
|
+
* know how to act on it without extra arguments.
|
|
399
|
+
*
|
|
400
|
+
* The class methods are thin delegations to the canonical functions in
|
|
401
|
+
* `sketchFns.ts` (`sketchExtrude`, `sketchRevolve`, etc.). New functionality
|
|
402
|
+
* should be added there.
|
|
403
|
+
*
|
|
404
|
+
* @remarks Most operations consume (delete) the sketch after producing a solid.
|
|
405
|
+
*
|
|
406
|
+
* @see {@link Sketcher} to build a Sketch interactively.
|
|
407
|
+
* @see {@link CompoundSketch} for multi-wire (outer + holes) profiles.
|
|
408
|
+
* @category Sketching
|
|
409
|
+
*/
|
|
410
|
+
var Sketch = class Sketch {
|
|
411
|
+
/**
|
|
412
|
+
* The wire is typed as `ClosedWire & PlanarWire` to reflect the contract at
|
|
413
|
+
* Sketcher boundaries: `Sketcher.close()`, `closeWithMirror()`,
|
|
414
|
+
* `closeWithCustomCorner()`, and the canned-sketch factories all produce
|
|
415
|
+
* closed planar wires. Callers constructing `Sketch` from an arbitrary
|
|
416
|
+
* `Wire` must assert validity at the construction site.
|
|
417
|
+
*/
|
|
418
|
+
wire;
|
|
419
|
+
/**
|
|
420
|
+
* @ignore
|
|
421
|
+
*/
|
|
422
|
+
_defaultOrigin;
|
|
423
|
+
/**
|
|
424
|
+
* @ignore
|
|
425
|
+
*/
|
|
426
|
+
_defaultDirection;
|
|
427
|
+
_baseFace;
|
|
428
|
+
constructor(wire, { defaultOrigin = [
|
|
429
|
+
0,
|
|
430
|
+
0,
|
|
431
|
+
0
|
|
432
|
+
], defaultDirection = [
|
|
433
|
+
0,
|
|
434
|
+
0,
|
|
435
|
+
1
|
|
436
|
+
] } = {}) {
|
|
437
|
+
this.wire = wire;
|
|
438
|
+
this._defaultOrigin = require_types.toVec3(defaultOrigin);
|
|
439
|
+
this._defaultDirection = require_types.toVec3(defaultDirection);
|
|
440
|
+
this.baseFace = null;
|
|
441
|
+
}
|
|
442
|
+
get baseFace() {
|
|
443
|
+
return this._baseFace;
|
|
444
|
+
}
|
|
445
|
+
set baseFace(newFace) {
|
|
446
|
+
if (this._baseFace) this._baseFace.delete();
|
|
447
|
+
this._baseFace = newFace ? require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(newFace.wrapped))) : newFace;
|
|
448
|
+
}
|
|
449
|
+
/** Release all kernel resources held by this sketch. */
|
|
450
|
+
delete() {
|
|
451
|
+
this.wire.delete();
|
|
452
|
+
if (this.baseFace) this.baseFace.delete();
|
|
453
|
+
}
|
|
454
|
+
/** Create an independent deep copy of this sketch. */
|
|
455
|
+
clone() {
|
|
456
|
+
const sketch = new Sketch(require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(this.wire.wrapped))), {
|
|
457
|
+
defaultOrigin: this.defaultOrigin,
|
|
458
|
+
defaultDirection: this.defaultDirection
|
|
459
|
+
});
|
|
460
|
+
if (this.baseFace) sketch.baseFace = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(this.baseFace.wrapped)));
|
|
461
|
+
return sketch;
|
|
462
|
+
}
|
|
463
|
+
/** Get the 3D origin used as default for extrusion and revolution. */
|
|
464
|
+
get defaultOrigin() {
|
|
465
|
+
return this._defaultOrigin;
|
|
466
|
+
}
|
|
467
|
+
/** Set the 3D origin used as default for extrusion and revolution. */
|
|
468
|
+
set defaultOrigin(newOrigin) {
|
|
469
|
+
this._defaultOrigin = require_types.toVec3(newOrigin);
|
|
470
|
+
}
|
|
471
|
+
/** Get the default extrusion/normal direction. */
|
|
472
|
+
get defaultDirection() {
|
|
473
|
+
return this._defaultDirection;
|
|
474
|
+
}
|
|
475
|
+
/** Set the default extrusion/normal direction. */
|
|
476
|
+
set defaultDirection(newDirection) {
|
|
477
|
+
this._defaultDirection = require_types.toVec3(newDirection);
|
|
478
|
+
}
|
|
479
|
+
/** Transforms the lines into a face. The lines should be closed. */
|
|
480
|
+
face() {
|
|
481
|
+
return sketchFace(this);
|
|
482
|
+
}
|
|
483
|
+
/** Return a clone of the underlying wire. */
|
|
484
|
+
wires() {
|
|
485
|
+
return sketchWires(this);
|
|
486
|
+
}
|
|
487
|
+
/** Alias for {@link Sketch.face}. */
|
|
488
|
+
faces() {
|
|
489
|
+
return this.face();
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
493
|
+
* (defaults to the sketch origin)
|
|
494
|
+
*
|
|
495
|
+
* @remarks Consumes the sketch — calling this twice throws on the second call.
|
|
496
|
+
*/
|
|
497
|
+
revolve(revolutionAxis, config = {}) {
|
|
498
|
+
return sketchRevolve(this, revolutionAxis, config);
|
|
499
|
+
}
|
|
500
|
+
/** Extrudes the sketch to a certain distance (along the default direction
|
|
501
|
+
* and origin of the sketch).
|
|
502
|
+
*
|
|
503
|
+
* You can define another extrusion direction or origin,
|
|
504
|
+
*
|
|
505
|
+
* It is also possible to twist extrude with an angle (in degrees), or to
|
|
506
|
+
* give a profile to the extrusion (the endFactor will scale the face, and
|
|
507
|
+
* the profile will define how the scale is applied (either linearly or with
|
|
508
|
+
* a s-shape).
|
|
509
|
+
*
|
|
510
|
+
* @remarks Consumes the sketch — calling this twice throws on the second call.
|
|
511
|
+
*/
|
|
512
|
+
extrude(extrusionDistance, config = {}) {
|
|
513
|
+
return sketchExtrude(this, extrusionDistance, config);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Sweep along this sketch another sketch defined in the function
|
|
517
|
+
* `sketchOnPlane`.
|
|
518
|
+
*
|
|
519
|
+
* @remarks Consumes both this sketch and the one returned by `sketchOnPlane` —
|
|
520
|
+
* calling either consumer twice throws on the second call.
|
|
521
|
+
*/
|
|
522
|
+
sweepSketch(sketchOnPlane, sweepConfig = {}) {
|
|
523
|
+
return sketchSweep(this, sketchOnPlane, sweepConfig);
|
|
524
|
+
}
|
|
525
|
+
/** Loft between this sketch and another sketch (or an array of them)
|
|
526
|
+
*
|
|
527
|
+
* You can also define a `startPoint` for the loft (that will be placed
|
|
528
|
+
* before this sketch) and an `endPoint` after the last one.
|
|
529
|
+
*
|
|
530
|
+
* You can also define if you want the loft to result in a ruled surface.
|
|
531
|
+
*
|
|
532
|
+
* Note that all sketches will be deleted by this operation
|
|
533
|
+
*/
|
|
534
|
+
loftWith(otherSketches, loftConfig = {}, returnShell = false) {
|
|
535
|
+
return sketchLoft(this, otherSketches, loftConfig, returnShell);
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/sketching/sketches.ts
|
|
540
|
+
/**
|
|
541
|
+
* Batch wrapper around multiple {@link Sketch} or {@link CompoundSketch} instances.
|
|
542
|
+
*
|
|
543
|
+
* Applies the same operation (extrude, revolve, etc.) to every contained sketch
|
|
544
|
+
* and returns the results combined into a single compound shape.
|
|
545
|
+
*
|
|
546
|
+
* @category Sketching
|
|
547
|
+
*/
|
|
548
|
+
var Sketches = class {
|
|
549
|
+
sketches;
|
|
550
|
+
constructor(sketches) {
|
|
551
|
+
this.sketches = sketches;
|
|
552
|
+
}
|
|
553
|
+
/** Return all wires combined into a single compound shape. */
|
|
554
|
+
wires() {
|
|
555
|
+
return require_solidBuilders.makeCompound(this.sketches.map((s) => s instanceof Sketch ? s.wire : s.wires));
|
|
556
|
+
}
|
|
557
|
+
/** Return all sketch faces combined into a single compound shape. */
|
|
558
|
+
faces() {
|
|
559
|
+
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.face()));
|
|
560
|
+
}
|
|
561
|
+
/** Extrudes the sketch to a certain distance (along the default direction
|
|
562
|
+
* and origin of the sketch).
|
|
563
|
+
*
|
|
564
|
+
* You can define another extrusion direction or origin,
|
|
565
|
+
*
|
|
566
|
+
* It is also possible to twist extrude with an angle (in degrees), or to
|
|
567
|
+
* give a profile to the extrusion (the endFactor will scale the face, and
|
|
568
|
+
* the profile will define how the scale is applied (either linearly or with
|
|
569
|
+
* a s-shape).
|
|
570
|
+
*/
|
|
571
|
+
extrude(extrusionDistance, extrusionConfig = {}) {
|
|
572
|
+
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.extrude(extrusionDistance, extrusionConfig)));
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
576
|
+
* (defaults to the sketch origin)
|
|
577
|
+
*/
|
|
578
|
+
revolve(revolutionAxis, config) {
|
|
579
|
+
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.revolve(revolutionAxis, config)));
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/text/fontRegistry.ts
|
|
584
|
+
var FONT_REGISTER = {};
|
|
585
|
+
/**
|
|
586
|
+
* Load and register an OpenType/TrueType font for use with text drawing functions.
|
|
587
|
+
*
|
|
588
|
+
* The font is fetched (if a URL string) or parsed (if an ArrayBuffer) and
|
|
589
|
+
* stored in an internal registry keyed by `fontFamily`. The first font loaded
|
|
590
|
+
* is also registered as `'default'`.
|
|
591
|
+
*
|
|
592
|
+
* @param fontPath - URL string or raw ArrayBuffer of the font file.
|
|
593
|
+
* @param fontFamily - Registry key for later retrieval (defaults to `'default'`).
|
|
594
|
+
* @param force - If true, overwrite a previously loaded font with the same key.
|
|
595
|
+
* @returns The parsed opentype.js Font object.
|
|
596
|
+
*/
|
|
597
|
+
async function loadFont(fontPath, fontFamily = "default", force = false) {
|
|
598
|
+
if (!force && FONT_REGISTER[fontFamily]) return require_errors.ok(FONT_REGISTER[fontFamily]);
|
|
599
|
+
let fontData;
|
|
600
|
+
if (typeof fontPath === "string") {
|
|
601
|
+
let response;
|
|
602
|
+
try {
|
|
603
|
+
response = await fetch(fontPath);
|
|
604
|
+
} catch (e) {
|
|
605
|
+
return require_errors.err(require_errors.ioError(require_errors.BrepErrorCode.FONT_FETCH_FAILED, `Failed to fetch font from ${fontPath}: ${e instanceof Error ? e.message : String(e)}`, e));
|
|
606
|
+
}
|
|
607
|
+
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}`));
|
|
608
|
+
fontData = await response.arrayBuffer();
|
|
609
|
+
} else fontData = fontPath;
|
|
610
|
+
let font;
|
|
611
|
+
try {
|
|
612
|
+
font = opentype_js.default.parse(fontData);
|
|
613
|
+
} catch (e) {
|
|
614
|
+
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));
|
|
615
|
+
}
|
|
616
|
+
const typedFont = font;
|
|
617
|
+
FONT_REGISTER[fontFamily] = typedFont;
|
|
618
|
+
if (!FONT_REGISTER["default"]) FONT_REGISTER["default"] = typedFont;
|
|
619
|
+
return require_errors.ok(typedFont);
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Retrieve a previously loaded font by family name.
|
|
623
|
+
*
|
|
624
|
+
* @param fontFamily - Registry key (defaults to `'default'`).
|
|
625
|
+
* @returns The opentype.js Font object, or `undefined` if not loaded.
|
|
626
|
+
*/
|
|
627
|
+
var getFont = (fontFamily = "default") => {
|
|
628
|
+
return FONT_REGISTER[fontFamily];
|
|
629
|
+
};
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region src/text/textBlueprints.ts
|
|
632
|
+
var sketchFontCommands = function* (commands) {
|
|
633
|
+
let sk = null;
|
|
634
|
+
let lastPoint = null;
|
|
635
|
+
for (const command of commands) {
|
|
636
|
+
if (command.type === "Z") {
|
|
637
|
+
if (sk) yield sk.close();
|
|
638
|
+
sk = null;
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
const p = [-command.x, command.y];
|
|
642
|
+
if (command.type === "M") {
|
|
643
|
+
if (sk) yield sk.done();
|
|
644
|
+
sk = new require_blueprintSketcher.BlueprintSketcher();
|
|
645
|
+
sk.movePointerTo(p);
|
|
646
|
+
lastPoint = p;
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
if (lastPoint && Math.abs(p[0] - lastPoint[0]) < 1e-9 && Math.abs(p[1] - lastPoint[1]) < 1e-9) continue;
|
|
650
|
+
if (command.type === "L") sk?.lineTo(p);
|
|
651
|
+
if (command.type === "C") sk?.cubicBezierCurveTo(p, [-command.x1, command.y1], [-command.x2, command.y2]);
|
|
652
|
+
if (command.type === "Q") sk?.quadraticBezierCurveTo(p, [-command.x1, command.y1]);
|
|
653
|
+
lastPoint = p;
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Convert a text string into 2D Blueprints using a loaded font.
|
|
658
|
+
*
|
|
659
|
+
* Each glyph outline is traced as a series of line/bezier curves, then
|
|
660
|
+
* organised into a {@link Blueprints} collection (outer contours + holes).
|
|
661
|
+
*
|
|
662
|
+
* @param text - The string to render.
|
|
663
|
+
* @returns A Blueprints instance representing the text outlines.
|
|
664
|
+
*
|
|
665
|
+
* @remarks Requires a font to be loaded via {@link loadFont} before use.
|
|
666
|
+
*/
|
|
667
|
+
function textBlueprints(text, { startX = 0, startY = 0, fontSize = 16, fontFamily = "default" } = {}) {
|
|
668
|
+
let font = getFont(fontFamily);
|
|
669
|
+
if (!font) font = getFont();
|
|
670
|
+
if (!font) require_errors.bug("text", "No fonts loaded. Call loadFont() before using text functions.");
|
|
671
|
+
const writtenText = font.getPath(text, -startX, -startY, fontSize);
|
|
672
|
+
return require_blueprintSketcher.organiseBlueprints(Array.from(sketchFontCommands(writtenText.commands))).mirror([0, 0]);
|
|
673
|
+
}
|
|
674
|
+
//#endregion
|
|
675
|
+
Object.defineProperty(exports, "CompoundSketch", {
|
|
676
|
+
enumerable: true,
|
|
677
|
+
get: function() {
|
|
678
|
+
return CompoundSketch;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
Object.defineProperty(exports, "Sketch", {
|
|
682
|
+
enumerable: true,
|
|
683
|
+
get: function() {
|
|
684
|
+
return Sketch;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
Object.defineProperty(exports, "Sketches", {
|
|
688
|
+
enumerable: true,
|
|
689
|
+
get: function() {
|
|
690
|
+
return Sketches;
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
694
|
+
enumerable: true,
|
|
695
|
+
get: function() {
|
|
696
|
+
return __exportAll;
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
Object.defineProperty(exports, "compoundSketchExtrude", {
|
|
700
|
+
enumerable: true,
|
|
701
|
+
get: function() {
|
|
702
|
+
return compoundSketchExtrude;
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
Object.defineProperty(exports, "compoundSketchFace", {
|
|
706
|
+
enumerable: true,
|
|
707
|
+
get: function() {
|
|
708
|
+
return compoundSketchFace;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
Object.defineProperty(exports, "compoundSketchLoft", {
|
|
712
|
+
enumerable: true,
|
|
713
|
+
get: function() {
|
|
714
|
+
return compoundSketchLoft;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
Object.defineProperty(exports, "compoundSketchRevolve", {
|
|
718
|
+
enumerable: true,
|
|
719
|
+
get: function() {
|
|
720
|
+
return compoundSketchRevolve;
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
Object.defineProperty(exports, "getFont", {
|
|
724
|
+
enumerable: true,
|
|
725
|
+
get: function() {
|
|
726
|
+
return getFont;
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
Object.defineProperty(exports, "loadFont", {
|
|
730
|
+
enumerable: true,
|
|
731
|
+
get: function() {
|
|
732
|
+
return loadFont;
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
Object.defineProperty(exports, "loft", {
|
|
736
|
+
enumerable: true,
|
|
737
|
+
get: function() {
|
|
738
|
+
return loft;
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
Object.defineProperty(exports, "loftAll", {
|
|
742
|
+
enumerable: true,
|
|
743
|
+
get: function() {
|
|
744
|
+
return loftAll;
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
Object.defineProperty(exports, "sketchExtrude", {
|
|
748
|
+
enumerable: true,
|
|
749
|
+
get: function() {
|
|
750
|
+
return sketchExtrude;
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
Object.defineProperty(exports, "sketchFace", {
|
|
754
|
+
enumerable: true,
|
|
755
|
+
get: function() {
|
|
756
|
+
return sketchFace;
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
Object.defineProperty(exports, "sketchLoft", {
|
|
760
|
+
enumerable: true,
|
|
761
|
+
get: function() {
|
|
762
|
+
return sketchLoft;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
Object.defineProperty(exports, "sketchRevolve", {
|
|
766
|
+
enumerable: true,
|
|
767
|
+
get: function() {
|
|
768
|
+
return sketchRevolve;
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
Object.defineProperty(exports, "sketchSweep", {
|
|
772
|
+
enumerable: true,
|
|
773
|
+
get: function() {
|
|
774
|
+
return sketchSweep;
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
Object.defineProperty(exports, "sketchWires", {
|
|
778
|
+
enumerable: true,
|
|
779
|
+
get: function() {
|
|
780
|
+
return sketchWires;
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
Object.defineProperty(exports, "textBlueprints", {
|
|
784
|
+
enumerable: true,
|
|
785
|
+
get: function() {
|
|
786
|
+
return textBlueprints;
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
Object.defineProperty(exports, "wrapSketchData", {
|
|
790
|
+
enumerable: true,
|
|
791
|
+
get: function() {
|
|
792
|
+
return wrapSketchData;
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
Object.defineProperty(exports, "wrapSketchDataArray", {
|
|
796
|
+
enumerable: true,
|
|
797
|
+
get: function() {
|
|
798
|
+
return wrapSketchDataArray;
|
|
799
|
+
}
|
|
800
|
+
});
|