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
|
@@ -1,52 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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-C0MDggKf.cjs");
|
|
33
|
-
const require_errors = require("./errors-CXRNVCec.cjs");
|
|
34
|
-
const require_faceFns = require("./faceFns-22idS-ht.cjs");
|
|
35
|
-
const require_constants = require("./constants-BNP_xnBN.cjs");
|
|
36
|
-
const require_types = require("./types-gLi9wL0N.cjs");
|
|
37
|
-
const require_vecOps = require("./vecOps-CODplJp3.cjs");
|
|
38
|
-
const require_planeOps = require("./planeOps-BJOIbn4K.cjs");
|
|
39
|
-
const require_curveFns = require("./curveFns-DrT54cm8.cjs");
|
|
40
|
-
const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
|
|
41
|
-
const require_surfaceBuilders = require("./surfaceBuilders-CbH4FIW5.cjs");
|
|
42
|
-
const require_boolean2D = require("./boolean2D-k1AJmCMp.cjs");
|
|
43
|
-
const require_helpers = require("./helpers-BpXNcxuJ.cjs");
|
|
44
|
-
const require_blueprint = require("./blueprint-CscZ0-wr.cjs");
|
|
45
|
-
const require_solidBuilders = require("./solidBuilders-DACzFqvX.cjs");
|
|
46
|
-
const require_cornerFinder = require("./cornerFinder-5BYE2cbd.cjs");
|
|
47
|
-
const require_extrudeFns = require("./extrudeFns-BtblHdaJ.cjs");
|
|
48
|
-
let opentype_js = require("opentype.js");
|
|
49
|
-
opentype_js = __toESM(opentype_js, 1);
|
|
1
|
+
const require_textBlueprints = require("./textBlueprints-oWhiABaY.cjs");
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-BTt_LLbk.cjs");
|
|
3
|
+
const require_vec3 = require("./vec3-S4Oh59IX.cjs");
|
|
4
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
5
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BU0qdNJP.cjs");
|
|
6
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
7
|
+
const require_types = require("./types-CDkxah-M.cjs");
|
|
8
|
+
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
9
|
+
const require_planeOps = require("./planeOps-CH4ruLuj.cjs");
|
|
10
|
+
const require_faceFns = require("./faceFns-DP7i60yJ.cjs");
|
|
11
|
+
const require_curveFns = require("./curveFns-CD20-4fM.cjs");
|
|
12
|
+
const require_arrayAccess = require("./arrayAccess-7pTWqkJu.cjs");
|
|
13
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CYeTNW33.cjs");
|
|
14
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Bei866Bt.cjs");
|
|
15
|
+
const require_helpers = require("./helpers-Cyj6gaqy.cjs");
|
|
16
|
+
const require_blueprint = require("./blueprint-B8ogGJiQ.cjs");
|
|
17
|
+
const require_cornerFinder = require("./cornerFinder-CC8EBRCR.cjs");
|
|
18
|
+
const require_boolean2D = require("./boolean2D-DGuiEJHA.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-1y1NyACI.cjs");
|
|
50
20
|
//#region src/2d/lib/stitching.ts
|
|
51
21
|
/**
|
|
52
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -61,7 +31,7 @@ opentype_js = __toESM(opentype_js, 1);
|
|
|
61
31
|
* @returns An array of connected curve chains.
|
|
62
32
|
*/
|
|
63
33
|
var stitchCurves = (curves, precision = 1e-7) => {
|
|
64
|
-
const startPoints = new
|
|
34
|
+
const startPoints = new require_blueprintSketcher.Flatbush(curves.length);
|
|
65
35
|
curves.forEach((c) => {
|
|
66
36
|
const [x, y] = c.firstPoint;
|
|
67
37
|
startPoints.add(x - precision, y - precision, x + precision, y + precision);
|
|
@@ -77,11 +47,11 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
77
47
|
let maxLoops = curves.length;
|
|
78
48
|
while (true) {
|
|
79
49
|
if (maxLoops-- < 0) require_errors.bug("stitchCurves", "Infinite loop detected");
|
|
80
|
-
const [x, y] = connectedCurves
|
|
50
|
+
const [x, y] = require_vec3.wasmIndex(connectedCurves, connectedCurves.length - 1).lastPoint;
|
|
81
51
|
const neighbors = startPoints.search(x - precision, y - precision, x + precision, y + precision);
|
|
82
52
|
const indexDistance = (otherIndex) => Math.abs((currentIndex - otherIndex) % curves.length);
|
|
83
53
|
const potentialNextCurves = neighbors.filter((neighborIndex) => !visited.has(neighborIndex)).map((neighborIndex) => [
|
|
84
|
-
curves
|
|
54
|
+
require_vec3.wasmIndex(curves, neighborIndex),
|
|
85
55
|
neighborIndex,
|
|
86
56
|
indexDistance(neighborIndex)
|
|
87
57
|
]).sort(([, , a], [, , b]) => a - b);
|
|
@@ -89,7 +59,7 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
89
59
|
stitchedCurves.push(connectedCurves);
|
|
90
60
|
break;
|
|
91
61
|
}
|
|
92
|
-
const [nextCurve, nextCurveIndex] = potentialNextCurves
|
|
62
|
+
const [nextCurve, nextCurveIndex] = require_vec3.wasmIndex(potentialNextCurves, 0);
|
|
93
63
|
connectedCurves.push(nextCurve);
|
|
94
64
|
visited.add(nextCurveIndex);
|
|
95
65
|
currentIndex = nextCurveIndex;
|
|
@@ -98,172 +68,6 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
98
68
|
return stitchedCurves;
|
|
99
69
|
};
|
|
100
70
|
//#endregion
|
|
101
|
-
//#region src/sketching/compoundSketch.ts
|
|
102
|
-
var guessFaceFromWires = (wires) => {
|
|
103
|
-
const wireShapes = wires.map((w) => w.wrapped);
|
|
104
|
-
const newFace = require_errors.unwrap(require_faceFns.cast(require_shapeTypes.getKernel().fillSurface(wireShapes)));
|
|
105
|
-
if (!require_shapeTypes.isFace(newFace)) require_errors.bug("guessFaceFromWires", "Failed to create a face");
|
|
106
|
-
return newFace;
|
|
107
|
-
};
|
|
108
|
-
var fixWire = (wire, baseFace) => {
|
|
109
|
-
return require_shapeTypes.createWire(require_shapeTypes.getKernel().fixWireOnFace(wire.wrapped, baseFace.wrapped, 1e-9));
|
|
110
|
-
};
|
|
111
|
-
var faceFromWires = (wires) => {
|
|
112
|
-
let baseFace;
|
|
113
|
-
let holeWires;
|
|
114
|
-
const faceResult = require_surfaceBuilders.makeFace(require_arrayAccess.firstOrThrow(wires));
|
|
115
|
-
if (require_errors.isOk(faceResult)) {
|
|
116
|
-
baseFace = faceResult.value;
|
|
117
|
-
holeWires = wires.slice(1);
|
|
118
|
-
} else {
|
|
119
|
-
baseFace = guessFaceFromWires(wires);
|
|
120
|
-
holeWires = wires.slice(1).map((w) => fixWire(w, baseFace));
|
|
121
|
-
}
|
|
122
|
-
return require_surfaceBuilders.addHolesInFace(baseFace, holeWires);
|
|
123
|
-
};
|
|
124
|
-
var solidFromShellGenerator = (sketches, shellGenerator) => {
|
|
125
|
-
const shells = [];
|
|
126
|
-
const startWires = [];
|
|
127
|
-
const endWires = [];
|
|
128
|
-
sketches.forEach((sketch) => {
|
|
129
|
-
const [shell, startWire, endWire] = require_errors.unwrap(shellGenerator(sketch));
|
|
130
|
-
shells.push(shell);
|
|
131
|
-
startWires.push(startWire);
|
|
132
|
-
endWires.push(endWire);
|
|
133
|
-
});
|
|
134
|
-
const startFace = faceFromWires(startWires);
|
|
135
|
-
const endFace = faceFromWires(endWires);
|
|
136
|
-
return require_errors.unwrap(require_solidBuilders.makeSolid([
|
|
137
|
-
startFace,
|
|
138
|
-
...shells,
|
|
139
|
-
endFace
|
|
140
|
-
]));
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Represent a face with holes as a group of sketches (one outer + zero or more inner).
|
|
144
|
-
*
|
|
145
|
-
* All contained sketches must share the same base surface. The first sketch is
|
|
146
|
-
* treated as the outer boundary; subsequent sketches define holes.
|
|
147
|
-
*
|
|
148
|
-
* Typically produced from a {@link CompoundBlueprint} via `sketchOnPlane`.
|
|
149
|
-
*
|
|
150
|
-
* @see {@link Sketch} for single-wire profiles without holes.
|
|
151
|
-
* @category Sketching
|
|
152
|
-
*/
|
|
153
|
-
var CompoundSketch = class {
|
|
154
|
-
sketches;
|
|
155
|
-
constructor(sketches) {
|
|
156
|
-
if (sketches.length === 0) require_errors.bug("CompoundSketch", "Cannot create CompoundSketch with an empty array of sketches");
|
|
157
|
-
this.sketches = sketches;
|
|
158
|
-
}
|
|
159
|
-
/** Release all kernel resources held by every sub-sketch. */
|
|
160
|
-
delete() {
|
|
161
|
-
this.sketches.forEach((sketch) => {
|
|
162
|
-
sketch.delete();
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/** Get the outer boundary sketch (the first in the array). */
|
|
166
|
-
get outerSketch() {
|
|
167
|
-
return require_arrayAccess.firstOrThrow(this.sketches);
|
|
168
|
-
}
|
|
169
|
-
/** Get the hole sketches (all but the first). */
|
|
170
|
-
get innerSketches() {
|
|
171
|
-
return this.sketches.slice(1);
|
|
172
|
-
}
|
|
173
|
-
/** Return all wires (outer + holes) combined into a compound shape. */
|
|
174
|
-
get wires() {
|
|
175
|
-
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.wire));
|
|
176
|
-
}
|
|
177
|
-
/** Build a face from the outer boundary with inner wires subtracted as holes. */
|
|
178
|
-
face() {
|
|
179
|
-
return require_surfaceBuilders.addHolesInFace(this.outerSketch.face(), this.innerSketches.map((s) => s.wire));
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Extrude the compound face (with holes) along the default or given direction.
|
|
183
|
-
*
|
|
184
|
-
* Supports twist and profile extrusions. For twist/profile modes each
|
|
185
|
-
* sub-sketch is extruded as a shell, then capped into a solid.
|
|
186
|
-
*/
|
|
187
|
-
extrude(extrusionDistance, { extrusionDirection, extrusionProfile, twistAngle, origin } = {}) {
|
|
188
|
-
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : this.outerSketch.defaultDirection), extrusionDistance);
|
|
189
|
-
let result;
|
|
190
|
-
if (extrusionProfile && !twistAngle) result = solidFromShellGenerator(this.sketches, (sketch) => require_extrudeFns.complexExtrude(sketch.wire, origin ? require_types.toVec3(origin) : this.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
191
|
-
else if (twistAngle) result = solidFromShellGenerator(this.sketches, (sketch) => require_extrudeFns.twistExtrude(sketch.wire, twistAngle, origin ? require_types.toVec3(origin) : this.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
192
|
-
else result = require_errors.unwrap(require_extrudeFns.extrude(this.face(), extrusionVec));
|
|
193
|
-
return result;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
197
|
-
* (defaults to the sketch origin)
|
|
198
|
-
*/
|
|
199
|
-
revolve(revolutionAxis, { origin } = {}) {
|
|
200
|
-
const center = origin ? require_types.toVec3(origin) : this.outerSketch.defaultOrigin;
|
|
201
|
-
const dir = revolutionAxis ? require_types.toVec3(revolutionAxis) : [
|
|
202
|
-
0,
|
|
203
|
-
0,
|
|
204
|
-
1
|
|
205
|
-
];
|
|
206
|
-
return require_errors.unwrap(require_extrudeFns.revolve(this.face(), center, dir));
|
|
207
|
-
}
|
|
208
|
-
/** Loft between this compound sketch and another with matching sub-sketch counts. */
|
|
209
|
-
loftWith(otherCompound, loftConfig) {
|
|
210
|
-
if (this.sketches.length !== otherCompound.sketches.length) require_errors.bug("CompoundSketch.loftWith", "You need to loft with another compound with the same number of sketches");
|
|
211
|
-
const shells = this.sketches.map((base, cIndex) => {
|
|
212
|
-
const outer = require_arrayAccess.getAtOrThrow(otherCompound.sketches, cIndex);
|
|
213
|
-
const loftOpts = {};
|
|
214
|
-
if (loftConfig.ruled !== void 0) loftOpts.ruled = loftConfig.ruled;
|
|
215
|
-
return base.clone().loftWith(outer.clone(), loftOpts, true);
|
|
216
|
-
});
|
|
217
|
-
const baseFace = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(this.face().wrapped)));
|
|
218
|
-
shells.push(baseFace, otherCompound.face());
|
|
219
|
-
return require_errors.unwrap(require_solidBuilders.makeSolid(shells));
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
//#endregion
|
|
223
|
-
//#region src/sketching/sketches.ts
|
|
224
|
-
/**
|
|
225
|
-
* Batch wrapper around multiple {@link Sketch} or {@link CompoundSketch} instances.
|
|
226
|
-
*
|
|
227
|
-
* Applies the same operation (extrude, revolve, etc.) to every contained sketch
|
|
228
|
-
* and returns the results combined into a single compound shape.
|
|
229
|
-
*
|
|
230
|
-
* @category Sketching
|
|
231
|
-
*/
|
|
232
|
-
var Sketches = class {
|
|
233
|
-
sketches;
|
|
234
|
-
constructor(sketches) {
|
|
235
|
-
this.sketches = sketches;
|
|
236
|
-
}
|
|
237
|
-
/** Return all wires combined into a single compound shape. */
|
|
238
|
-
wires() {
|
|
239
|
-
return require_solidBuilders.makeCompound(this.sketches.map((s) => s instanceof require_boolean2D.Sketch ? s.wire : s.wires));
|
|
240
|
-
}
|
|
241
|
-
/** Return all sketch faces combined into a single compound shape. */
|
|
242
|
-
faces() {
|
|
243
|
-
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.face()));
|
|
244
|
-
}
|
|
245
|
-
/** Extrudes the sketch to a certain distance (along the default direction
|
|
246
|
-
* and origin of the sketch).
|
|
247
|
-
*
|
|
248
|
-
* You can define another extrusion direction or origin,
|
|
249
|
-
*
|
|
250
|
-
* It is also possible to twist extrude with an angle (in degrees), or to
|
|
251
|
-
* give a profile to the extrusion (the endFactor will scale the face, and
|
|
252
|
-
* the profile will define how the scale is applied (either linearly or with
|
|
253
|
-
* a s-shape).
|
|
254
|
-
*/
|
|
255
|
-
extrude(extrusionDistance, extrusionConfig = {}) {
|
|
256
|
-
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.extrude(extrusionDistance, extrusionConfig)));
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
260
|
-
* (defaults to the sketch origin)
|
|
261
|
-
*/
|
|
262
|
-
revolve(revolutionAxis, config) {
|
|
263
|
-
return require_solidBuilders.makeCompound(this.sketches.map((s) => s.revolve(revolutionAxis, config)));
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
//#endregion
|
|
267
71
|
//#region src/sketching/sketcher.ts
|
|
268
72
|
/**
|
|
269
73
|
* Build 2D wire profiles on a 3D plane using a builder-pen API.
|
|
@@ -285,7 +89,7 @@ var Sketches = class {
|
|
|
285
89
|
* @see {@link DrawingPen} for the pure-2D equivalent.
|
|
286
90
|
* @category Sketching
|
|
287
91
|
*/
|
|
288
|
-
var Sketcher = class extends
|
|
92
|
+
var Sketcher = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
289
93
|
plane;
|
|
290
94
|
constructor(plane, origin) {
|
|
291
95
|
super();
|
|
@@ -308,19 +112,19 @@ var Sketcher = class extends require_boolean2D.BaseSketcher2d {
|
|
|
308
112
|
}
|
|
309
113
|
buildWire() {
|
|
310
114
|
try {
|
|
311
|
-
var _usingCtx$
|
|
115
|
+
var _usingCtx$4 = require_shapeTypes._usingCtx();
|
|
312
116
|
if (!this.pendingCurves.length) require_errors.bug("Sketcher.buildWire", "No lines to convert into a wire");
|
|
313
|
-
const scope = _usingCtx$
|
|
117
|
+
const scope = _usingCtx$4.u(new require_shapeTypes.DisposalScope());
|
|
314
118
|
return require_errors.unwrap(require_surfaceBuilders.assembleWire(require_blueprint.curvesAsEdgesOnPlane(this.pendingCurves, this.plane).map((e) => scope.register(e))));
|
|
315
119
|
} catch (_) {
|
|
316
|
-
_usingCtx$
|
|
120
|
+
_usingCtx$4.e = _;
|
|
317
121
|
} finally {
|
|
318
|
-
_usingCtx$
|
|
122
|
+
_usingCtx$4.d();
|
|
319
123
|
}
|
|
320
124
|
}
|
|
321
125
|
/** Finish drawing and return the open-wire Sketch (does not close the path). */
|
|
322
126
|
done() {
|
|
323
|
-
return new
|
|
127
|
+
return new require_textBlueprints.Sketch(this.buildWire(), {
|
|
324
128
|
defaultOrigin: this.plane.origin,
|
|
325
129
|
defaultDirection: this.plane.zDir
|
|
326
130
|
});
|
|
@@ -342,7 +146,7 @@ var Sketcher = class extends require_boolean2D.BaseSketcher2d {
|
|
|
342
146
|
const pointer3d = require_planeOps.planeToWorld(this.plane, this.pointer);
|
|
343
147
|
const normal = require_vecOps.vecCross(require_vecOps.vecNormalize(require_vecOps.vecSub(pointer3d, require_planeOps.planeToWorld(this.plane, this.firstPoint))), this.plane.zDir);
|
|
344
148
|
const clonedWrapped = require_errors.unwrap(require_faceFns.downcast(wire.wrapped));
|
|
345
|
-
return new
|
|
149
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([wire, require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(require_shapeTypes.getKernel().mirror(clonedWrapped, require_types.toVec3(pointer3d), require_types.toVec3(normal)))))])), {
|
|
346
150
|
defaultOrigin: this.plane.origin,
|
|
347
151
|
defaultDirection: this.plane.zDir
|
|
348
152
|
});
|
|
@@ -361,6 +165,122 @@ var Sketcher = class extends require_boolean2D.BaseSketcher2d {
|
|
|
361
165
|
}
|
|
362
166
|
};
|
|
363
167
|
//#endregion
|
|
168
|
+
//#region src/sketching/faceSketcher.ts
|
|
169
|
+
/**
|
|
170
|
+
* The FaceSketcher allows you to sketch on a face that is not planar, for
|
|
171
|
+
* instance the sides of a cylinder.
|
|
172
|
+
*
|
|
173
|
+
* The coordinates passed to the methods corresponds to normalised distances on
|
|
174
|
+
* this surface, between 0 and 1 in both direction.
|
|
175
|
+
*
|
|
176
|
+
* Note that if you are drawing on a closed surface (typically a revolution
|
|
177
|
+
* surface or a cylinder), the first parameters represents the angle and can be
|
|
178
|
+
* smaller than 0 or bigger than 1.
|
|
179
|
+
*
|
|
180
|
+
* @category Sketching
|
|
181
|
+
*/
|
|
182
|
+
var FaceSketcher = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
183
|
+
face;
|
|
184
|
+
_bounds;
|
|
185
|
+
constructor(face, origin = [0, 0]) {
|
|
186
|
+
super(origin);
|
|
187
|
+
this.face = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(face.wrapped)));
|
|
188
|
+
this._bounds = require_faceFns.uvBounds(face);
|
|
189
|
+
}
|
|
190
|
+
_convertToUV([x, y]) {
|
|
191
|
+
const { uMin, uMax, vMin, vMax } = this._bounds;
|
|
192
|
+
return [uMin + x * (uMax - uMin), vMin + y * (vMax - vMin)];
|
|
193
|
+
}
|
|
194
|
+
_convertFromUV([u, v]) {
|
|
195
|
+
const { uMin, uMax, vMin, vMax } = this._bounds;
|
|
196
|
+
return [(u - uMin) / (uMax - uMin), (v - vMin) / (vMax - vMin)];
|
|
197
|
+
}
|
|
198
|
+
_adaptSurface() {
|
|
199
|
+
return require_shapeTypes.getKernel().extractSurfaceFromFace(this.face.wrapped);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* @ignore
|
|
203
|
+
*/
|
|
204
|
+
buildWire() {
|
|
205
|
+
const kernel = require_shapeTypes.getKernel();
|
|
206
|
+
const geomSurf = this._adaptSurface();
|
|
207
|
+
const wire = require_errors.unwrap(require_surfaceBuilders.assembleWire(this.pendingCurves.map((curve) => {
|
|
208
|
+
return require_shapeTypes.createEdge(kernel.buildEdgeOnSurface(curve.wrapped, geomSurf));
|
|
209
|
+
})));
|
|
210
|
+
kernel.buildCurves3d(wire.wrapped);
|
|
211
|
+
return wire;
|
|
212
|
+
}
|
|
213
|
+
/** Finish drawing and return the resulting {@link Sketch} (does not close the path). */
|
|
214
|
+
done() {
|
|
215
|
+
try {
|
|
216
|
+
var _usingCtx$3 = require_shapeTypes._usingCtx();
|
|
217
|
+
const scope = _usingCtx$3.u(new require_shapeTypes.DisposalScope());
|
|
218
|
+
const wire = this.buildWire();
|
|
219
|
+
const sketch = new require_textBlueprints.Sketch(wire);
|
|
220
|
+
if (require_curveFns.curveIsClosed(wire)) {
|
|
221
|
+
const face = scope.register(sketch.clone().face());
|
|
222
|
+
const origin = require_faceFns.pointOnSurface(face, .5, .5);
|
|
223
|
+
const direction = require_vecOps.vecScale(require_faceFns.normalAt(face), -1);
|
|
224
|
+
sketch.defaultOrigin = [
|
|
225
|
+
origin[0],
|
|
226
|
+
origin[1],
|
|
227
|
+
origin[2]
|
|
228
|
+
];
|
|
229
|
+
sketch.defaultDirection = [
|
|
230
|
+
direction[0],
|
|
231
|
+
direction[1],
|
|
232
|
+
direction[2]
|
|
233
|
+
];
|
|
234
|
+
} else {
|
|
235
|
+
const startPoint = require_curveFns.curveStartPoint(wire);
|
|
236
|
+
const normal = require_faceFns.normalAt(this.face, [
|
|
237
|
+
startPoint[0],
|
|
238
|
+
startPoint[1],
|
|
239
|
+
startPoint[2]
|
|
240
|
+
]);
|
|
241
|
+
sketch.defaultOrigin = [
|
|
242
|
+
startPoint[0],
|
|
243
|
+
startPoint[1],
|
|
244
|
+
startPoint[2]
|
|
245
|
+
];
|
|
246
|
+
sketch.defaultDirection = [
|
|
247
|
+
normal[0],
|
|
248
|
+
normal[1],
|
|
249
|
+
normal[2]
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
sketch.baseFace = this.face;
|
|
253
|
+
return sketch;
|
|
254
|
+
} catch (_) {
|
|
255
|
+
_usingCtx$3.e = _;
|
|
256
|
+
} finally {
|
|
257
|
+
_usingCtx$3.d();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/** Close the path with a straight line to the start point and return the Sketch. */
|
|
261
|
+
close() {
|
|
262
|
+
this._closeSketch();
|
|
263
|
+
return this.done();
|
|
264
|
+
}
|
|
265
|
+
/** Close the path by mirroring all curves about the line from first to last point. */
|
|
266
|
+
closeWithMirror() {
|
|
267
|
+
this._closeWithMirror();
|
|
268
|
+
return this.close();
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Close the path and apply a custom corner treatment between the last and first segments.
|
|
272
|
+
*
|
|
273
|
+
* @param radius - Fillet/chamfer radius, or a custom corner function.
|
|
274
|
+
* @param mode - Corner treatment type.
|
|
275
|
+
* @returns The closed {@link Sketch}.
|
|
276
|
+
*/
|
|
277
|
+
closeWithCustomCorner(radius, mode = "fillet") {
|
|
278
|
+
this._closeSketch();
|
|
279
|
+
this._customCornerLastWithFirst(radius, mode);
|
|
280
|
+
return this.done();
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
//#endregion
|
|
364
284
|
//#region src/sketching/cannedSketches.ts
|
|
365
285
|
/**
|
|
366
286
|
* Create a circular Sketch on a given plane.
|
|
@@ -379,7 +299,7 @@ var Sketcher = class extends require_boolean2D.BaseSketcher2d {
|
|
|
379
299
|
*/
|
|
380
300
|
var sketchCircle = (radius, planeConfig = {}) => {
|
|
381
301
|
const plane = planeConfig.plane && typeof planeConfig.plane !== "string" ? { ...planeConfig.plane } : require_errors.unwrap(require_planeOps.resolvePlane(planeConfig.plane ?? "XY", planeConfig.origin));
|
|
382
|
-
return new
|
|
302
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([require_surfaceBuilders.makeCircle(radius, plane.origin, plane.zDir)])), {
|
|
383
303
|
defaultOrigin: [...plane.origin],
|
|
384
304
|
defaultDirection: [...plane.zDir]
|
|
385
305
|
});
|
|
@@ -404,7 +324,7 @@ var sketchEllipse = (xRadius = 1, yRadius = 2, planeConfig = {}) => {
|
|
|
404
324
|
majR = yRadius;
|
|
405
325
|
minR = xRadius;
|
|
406
326
|
}
|
|
407
|
-
return new
|
|
327
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([require_errors.unwrap(require_surfaceBuilders.makeEllipse(majR, minR, plane.origin, plane.zDir, xDir))])), {
|
|
408
328
|
defaultOrigin: [...plane.origin],
|
|
409
329
|
defaultDirection: [...plane.zDir]
|
|
410
330
|
});
|
|
@@ -444,7 +364,7 @@ var sketchRoundedRectangle = (width, height, r = 0, planeConfig = {}) => {
|
|
|
444
364
|
const opts = {};
|
|
445
365
|
if (data.defaultOrigin) opts.defaultOrigin = data.defaultOrigin;
|
|
446
366
|
if (data.defaultDirection) opts.defaultDirection = data.defaultDirection;
|
|
447
|
-
return new
|
|
367
|
+
return new require_textBlueprints.Sketch(data.wire, opts);
|
|
448
368
|
};
|
|
449
369
|
/**
|
|
450
370
|
* Create a regular-polygon Sketch on a given plane.
|
|
@@ -505,7 +425,7 @@ var polysideInnerRadius = (outerRadius, sidesCount, sagitta = 0) => {
|
|
|
505
425
|
var sketchFaceOffset = (face, offset) => {
|
|
506
426
|
const defaultOrigin = [...require_faceFns.faceCenter(face)];
|
|
507
427
|
const defaultDirection = [...require_faceFns.normalAt(face)];
|
|
508
|
-
return new
|
|
428
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_curveFns.offsetWire2D(require_faceFns.outerWire(face), offset)), {
|
|
509
429
|
defaultOrigin,
|
|
510
430
|
defaultDirection
|
|
511
431
|
});
|
|
@@ -532,7 +452,7 @@ var sketchParametricFunction = (func, planeConfig = {}, { pointsCount = 400, sta
|
|
|
532
452
|
const points = [...Array(pointsCount + 1).keys()].map((t) => {
|
|
533
453
|
return require_planeOps.planeToWorld(plane, func(start + t * stepSize));
|
|
534
454
|
});
|
|
535
|
-
return new
|
|
455
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([scope.register(require_errors.unwrap(require_surfaceBuilders.makeBSplineApproximation(points, approximationConfig)))])), {
|
|
536
456
|
defaultOrigin: [...plane.origin],
|
|
537
457
|
defaultDirection: [...plane.zDir]
|
|
538
458
|
});
|
|
@@ -564,7 +484,7 @@ var sketchHelix = (pitch, height, radius, center = [
|
|
|
564
484
|
0,
|
|
565
485
|
1
|
|
566
486
|
], lefthand = false) => {
|
|
567
|
-
return new
|
|
487
|
+
return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([require_surfaceBuilders.makeHelix(pitch, height, radius, require_types.toVec3(center), require_types.toVec3(dir), lefthand)])));
|
|
568
488
|
};
|
|
569
489
|
//#endregion
|
|
570
490
|
//#region src/sketching/shortcuts.ts
|
|
@@ -682,7 +602,7 @@ function findSelfIntersections(offsettedArray) {
|
|
|
682
602
|
const intersections = allIntersections.get(index) || [];
|
|
683
603
|
allIntersections.set(index, [...intersections, ...newPoints]);
|
|
684
604
|
};
|
|
685
|
-
const spatialIndex = new
|
|
605
|
+
const spatialIndex = new require_blueprintSketcher.Flatbush(offsettedArray.length);
|
|
686
606
|
for (const curve of offsettedArray) {
|
|
687
607
|
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
688
608
|
spatialIndex.add(xMin, yMin, xMax, yMax);
|
|
@@ -694,7 +614,7 @@ function findSelfIntersections(offsettedArray) {
|
|
|
694
614
|
for (const secondIndex of candidates) {
|
|
695
615
|
if (secondIndex <= firstIndex) continue;
|
|
696
616
|
const secondCurve = require_errors.safeIndex(offsettedArray, secondIndex, "offsetBlueprint");
|
|
697
|
-
const { intersections: rawIntersections, commonSegmentsPoints } = require_errors.unwrap(
|
|
617
|
+
const { intersections: rawIntersections, commonSegmentsPoints } = require_errors.unwrap(require_blueprintSketcher.intersectCurves(firstCurve, secondCurve, require_helpers.PRECISION_OFFSET));
|
|
698
618
|
const intersections = [...rawIntersections, ...commonSegmentsPoints].filter((intersection) => {
|
|
699
619
|
const onFirstCurveExtremity = samePoint(intersection, firstCurve.firstPoint) || samePoint(intersection, firstCurve.lastPoint);
|
|
700
620
|
const onSecondCurveExtremity = samePoint(intersection, secondCurve.firstPoint) || samePoint(intersection, secondCurve.lastPoint);
|
|
@@ -724,7 +644,7 @@ function findSelfIntersections(offsettedArray) {
|
|
|
724
644
|
function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
725
645
|
const correctedOffset = blueprint.orientation === "clockwise" ? -offset : offset;
|
|
726
646
|
const offsetCurves = blueprint.curves.map((c) => ({
|
|
727
|
-
offset:
|
|
647
|
+
offset: require_blueprintSketcher.make2dOffset(c, correctedOffset),
|
|
728
648
|
original: c
|
|
729
649
|
}));
|
|
730
650
|
const offsettedArray = [];
|
|
@@ -755,7 +675,7 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
755
675
|
}
|
|
756
676
|
let intersections = [];
|
|
757
677
|
if (previousCurve.offset instanceof require_blueprint.Curve2D && curve.offset instanceof require_blueprint.Curve2D) {
|
|
758
|
-
const { intersections: pointIntersections, commonSegmentsPoints } = require_errors.unwrap(
|
|
678
|
+
const { intersections: pointIntersections, commonSegmentsPoints } = require_errors.unwrap(require_blueprintSketcher.intersectCurves(previousCurve.offset, curve.offset, require_helpers.PRECISION_OFFSET / 100));
|
|
759
679
|
intersections = [...pointIntersections, ...commonSegmentsPoints];
|
|
760
680
|
}
|
|
761
681
|
if (intersections.length > 0) {
|
|
@@ -800,7 +720,7 @@ function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
|
800
720
|
const intersections = allIntersections.get(index) || [];
|
|
801
721
|
return curve.splitAt(intersections, require_helpers.PRECISION_OFFSET * 100);
|
|
802
722
|
});
|
|
803
|
-
const originalIndex = new
|
|
723
|
+
const originalIndex = new require_blueprintSketcher.Flatbush(blueprint.curves.length);
|
|
804
724
|
for (const c of blueprint.curves) {
|
|
805
725
|
const [[xMin, yMin], [xMax, yMax]] = c.boundingBox.bounds;
|
|
806
726
|
originalIndex.add(xMin, yMin, xMax, yMax);
|
|
@@ -810,14 +730,14 @@ function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
|
810
730
|
const prunedCurves = splitCurves.filter((curve) => {
|
|
811
731
|
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
812
732
|
return !originalIndex.search(xMin - absOffset, yMin - absOffset, xMax + absOffset, yMax + absOffset).some((idx) => {
|
|
813
|
-
return blueprint.curves
|
|
733
|
+
return require_vec3.wasmIndex(blueprint.curves, idx).distanceFrom(curve) < absOffset - require_helpers.PRECISION_OFFSET;
|
|
814
734
|
});
|
|
815
735
|
});
|
|
816
736
|
if (!prunedCurves.length) return null;
|
|
817
737
|
const blueprints = stitchCurves(prunedCurves).filter((c) => c.length > 1).map((c) => new require_blueprint.Blueprint(c)).filter((b) => b.isClosed());
|
|
818
738
|
if (!blueprints.length) return null;
|
|
819
739
|
if (blueprints.length === 1) return require_errors.safeIndex(blueprints, 0, "offsetBlueprint");
|
|
820
|
-
return new
|
|
740
|
+
return new require_blueprintSketcher.Blueprints(blueprints);
|
|
821
741
|
}
|
|
822
742
|
var fuseAll = (blueprints) => {
|
|
823
743
|
let fused = require_errors.safeIndex(blueprints, 0, "fuseAll");
|
|
@@ -843,8 +763,8 @@ var fuseAll = (blueprints) => {
|
|
|
843
763
|
*/
|
|
844
764
|
function offset(bp, offsetDistance, offsetConfig = {}) {
|
|
845
765
|
if (bp instanceof require_blueprint.Blueprint) return offsetBlueprint(bp, offsetDistance, offsetConfig);
|
|
846
|
-
else if (bp instanceof
|
|
847
|
-
else if (bp instanceof
|
|
766
|
+
else if (bp instanceof require_blueprintSketcher.Blueprints) return fuseAll(bp.blueprints.map((b) => offset(b, offsetDistance, offsetConfig)));
|
|
767
|
+
else if (bp instanceof require_blueprintSketcher.CompoundBlueprint) {
|
|
848
768
|
const innerShape = fuseAll(bp.blueprints.slice(1).map((b) => offset(b, -offsetDistance, offsetConfig)));
|
|
849
769
|
return require_boolean2D.cut2D(offset(require_errors.safeIndex(bp.blueprints, 0, "offset"), offsetDistance, offsetConfig), innerShape);
|
|
850
770
|
}
|
|
@@ -865,8 +785,8 @@ function offset(bp, offsetDistance, offsetConfig = {}) {
|
|
|
865
785
|
*/
|
|
866
786
|
function approximateForSVG(bp, options) {
|
|
867
787
|
if (bp instanceof require_blueprint.Blueprint) return new require_blueprint.Blueprint(require_blueprint.approximateAsSvgCompatibleCurve(bp.curves, options));
|
|
868
|
-
else if (bp instanceof
|
|
869
|
-
else if (bp instanceof
|
|
788
|
+
else if (bp instanceof require_blueprintSketcher.CompoundBlueprint) return new require_blueprintSketcher.CompoundBlueprint(bp.blueprints.map((b) => approximateForSVG(b, options)));
|
|
789
|
+
else if (bp instanceof require_blueprintSketcher.Blueprints) return new require_blueprintSketcher.Blueprints(bp.blueprints.map((b) => approximateForSVG(b, options)));
|
|
870
790
|
return bp;
|
|
871
791
|
}
|
|
872
792
|
//#endregion
|
|
@@ -900,8 +820,8 @@ function modifyCorners(makeCorner, blueprint, radius, finder) {
|
|
|
900
820
|
}
|
|
901
821
|
function modifyCorner2D(makeCorner, shape, radius, finder) {
|
|
902
822
|
if (shape instanceof require_blueprint.Blueprint) return modifyCorners(makeCorner, shape, radius, finder);
|
|
903
|
-
if (shape instanceof
|
|
904
|
-
if (shape instanceof
|
|
823
|
+
if (shape instanceof require_blueprintSketcher.CompoundBlueprint) return new require_blueprintSketcher.CompoundBlueprint(shape.blueprints.map((b) => modifyCorners(makeCorner, b, radius, finder)));
|
|
824
|
+
if (shape instanceof require_blueprintSketcher.Blueprints) return new require_blueprintSketcher.Blueprints(shape.blueprints.map((b) => modifyCorner2D(makeCorner, b, radius, finder)).filter((b) => b !== null));
|
|
905
825
|
return null;
|
|
906
826
|
}
|
|
907
827
|
/**
|
|
@@ -917,7 +837,7 @@ function modifyCorner2D(makeCorner, shape, radius, finder) {
|
|
|
917
837
|
* @returns A new shape with filleted corners, or `null` if the input is `null`.
|
|
918
838
|
*/
|
|
919
839
|
function fillet2D(shape, radius, finder) {
|
|
920
|
-
return modifyCorner2D(
|
|
840
|
+
return modifyCorner2D(require_blueprintSketcher.filletCurves, shape, radius, finder);
|
|
921
841
|
}
|
|
922
842
|
/**
|
|
923
843
|
* Apply chamfer (beveled) corners to a 2D shape.
|
|
@@ -932,181 +852,14 @@ function fillet2D(shape, radius, finder) {
|
|
|
932
852
|
* @returns A new shape with chamfered corners, or `null` if the input is `null`.
|
|
933
853
|
*/
|
|
934
854
|
function chamfer2D(shape, radius, finder) {
|
|
935
|
-
return modifyCorner2D(
|
|
936
|
-
}
|
|
937
|
-
//#endregion
|
|
938
|
-
//#region src/sketching/sketchUtils.ts
|
|
939
|
-
/** Wrap SketchData into a Sketch instance. */
|
|
940
|
-
function wrapSketchData(data) {
|
|
941
|
-
const opts = {};
|
|
942
|
-
if (data.defaultOrigin) opts.defaultOrigin = data.defaultOrigin;
|
|
943
|
-
if (data.defaultDirection) opts.defaultDirection = data.defaultDirection;
|
|
944
|
-
const sketch = new require_boolean2D.Sketch(data.wire, opts);
|
|
945
|
-
if (data.baseFace) sketch.baseFace = data.baseFace;
|
|
946
|
-
return sketch;
|
|
947
|
-
}
|
|
948
|
-
/** Wrap an array of SketchData into a CompoundSketch. */
|
|
949
|
-
function wrapSketchDataArray(dataArr) {
|
|
950
|
-
return new CompoundSketch(dataArr.map(wrapSketchData));
|
|
951
|
-
}
|
|
952
|
-
//#endregion
|
|
953
|
-
//#region src/text/textBlueprints.ts
|
|
954
|
-
var FONT_REGISTER = {};
|
|
955
|
-
/**
|
|
956
|
-
* Load and register an OpenType/TrueType font for use with text drawing functions.
|
|
957
|
-
*
|
|
958
|
-
* The font is fetched (if a URL string) or parsed (if an ArrayBuffer) and
|
|
959
|
-
* stored in an internal registry keyed by `fontFamily`. The first font loaded
|
|
960
|
-
* is also registered as `'default'`.
|
|
961
|
-
*
|
|
962
|
-
* @param fontPath - URL string or raw ArrayBuffer of the font file.
|
|
963
|
-
* @param fontFamily - Registry key for later retrieval (defaults to `'default'`).
|
|
964
|
-
* @param force - If true, overwrite a previously loaded font with the same key.
|
|
965
|
-
* @returns The parsed opentype.js Font object.
|
|
966
|
-
*/
|
|
967
|
-
async function loadFont(fontPath, fontFamily = "default", force = false) {
|
|
968
|
-
if (!force && FONT_REGISTER[fontFamily]) return require_errors.ok(FONT_REGISTER[fontFamily]);
|
|
969
|
-
let fontData;
|
|
970
|
-
if (typeof fontPath === "string") {
|
|
971
|
-
let response;
|
|
972
|
-
try {
|
|
973
|
-
response = await fetch(fontPath);
|
|
974
|
-
} catch (e) {
|
|
975
|
-
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));
|
|
976
|
-
}
|
|
977
|
-
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}`));
|
|
978
|
-
fontData = await response.arrayBuffer();
|
|
979
|
-
} else fontData = fontPath;
|
|
980
|
-
let font;
|
|
981
|
-
try {
|
|
982
|
-
font = opentype_js.default.parse(fontData);
|
|
983
|
-
} catch (e) {
|
|
984
|
-
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));
|
|
985
|
-
}
|
|
986
|
-
const typedFont = font;
|
|
987
|
-
FONT_REGISTER[fontFamily] = typedFont;
|
|
988
|
-
if (!FONT_REGISTER["default"]) FONT_REGISTER["default"] = typedFont;
|
|
989
|
-
return require_errors.ok(typedFont);
|
|
990
|
-
}
|
|
991
|
-
/**
|
|
992
|
-
* Retrieve a previously loaded font by family name.
|
|
993
|
-
*
|
|
994
|
-
* @param fontFamily - Registry key (defaults to `'default'`).
|
|
995
|
-
* @returns The opentype.js Font object, or `undefined` if not loaded.
|
|
996
|
-
*/
|
|
997
|
-
var getFont = (fontFamily = "default") => {
|
|
998
|
-
return FONT_REGISTER[fontFamily];
|
|
999
|
-
};
|
|
1000
|
-
var sketchFontCommands = function* (commands) {
|
|
1001
|
-
let sk = null;
|
|
1002
|
-
let lastPoint = null;
|
|
1003
|
-
for (const command of commands) {
|
|
1004
|
-
if (command.type === "Z") {
|
|
1005
|
-
if (sk) yield sk.close();
|
|
1006
|
-
sk = null;
|
|
1007
|
-
continue;
|
|
1008
|
-
}
|
|
1009
|
-
const p = [-command.x, command.y];
|
|
1010
|
-
if (command.type === "M") {
|
|
1011
|
-
if (sk) yield sk.done();
|
|
1012
|
-
sk = new require_boolean2D.BlueprintSketcher();
|
|
1013
|
-
sk.movePointerTo(p);
|
|
1014
|
-
lastPoint = p;
|
|
1015
|
-
continue;
|
|
1016
|
-
}
|
|
1017
|
-
if (lastPoint && Math.abs(p[0] - lastPoint[0]) < 1e-9 && Math.abs(p[1] - lastPoint[1]) < 1e-9) continue;
|
|
1018
|
-
if (command.type === "L") sk?.lineTo(p);
|
|
1019
|
-
if (command.type === "C") sk?.cubicBezierCurveTo(p, [-command.x1, command.y1], [-command.x2, command.y2]);
|
|
1020
|
-
if (command.type === "Q") sk?.quadraticBezierCurveTo(p, [-command.x1, command.y1]);
|
|
1021
|
-
lastPoint = p;
|
|
1022
|
-
}
|
|
1023
|
-
};
|
|
1024
|
-
/**
|
|
1025
|
-
* Convert a text string into 2D Blueprints using a loaded font.
|
|
1026
|
-
*
|
|
1027
|
-
* Each glyph outline is traced as a series of line/bezier curves, then
|
|
1028
|
-
* organised into a {@link Blueprints} collection (outer contours + holes).
|
|
1029
|
-
*
|
|
1030
|
-
* @param text - The string to render.
|
|
1031
|
-
* @returns A Blueprints instance representing the text outlines.
|
|
1032
|
-
*
|
|
1033
|
-
* @remarks Requires a font to be loaded via {@link loadFont} before use.
|
|
1034
|
-
*/
|
|
1035
|
-
function textBlueprints(text, { startX = 0, startY = 0, fontSize = 16, fontFamily = "default" } = {}) {
|
|
1036
|
-
let font = getFont(fontFamily);
|
|
1037
|
-
if (!font) font = getFont();
|
|
1038
|
-
if (!font) require_errors.bug("text", "No fonts loaded. Call loadFont() before using text functions.");
|
|
1039
|
-
const writtenText = font.getPath(text, -startX, -startY, fontSize);
|
|
1040
|
-
return require_boolean2D.organiseBlueprints(Array.from(sketchFontCommands(writtenText.commands))).mirror([0, 0]);
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
* Render text as 3D sketch outlines on a plane.
|
|
1044
|
-
*
|
|
1045
|
-
* Combines {@link textBlueprints} with `sketchOnPlane` to produce a
|
|
1046
|
-
* {@link Sketches} collection that can be extruded, revolved, etc.
|
|
1047
|
-
*
|
|
1048
|
-
* @param text - The string to render.
|
|
1049
|
-
* @param textConfig - Font size, family, and start position.
|
|
1050
|
-
* @param planeConfig - Plane name / origin to sketch on (defaults to XY at origin).
|
|
1051
|
-
* @returns A {@link Sketches} collection of the text outlines.
|
|
1052
|
-
*
|
|
1053
|
-
* @example
|
|
1054
|
-
* ```ts
|
|
1055
|
-
* await loadFont("/fonts/Roboto.ttf");
|
|
1056
|
-
* const textSketches = sketchText("Hello", { fontSize: 24 });
|
|
1057
|
-
* const solid = textSketches.extrude(2);
|
|
1058
|
-
* ```
|
|
1059
|
-
*/
|
|
1060
|
-
function sketchText(text, textConfig, planeConfig = {}) {
|
|
1061
|
-
const textBp = textBlueprints(text, textConfig);
|
|
1062
|
-
return new Sketches((typeof planeConfig.plane === "string" || planeConfig.plane === void 0 ? textBp.sketchOnPlane(planeConfig.plane, planeConfig.origin) : textBp.sketchOnPlane(planeConfig.plane)).map((item) => Array.isArray(item) ? new CompoundSketch(item.map(wrapSketchData)) : wrapSketchData(item)));
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* Measure the dimensions of a text string without generating geometry.
|
|
1066
|
-
*
|
|
1067
|
-
* Requires a font to be loaded via {@link loadFont} first.
|
|
1068
|
-
*/
|
|
1069
|
-
function textMetrics(text, options) {
|
|
1070
|
-
const fontSize = options?.fontSize ?? 1;
|
|
1071
|
-
const font = getFont(options?.fontFamily);
|
|
1072
|
-
if (!font) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.NO_FONT_LOADED, "No font loaded. Call loadFont() first.", void 0, void 0, "Load a font with loadFont() before calling textMetrics()"));
|
|
1073
|
-
const width = font.getAdvanceWidth(text, fontSize);
|
|
1074
|
-
const scale = fontSize / font.unitsPerEm;
|
|
1075
|
-
const ascender = font.ascender * scale;
|
|
1076
|
-
const descender = font.descender * scale;
|
|
1077
|
-
return require_errors.ok({
|
|
1078
|
-
width,
|
|
1079
|
-
height: ascender - descender,
|
|
1080
|
-
ascender,
|
|
1081
|
-
descender
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Retrieve font-level metrics without referencing specific text.
|
|
1086
|
-
*
|
|
1087
|
-
* Requires a font to be loaded via {@link loadFont} first.
|
|
1088
|
-
*/
|
|
1089
|
-
function fontMetrics(options) {
|
|
1090
|
-
const fontSize = options?.fontSize ?? 1;
|
|
1091
|
-
const font = getFont(options?.fontFamily);
|
|
1092
|
-
if (!font) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.NO_FONT_LOADED, "No font loaded. Call loadFont() first.", void 0, void 0, "Load a font with loadFont() before calling fontMetrics()"));
|
|
1093
|
-
const scale = fontSize / font.unitsPerEm;
|
|
1094
|
-
const ascender = font.ascender * scale;
|
|
1095
|
-
const descender = font.descender * scale;
|
|
1096
|
-
const lineGap = (font.tables?.os2?.sTypoLineGap ?? 0) * scale;
|
|
1097
|
-
return require_errors.ok({
|
|
1098
|
-
ascender,
|
|
1099
|
-
descender,
|
|
1100
|
-
unitsPerEm: font.unitsPerEm,
|
|
1101
|
-
lineHeight: ascender - descender + lineGap
|
|
1102
|
-
});
|
|
855
|
+
return modifyCorner2D(require_blueprintSketcher.chamferCurves, shape, radius, finder);
|
|
1103
856
|
}
|
|
1104
857
|
//#endregion
|
|
1105
|
-
//#region src/sketching/
|
|
858
|
+
//#region src/sketching/drawing.ts
|
|
1106
859
|
function wrapBlueprintResult(shape, result) {
|
|
1107
|
-
if (shape instanceof require_blueprint.Blueprint) return wrapSketchData(result);
|
|
1108
|
-
else if (shape instanceof
|
|
1109
|
-
else return new Sketches(result.map((item) => Array.isArray(item) ? wrapSketchDataArray(item) : wrapSketchData(item)));
|
|
860
|
+
if (shape instanceof require_blueprint.Blueprint) return require_textBlueprints.wrapSketchData(result);
|
|
861
|
+
else if (shape instanceof require_blueprintSketcher.CompoundBlueprint) return require_textBlueprints.wrapSketchDataArray(result);
|
|
862
|
+
else return new require_textBlueprints.Sketches(result.map((item) => Array.isArray(item) ? require_textBlueprints.wrapSketchDataArray(item) : require_textBlueprints.wrapSketchData(item)));
|
|
1110
863
|
}
|
|
1111
864
|
/**
|
|
1112
865
|
* @categoryDescription Drawing
|
|
@@ -1144,11 +897,11 @@ var Drawing = class Drawing {
|
|
|
1144
897
|
serialize() {
|
|
1145
898
|
if (!this.innerShape) return JSON.stringify({ type: "Empty" });
|
|
1146
899
|
function serializeHelper(shape) {
|
|
1147
|
-
if (shape instanceof
|
|
900
|
+
if (shape instanceof require_blueprintSketcher.CompoundBlueprint) return {
|
|
1148
901
|
type: "CompoundBlueprint",
|
|
1149
902
|
blueprints: shape.blueprints.map(serializeHelper)
|
|
1150
903
|
};
|
|
1151
|
-
else if (shape instanceof
|
|
904
|
+
else if (shape instanceof require_blueprintSketcher.Blueprints) return {
|
|
1152
905
|
type: "Blueprints",
|
|
1153
906
|
blueprints: shape.blueprints.map(serializeHelper)
|
|
1154
907
|
};
|
|
@@ -1278,20 +1031,35 @@ var Drawing = class Drawing {
|
|
|
1278
1031
|
/** Access the underlying {@link Blueprint}, throwing if the drawing is compound. */
|
|
1279
1032
|
get blueprint() {
|
|
1280
1033
|
if (!(this.innerShape instanceof require_blueprint.Blueprint)) {
|
|
1281
|
-
if (this.innerShape instanceof
|
|
1034
|
+
if (this.innerShape instanceof require_blueprintSketcher.Blueprints && this.innerShape.blueprints.length === 1 && this.innerShape.blueprints[0] instanceof require_blueprint.Blueprint) return this.innerShape.blueprints[0];
|
|
1282
1035
|
require_errors.bug("Drawing.blueprint", "This drawing is not a blueprint");
|
|
1283
1036
|
}
|
|
1284
1037
|
return this.innerShape;
|
|
1285
1038
|
}
|
|
1286
1039
|
};
|
|
1287
1040
|
/**
|
|
1041
|
+
* Deserializes a drawing from a string. String is expected to be in the format
|
|
1042
|
+
* generated by `Drawing.serialize()`.
|
|
1043
|
+
*/
|
|
1044
|
+
function deserializeDrawing(data) {
|
|
1045
|
+
function deserializeHelper(json) {
|
|
1046
|
+
if (json["type"] === "CompoundBlueprint") return new require_blueprintSketcher.CompoundBlueprint(json["blueprints"].map(deserializeHelper));
|
|
1047
|
+
else if (json["type"] === "Blueprints") return new require_blueprintSketcher.Blueprints(json["blueprints"].map(deserializeHelper));
|
|
1048
|
+
else if (json["type"] === "Blueprint") return new require_blueprint.Blueprint(json["curves"].map((c) => require_blueprint.deserializeCurve2D(c)));
|
|
1049
|
+
else require_errors.bug("Drawing.deserialize", "Unknown shape type for deserialization");
|
|
1050
|
+
}
|
|
1051
|
+
return new Drawing(deserializeHelper(JSON.parse(data)));
|
|
1052
|
+
}
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region src/sketching/drawingPen.ts
|
|
1055
|
+
/**
|
|
1288
1056
|
* DrawingPen is a helper class to draw in 2D. It is used to create drawings
|
|
1289
1057
|
* by exposing a builder interface. It is not a drawing itself, but it can be
|
|
1290
1058
|
* used to create a drawing.
|
|
1291
1059
|
*
|
|
1292
1060
|
* @category Drawing
|
|
1293
1061
|
*/
|
|
1294
|
-
var DrawingPen = class extends
|
|
1062
|
+
var DrawingPen = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
1295
1063
|
constructor(origin = [0, 0]) {
|
|
1296
1064
|
super();
|
|
1297
1065
|
this.pointer = origin;
|
|
@@ -1326,19 +1094,6 @@ var DrawingPen = class extends require_boolean2D.BaseSketcher2d {
|
|
|
1326
1094
|
}
|
|
1327
1095
|
};
|
|
1328
1096
|
/**
|
|
1329
|
-
* Deserializes a drawing from a string. String is expected to be in the format
|
|
1330
|
-
* generated by `Drawing.serialize()`.
|
|
1331
|
-
*/
|
|
1332
|
-
function deserializeDrawing(data) {
|
|
1333
|
-
function deserializeHelper(json) {
|
|
1334
|
-
if (json["type"] === "CompoundBlueprint") return new require_boolean2D.CompoundBlueprint(json["blueprints"].map(deserializeHelper));
|
|
1335
|
-
else if (json["type"] === "Blueprints") return new require_boolean2D.Blueprints(json["blueprints"].map(deserializeHelper));
|
|
1336
|
-
else if (json["type"] === "Blueprint") return new require_blueprint.Blueprint(json["curves"].map((c) => require_blueprint.deserializeCurve2D(c)));
|
|
1337
|
-
else require_errors.bug("Drawing.deserialize", "Unknown shape type for deserialization");
|
|
1338
|
-
}
|
|
1339
|
-
return new Drawing(deserializeHelper(JSON.parse(data)));
|
|
1340
|
-
}
|
|
1341
|
-
/**
|
|
1342
1097
|
* Creates a drawing pen to programatically draw in 2D.
|
|
1343
1098
|
*
|
|
1344
1099
|
* @category Drawing
|
|
@@ -1348,6 +1103,8 @@ function draw(initialPoint) {
|
|
|
1348
1103
|
if (initialPoint) pen.movePointerTo(initialPoint);
|
|
1349
1104
|
return pen;
|
|
1350
1105
|
}
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region src/sketching/drawingFactories.ts
|
|
1351
1108
|
/**
|
|
1352
1109
|
* Creates the `Drawing` of a rectangle with (optional) rounded corners.
|
|
1353
1110
|
*
|
|
@@ -1419,7 +1176,7 @@ function drawPolysides(radius, sidesCount, sagitta = 0) {
|
|
|
1419
1176
|
* @category Drawing
|
|
1420
1177
|
*/
|
|
1421
1178
|
function drawText(text, { startX = 0, startY = 0, fontSize = 16, fontFamily = "default" } = {}) {
|
|
1422
|
-
return new Drawing(textBlueprints(text, {
|
|
1179
|
+
return new Drawing(require_textBlueprints.textBlueprints(text, {
|
|
1423
1180
|
startX,
|
|
1424
1181
|
startY,
|
|
1425
1182
|
fontSize,
|
|
@@ -1457,275 +1214,6 @@ var drawParametricFunction = (func, { pointsCount = 400, start = 0, stop = 1, cl
|
|
|
1457
1214
|
}), approximationConfig, { closeShape });
|
|
1458
1215
|
};
|
|
1459
1216
|
//#endregion
|
|
1460
|
-
//#region src/projection/projectionPlanes.ts
|
|
1461
|
-
/** Lookup table mapping each {@link ProjectionPlane} to its camera configuration. */
|
|
1462
|
-
var PROJECTION_PLANES = {
|
|
1463
|
-
XY: {
|
|
1464
|
-
dir: [
|
|
1465
|
-
0,
|
|
1466
|
-
0,
|
|
1467
|
-
1
|
|
1468
|
-
],
|
|
1469
|
-
xAxis: [
|
|
1470
|
-
1,
|
|
1471
|
-
0,
|
|
1472
|
-
0
|
|
1473
|
-
]
|
|
1474
|
-
},
|
|
1475
|
-
XZ: {
|
|
1476
|
-
dir: [
|
|
1477
|
-
0,
|
|
1478
|
-
-1,
|
|
1479
|
-
0
|
|
1480
|
-
],
|
|
1481
|
-
xAxis: [
|
|
1482
|
-
1,
|
|
1483
|
-
0,
|
|
1484
|
-
0
|
|
1485
|
-
]
|
|
1486
|
-
},
|
|
1487
|
-
YZ: {
|
|
1488
|
-
dir: [
|
|
1489
|
-
1,
|
|
1490
|
-
0,
|
|
1491
|
-
0
|
|
1492
|
-
],
|
|
1493
|
-
xAxis: [
|
|
1494
|
-
0,
|
|
1495
|
-
1,
|
|
1496
|
-
0
|
|
1497
|
-
]
|
|
1498
|
-
},
|
|
1499
|
-
YX: {
|
|
1500
|
-
dir: [
|
|
1501
|
-
0,
|
|
1502
|
-
0,
|
|
1503
|
-
-1
|
|
1504
|
-
],
|
|
1505
|
-
xAxis: [
|
|
1506
|
-
0,
|
|
1507
|
-
1,
|
|
1508
|
-
0
|
|
1509
|
-
]
|
|
1510
|
-
},
|
|
1511
|
-
ZX: {
|
|
1512
|
-
dir: [
|
|
1513
|
-
0,
|
|
1514
|
-
1,
|
|
1515
|
-
0
|
|
1516
|
-
],
|
|
1517
|
-
xAxis: [
|
|
1518
|
-
0,
|
|
1519
|
-
0,
|
|
1520
|
-
1
|
|
1521
|
-
]
|
|
1522
|
-
},
|
|
1523
|
-
ZY: {
|
|
1524
|
-
dir: [
|
|
1525
|
-
-1,
|
|
1526
|
-
0,
|
|
1527
|
-
0
|
|
1528
|
-
],
|
|
1529
|
-
xAxis: [
|
|
1530
|
-
0,
|
|
1531
|
-
0,
|
|
1532
|
-
1
|
|
1533
|
-
]
|
|
1534
|
-
},
|
|
1535
|
-
front: {
|
|
1536
|
-
dir: [
|
|
1537
|
-
0,
|
|
1538
|
-
-1,
|
|
1539
|
-
0
|
|
1540
|
-
],
|
|
1541
|
-
xAxis: [
|
|
1542
|
-
1,
|
|
1543
|
-
0,
|
|
1544
|
-
0
|
|
1545
|
-
]
|
|
1546
|
-
},
|
|
1547
|
-
back: {
|
|
1548
|
-
dir: [
|
|
1549
|
-
0,
|
|
1550
|
-
1,
|
|
1551
|
-
0
|
|
1552
|
-
],
|
|
1553
|
-
xAxis: [
|
|
1554
|
-
-1,
|
|
1555
|
-
0,
|
|
1556
|
-
0
|
|
1557
|
-
]
|
|
1558
|
-
},
|
|
1559
|
-
right: {
|
|
1560
|
-
dir: [
|
|
1561
|
-
-1,
|
|
1562
|
-
0,
|
|
1563
|
-
0
|
|
1564
|
-
],
|
|
1565
|
-
xAxis: [
|
|
1566
|
-
0,
|
|
1567
|
-
-1,
|
|
1568
|
-
0
|
|
1569
|
-
]
|
|
1570
|
-
},
|
|
1571
|
-
left: {
|
|
1572
|
-
dir: [
|
|
1573
|
-
1,
|
|
1574
|
-
0,
|
|
1575
|
-
0
|
|
1576
|
-
],
|
|
1577
|
-
xAxis: [
|
|
1578
|
-
0,
|
|
1579
|
-
1,
|
|
1580
|
-
0
|
|
1581
|
-
]
|
|
1582
|
-
},
|
|
1583
|
-
bottom: {
|
|
1584
|
-
dir: [
|
|
1585
|
-
0,
|
|
1586
|
-
0,
|
|
1587
|
-
1
|
|
1588
|
-
],
|
|
1589
|
-
xAxis: [
|
|
1590
|
-
1,
|
|
1591
|
-
0,
|
|
1592
|
-
0
|
|
1593
|
-
]
|
|
1594
|
-
},
|
|
1595
|
-
top: {
|
|
1596
|
-
dir: [
|
|
1597
|
-
0,
|
|
1598
|
-
0,
|
|
1599
|
-
-1
|
|
1600
|
-
],
|
|
1601
|
-
xAxis: [
|
|
1602
|
-
1,
|
|
1603
|
-
0,
|
|
1604
|
-
0
|
|
1605
|
-
]
|
|
1606
|
-
}
|
|
1607
|
-
};
|
|
1608
|
-
/** Type guard — check if a value is a valid {@link ProjectionPlane} name. */
|
|
1609
|
-
function isProjectionPlane(plane) {
|
|
1610
|
-
return typeof plane === "string" && plane in PROJECTION_PLANES;
|
|
1611
|
-
}
|
|
1612
|
-
//#endregion
|
|
1613
|
-
//#region src/projection/makeProjectedEdges.ts
|
|
1614
|
-
var getEdgesFromOc = (shape) => {
|
|
1615
|
-
if (shape.IsNull()) return [];
|
|
1616
|
-
return require_faceFns.getEdges(require_shapeTypes.castShape(shape));
|
|
1617
|
-
};
|
|
1618
|
-
/**
|
|
1619
|
-
* Project a 3D shape onto a 2D plane using hidden-line removal (HLR).
|
|
1620
|
-
*
|
|
1621
|
-
* @param camera - Camera defining the projection plane.
|
|
1622
|
-
* @param withHiddenLines - If `true`, also returns hidden (occluded) edges.
|
|
1623
|
-
* @returns Separate arrays of visible and hidden projected edges.
|
|
1624
|
-
*/
|
|
1625
|
-
function makeProjectedEdges(shape, camera, withHiddenLines = true) {
|
|
1626
|
-
const projected = require_shapeTypes.getKernel().projectEdges(shape.wrapped, [...camera.position], [...camera.direction], [...camera.xAxis]);
|
|
1627
|
-
return {
|
|
1628
|
-
visible: [
|
|
1629
|
-
...getEdgesFromOc(projected.visible.sharp),
|
|
1630
|
-
...getEdgesFromOc(projected.visible.smooth),
|
|
1631
|
-
...getEdgesFromOc(projected.visible.outline)
|
|
1632
|
-
],
|
|
1633
|
-
hidden: withHiddenLines ? [
|
|
1634
|
-
...getEdgesFromOc(projected.hidden.sharp),
|
|
1635
|
-
...getEdgesFromOc(projected.hidden.smooth),
|
|
1636
|
-
...getEdgesFromOc(projected.hidden.outline)
|
|
1637
|
-
] : []
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
//#endregion
|
|
1641
|
-
//#region src/projection/cameraFns.ts
|
|
1642
|
-
/**
|
|
1643
|
-
* Create a camera from position, direction, and an optional X-axis.
|
|
1644
|
-
*
|
|
1645
|
-
* If `xAxis` is omitted, it is derived automatically from the direction.
|
|
1646
|
-
*
|
|
1647
|
-
* @param position - Camera position in world coordinates.
|
|
1648
|
-
* @param direction - View direction (camera looks along this vector).
|
|
1649
|
-
* @param xAxis - Optional horizontal axis; derived automatically if not provided.
|
|
1650
|
-
* @returns `Result<Camera>` -- an error if direction is zero-length.
|
|
1651
|
-
*/
|
|
1652
|
-
function createCamera(position = [
|
|
1653
|
-
0,
|
|
1654
|
-
0,
|
|
1655
|
-
0
|
|
1656
|
-
], direction = [
|
|
1657
|
-
0,
|
|
1658
|
-
0,
|
|
1659
|
-
1
|
|
1660
|
-
], xAxis) {
|
|
1661
|
-
if (require_vecOps.vecLength(direction) < 1e-12) return require_errors.err(require_errors.validationError("CAMERA_ZERO_DIRECTION", "Camera direction cannot be a zero-length vector"));
|
|
1662
|
-
let resolvedXAxis;
|
|
1663
|
-
if (xAxis) resolvedXAxis = require_vecOps.vecNormalize(xAxis);
|
|
1664
|
-
else {
|
|
1665
|
-
let cross = require_vecOps.vecCross([
|
|
1666
|
-
0,
|
|
1667
|
-
0,
|
|
1668
|
-
1
|
|
1669
|
-
], direction);
|
|
1670
|
-
if (require_vecOps.vecLength(cross) < 1e-12) cross = require_vecOps.vecCross([
|
|
1671
|
-
0,
|
|
1672
|
-
1,
|
|
1673
|
-
0
|
|
1674
|
-
], direction);
|
|
1675
|
-
if (require_vecOps.vecLength(cross) < 1e-12) cross = require_vecOps.vecCross([
|
|
1676
|
-
1,
|
|
1677
|
-
0,
|
|
1678
|
-
0
|
|
1679
|
-
], direction);
|
|
1680
|
-
resolvedXAxis = require_vecOps.vecNormalize(cross);
|
|
1681
|
-
}
|
|
1682
|
-
const yAxis = require_vecOps.vecNormalize(require_vecOps.vecCross(direction, resolvedXAxis));
|
|
1683
|
-
return require_errors.ok({
|
|
1684
|
-
position,
|
|
1685
|
-
direction: require_vecOps.vecNormalize(direction),
|
|
1686
|
-
xAxis: resolvedXAxis,
|
|
1687
|
-
yAxis
|
|
1688
|
-
});
|
|
1689
|
-
}
|
|
1690
|
-
/**
|
|
1691
|
-
* Create a new camera oriented to look at a target point from the current position.
|
|
1692
|
-
*
|
|
1693
|
-
* @param camera - Existing camera whose position is preserved.
|
|
1694
|
-
* @param target - World-space point to look at.
|
|
1695
|
-
* @returns `Result<Camera>` with updated direction and derived axes.
|
|
1696
|
-
*/
|
|
1697
|
-
function cameraLookAt(camera, target) {
|
|
1698
|
-
const direction = require_vecOps.vecNormalize(require_vecOps.vecSub(camera.position, target));
|
|
1699
|
-
return createCamera(camera.position, direction);
|
|
1700
|
-
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Create a camera positioned at the origin, looking along a named projection plane.
|
|
1703
|
-
*
|
|
1704
|
-
* @param planeName - Named projection direction (e.g., `'front'`, `'top'`).
|
|
1705
|
-
* @returns `Result<Camera>` configured for that standard view.
|
|
1706
|
-
*/
|
|
1707
|
-
function cameraFromPlane(planeName) {
|
|
1708
|
-
const config = PROJECTION_PLANES[planeName];
|
|
1709
|
-
return createCamera([
|
|
1710
|
-
0,
|
|
1711
|
-
0,
|
|
1712
|
-
0
|
|
1713
|
-
], config.dir, config.xAxis);
|
|
1714
|
-
}
|
|
1715
|
-
/**
|
|
1716
|
-
* Project the edges of a 3D shape onto a 2D plane defined by a {@link Camera}.
|
|
1717
|
-
*
|
|
1718
|
-
* @param shape - The 3D shape to project.
|
|
1719
|
-
* @param camera - Camera defining the projection plane.
|
|
1720
|
-
* @param withHiddenLines - If true, compute hidden-line edges as well.
|
|
1721
|
-
* @returns Separate arrays of visible and hidden projected edges.
|
|
1722
|
-
*
|
|
1723
|
-
* @see {@link drawProjection} for the higher-level Drawing-based API.
|
|
1724
|
-
*/
|
|
1725
|
-
function projectEdges(shape, camera, withHiddenLines = true) {
|
|
1726
|
-
return makeProjectedEdges(shape, camera, withHiddenLines);
|
|
1727
|
-
}
|
|
1728
|
-
//#endregion
|
|
1729
1217
|
//#region src/sketching/draw3d.ts
|
|
1730
1218
|
var edgesToDrawing = (edges) => {
|
|
1731
1219
|
try {
|
|
@@ -1736,7 +1224,7 @@ var edgesToDrawing = (edges) => {
|
|
|
1736
1224
|
const stitchedCurves = stitchCurves(edges.map((e) => require_blueprint.edgeToCurve(e, planeFace))).map((s) => new require_blueprint.Blueprint(s));
|
|
1737
1225
|
if (stitchedCurves.length === 0) return new Drawing();
|
|
1738
1226
|
if (stitchedCurves.length === 1) return new Drawing(stitchedCurves[0]);
|
|
1739
|
-
return new Drawing(new
|
|
1227
|
+
return new Drawing(new require_blueprintSketcher.Blueprints(stitchedCurves));
|
|
1740
1228
|
} catch (_) {
|
|
1741
1229
|
_usingCtx$1.e = _;
|
|
1742
1230
|
} finally {
|
|
@@ -1752,9 +1240,9 @@ var edgesToDrawing = (edges) => {
|
|
|
1752
1240
|
*/
|
|
1753
1241
|
function drawProjection(shape, projectionCamera = "front") {
|
|
1754
1242
|
let camera;
|
|
1755
|
-
if (typeof projectionCamera === "string") camera = require_errors.unwrap(cameraFromPlane(projectionCamera));
|
|
1243
|
+
if (typeof projectionCamera === "string") camera = require_errors.unwrap(require_cameraFns.cameraFromPlane(projectionCamera));
|
|
1756
1244
|
else camera = projectionCamera;
|
|
1757
|
-
const { visible, hidden } = projectEdges(shape, camera);
|
|
1245
|
+
const { visible, hidden } = require_cameraFns.projectEdges(shape, camera);
|
|
1758
1246
|
return {
|
|
1759
1247
|
visible: edgesToDrawing(visible),
|
|
1760
1248
|
hidden: edgesToDrawing(hidden)
|
|
@@ -1770,10 +1258,10 @@ function drawFaceOutline(face) {
|
|
|
1770
1258
|
var _usingCtx3 = require_shapeTypes._usingCtx();
|
|
1771
1259
|
const scope = _usingCtx3.u(new require_shapeTypes.DisposalScope());
|
|
1772
1260
|
const clonedFace = scope.register(require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(face.wrapped))));
|
|
1773
|
-
const stitchedCurves = stitchCurves(
|
|
1261
|
+
const stitchedCurves = stitchCurves(require_topologyQueryFns.getEdges(scope.register(require_faceFns.outerWire(clonedFace))).map((e) => require_blueprint.edgeToCurve(e, face))).map((s) => new require_blueprint.Blueprint(s));
|
|
1774
1262
|
if (stitchedCurves.length === 0) return new Drawing();
|
|
1775
1263
|
if (stitchedCurves.length === 1) return new Drawing(stitchedCurves[0]);
|
|
1776
|
-
return new Drawing(new
|
|
1264
|
+
return new Drawing(new require_blueprintSketcher.Blueprints(stitchedCurves));
|
|
1777
1265
|
} catch (_) {
|
|
1778
1266
|
_usingCtx3.e = _;
|
|
1779
1267
|
} finally {
|
|
@@ -1781,133 +1269,6 @@ function drawFaceOutline(face) {
|
|
|
1781
1269
|
}
|
|
1782
1270
|
}
|
|
1783
1271
|
//#endregion
|
|
1784
|
-
//#region src/sketching/sketchFns.ts
|
|
1785
|
-
/**
|
|
1786
|
-
* Extrude a sketch to a given distance along its default (or overridden) direction.
|
|
1787
|
-
*
|
|
1788
|
-
* @param sketch - The sketch to extrude. Consumed (deleted) by this call.
|
|
1789
|
-
* @param height - Extrusion distance.
|
|
1790
|
-
* @param config - Optional direction, profile, twist angle, or origin overrides.
|
|
1791
|
-
* @returns The extruded 3D solid.
|
|
1792
|
-
*
|
|
1793
|
-
* @see {@link Sketch.extrude} for the OOP equivalent.
|
|
1794
|
-
*/
|
|
1795
|
-
function sketchExtrude(sketch, height, config) {
|
|
1796
|
-
return sketch.extrude(height, config);
|
|
1797
|
-
}
|
|
1798
|
-
/**
|
|
1799
|
-
* Revolve a sketch around an axis to produce a solid of revolution.
|
|
1800
|
-
*
|
|
1801
|
-
* @param sketch - The sketch to revolve. Consumed (deleted) by this call.
|
|
1802
|
-
* @param revolutionAxis - Axis direction (defaults to sketch default direction).
|
|
1803
|
-
* @param options - Optional origin override.
|
|
1804
|
-
* @returns The revolved 3D solid.
|
|
1805
|
-
*
|
|
1806
|
-
* @see {@link Sketch.revolve} for the OOP equivalent.
|
|
1807
|
-
*/
|
|
1808
|
-
function sketchRevolve(sketch, revolutionAxis, options) {
|
|
1809
|
-
return sketch.revolve(revolutionAxis, options);
|
|
1810
|
-
}
|
|
1811
|
-
/**
|
|
1812
|
-
* Loft between this sketch and one or more other sketches.
|
|
1813
|
-
*
|
|
1814
|
-
* @param sketch - The starting sketch. Consumed by this call.
|
|
1815
|
-
* @param otherSketches - Target sketch(es) to loft toward.
|
|
1816
|
-
* @param loftConfig - Loft options (ruled surface, start/end points, etc.).
|
|
1817
|
-
* @param returnShell - If true, return a shell instead of a solid.
|
|
1818
|
-
* @returns The lofted 3D shape.
|
|
1819
|
-
*
|
|
1820
|
-
* @see {@link Sketch.loftWith} for the OOP equivalent.
|
|
1821
|
-
*/
|
|
1822
|
-
function sketchLoft(sketch, otherSketches, loftConfig, returnShell) {
|
|
1823
|
-
return sketch.loftWith(otherSketches, loftConfig, returnShell);
|
|
1824
|
-
}
|
|
1825
|
-
/**
|
|
1826
|
-
* Sweep a profile sketch along this sketch's wire path.
|
|
1827
|
-
*
|
|
1828
|
-
* @param sketch - The path sketch. Consumed by this call.
|
|
1829
|
-
* @param sketchOnPlane - Function that builds the profile sketch at the sweep start.
|
|
1830
|
-
* @param sweepConfig - Sweep options (auxiliary spine, orthogonality, etc.).
|
|
1831
|
-
* @returns The swept 3D shape.
|
|
1832
|
-
*
|
|
1833
|
-
* @see {@link Sketch.sweepSketch} for the OOP equivalent.
|
|
1834
|
-
*/
|
|
1835
|
-
function sketchSweep(sketch, sketchOnPlane, sweepConfig) {
|
|
1836
|
-
return sketch.sweepSketch(sketchOnPlane, sweepConfig);
|
|
1837
|
-
}
|
|
1838
|
-
/**
|
|
1839
|
-
* Build a face from a sketch's closed wire.
|
|
1840
|
-
*
|
|
1841
|
-
* @param sketch - A sketch with a closed wire.
|
|
1842
|
-
* @returns The planar face.
|
|
1843
|
-
*
|
|
1844
|
-
* @see {@link Sketch.face} for the OOP equivalent.
|
|
1845
|
-
*/
|
|
1846
|
-
function sketchFace(sketch) {
|
|
1847
|
-
return sketch.face();
|
|
1848
|
-
}
|
|
1849
|
-
/**
|
|
1850
|
-
* Get a clone of the wire from a sketch.
|
|
1851
|
-
*
|
|
1852
|
-
* @param sketch - The source sketch.
|
|
1853
|
-
* @returns A cloned wire.
|
|
1854
|
-
*
|
|
1855
|
-
* @see {@link Sketch.wires} for the OOP equivalent.
|
|
1856
|
-
*/
|
|
1857
|
-
function sketchWires(sketch) {
|
|
1858
|
-
return sketch.wires();
|
|
1859
|
-
}
|
|
1860
|
-
/**
|
|
1861
|
-
* Extrude a compound sketch (outer + holes) to a given distance.
|
|
1862
|
-
*
|
|
1863
|
-
* @param sketch - The compound sketch to extrude.
|
|
1864
|
-
* @param height - Extrusion distance.
|
|
1865
|
-
* @param config - Optional direction, profile, twist angle, or origin overrides.
|
|
1866
|
-
* @returns The extruded 3D solid.
|
|
1867
|
-
*
|
|
1868
|
-
* @see {@link CompoundSketch.extrude} for the OOP equivalent.
|
|
1869
|
-
*/
|
|
1870
|
-
function compoundSketchExtrude(sketch, height, config) {
|
|
1871
|
-
return sketch.extrude(height, config);
|
|
1872
|
-
}
|
|
1873
|
-
/**
|
|
1874
|
-
* Revolve a compound sketch around an axis to produce a solid of revolution.
|
|
1875
|
-
*
|
|
1876
|
-
* @param sketch - The compound sketch to revolve.
|
|
1877
|
-
* @param revolutionAxis - Axis direction.
|
|
1878
|
-
* @param options - Optional origin override.
|
|
1879
|
-
* @returns The revolved 3D solid.
|
|
1880
|
-
*
|
|
1881
|
-
* @see {@link CompoundSketch.revolve} for the OOP equivalent.
|
|
1882
|
-
*/
|
|
1883
|
-
function compoundSketchRevolve(sketch, revolutionAxis, options) {
|
|
1884
|
-
return sketch.revolve(revolutionAxis, options);
|
|
1885
|
-
}
|
|
1886
|
-
/**
|
|
1887
|
-
* Build a face from a compound sketch (outer boundary with holes).
|
|
1888
|
-
*
|
|
1889
|
-
* @param sketch - The compound sketch.
|
|
1890
|
-
* @returns A face with inner wires subtracted as holes.
|
|
1891
|
-
*
|
|
1892
|
-
* @see {@link CompoundSketch.face} for the OOP equivalent.
|
|
1893
|
-
*/
|
|
1894
|
-
function compoundSketchFace(sketch) {
|
|
1895
|
-
return sketch.face();
|
|
1896
|
-
}
|
|
1897
|
-
/**
|
|
1898
|
-
* Loft between two compound sketches that have the same number of sub-sketches.
|
|
1899
|
-
*
|
|
1900
|
-
* @param sketch - Starting compound sketch.
|
|
1901
|
-
* @param other - Target compound sketch.
|
|
1902
|
-
* @param loftConfig - Loft options (ruled surface, etc.).
|
|
1903
|
-
* @returns The lofted 3D solid.
|
|
1904
|
-
*
|
|
1905
|
-
* @see {@link CompoundSketch.loftWith} for the OOP equivalent.
|
|
1906
|
-
*/
|
|
1907
|
-
function compoundSketchLoft(sketch, other, loftConfig) {
|
|
1908
|
-
return sketch.loftWith(other, loftConfig);
|
|
1909
|
-
}
|
|
1910
|
-
//#endregion
|
|
1911
1272
|
//#region src/sketching/drawFns.ts
|
|
1912
1273
|
/**
|
|
1913
1274
|
* Sketch a drawing onto a 3D plane, producing a Sketch or Sketches.
|
|
@@ -1921,6 +1282,7 @@ function compoundSketchLoft(sketch, other, loftConfig) {
|
|
|
1921
1282
|
*/
|
|
1922
1283
|
function drawingToSketchOnPlane(drawing, inputPlane, origin) {
|
|
1923
1284
|
if (origin !== void 0) return drawing.sketchOnPlane(inputPlane, origin);
|
|
1285
|
+
if (typeof inputPlane === "object") return drawing.sketchOnPlane(inputPlane);
|
|
1924
1286
|
return drawing.sketchOnPlane(inputPlane);
|
|
1925
1287
|
}
|
|
1926
1288
|
/**
|
|
@@ -2029,12 +1391,6 @@ function mirrorDrawing(drawing, centerOrDirection, origin, mode) {
|
|
|
2029
1391
|
return drawing.mirror(centerOrDirection, origin, mode);
|
|
2030
1392
|
}
|
|
2031
1393
|
//#endregion
|
|
2032
|
-
Object.defineProperty(exports, "CompoundSketch", {
|
|
2033
|
-
enumerable: true,
|
|
2034
|
-
get: function() {
|
|
2035
|
-
return CompoundSketch;
|
|
2036
|
-
}
|
|
2037
|
-
});
|
|
2038
1394
|
Object.defineProperty(exports, "Drawing", {
|
|
2039
1395
|
enumerable: true,
|
|
2040
1396
|
get: function() {
|
|
@@ -2047,64 +1403,16 @@ Object.defineProperty(exports, "DrawingPen", {
|
|
|
2047
1403
|
return DrawingPen;
|
|
2048
1404
|
}
|
|
2049
1405
|
});
|
|
2050
|
-
Object.defineProperty(exports, "
|
|
2051
|
-
enumerable: true,
|
|
2052
|
-
get: function() {
|
|
2053
|
-
return Sketcher;
|
|
2054
|
-
}
|
|
2055
|
-
});
|
|
2056
|
-
Object.defineProperty(exports, "Sketches", {
|
|
2057
|
-
enumerable: true,
|
|
2058
|
-
get: function() {
|
|
2059
|
-
return Sketches;
|
|
2060
|
-
}
|
|
2061
|
-
});
|
|
2062
|
-
Object.defineProperty(exports, "__exportAll", {
|
|
2063
|
-
enumerable: true,
|
|
2064
|
-
get: function() {
|
|
2065
|
-
return __exportAll;
|
|
2066
|
-
}
|
|
2067
|
-
});
|
|
2068
|
-
Object.defineProperty(exports, "cameraFromPlane", {
|
|
2069
|
-
enumerable: true,
|
|
2070
|
-
get: function() {
|
|
2071
|
-
return cameraFromPlane;
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
|
-
Object.defineProperty(exports, "cameraLookAt", {
|
|
2075
|
-
enumerable: true,
|
|
2076
|
-
get: function() {
|
|
2077
|
-
return cameraLookAt;
|
|
2078
|
-
}
|
|
2079
|
-
});
|
|
2080
|
-
Object.defineProperty(exports, "compoundSketchExtrude", {
|
|
2081
|
-
enumerable: true,
|
|
2082
|
-
get: function() {
|
|
2083
|
-
return compoundSketchExtrude;
|
|
2084
|
-
}
|
|
2085
|
-
});
|
|
2086
|
-
Object.defineProperty(exports, "compoundSketchFace", {
|
|
2087
|
-
enumerable: true,
|
|
2088
|
-
get: function() {
|
|
2089
|
-
return compoundSketchFace;
|
|
2090
|
-
}
|
|
2091
|
-
});
|
|
2092
|
-
Object.defineProperty(exports, "compoundSketchLoft", {
|
|
2093
|
-
enumerable: true,
|
|
2094
|
-
get: function() {
|
|
2095
|
-
return compoundSketchLoft;
|
|
2096
|
-
}
|
|
2097
|
-
});
|
|
2098
|
-
Object.defineProperty(exports, "compoundSketchRevolve", {
|
|
1406
|
+
Object.defineProperty(exports, "FaceSketcher", {
|
|
2099
1407
|
enumerable: true,
|
|
2100
1408
|
get: function() {
|
|
2101
|
-
return
|
|
1409
|
+
return FaceSketcher;
|
|
2102
1410
|
}
|
|
2103
1411
|
});
|
|
2104
|
-
Object.defineProperty(exports, "
|
|
1412
|
+
Object.defineProperty(exports, "Sketcher", {
|
|
2105
1413
|
enumerable: true,
|
|
2106
1414
|
get: function() {
|
|
2107
|
-
return
|
|
1415
|
+
return Sketcher;
|
|
2108
1416
|
}
|
|
2109
1417
|
});
|
|
2110
1418
|
Object.defineProperty(exports, "deserializeDrawing", {
|
|
@@ -2227,42 +1535,12 @@ Object.defineProperty(exports, "drawingToSketchOnPlane", {
|
|
|
2227
1535
|
return drawingToSketchOnPlane;
|
|
2228
1536
|
}
|
|
2229
1537
|
});
|
|
2230
|
-
Object.defineProperty(exports, "fontMetrics", {
|
|
2231
|
-
enumerable: true,
|
|
2232
|
-
get: function() {
|
|
2233
|
-
return fontMetrics;
|
|
2234
|
-
}
|
|
2235
|
-
});
|
|
2236
|
-
Object.defineProperty(exports, "getFont", {
|
|
2237
|
-
enumerable: true,
|
|
2238
|
-
get: function() {
|
|
2239
|
-
return getFont;
|
|
2240
|
-
}
|
|
2241
|
-
});
|
|
2242
|
-
Object.defineProperty(exports, "isProjectionPlane", {
|
|
2243
|
-
enumerable: true,
|
|
2244
|
-
get: function() {
|
|
2245
|
-
return isProjectionPlane;
|
|
2246
|
-
}
|
|
2247
|
-
});
|
|
2248
|
-
Object.defineProperty(exports, "loadFont", {
|
|
2249
|
-
enumerable: true,
|
|
2250
|
-
get: function() {
|
|
2251
|
-
return loadFont;
|
|
2252
|
-
}
|
|
2253
|
-
});
|
|
2254
1538
|
Object.defineProperty(exports, "makeBaseBox", {
|
|
2255
1539
|
enumerable: true,
|
|
2256
1540
|
get: function() {
|
|
2257
1541
|
return makeBaseBox;
|
|
2258
1542
|
}
|
|
2259
1543
|
});
|
|
2260
|
-
Object.defineProperty(exports, "makeProjectedEdges", {
|
|
2261
|
-
enumerable: true,
|
|
2262
|
-
get: function() {
|
|
2263
|
-
return makeProjectedEdges;
|
|
2264
|
-
}
|
|
2265
|
-
});
|
|
2266
1544
|
Object.defineProperty(exports, "mirrorDrawing", {
|
|
2267
1545
|
enumerable: true,
|
|
2268
1546
|
get: function() {
|
|
@@ -2275,12 +1553,6 @@ Object.defineProperty(exports, "polysideInnerRadius", {
|
|
|
2275
1553
|
return polysideInnerRadius;
|
|
2276
1554
|
}
|
|
2277
1555
|
});
|
|
2278
|
-
Object.defineProperty(exports, "projectEdges", {
|
|
2279
|
-
enumerable: true,
|
|
2280
|
-
get: function() {
|
|
2281
|
-
return projectEdges;
|
|
2282
|
-
}
|
|
2283
|
-
});
|
|
2284
1556
|
Object.defineProperty(exports, "rotateDrawing", {
|
|
2285
1557
|
enumerable: true,
|
|
2286
1558
|
get: function() {
|
|
@@ -2305,18 +1577,6 @@ Object.defineProperty(exports, "sketchEllipse", {
|
|
|
2305
1577
|
return sketchEllipse;
|
|
2306
1578
|
}
|
|
2307
1579
|
});
|
|
2308
|
-
Object.defineProperty(exports, "sketchExtrude", {
|
|
2309
|
-
enumerable: true,
|
|
2310
|
-
get: function() {
|
|
2311
|
-
return sketchExtrude;
|
|
2312
|
-
}
|
|
2313
|
-
});
|
|
2314
|
-
Object.defineProperty(exports, "sketchFace", {
|
|
2315
|
-
enumerable: true,
|
|
2316
|
-
get: function() {
|
|
2317
|
-
return sketchFace;
|
|
2318
|
-
}
|
|
2319
|
-
});
|
|
2320
1580
|
Object.defineProperty(exports, "sketchFaceOffset", {
|
|
2321
1581
|
enumerable: true,
|
|
2322
1582
|
get: function() {
|
|
@@ -2329,12 +1589,6 @@ Object.defineProperty(exports, "sketchHelix", {
|
|
|
2329
1589
|
return sketchHelix;
|
|
2330
1590
|
}
|
|
2331
1591
|
});
|
|
2332
|
-
Object.defineProperty(exports, "sketchLoft", {
|
|
2333
|
-
enumerable: true,
|
|
2334
|
-
get: function() {
|
|
2335
|
-
return sketchLoft;
|
|
2336
|
-
}
|
|
2337
|
-
});
|
|
2338
1592
|
Object.defineProperty(exports, "sketchParametricFunction", {
|
|
2339
1593
|
enumerable: true,
|
|
2340
1594
|
get: function() {
|
|
@@ -2353,48 +1607,12 @@ Object.defineProperty(exports, "sketchRectangle", {
|
|
|
2353
1607
|
return sketchRectangle;
|
|
2354
1608
|
}
|
|
2355
1609
|
});
|
|
2356
|
-
Object.defineProperty(exports, "sketchRevolve", {
|
|
2357
|
-
enumerable: true,
|
|
2358
|
-
get: function() {
|
|
2359
|
-
return sketchRevolve;
|
|
2360
|
-
}
|
|
2361
|
-
});
|
|
2362
1610
|
Object.defineProperty(exports, "sketchRoundedRectangle", {
|
|
2363
1611
|
enumerable: true,
|
|
2364
1612
|
get: function() {
|
|
2365
1613
|
return sketchRoundedRectangle;
|
|
2366
1614
|
}
|
|
2367
1615
|
});
|
|
2368
|
-
Object.defineProperty(exports, "sketchSweep", {
|
|
2369
|
-
enumerable: true,
|
|
2370
|
-
get: function() {
|
|
2371
|
-
return sketchSweep;
|
|
2372
|
-
}
|
|
2373
|
-
});
|
|
2374
|
-
Object.defineProperty(exports, "sketchText", {
|
|
2375
|
-
enumerable: true,
|
|
2376
|
-
get: function() {
|
|
2377
|
-
return sketchText;
|
|
2378
|
-
}
|
|
2379
|
-
});
|
|
2380
|
-
Object.defineProperty(exports, "sketchWires", {
|
|
2381
|
-
enumerable: true,
|
|
2382
|
-
get: function() {
|
|
2383
|
-
return sketchWires;
|
|
2384
|
-
}
|
|
2385
|
-
});
|
|
2386
|
-
Object.defineProperty(exports, "textBlueprints", {
|
|
2387
|
-
enumerable: true,
|
|
2388
|
-
get: function() {
|
|
2389
|
-
return textBlueprints;
|
|
2390
|
-
}
|
|
2391
|
-
});
|
|
2392
|
-
Object.defineProperty(exports, "textMetrics", {
|
|
2393
|
-
enumerable: true,
|
|
2394
|
-
get: function() {
|
|
2395
|
-
return textMetrics;
|
|
2396
|
-
}
|
|
2397
|
-
});
|
|
2398
1616
|
Object.defineProperty(exports, "translateDrawing", {
|
|
2399
1617
|
enumerable: true,
|
|
2400
1618
|
get: function() {
|