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,16 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_constants = require("./constants-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const require_curveFns = require("./curveFns-DrT54cm8.cjs");
|
|
9
|
-
const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
|
|
10
|
-
const require_surfaceBuilders = require("./surfaceBuilders-CbH4FIW5.cjs");
|
|
11
|
-
const require_helpers = require("./helpers-BpXNcxuJ.cjs");
|
|
12
|
-
const require_blueprint = require("./blueprint-CscZ0-wr.cjs");
|
|
13
|
-
const require_extrudeFns = require("./extrudeFns-BtblHdaJ.cjs");
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTt_LLbk.cjs");
|
|
2
|
+
const require_vec3 = require("./vec3-S4Oh59IX.cjs");
|
|
3
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
4
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
5
|
+
const require_arrayAccess = require("./arrayAccess-7pTWqkJu.cjs");
|
|
6
|
+
const require_helpers = require("./helpers-Cyj6gaqy.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-B8ogGJiQ.cjs");
|
|
14
8
|
//#region node_modules/flatqueue/index.js
|
|
15
9
|
/** @template T */
|
|
16
10
|
var FlatQueue = class {
|
|
@@ -526,7 +520,7 @@ var selfIntersections = (curve, precision = 1e-9) => {
|
|
|
526
520
|
var offsetEndPoints = (firstPoint, lastPoint, offset) => {
|
|
527
521
|
const tangent = require_helpers.normalize2d(require_helpers.subtract2d(lastPoint, firstPoint));
|
|
528
522
|
const normal = [tangent[1], -tangent[0]];
|
|
529
|
-
const offsetVec = [normal
|
|
523
|
+
const offsetVec = [require_vec3.wasmIndex(normal, 0) * offset, require_vec3.wasmIndex(normal, 1) * offset];
|
|
530
524
|
return {
|
|
531
525
|
firstPoint: require_helpers.add2d(firstPoint, offsetVec),
|
|
532
526
|
lastPoint: require_helpers.add2d(lastPoint, offsetVec)
|
|
@@ -623,11 +617,11 @@ function removeCorner(firstCurve, secondCurve, radius) {
|
|
|
623
617
|
const splitParam = require_errors.unwrap(curve.parameter(splitPoint, 1e-6));
|
|
624
618
|
return curve.splitAt([splitParam]);
|
|
625
619
|
};
|
|
626
|
-
const
|
|
627
|
-
const
|
|
620
|
+
const firstSplit = splitForFillet(firstCurve, firstOffset);
|
|
621
|
+
const secondSplit = splitForFillet(secondCurve, secondOffset);
|
|
628
622
|
return {
|
|
629
|
-
first,
|
|
630
|
-
second,
|
|
623
|
+
first: require_vec3.wasmIndex(firstSplit, 0),
|
|
624
|
+
second: require_vec3.wasmIndex(secondSplit, 1),
|
|
631
625
|
center
|
|
632
626
|
};
|
|
633
627
|
}
|
|
@@ -692,8 +686,10 @@ function dogboneFilletCurves(firstCurve, secondCurve, radius) {
|
|
|
692
686
|
const firstInt = require_errors.unwrap(intersectCurves(firstCurve, circle)).intersections[0];
|
|
693
687
|
const secondInt = require_errors.unwrap(intersectCurves(secondCurve, circle)).intersections.at(-1);
|
|
694
688
|
if (!firstInt || !secondInt) return [firstCurve, secondCurve];
|
|
695
|
-
const
|
|
696
|
-
const
|
|
689
|
+
const firstSplit = firstCurve.splitAt([firstInt]);
|
|
690
|
+
const secondSplit = secondCurve.splitAt([secondInt]);
|
|
691
|
+
const firstPart = require_vec3.wasmIndex(firstSplit, 0);
|
|
692
|
+
const secondPart = require_vec3.wasmIndex(secondSplit, secondSplit.length - 1);
|
|
697
693
|
try {
|
|
698
694
|
return [
|
|
699
695
|
firstPart,
|
|
@@ -994,278 +990,7 @@ var organiseBlueprints = (blueprints) => {
|
|
|
994
990
|
}));
|
|
995
991
|
};
|
|
996
992
|
//#endregion
|
|
997
|
-
//#region src/
|
|
998
|
-
/**
|
|
999
|
-
* Functional loft operation using branded shape types.
|
|
1000
|
-
*/
|
|
1001
|
-
/**
|
|
1002
|
-
* Loft through a set of wire profiles to create a 3D shape.
|
|
1003
|
-
*
|
|
1004
|
-
* Builds a `BRepOffsetAPI_ThruSections` surface through the given wires,
|
|
1005
|
-
* optionally starting and/or ending at point vertices. Produces a solid
|
|
1006
|
-
* by default, or a shell when `returnShell` is `true`.
|
|
1007
|
-
*
|
|
1008
|
-
* @param wires - Ordered wire profiles to loft through.
|
|
1009
|
-
* @param config - Loft configuration (ruled interpolation, start/end points).
|
|
1010
|
-
* @param returnShell - When `true`, return a shell instead of a solid.
|
|
1011
|
-
* @returns `Result` containing the lofted 3D shape, or an error on failure.
|
|
1012
|
-
*
|
|
1013
|
-
* @example
|
|
1014
|
-
* ```ts
|
|
1015
|
-
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
1016
|
-
* ```
|
|
1017
|
-
*
|
|
1018
|
-
* @see {@link loft!loft | loft} for the OOP API equivalent.
|
|
1019
|
-
*/
|
|
1020
|
-
function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
1021
|
-
if (wires.length === 0 && !startPoint && !endPoint) return require_errors.err(require_errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
1022
|
-
const kernel = require_shapeTypes.getKernel();
|
|
1023
|
-
const startVertex = startPoint ? kernel.makeVertex(...require_types.toVec3(startPoint)) : void 0;
|
|
1024
|
-
const endVertex = endPoint ? kernel.makeVertex(...require_types.toVec3(endPoint)) : void 0;
|
|
1025
|
-
try {
|
|
1026
|
-
const result = require_shapeTypes.castShape(kernel.loftAdvanced(wires.map((w) => w.wrapped), {
|
|
1027
|
-
solid: !returnShell,
|
|
1028
|
-
ruled,
|
|
1029
|
-
tolerance,
|
|
1030
|
-
...startVertex ? { startVertex } : {},
|
|
1031
|
-
...endVertex ? { endVertex } : {}
|
|
1032
|
-
}));
|
|
1033
|
-
if (!require_shapeTypes.isShape3D(result)) return require_errors.err(require_errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
1034
|
-
return require_errors.ok(result);
|
|
1035
|
-
} catch (e) {
|
|
1036
|
-
return require_errors.err(require_errors.kernelError("LOFT_FAILED", "Loft operation failed", e, void 0, "Common causes: wire profiles with different edge counts, self-intersecting result, or profiles too far apart. Ensure profiles are compatible and ordered."));
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
/**
|
|
1040
|
-
* Batch loft: build N independent lofts in a single kernel call.
|
|
1041
|
-
*
|
|
1042
|
-
* Uses the C++ LoftBatch extractor when available (single WASM call),
|
|
1043
|
-
* falling back to N individual loft operations otherwise.
|
|
1044
|
-
*
|
|
1045
|
-
* @returns Array of 3D shapes, one per entry.
|
|
1046
|
-
*/
|
|
1047
|
-
function loftAll(entries) {
|
|
1048
|
-
if (entries.length === 0) return require_errors.ok([]);
|
|
1049
|
-
const kernel = require_shapeTypes.getKernel();
|
|
1050
|
-
const verticesToDelete = [];
|
|
1051
|
-
const kernelEntries = entries.map((e) => {
|
|
1052
|
-
const startVertex = e.startPoint ? kernel.makeVertex(...require_types.toVec3(e.startPoint)) : void 0;
|
|
1053
|
-
const endVertex = e.endPoint ? kernel.makeVertex(...require_types.toVec3(e.endPoint)) : void 0;
|
|
1054
|
-
if (startVertex) verticesToDelete.push(startVertex);
|
|
1055
|
-
if (endVertex) verticesToDelete.push(endVertex);
|
|
1056
|
-
return {
|
|
1057
|
-
wires: e.wires.map((w) => w.wrapped),
|
|
1058
|
-
solid: true,
|
|
1059
|
-
ruled: e.ruled ?? true,
|
|
1060
|
-
tolerance: e.tolerance ?? 1e-6,
|
|
1061
|
-
startVertex,
|
|
1062
|
-
endVertex
|
|
1063
|
-
};
|
|
1064
|
-
});
|
|
1065
|
-
try {
|
|
1066
|
-
const shapes = kernel.loftBatch?.(kernelEntries) ?? kernelEntries.map((e) => kernel.loftAdvanced(e.wires, {
|
|
1067
|
-
solid: e.solid,
|
|
1068
|
-
ruled: e.ruled,
|
|
1069
|
-
tolerance: e.tolerance,
|
|
1070
|
-
startVertex: e.startVertex,
|
|
1071
|
-
endVertex: e.endVertex
|
|
1072
|
-
}));
|
|
1073
|
-
const results = [];
|
|
1074
|
-
for (const shape of shapes) {
|
|
1075
|
-
const cast = require_shapeTypes.castShape(shape);
|
|
1076
|
-
if (!require_shapeTypes.isShape3D(cast)) return require_errors.err(require_errors.typeCastError("LOFT_ALL_NOT_3D", "Batch loft entry did not produce a 3D shape"));
|
|
1077
|
-
results.push(cast);
|
|
1078
|
-
}
|
|
1079
|
-
return require_errors.ok(results);
|
|
1080
|
-
} catch (e) {
|
|
1081
|
-
return require_errors.err(require_errors.kernelError("LOFT_ALL_FAILED", "Batch loft operation failed", e));
|
|
1082
|
-
} finally {
|
|
1083
|
-
for (const v of verticesToDelete) kernel.dispose(v);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
//#endregion
|
|
1087
|
-
//#region src/sketching/sketch.ts
|
|
1088
|
-
/**
|
|
1089
|
-
* Represent a closed or open wire profile with a default extrusion origin and direction.
|
|
1090
|
-
*
|
|
1091
|
-
* A Sketch wraps a single {@link Wire} and carries metadata (origin, direction,
|
|
1092
|
-
* optional base face) so that downstream operations like {@link Sketch.extrude},
|
|
1093
|
-
* {@link Sketch.revolve}, {@link Sketch.sweepSketch}, and {@link Sketch.loftWith}
|
|
1094
|
-
* know how to act on it without extra arguments.
|
|
1095
|
-
*
|
|
1096
|
-
* @remarks Most operations consume (delete) the sketch after producing a solid.
|
|
1097
|
-
*
|
|
1098
|
-
* @see {@link Sketcher} to build a Sketch interactively.
|
|
1099
|
-
* @see {@link CompoundSketch} for multi-wire (outer + holes) profiles.
|
|
1100
|
-
* @category Sketching
|
|
1101
|
-
*/
|
|
1102
|
-
var Sketch = class Sketch {
|
|
1103
|
-
wire;
|
|
1104
|
-
/**
|
|
1105
|
-
* @ignore
|
|
1106
|
-
*/
|
|
1107
|
-
_defaultOrigin;
|
|
1108
|
-
/**
|
|
1109
|
-
* @ignore
|
|
1110
|
-
*/
|
|
1111
|
-
_defaultDirection;
|
|
1112
|
-
_baseFace;
|
|
1113
|
-
constructor(wire, { defaultOrigin = [
|
|
1114
|
-
0,
|
|
1115
|
-
0,
|
|
1116
|
-
0
|
|
1117
|
-
], defaultDirection = [
|
|
1118
|
-
0,
|
|
1119
|
-
0,
|
|
1120
|
-
1
|
|
1121
|
-
] } = {}) {
|
|
1122
|
-
this.wire = wire;
|
|
1123
|
-
this._defaultOrigin = require_types.toVec3(defaultOrigin);
|
|
1124
|
-
this._defaultDirection = require_types.toVec3(defaultDirection);
|
|
1125
|
-
this.baseFace = null;
|
|
1126
|
-
}
|
|
1127
|
-
get baseFace() {
|
|
1128
|
-
return this._baseFace;
|
|
1129
|
-
}
|
|
1130
|
-
set baseFace(newFace) {
|
|
1131
|
-
if (this._baseFace) this._baseFace.delete();
|
|
1132
|
-
this._baseFace = newFace ? require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(newFace.wrapped))) : newFace;
|
|
1133
|
-
}
|
|
1134
|
-
/** Release all kernel resources held by this sketch. */
|
|
1135
|
-
delete() {
|
|
1136
|
-
this.wire.delete();
|
|
1137
|
-
if (this.baseFace) this.baseFace.delete();
|
|
1138
|
-
}
|
|
1139
|
-
/** Create an independent deep copy of this sketch. */
|
|
1140
|
-
clone() {
|
|
1141
|
-
const sketch = new Sketch(require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(this.wire.wrapped))), {
|
|
1142
|
-
defaultOrigin: this.defaultOrigin,
|
|
1143
|
-
defaultDirection: this.defaultDirection
|
|
1144
|
-
});
|
|
1145
|
-
if (this.baseFace) sketch.baseFace = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(this.baseFace.wrapped)));
|
|
1146
|
-
return sketch;
|
|
1147
|
-
}
|
|
1148
|
-
/** Get the 3D origin used as default for extrusion and revolution. */
|
|
1149
|
-
get defaultOrigin() {
|
|
1150
|
-
return this._defaultOrigin;
|
|
1151
|
-
}
|
|
1152
|
-
/** Set the 3D origin used as default for extrusion and revolution. */
|
|
1153
|
-
set defaultOrigin(newOrigin) {
|
|
1154
|
-
this._defaultOrigin = require_types.toVec3(newOrigin);
|
|
1155
|
-
}
|
|
1156
|
-
/** Get the default extrusion/normal direction. */
|
|
1157
|
-
get defaultDirection() {
|
|
1158
|
-
return this._defaultDirection;
|
|
1159
|
-
}
|
|
1160
|
-
/** Set the default extrusion/normal direction. */
|
|
1161
|
-
set defaultDirection(newDirection) {
|
|
1162
|
-
this._defaultDirection = require_types.toVec3(newDirection);
|
|
1163
|
-
}
|
|
1164
|
-
/**
|
|
1165
|
-
* Transforms the lines into a face. The lines should be closed.
|
|
1166
|
-
*/
|
|
1167
|
-
face() {
|
|
1168
|
-
let face;
|
|
1169
|
-
const closedWire = this.wire;
|
|
1170
|
-
if (!this.baseFace) face = require_errors.unwrap(require_surfaceBuilders.makeFace(closedWire));
|
|
1171
|
-
else face = require_surfaceBuilders.makeNewFaceWithinFace(this.baseFace, closedWire);
|
|
1172
|
-
return face;
|
|
1173
|
-
}
|
|
1174
|
-
/** Return a clone of the underlying wire. */
|
|
1175
|
-
wires() {
|
|
1176
|
-
return require_shapeTypes.createWire(require_errors.unwrap(require_faceFns.downcast(this.wire.wrapped)));
|
|
1177
|
-
}
|
|
1178
|
-
/** Alias for {@link Sketch.face}. */
|
|
1179
|
-
faces() {
|
|
1180
|
-
return this.face();
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* Revolves the drawing on an axis (defined by its direction and an origin
|
|
1184
|
-
* (defaults to the sketch origin)
|
|
1185
|
-
*/
|
|
1186
|
-
revolve(revolutionAxis, { origin } = {}) {
|
|
1187
|
-
const face = require_errors.unwrap(require_surfaceBuilders.makeFace(this.wire));
|
|
1188
|
-
const solid = require_errors.unwrap(require_extrudeFns.revolve(face, origin ? require_types.toVec3(origin) : this.defaultOrigin, revolutionAxis ? require_types.toVec3(revolutionAxis) : [
|
|
1189
|
-
0,
|
|
1190
|
-
0,
|
|
1191
|
-
1
|
|
1192
|
-
]));
|
|
1193
|
-
face.delete();
|
|
1194
|
-
this.delete();
|
|
1195
|
-
return solid;
|
|
1196
|
-
}
|
|
1197
|
-
/** Extrudes the sketch to a certain distance (along the default direction
|
|
1198
|
-
* and origin of the sketch).
|
|
1199
|
-
*
|
|
1200
|
-
* You can define another extrusion direction or origin,
|
|
1201
|
-
*
|
|
1202
|
-
* It is also possible to twist extrude with an angle (in degrees), or to
|
|
1203
|
-
* give a profile to the extrusion (the endFactor will scale the face, and
|
|
1204
|
-
* the profile will define how the scale is applied (either linearly or with
|
|
1205
|
-
* a s-shape).
|
|
1206
|
-
*/
|
|
1207
|
-
extrude(extrusionDistance, { extrusionDirection, extrusionProfile, twistAngle, origin } = {}) {
|
|
1208
|
-
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : this.defaultDirection), extrusionDistance);
|
|
1209
|
-
const originVec = origin ? require_types.toVec3(origin) : this.defaultOrigin;
|
|
1210
|
-
if (extrusionProfile && !twistAngle) {
|
|
1211
|
-
const solid = require_errors.unwrap(require_extrudeFns.complexExtrude(this.wire, [...originVec], [...extrusionVec], extrusionProfile));
|
|
1212
|
-
this.delete();
|
|
1213
|
-
return solid;
|
|
1214
|
-
}
|
|
1215
|
-
if (twistAngle) {
|
|
1216
|
-
const solid = require_errors.unwrap(require_extrudeFns.twistExtrude(this.wire, twistAngle, [...originVec], [...extrusionVec], extrusionProfile));
|
|
1217
|
-
this.delete();
|
|
1218
|
-
return solid;
|
|
1219
|
-
}
|
|
1220
|
-
const solid = require_errors.unwrap(require_extrudeFns.extrude(require_errors.unwrap(require_surfaceBuilders.makeFace(this.wire)), [...extrusionVec]));
|
|
1221
|
-
this.delete();
|
|
1222
|
-
return solid;
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Sweep along this sketch another sketch defined in the function
|
|
1226
|
-
* `sketchOnPlane`.
|
|
1227
|
-
*/
|
|
1228
|
-
sweepSketch(sketchOnPlane, sweepConfig = {}) {
|
|
1229
|
-
const startPoint = require_curveFns.curveStartPoint(this.wire);
|
|
1230
|
-
const normal = require_vecOps.vecNormalize(require_vecOps.vecScale(require_curveFns.curveTangentAt(this.wire, 1e-9), -1));
|
|
1231
|
-
const defaultDir = this.defaultDirection;
|
|
1232
|
-
const xDir = require_vecOps.vecScale(require_vecOps.vecCross(normal, defaultDir), -1);
|
|
1233
|
-
const result = sketchOnPlane(require_planeOps.createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
|
|
1234
|
-
let sketch;
|
|
1235
|
-
if ("sketches" in result && Array.isArray(result.sketches)) {
|
|
1236
|
-
const pieces = result.sketches;
|
|
1237
|
-
sketch = pieces[0];
|
|
1238
|
-
for (let i = 1; i < pieces.length; i++) pieces[i]?.delete();
|
|
1239
|
-
} else sketch = result;
|
|
1240
|
-
const config = {
|
|
1241
|
-
forceProfileSpineOthogonality: true,
|
|
1242
|
-
...sweepConfig
|
|
1243
|
-
};
|
|
1244
|
-
if (this.baseFace) config.support = this.baseFace.wrapped;
|
|
1245
|
-
const shape = require_errors.unwrap(require_extrudeFns.sweep(sketch.wire, this.wire, config));
|
|
1246
|
-
this.delete();
|
|
1247
|
-
return shape;
|
|
1248
|
-
}
|
|
1249
|
-
/** Loft between this sketch and another sketch (or an array of them)
|
|
1250
|
-
*
|
|
1251
|
-
* You can also define a `startPoint` for the loft (that will be placed
|
|
1252
|
-
* before this sketch) and an `endPoint` after the last one.
|
|
1253
|
-
*
|
|
1254
|
-
* You can also define if you want the loft to result in a ruled surface.
|
|
1255
|
-
*
|
|
1256
|
-
* Note that all sketches will be deleted by this operation
|
|
1257
|
-
*/
|
|
1258
|
-
loftWith(otherSketches, loftConfig = {}, returnShell = false) {
|
|
1259
|
-
const sketchArray = Array.isArray(otherSketches) ? [this, ...otherSketches] : [this, otherSketches];
|
|
1260
|
-
const shape = require_errors.unwrap(loft(sketchArray.map((s) => s.wire), loftConfig, returnShell));
|
|
1261
|
-
sketchArray.forEach((s) => {
|
|
1262
|
-
s.delete();
|
|
1263
|
-
});
|
|
1264
|
-
return shape;
|
|
1265
|
-
}
|
|
1266
|
-
};
|
|
1267
|
-
//#endregion
|
|
1268
|
-
//#region src/sketching/sketcherlib.ts
|
|
993
|
+
//#region src/2d/blueprints/genericSketcher.ts
|
|
1269
994
|
var isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
|
|
1270
995
|
/** Resolve a {@link SplineOptions} into fully-expanded tangent directions and factors. */
|
|
1271
996
|
var defaultsSplineOptions = (config) => {
|
|
@@ -1290,6 +1015,49 @@ var defaultsSplineOptions = (config) => {
|
|
|
1290
1015
|
startTangent
|
|
1291
1016
|
};
|
|
1292
1017
|
};
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/2d/blueprints/ellipseUtils.ts
|
|
1020
|
+
/**
|
|
1021
|
+
* Normalize ellipse radii so that major >= minor, adjusting the rotation
|
|
1022
|
+
* angle by 90 degrees when the radii need to be swapped.
|
|
1023
|
+
*/
|
|
1024
|
+
function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
|
|
1025
|
+
if (horizontalRadius < verticalRadius) return {
|
|
1026
|
+
majorRadius: verticalRadius,
|
|
1027
|
+
minorRadius: horizontalRadius,
|
|
1028
|
+
rotationAngle: rotation + 90
|
|
1029
|
+
};
|
|
1030
|
+
return {
|
|
1031
|
+
majorRadius: horizontalRadius,
|
|
1032
|
+
minorRadius: verticalRadius,
|
|
1033
|
+
rotationAngle: rotation
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Build a 2D elliptical arc curve from SVG-style endpoint parameters,
|
|
1038
|
+
* applying the UV coordinate conversions used by {@link BaseSketcher2d}.
|
|
1039
|
+
*
|
|
1040
|
+
* @param startUV - Start point in UV space.
|
|
1041
|
+
* @param endUV - End point in UV space.
|
|
1042
|
+
* @param majorRadius - Major radius (already normalized so major >= minor).
|
|
1043
|
+
* @param minorRadius - Minor radius.
|
|
1044
|
+
* @param rotationAngleDeg - Rotation of the ellipse in degrees.
|
|
1045
|
+
* @param longAxis - SVG large-arc flag.
|
|
1046
|
+
* @param sweep - SVG sweep flag.
|
|
1047
|
+
* @param convertToUV - Coordinate conversion function from user space to UV space.
|
|
1048
|
+
*/
|
|
1049
|
+
function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep, convertToUV) {
|
|
1050
|
+
const radRotationAngle = rotationAngleDeg * require_constants.DEG2RAD;
|
|
1051
|
+
const convertAxis = (ax) => require_helpers.distance2d(convertToUV(ax));
|
|
1052
|
+
const r1 = convertAxis(require_helpers.polarToCartesian(majorRadius, radRotationAngle));
|
|
1053
|
+
const r2 = convertAxis(require_helpers.polarToCartesian(minorRadius, radRotationAngle + Math.PI / 2));
|
|
1054
|
+
const xDir = require_helpers.normalize2d(convertToUV(require_helpers.rotate2d([1, 0], radRotationAngle)));
|
|
1055
|
+
const [, newRotationAngle] = require_helpers.cartesianToPolar(xDir);
|
|
1056
|
+
const { cx, cy, startAngle, endAngle, clockwise, rx, ry } = convertSvgEllipseParams(startUV, endUV, r1, r2, newRotationAngle, longAxis, sweep);
|
|
1057
|
+
const arc = require_blueprint.make2dEllipseArc(rx, ry, clockwise ? startAngle : endAngle, clockwise ? endAngle : startAngle, [cx, cy], xDir);
|
|
1058
|
+
if (!clockwise) arc.reverse();
|
|
1059
|
+
return arc;
|
|
1060
|
+
}
|
|
1293
1061
|
/**
|
|
1294
1062
|
* Compute start/delta/end angles from the unit-circle parameterization
|
|
1295
1063
|
* of an SVG elliptical arc (F6.5.5–F6.5.6).
|
|
@@ -1369,50 +1137,7 @@ function convertSvgEllipseParams([x1, y1], [x2, y2], rx, ry, phi, fA, fS) {
|
|
|
1369
1137
|
};
|
|
1370
1138
|
}
|
|
1371
1139
|
//#endregion
|
|
1372
|
-
//#region src/
|
|
1373
|
-
/**
|
|
1374
|
-
* Normalize ellipse radii so that major >= minor, adjusting the rotation
|
|
1375
|
-
* angle by 90 degrees when the radii need to be swapped.
|
|
1376
|
-
*/
|
|
1377
|
-
function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
|
|
1378
|
-
if (horizontalRadius < verticalRadius) return {
|
|
1379
|
-
majorRadius: verticalRadius,
|
|
1380
|
-
minorRadius: horizontalRadius,
|
|
1381
|
-
rotationAngle: rotation + 90
|
|
1382
|
-
};
|
|
1383
|
-
return {
|
|
1384
|
-
majorRadius: horizontalRadius,
|
|
1385
|
-
minorRadius: verticalRadius,
|
|
1386
|
-
rotationAngle: rotation
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Build a 2D elliptical arc curve from SVG-style endpoint parameters,
|
|
1391
|
-
* applying the UV coordinate conversions used by {@link BaseSketcher2d}.
|
|
1392
|
-
*
|
|
1393
|
-
* @param startUV - Start point in UV space.
|
|
1394
|
-
* @param endUV - End point in UV space.
|
|
1395
|
-
* @param majorRadius - Major radius (already normalized so major >= minor).
|
|
1396
|
-
* @param minorRadius - Minor radius.
|
|
1397
|
-
* @param rotationAngleDeg - Rotation of the ellipse in degrees.
|
|
1398
|
-
* @param longAxis - SVG large-arc flag.
|
|
1399
|
-
* @param sweep - SVG sweep flag.
|
|
1400
|
-
* @param convertToUV - Coordinate conversion function from user space to UV space.
|
|
1401
|
-
*/
|
|
1402
|
-
function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep, convertToUV) {
|
|
1403
|
-
const radRotationAngle = rotationAngleDeg * require_constants.DEG2RAD;
|
|
1404
|
-
const convertAxis = (ax) => require_helpers.distance2d(convertToUV(ax));
|
|
1405
|
-
const r1 = convertAxis(require_helpers.polarToCartesian(majorRadius, radRotationAngle));
|
|
1406
|
-
const r2 = convertAxis(require_helpers.polarToCartesian(minorRadius, radRotationAngle + Math.PI / 2));
|
|
1407
|
-
const xDir = require_helpers.normalize2d(convertToUV(require_helpers.rotate2d([1, 0], radRotationAngle)));
|
|
1408
|
-
const [, newRotationAngle] = require_helpers.cartesianToPolar(xDir);
|
|
1409
|
-
const { cx, cy, startAngle, endAngle, clockwise, rx, ry } = convertSvgEllipseParams(startUV, endUV, r1, r2, newRotationAngle, longAxis, sweep);
|
|
1410
|
-
const arc = require_blueprint.make2dEllipseArc(rx, ry, clockwise ? startAngle : endAngle, clockwise ? endAngle : startAngle, [cx, cy], xDir);
|
|
1411
|
-
if (!clockwise) arc.reverse();
|
|
1412
|
-
return arc;
|
|
1413
|
-
}
|
|
1414
|
-
//#endregion
|
|
1415
|
-
//#region src/sketching/sketcher2d.ts
|
|
1140
|
+
//#region src/2d/blueprints/baseSketcher2d.ts
|
|
1416
1141
|
var cornerModeFns = {
|
|
1417
1142
|
chamfer: chamferCurves,
|
|
1418
1143
|
dogbone: dogboneFilletCurves,
|
|
@@ -1427,7 +1152,7 @@ function buildCornerFunction(radius, mode) {
|
|
|
1427
1152
|
* Base class for 2D sketchers that accumulate {@link Curve2D} segments.
|
|
1428
1153
|
*
|
|
1429
1154
|
* Provides the shared pen-drawing API (lines, arcs, ellipses, beziers, splines)
|
|
1430
|
-
* used by
|
|
1155
|
+
* used by `FaceSketcher`, `BlueprintSketcher`, and `DrawingPen`.
|
|
1431
1156
|
* Subclasses implement `done()` / `close()` to produce the appropriate output type.
|
|
1432
1157
|
*
|
|
1433
1158
|
* @category Sketching
|
|
@@ -1449,23 +1174,19 @@ var BaseSketcher2d = class {
|
|
|
1449
1174
|
_convertFromUV([u, v]) {
|
|
1450
1175
|
return [u, v];
|
|
1451
1176
|
}
|
|
1452
|
-
/** Return the last curve in the pending list, or null if empty. */
|
|
1453
1177
|
_lastCurve() {
|
|
1454
1178
|
const len = this.pendingCurves.length;
|
|
1455
1179
|
if (len === 0) return null;
|
|
1456
1180
|
return this.pendingCurves[len - 1];
|
|
1457
1181
|
}
|
|
1458
|
-
/** Require that a previous curve exists, returning it or throwing. */
|
|
1459
1182
|
_requireLastCurve(caller, action) {
|
|
1460
1183
|
const curve = this._lastCurve();
|
|
1461
1184
|
if (!curve) require_errors.bug(caller, `You need a previous curve to ${action}`);
|
|
1462
1185
|
return curve;
|
|
1463
1186
|
}
|
|
1464
|
-
/** Resolve a relative offset from the current pointer position. */
|
|
1465
1187
|
_resolveRelative(xDist, yDist) {
|
|
1466
1188
|
return [this.pointer[0] + xDist, this.pointer[1] + yDist];
|
|
1467
1189
|
}
|
|
1468
|
-
/** Save a curve, advance the pointer to the given end point, and return `this`. */
|
|
1469
1190
|
_saveCurveAndAdvance(curve, end) {
|
|
1470
1191
|
this.saveCurve(curve);
|
|
1471
1192
|
this.pointer = end;
|
|
@@ -1482,10 +1203,6 @@ var BaseSketcher2d = class {
|
|
|
1482
1203
|
/**
|
|
1483
1204
|
* Returns the current pen angle in degrees
|
|
1484
1205
|
*
|
|
1485
|
-
* The angle represents the tangent direction at the current pen position,
|
|
1486
|
-
* based on the last drawing operation (line, arc, bezier, etc.).
|
|
1487
|
-
* Returns 0 if nothing has been drawn yet.
|
|
1488
|
-
*
|
|
1489
1206
|
* @category Drawing State
|
|
1490
1207
|
*/
|
|
1491
1208
|
get penAngle() {
|
|
@@ -1671,9 +1388,7 @@ var BaseSketcher2d = class {
|
|
|
1671
1388
|
smoothSpline(xDist, yDist, splineConfig) {
|
|
1672
1389
|
return this.smoothSplineTo(this._resolveRelative(xDist, yDist), splineConfig);
|
|
1673
1390
|
}
|
|
1674
|
-
/**
|
|
1675
|
-
* Changes the corner between the previous and next segments.
|
|
1676
|
-
*/
|
|
1391
|
+
/** Changes the corner between the previous and next segments. */
|
|
1677
1392
|
customCorner(radius, mode = "fillet") {
|
|
1678
1393
|
if (!this.pendingCurves.length) require_errors.bug("Sketcher2d.customCorner", "You need a curve defined to fillet the angle");
|
|
1679
1394
|
this._nextCorner = buildCornerFunction(radius, mode);
|
|
@@ -1701,127 +1416,14 @@ var BaseSketcher2d = class {
|
|
|
1701
1416
|
this.pointer = this.firstPoint;
|
|
1702
1417
|
}
|
|
1703
1418
|
};
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
* instance the sides of a cylinder.
|
|
1707
|
-
*
|
|
1708
|
-
* The coordinates passed to the methods corresponds to normalised distances on
|
|
1709
|
-
* this surface, between 0 and 1 in both direction.
|
|
1710
|
-
*
|
|
1711
|
-
* Note that if you are drawing on a closed surface (typically a revolution
|
|
1712
|
-
* surface or a cylinder), the first parameters represents the angle and can be
|
|
1713
|
-
* smaller than 0 or bigger than 1.
|
|
1714
|
-
*
|
|
1715
|
-
* @category Sketching
|
|
1716
|
-
*/
|
|
1717
|
-
var FaceSketcher = class extends BaseSketcher2d {
|
|
1718
|
-
face;
|
|
1719
|
-
_bounds;
|
|
1720
|
-
constructor(face, origin = [0, 0]) {
|
|
1721
|
-
super(origin);
|
|
1722
|
-
this.face = require_shapeTypes.createFace(require_errors.unwrap(require_faceFns.downcast(face.wrapped)));
|
|
1723
|
-
this._bounds = require_faceFns.uvBounds(face);
|
|
1724
|
-
}
|
|
1725
|
-
_convertToUV([x, y]) {
|
|
1726
|
-
const { uMin, uMax, vMin, vMax } = this._bounds;
|
|
1727
|
-
return [uMin + x * (uMax - uMin), vMin + y * (vMax - vMin)];
|
|
1728
|
-
}
|
|
1729
|
-
_convertFromUV([u, v]) {
|
|
1730
|
-
const { uMin, uMax, vMin, vMax } = this._bounds;
|
|
1731
|
-
return [(u - uMin) / (uMax - uMin), (v - vMin) / (vMax - vMin)];
|
|
1732
|
-
}
|
|
1733
|
-
_adaptSurface() {
|
|
1734
|
-
return require_shapeTypes.getKernel().extractSurfaceFromFace(this.face.wrapped);
|
|
1735
|
-
}
|
|
1736
|
-
/**
|
|
1737
|
-
* @ignore
|
|
1738
|
-
*/
|
|
1739
|
-
buildWire() {
|
|
1740
|
-
const kernel = require_shapeTypes.getKernel();
|
|
1741
|
-
const geomSurf = this._adaptSurface();
|
|
1742
|
-
const wire = require_errors.unwrap(require_surfaceBuilders.assembleWire(this.pendingCurves.map((curve) => {
|
|
1743
|
-
return require_shapeTypes.createEdge(kernel.buildEdgeOnSurface(curve.wrapped, geomSurf));
|
|
1744
|
-
})));
|
|
1745
|
-
kernel.buildCurves3d(wire.wrapped);
|
|
1746
|
-
return wire;
|
|
1747
|
-
}
|
|
1748
|
-
/** Finish drawing and return the resulting {@link Sketch} (does not close the path). */
|
|
1749
|
-
done() {
|
|
1750
|
-
try {
|
|
1751
|
-
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
1752
|
-
const scope = _usingCtx$1.u(new require_shapeTypes.DisposalScope());
|
|
1753
|
-
const wire = this.buildWire();
|
|
1754
|
-
const sketch = new Sketch(wire);
|
|
1755
|
-
if (require_curveFns.curveIsClosed(wire)) {
|
|
1756
|
-
const face = scope.register(sketch.clone().face());
|
|
1757
|
-
const origin = require_faceFns.pointOnSurface(face, .5, .5);
|
|
1758
|
-
const direction = require_vecOps.vecScale(require_faceFns.normalAt(face), -1);
|
|
1759
|
-
sketch.defaultOrigin = [
|
|
1760
|
-
origin[0],
|
|
1761
|
-
origin[1],
|
|
1762
|
-
origin[2]
|
|
1763
|
-
];
|
|
1764
|
-
sketch.defaultDirection = [
|
|
1765
|
-
direction[0],
|
|
1766
|
-
direction[1],
|
|
1767
|
-
direction[2]
|
|
1768
|
-
];
|
|
1769
|
-
} else {
|
|
1770
|
-
const startPoint = require_curveFns.curveStartPoint(wire);
|
|
1771
|
-
const normal = require_faceFns.normalAt(this.face, [
|
|
1772
|
-
startPoint[0],
|
|
1773
|
-
startPoint[1],
|
|
1774
|
-
startPoint[2]
|
|
1775
|
-
]);
|
|
1776
|
-
sketch.defaultOrigin = [
|
|
1777
|
-
startPoint[0],
|
|
1778
|
-
startPoint[1],
|
|
1779
|
-
startPoint[2]
|
|
1780
|
-
];
|
|
1781
|
-
sketch.defaultDirection = [
|
|
1782
|
-
normal[0],
|
|
1783
|
-
normal[1],
|
|
1784
|
-
normal[2]
|
|
1785
|
-
];
|
|
1786
|
-
}
|
|
1787
|
-
sketch.baseFace = this.face;
|
|
1788
|
-
return sketch;
|
|
1789
|
-
} catch (_) {
|
|
1790
|
-
_usingCtx$1.e = _;
|
|
1791
|
-
} finally {
|
|
1792
|
-
_usingCtx$1.d();
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
/** Close the path with a straight line to the start point and return the Sketch. */
|
|
1796
|
-
close() {
|
|
1797
|
-
this._closeSketch();
|
|
1798
|
-
return this.done();
|
|
1799
|
-
}
|
|
1800
|
-
/** Close the path by mirroring all curves about the line from first to last point. */
|
|
1801
|
-
closeWithMirror() {
|
|
1802
|
-
this._closeWithMirror();
|
|
1803
|
-
return this.close();
|
|
1804
|
-
}
|
|
1805
|
-
/**
|
|
1806
|
-
* Close the path and apply a custom corner treatment between the last and first segments.
|
|
1807
|
-
*
|
|
1808
|
-
* @param radius - Fillet/chamfer radius, or a custom corner function.
|
|
1809
|
-
* @param mode - Corner treatment type.
|
|
1810
|
-
* @returns The closed {@link Sketch}.
|
|
1811
|
-
*/
|
|
1812
|
-
closeWithCustomCorner(radius, mode = "fillet") {
|
|
1813
|
-
this._closeSketch();
|
|
1814
|
-
this._customCornerLastWithFirst(radius, mode);
|
|
1815
|
-
return this.done();
|
|
1816
|
-
}
|
|
1817
|
-
};
|
|
1419
|
+
//#endregion
|
|
1420
|
+
//#region src/2d/blueprints/blueprintSketcher.ts
|
|
1818
1421
|
/**
|
|
1819
1422
|
* Draw 2D curves and produce a {@link Blueprint} (pure-2D shape, no kernel wire).
|
|
1820
1423
|
*
|
|
1821
1424
|
* Use this when you need a reusable 2D profile that can later be sketched onto
|
|
1822
1425
|
* different planes or faces.
|
|
1823
1426
|
*
|
|
1824
|
-
* @see {@link DrawingPen} for the higher-level Drawing wrapper.
|
|
1825
1427
|
* @category Sketching
|
|
1826
1428
|
*/
|
|
1827
1429
|
var BlueprintSketcher = class extends BaseSketcher2d {
|
|
@@ -1859,854 +1461,6 @@ var BlueprintSketcher = class extends BaseSketcher2d {
|
|
|
1859
1461
|
}
|
|
1860
1462
|
};
|
|
1861
1463
|
//#endregion
|
|
1862
|
-
//#region src/2d/blueprints/cannedBlueprints.ts
|
|
1863
|
-
/**
|
|
1864
|
-
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
1865
|
-
*
|
|
1866
|
-
* @param radius - Circumscribed circle radius.
|
|
1867
|
-
* @param sidesCount - Number of sides (3 = triangle, 6 = hexagon, etc.).
|
|
1868
|
-
* @param sagitta - When non-zero, sides are replaced by sagitta arcs (bulge height).
|
|
1869
|
-
* @returns A closed Blueprint representing the polygon.
|
|
1870
|
-
*
|
|
1871
|
-
* @example
|
|
1872
|
-
* ```ts
|
|
1873
|
-
* const hexagon = polysidesBlueprint(10, 6);
|
|
1874
|
-
* const roundedTriangle = polysidesBlueprint(10, 3, 2);
|
|
1875
|
-
* ```
|
|
1876
|
-
*/
|
|
1877
|
-
var polysidesBlueprint = (radius, sidesCount, sagitta = 0) => {
|
|
1878
|
-
const points = [...Array(sidesCount).keys()].map((i) => {
|
|
1879
|
-
const theta = -(Math.PI * 2 / sidesCount) * i;
|
|
1880
|
-
return [radius * Math.sin(theta), radius * Math.cos(theta)];
|
|
1881
|
-
});
|
|
1882
|
-
const lastPoint = require_arrayAccess.lastOrThrow(points);
|
|
1883
|
-
const blueprint = new BlueprintSketcher().movePointerTo([lastPoint[0], lastPoint[1]]);
|
|
1884
|
-
if (sagitta) points.forEach(([x, y]) => blueprint.sagittaArcTo([x, y], sagitta));
|
|
1885
|
-
else points.forEach(([x, y]) => blueprint.lineTo([x, y]));
|
|
1886
|
-
return blueprint.done();
|
|
1887
|
-
};
|
|
1888
|
-
/**
|
|
1889
|
-
* Create an axis-aligned rectangle blueprint with optional rounded corners.
|
|
1890
|
-
*
|
|
1891
|
-
* The rectangle is centered at the origin. When `r` is zero the corners
|
|
1892
|
-
* are sharp; otherwise they are filleted with circular or elliptical arcs.
|
|
1893
|
-
*
|
|
1894
|
-
* @param width - Total width of the rectangle.
|
|
1895
|
-
* @param height - Total height of the rectangle.
|
|
1896
|
-
* @param r - Corner radius. Pass a number for uniform rounding, or
|
|
1897
|
-
* `{ rx, ry }` for elliptical corners. Clamped to half the respective
|
|
1898
|
-
* dimension.
|
|
1899
|
-
* @returns A closed Blueprint representing the rectangle.
|
|
1900
|
-
*
|
|
1901
|
-
* @example
|
|
1902
|
-
* ```ts
|
|
1903
|
-
* const sharp = roundedRectangleBlueprint(20, 10);
|
|
1904
|
-
* const rounded = roundedRectangleBlueprint(20, 10, 3);
|
|
1905
|
-
* const elliptical = roundedRectangleBlueprint(20, 10, { rx: 4, ry: 2 });
|
|
1906
|
-
* ```
|
|
1907
|
-
*/
|
|
1908
|
-
var roundedRectangleBlueprint = (width, height, r = 0) => {
|
|
1909
|
-
const { rx: inputRx = 0, ry: inputRy = 0 } = typeof r === "number" ? {
|
|
1910
|
-
ry: r,
|
|
1911
|
-
rx: r
|
|
1912
|
-
} : r;
|
|
1913
|
-
let rx = Math.min(inputRx, width / 2);
|
|
1914
|
-
let ry = Math.min(inputRy, height / 2);
|
|
1915
|
-
const withRadius = rx && ry;
|
|
1916
|
-
if (!withRadius) {
|
|
1917
|
-
rx = 0;
|
|
1918
|
-
ry = 0;
|
|
1919
|
-
}
|
|
1920
|
-
const symmetricRadius = rx === ry;
|
|
1921
|
-
const sk = new BlueprintSketcher([Math.min(0, -(width / 2 - rx)), -height / 2]);
|
|
1922
|
-
const addFillet = (xDist, yDist) => {
|
|
1923
|
-
if (withRadius) if (symmetricRadius) sk.tangentArc(xDist, yDist);
|
|
1924
|
-
else sk.ellipse(xDist, yDist, rx, ry, 0, false, true);
|
|
1925
|
-
};
|
|
1926
|
-
if (rx < width / 2) sk.hLine(width - 2 * rx);
|
|
1927
|
-
addFillet(rx, ry);
|
|
1928
|
-
if (ry < height / 2) sk.vLine(height - 2 * ry);
|
|
1929
|
-
addFillet(-rx, ry);
|
|
1930
|
-
if (rx < width / 2) sk.hLine(-(width - 2 * rx));
|
|
1931
|
-
addFillet(-rx, -ry);
|
|
1932
|
-
if (ry < height / 2) sk.vLine(-(height - 2 * ry));
|
|
1933
|
-
addFillet(rx, -ry);
|
|
1934
|
-
return sk.close();
|
|
1935
|
-
};
|
|
1936
|
-
//#endregion
|
|
1937
|
-
//#region src/2d/blueprints/booleanHelpers.ts
|
|
1938
|
-
var samePoint = (x, y) => require_helpers.samePoint(x, y, require_helpers.PRECISION_INTERSECTION);
|
|
1939
|
-
/**
|
|
1940
|
-
* Hash a point for Set/Map lookup using precision rounding.
|
|
1941
|
-
* Must match PRECISION_INTERSECTION (1e-9) to avoid hash collisions for
|
|
1942
|
-
* nearly-equal points.
|
|
1943
|
-
*/
|
|
1944
|
-
function hashPoint(p) {
|
|
1945
|
-
return `${p[0].toFixed(9)},${p[1].toFixed(9)}`;
|
|
1946
|
-
}
|
|
1947
|
-
/**
|
|
1948
|
-
* Hash a segment by both orientations for bidirectional lookup.
|
|
1949
|
-
* The smaller hash comes first so that (A,B) and (B,A) produce the same key.
|
|
1950
|
-
*/
|
|
1951
|
-
function hashSegment(first, last) {
|
|
1952
|
-
const h1 = hashPoint(first);
|
|
1953
|
-
const h2 = hashPoint(last);
|
|
1954
|
-
return h1 < h2 ? `${h1}|${h2}` : `${h2}|${h1}`;
|
|
1955
|
-
}
|
|
1956
|
-
function startOfSegment(s) {
|
|
1957
|
-
const first = s[0];
|
|
1958
|
-
if (first === void 0) require_errors.bug("startOfSegment", "empty segment");
|
|
1959
|
-
return first.firstPoint;
|
|
1960
|
-
}
|
|
1961
|
-
function endOfSegment(s) {
|
|
1962
|
-
const last = s[s.length - 1];
|
|
1963
|
-
if (last === void 0) require_errors.bug("endOfSegment", "empty segment");
|
|
1964
|
-
return last.lastPoint;
|
|
1965
|
-
}
|
|
1966
|
-
function reverseSegment(segment) {
|
|
1967
|
-
return [...segment].reverse().map((curve) => {
|
|
1968
|
-
const newCurve = curve.clone();
|
|
1969
|
-
newCurve.reverse();
|
|
1970
|
-
return newCurve;
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
function reverseSegments(segments) {
|
|
1974
|
-
return [...segments].reverse().map(reverseSegment);
|
|
1975
|
-
}
|
|
1976
|
-
function curveMidPoint(curve) {
|
|
1977
|
-
const midParameter = (curve.lastParameter + curve.firstParameter) / 2;
|
|
1978
|
-
return curve.value(midParameter);
|
|
1979
|
-
}
|
|
1980
|
-
/**
|
|
1981
|
-
* Find the index of the first curve in `curves` whose firstPoint matches
|
|
1982
|
-
* `point`. Uses hash for a fast first pass, then falls back to tolerance-only
|
|
1983
|
-
* comparison to handle floating-point rounding at `toFixed(9)` boundaries.
|
|
1984
|
-
* Returns -1 if no match is found.
|
|
1985
|
-
*/
|
|
1986
|
-
function findCurveIndexByStartPoint(curves, point) {
|
|
1987
|
-
const targetHash = hashPoint(point);
|
|
1988
|
-
for (let i = 0; i < curves.length; i++) {
|
|
1989
|
-
const curve = curves[i];
|
|
1990
|
-
if (curve === void 0) continue;
|
|
1991
|
-
if (hashPoint(curve.firstPoint) === targetHash && samePoint(point, curve.firstPoint)) return i;
|
|
1992
|
-
}
|
|
1993
|
-
for (let i = 0; i < curves.length; i++) {
|
|
1994
|
-
const curve = curves[i];
|
|
1995
|
-
if (curve === void 0) continue;
|
|
1996
|
-
if (samePoint(point, curve.firstPoint)) return i;
|
|
1997
|
-
}
|
|
1998
|
-
return -1;
|
|
1999
|
-
}
|
|
2000
|
-
/**
|
|
2001
|
-
* Find the index of the first curve in `curves` that matches the given
|
|
2002
|
-
* segment's start and end points. Uses hash for a fast first pass, then
|
|
2003
|
-
* falls back to tolerance-only comparison.
|
|
2004
|
-
* Returns -1 if no match is found.
|
|
2005
|
-
*/
|
|
2006
|
-
function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
|
|
2007
|
-
for (let i = 0; i < curves.length; i++) {
|
|
2008
|
-
const curve = curves[i];
|
|
2009
|
-
if (curve === void 0) continue;
|
|
2010
|
-
if (hashPoint(curve.firstPoint) === segFirstHash && hashPoint(curve.lastPoint) === segLastHash && matchesFn(curve)) return i;
|
|
2011
|
-
}
|
|
2012
|
-
for (let i = 0; i < curves.length; i++) {
|
|
2013
|
-
const curve = curves[i];
|
|
2014
|
-
if (curve === void 0) continue;
|
|
2015
|
-
if (matchesFn(curve)) return i;
|
|
2016
|
-
}
|
|
2017
|
-
return -1;
|
|
2018
|
-
}
|
|
2019
|
-
/** Rotate an array so that element at `startIndex` becomes the first element. */
|
|
2020
|
-
function rotateArray(arr, startIndex) {
|
|
2021
|
-
if (startIndex <= 0) return arr;
|
|
2022
|
-
return arr.slice(startIndex).concat(arr.slice(0, startIndex));
|
|
2023
|
-
}
|
|
2024
|
-
/**
|
|
2025
|
-
* Rotate the curves array so that it starts at the curve whose firstPoint
|
|
2026
|
-
* matches the given point.
|
|
2027
|
-
*/
|
|
2028
|
-
function rotateToStartAt(curves, point) {
|
|
2029
|
-
return rotateArray(curves, findCurveIndexByStartPoint(curves, point));
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Rotate the curves array so that it starts at the curve matching the given
|
|
2033
|
-
* segment. Tries both segment orientations (forward and flipped) against both
|
|
2034
|
-
* curve orientations (original and reversed chain) to handle cases where
|
|
2035
|
-
* `intersectCurves` returns a common segment oriented opposite to the
|
|
2036
|
-
* matching curve in the split result.
|
|
2037
|
-
*/
|
|
2038
|
-
function rotateToStartAtSegment(curves, segment) {
|
|
2039
|
-
const segFirstHash = hashPoint(segment.firstPoint);
|
|
2040
|
-
const segLastHash = hashPoint(segment.lastPoint);
|
|
2041
|
-
const matchesForward = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
|
|
2042
|
-
const matchesFlipped = (curve) => samePoint(segment.lastPoint, curve.firstPoint) && samePoint(segment.firstPoint, curve.lastPoint);
|
|
2043
|
-
function tryRotate(chain, firstHash, lastHash, matchFn) {
|
|
2044
|
-
const idx = findCurveIndexBySegment(chain, firstHash, lastHash, matchFn);
|
|
2045
|
-
return idx !== -1 ? rotateArray(chain, idx) : null;
|
|
2046
|
-
}
|
|
2047
|
-
const fwdFwd = tryRotate(curves, segFirstHash, segLastHash, matchesForward);
|
|
2048
|
-
if (fwdFwd !== null) return fwdFwd;
|
|
2049
|
-
const flipFwd = tryRotate(curves, segLastHash, segFirstHash, matchesFlipped);
|
|
2050
|
-
if (flipFwd !== null) return flipFwd;
|
|
2051
|
-
const reversed = reverseSegment(curves);
|
|
2052
|
-
const fwdRev = tryRotate(reversed, segFirstHash, segLastHash, matchesForward);
|
|
2053
|
-
if (fwdRev !== null) return fwdRev;
|
|
2054
|
-
const flipRev = tryRotate(reversed, segLastHash, segFirstHash, matchesFlipped);
|
|
2055
|
-
if (flipRev !== null) return flipRev;
|
|
2056
|
-
require_errors.bug("rotateToStartAtSegment", "failed to rotate to segment start");
|
|
2057
|
-
}
|
|
2058
|
-
//#endregion
|
|
2059
|
-
//#region src/2d/blueprints/intersectionSegments.ts
|
|
2060
|
-
function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
2061
|
-
const intersectionSet = new Set(allIntersections.map(hashPoint));
|
|
2062
|
-
const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
|
|
2063
|
-
const matchesIntersection = (point) => {
|
|
2064
|
-
if (intersectionSet.has(hashPoint(point))) return true;
|
|
2065
|
-
return allIntersections.some((p) => samePoint(p, point));
|
|
2066
|
-
};
|
|
2067
|
-
const matchesCommonSegment = (first, last) => {
|
|
2068
|
-
if (commonSegmentSet.has(hashSegment(first, last))) return true;
|
|
2069
|
-
return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
|
|
2070
|
-
};
|
|
2071
|
-
let currentCurves = [];
|
|
2072
|
-
for (const curve of curves) {
|
|
2073
|
-
if (samePoint(curve.firstPoint, curve.lastPoint)) {
|
|
2074
|
-
currentCurves.push(curve);
|
|
2075
|
-
continue;
|
|
2076
|
-
}
|
|
2077
|
-
const endsAtIntersection = matchesIntersection(curve.lastPoint);
|
|
2078
|
-
const isCommon = matchesCommonSegment(curve.firstPoint, curve.lastPoint);
|
|
2079
|
-
if (endsAtIntersection) {
|
|
2080
|
-
currentCurves.push(curve);
|
|
2081
|
-
yield currentCurves;
|
|
2082
|
-
currentCurves = [];
|
|
2083
|
-
} else if (isCommon) {
|
|
2084
|
-
if (currentCurves.length) {
|
|
2085
|
-
yield currentCurves;
|
|
2086
|
-
currentCurves = [];
|
|
2087
|
-
}
|
|
2088
|
-
yield [curve];
|
|
2089
|
-
} else currentCurves.push(curve);
|
|
2090
|
-
}
|
|
2091
|
-
if (currentCurves.length) yield currentCurves;
|
|
2092
|
-
}
|
|
2093
|
-
/**
|
|
2094
|
-
* Filter out intersection points where the curves only touch but do not
|
|
2095
|
-
* actually cross from one side to the other.
|
|
2096
|
-
*/
|
|
2097
|
-
function removeNonCrossingPoints(allIntersections, segmentedCurve, blueprintToCheck) {
|
|
2098
|
-
return allIntersections.filter((intersection) => {
|
|
2099
|
-
const touching = segmentedCurve.filter((s) => samePoint(s.firstPoint, intersection) || samePoint(s.lastPoint, intersection));
|
|
2100
|
-
const effectiveTouching = touching.length % 2 ? touching.filter((s) => !(samePoint(s.firstPoint, intersection) && samePoint(s.lastPoint, intersection))) : touching;
|
|
2101
|
-
if (effectiveTouching.length === 0 || effectiveTouching.length % 2) return false;
|
|
2102
|
-
const insideFlags = effectiveTouching.map((segment) => blueprintToCheck.isInside(curveMidPoint(segment)));
|
|
2103
|
-
return !(insideFlags.every(Boolean) || insideFlags.every((f) => !f));
|
|
2104
|
-
});
|
|
2105
|
-
}
|
|
2106
|
-
/**
|
|
2107
|
-
* Find all intersection points and common segments between two blueprints'
|
|
2108
|
-
* curves. Returns per-curve intersection points for subsequent splitting.
|
|
2109
|
-
*/
|
|
2110
|
-
function findAllIntersections(first, second) {
|
|
2111
|
-
const allIntersections = [];
|
|
2112
|
-
const allCommonSegments = [];
|
|
2113
|
-
const firstCurvePoints = first.curves.map(() => []);
|
|
2114
|
-
const secondCurvePoints = second.curves.map(() => []);
|
|
2115
|
-
const secondIndex = new Flatbush(second.curves.length);
|
|
2116
|
-
for (const curve of second.curves) {
|
|
2117
|
-
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
2118
|
-
secondIndex.add(xMin, yMin, xMax, yMax);
|
|
2119
|
-
}
|
|
2120
|
-
secondIndex.finish();
|
|
2121
|
-
first.curves.forEach((thisCurve, firstIdx) => {
|
|
2122
|
-
const [[xMin, yMin], [xMax, yMax]] = thisCurve.boundingBox.bounds;
|
|
2123
|
-
const candidates = secondIndex.search(xMin, yMin, xMax, yMax);
|
|
2124
|
-
for (const secondIdx of candidates) {
|
|
2125
|
-
const otherCurve = second.curves[secondIdx];
|
|
2126
|
-
const { intersections, commonSegments, commonSegmentsPoints } = require_errors.unwrap(intersectCurves(thisCurve, otherCurve, require_helpers.PRECISION_INTERSECTION / 100));
|
|
2127
|
-
allIntersections.push(...intersections);
|
|
2128
|
-
firstCurvePoints[firstIdx]?.push(...intersections);
|
|
2129
|
-
secondCurvePoints[secondIdx]?.push(...intersections);
|
|
2130
|
-
allCommonSegments.push(...commonSegments);
|
|
2131
|
-
allIntersections.push(...commonSegmentsPoints);
|
|
2132
|
-
firstCurvePoints[firstIdx]?.push(...commonSegmentsPoints);
|
|
2133
|
-
secondCurvePoints[secondIdx]?.push(...commonSegmentsPoints);
|
|
2134
|
-
}
|
|
2135
|
-
});
|
|
2136
|
-
return {
|
|
2137
|
-
allIntersections: require_blueprint.removeDuplicatePoints(allIntersections, require_helpers.PRECISION_INTERSECTION),
|
|
2138
|
-
allCommonSegments,
|
|
2139
|
-
firstCurvePoints,
|
|
2140
|
-
secondCurvePoints
|
|
2141
|
-
};
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
* Split each curve at its intersection points and return the resulting
|
|
2145
|
-
* sub-curves.
|
|
2146
|
-
*/
|
|
2147
|
-
function splitCurvesAtIntersections(curves, curvePoints) {
|
|
2148
|
-
return require_surfaceBuilders.zip([curves, curvePoints]).flatMap(([curve, intersections]) => {
|
|
2149
|
-
if (intersections.length === 0) return [curve];
|
|
2150
|
-
return curve.splitAt(intersections, require_helpers.PRECISION_INTERSECTION / 100);
|
|
2151
|
-
});
|
|
2152
|
-
}
|
|
2153
|
-
/**
|
|
2154
|
-
* Check whether a segment's start/end points match one of the common segment
|
|
2155
|
-
* point pairs.
|
|
2156
|
-
*/
|
|
2157
|
-
function isCommonSegmentMatch(commonSegmentsPoints, segmentStart, segmentEnd) {
|
|
2158
|
-
return commonSegmentsPoints.some(([startPoint, endPoint]) => {
|
|
2159
|
-
if (startPoint === void 0 || endPoint === void 0) return false;
|
|
2160
|
-
return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(endPoint, segmentStart);
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
/**
|
|
2164
|
-
* Given two closed blueprints, find their intersection points, split each
|
|
2165
|
-
* blueprint's curves at those points, and pair up the resulting segments.
|
|
2166
|
-
*
|
|
2167
|
-
* Returns an array of paired segments (one from each blueprint) that share
|
|
2168
|
-
* the same start/end intersection points, or `null` if the blueprints do not
|
|
2169
|
-
* intersect.
|
|
2170
|
-
*/
|
|
2171
|
-
function blueprintsIntersectionSegments(first, second) {
|
|
2172
|
-
const { allIntersections: rawIntersections, allCommonSegments, firstCurvePoints, secondCurvePoints } = findAllIntersections(first, second);
|
|
2173
|
-
if (rawIntersections.length <= 1) return null;
|
|
2174
|
-
let firstCurveSegments = splitCurvesAtIntersections(first.curves, firstCurvePoints);
|
|
2175
|
-
let secondCurveSegments = splitCurvesAtIntersections(second.curves, secondCurvePoints);
|
|
2176
|
-
const commonSegmentsPoints = allCommonSegments.map((c) => [c.firstPoint, c.lastPoint]);
|
|
2177
|
-
const allIntersections = removeNonCrossingPoints(removeNonCrossingPoints(rawIntersections, firstCurveSegments, second), secondCurveSegments, first);
|
|
2178
|
-
if (allIntersections.length === 0 && allCommonSegments.length === 0) return null;
|
|
2179
|
-
if (allCommonSegments.length === 0) {
|
|
2180
|
-
const startAt = allIntersections[0];
|
|
2181
|
-
if (startAt === void 0) return null;
|
|
2182
|
-
firstCurveSegments = rotateToStartAt(firstCurveSegments, startAt);
|
|
2183
|
-
secondCurveSegments = rotateToStartAt(secondCurveSegments, startAt);
|
|
2184
|
-
} else {
|
|
2185
|
-
const startSegment = allCommonSegments[0];
|
|
2186
|
-
if (startSegment === void 0) return null;
|
|
2187
|
-
firstCurveSegments = rotateToStartAtSegment(firstCurveSegments, startSegment);
|
|
2188
|
-
secondCurveSegments = rotateToStartAtSegment(secondCurveSegments, startSegment);
|
|
2189
|
-
}
|
|
2190
|
-
const firstIntersectedSegments = Array.from(createSegmentOnPoints(firstCurveSegments, allIntersections, allCommonSegments));
|
|
2191
|
-
let secondIntersectedSegments = Array.from(createSegmentOnPoints(secondCurveSegments, allIntersections, allCommonSegments));
|
|
2192
|
-
const firstSeg = firstIntersectedSegments[0];
|
|
2193
|
-
const secondSeg = secondIntersectedSegments[0];
|
|
2194
|
-
if (firstSeg !== void 0 && secondSeg !== void 0) {
|
|
2195
|
-
const endpointsMismatch = !samePoint(endOfSegment(secondSeg), endOfSegment(firstSeg));
|
|
2196
|
-
const commonSegmentLengthMismatch = allCommonSegments.length > 0 && secondSeg.length !== 1;
|
|
2197
|
-
if (endpointsMismatch || commonSegmentLengthMismatch) secondIntersectedSegments = reverseSegments(secondIntersectedSegments);
|
|
2198
|
-
}
|
|
2199
|
-
const maxLen = Math.max(firstIntersectedSegments.length, secondIntersectedSegments.length);
|
|
2200
|
-
const result = [];
|
|
2201
|
-
for (let i = 0; i < maxLen; i++) {
|
|
2202
|
-
const firstSeg2 = firstIntersectedSegments[i];
|
|
2203
|
-
const secondSeg2 = secondIntersectedSegments[i];
|
|
2204
|
-
if (firstSeg2 === void 0 || secondSeg2 === void 0) {
|
|
2205
|
-
const available = firstSeg2 ?? secondSeg2;
|
|
2206
|
-
if (available === void 0) continue;
|
|
2207
|
-
result.push([available, available]);
|
|
2208
|
-
continue;
|
|
2209
|
-
}
|
|
2210
|
-
if (isCommonSegmentMatch(commonSegmentsPoints, startOfSegment(firstSeg2), endOfSegment(firstSeg2))) result.push([firstSeg2, "same"]);
|
|
2211
|
-
else result.push([firstSeg2, secondSeg2]);
|
|
2212
|
-
}
|
|
2213
|
-
return result;
|
|
2214
|
-
}
|
|
2215
|
-
//#endregion
|
|
2216
|
-
//#region src/2d/blueprints/segmentAssembly.ts
|
|
2217
|
-
/**
|
|
2218
|
-
* Merge adjacent collinear line segments into single segments.
|
|
2219
|
-
*
|
|
2220
|
-
* Boolean operations can split a line at intersection points that lie on the
|
|
2221
|
-
* line itself (e.g. when a cut rectangle's edge is collinear with the
|
|
2222
|
-
* profile's edge). The extra split creates a C0 discontinuity in swept
|
|
2223
|
-
* surfaces. Merging eliminates unnecessary vertices.
|
|
2224
|
-
*/
|
|
2225
|
-
function mergeCollinearSegments(curves) {
|
|
2226
|
-
if (curves.length < 2) return curves;
|
|
2227
|
-
const result = [];
|
|
2228
|
-
let i = 0;
|
|
2229
|
-
while (i < curves.length) {
|
|
2230
|
-
const current = curves[i];
|
|
2231
|
-
if (current.geomType !== "LINE") {
|
|
2232
|
-
result.push(current);
|
|
2233
|
-
i++;
|
|
2234
|
-
continue;
|
|
2235
|
-
}
|
|
2236
|
-
let endPoint = current.lastPoint;
|
|
2237
|
-
let j = i + 1;
|
|
2238
|
-
while (j < curves.length) {
|
|
2239
|
-
const next = curves[j];
|
|
2240
|
-
if (next.geomType !== "LINE") break;
|
|
2241
|
-
if (!samePoint(endPoint, next.firstPoint)) break;
|
|
2242
|
-
const dir1 = require_helpers.subtract2d(endPoint, current.firstPoint);
|
|
2243
|
-
const dir2 = require_helpers.subtract2d(next.lastPoint, next.firstPoint);
|
|
2244
|
-
if (Math.abs(require_helpers.crossProduct2d(dir1, dir2)) > 1e-9) break;
|
|
2245
|
-
endPoint = next.lastPoint;
|
|
2246
|
-
j++;
|
|
2247
|
-
}
|
|
2248
|
-
if (j > i + 1) result.push(require_blueprint.make2dSegmentCurve(current.firstPoint, endPoint));
|
|
2249
|
-
else result.push(current);
|
|
2250
|
-
i = j;
|
|
2251
|
-
}
|
|
2252
|
-
return result;
|
|
2253
|
-
}
|
|
2254
|
-
/**
|
|
2255
|
-
* Split an array of curves into separate continuous paths. A discontinuity
|
|
2256
|
-
* occurs where one curve's lastPoint does not match the next curve's
|
|
2257
|
-
* firstPoint.
|
|
2258
|
-
*/
|
|
2259
|
-
function splitPaths(curves) {
|
|
2260
|
-
const startPoints = curves.map((c) => c.firstPoint);
|
|
2261
|
-
const shiftedEndPoints = curves.map((c) => c.lastPoint);
|
|
2262
|
-
const discontinuities = require_surfaceBuilders.zip([startPoints, shiftedEndPoints.slice(-1).concat(shiftedEndPoints.slice(0, -1))]).map(([startPoint, endPoint], index) => {
|
|
2263
|
-
if (startPoint === void 0 || endPoint === void 0) return null;
|
|
2264
|
-
return samePoint(startPoint, endPoint) ? null : index;
|
|
2265
|
-
}).filter((f) => f !== null);
|
|
2266
|
-
if (discontinuities.length === 0) return [curves];
|
|
2267
|
-
const paths = require_surfaceBuilders.zip([discontinuities.slice(0, -1), discontinuities.slice(1)]).map(([start, end]) => curves.slice(start, end));
|
|
2268
|
-
let lastPath = curves.slice(discontinuities[discontinuities.length - 1]);
|
|
2269
|
-
const firstDiscontinuity = discontinuities[0];
|
|
2270
|
-
if (firstDiscontinuity !== void 0 && firstDiscontinuity !== 0) lastPath = lastPath.concat(curves.slice(0, firstDiscontinuity));
|
|
2271
|
-
paths.push(lastPath);
|
|
2272
|
-
return paths;
|
|
2273
|
-
}
|
|
2274
|
-
/**
|
|
2275
|
-
* Handle the case where two segments overlap ("same"). The decision depends
|
|
2276
|
-
* on how many segments are entering the current intersection node.
|
|
2277
|
-
*/
|
|
2278
|
-
function handleSameSegment(firstSegment, segmentsIn, lastWasSame) {
|
|
2279
|
-
if (segmentsIn === 1) return {
|
|
2280
|
-
curves: [...firstSegment],
|
|
2281
|
-
segmentsIn: 1,
|
|
2282
|
-
lastWasSame: null
|
|
2283
|
-
};
|
|
2284
|
-
if (segmentsIn === 2 || segmentsIn === 0) return {
|
|
2285
|
-
curves: [],
|
|
2286
|
-
segmentsIn: null,
|
|
2287
|
-
lastWasSame: null
|
|
2288
|
-
};
|
|
2289
|
-
if (segmentsIn === null) return {
|
|
2290
|
-
curves: [],
|
|
2291
|
-
segmentsIn: null,
|
|
2292
|
-
lastWasSame: lastWasSame ? [...lastWasSame, ...firstSegment] : firstSegment
|
|
2293
|
-
};
|
|
2294
|
-
return {
|
|
2295
|
-
curves: [],
|
|
2296
|
-
segmentsIn,
|
|
2297
|
-
lastWasSame
|
|
2298
|
-
};
|
|
2299
|
-
}
|
|
2300
|
-
/**
|
|
2301
|
-
* Determine which non-overlapping segments to keep based on
|
|
2302
|
-
* inside/outside status relative to the other blueprint.
|
|
2303
|
-
*/
|
|
2304
|
-
function selectSegments(firstSegment, secondSegment, first, second, config, segmentsIn, lastWasSame) {
|
|
2305
|
-
let segments = [];
|
|
2306
|
-
let segmentsOut = 0;
|
|
2307
|
-
const firstCurve = firstSegment[0];
|
|
2308
|
-
if (firstCurve !== void 0) {
|
|
2309
|
-
const firstSegmentPoint = curveMidPoint(firstCurve);
|
|
2310
|
-
const firstInSecond = second.isInside(firstSegmentPoint);
|
|
2311
|
-
if (config.firstInside === "keep" && firstInSecond || config.firstInside === "remove" && !firstInSecond) {
|
|
2312
|
-
segmentsOut += 1;
|
|
2313
|
-
segments.push(...firstSegment);
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
const secondCurve = secondSegment[0];
|
|
2317
|
-
if (secondCurve !== void 0) {
|
|
2318
|
-
const secondSegmentPoint = curveMidPoint(secondCurve);
|
|
2319
|
-
const secondInFirst = first.isInside(secondSegmentPoint);
|
|
2320
|
-
if (config.secondInside === "keep" && secondInFirst || config.secondInside === "remove" && !secondInFirst) {
|
|
2321
|
-
let segmentsToAdd = secondSegment;
|
|
2322
|
-
if (segmentsOut === 1) segmentsToAdd = reverseSegment(secondSegment);
|
|
2323
|
-
segmentsOut += 1;
|
|
2324
|
-
segments.push(...segmentsToAdd);
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
if (segmentsIn === null && segmentsOut === 1 && lastWasSame !== null) segments = [...lastWasSame, ...segments];
|
|
2328
|
-
return {
|
|
2329
|
-
curves: segments,
|
|
2330
|
-
segmentsIn: segmentsOut === 1 ? segmentsOut : segmentsIn,
|
|
2331
|
-
lastWasSame: segmentsOut === 1 ? null : lastWasSame
|
|
2332
|
-
};
|
|
2333
|
-
}
|
|
2334
|
-
/**
|
|
2335
|
-
* Core boolean operation between two simple (non-compound) blueprints.
|
|
2336
|
-
*
|
|
2337
|
-
* Segments both blueprints at their intersection points, then selects which
|
|
2338
|
-
* segments to keep based on the `firstInside`/`secondInside` configuration.
|
|
2339
|
-
*/
|
|
2340
|
-
function booleanOperation(first, second, config) {
|
|
2341
|
-
const segments = blueprintsIntersectionSegments(first, second);
|
|
2342
|
-
if (segments === null) return buildNoIntersectionResult(first, second);
|
|
2343
|
-
if (segments.every(([, secondSegment]) => secondSegment === "same")) return { identical: true };
|
|
2344
|
-
let segmentsIn = null;
|
|
2345
|
-
let lastWasSame = null;
|
|
2346
|
-
let assembledCurves = segments.flatMap(([firstSegment, secondSegment]) => {
|
|
2347
|
-
if (secondSegment === "same") {
|
|
2348
|
-
const result = handleSameSegment(firstSegment, segmentsIn, lastWasSame);
|
|
2349
|
-
segmentsIn = result.segmentsIn;
|
|
2350
|
-
lastWasSame = result.lastWasSame;
|
|
2351
|
-
return result.curves;
|
|
2352
|
-
}
|
|
2353
|
-
const result = selectSegments(firstSegment, secondSegment, first, second, config, segmentsIn, lastWasSame);
|
|
2354
|
-
segmentsIn = result.segmentsIn;
|
|
2355
|
-
lastWasSame = result.lastWasSame;
|
|
2356
|
-
return result.curves;
|
|
2357
|
-
});
|
|
2358
|
-
const finalLastWasSame = lastWasSame;
|
|
2359
|
-
if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
|
|
2360
|
-
const paths = splitPaths(mergeCollinearSegments(assembledCurves)).filter((b) => b.length > 0).map((b) => new require_blueprint.Blueprint(b));
|
|
2361
|
-
if (paths.length === 0) return null;
|
|
2362
|
-
if (paths.length === 1) {
|
|
2363
|
-
const single = paths[0];
|
|
2364
|
-
if (single === void 0) return null;
|
|
2365
|
-
return single;
|
|
2366
|
-
}
|
|
2367
|
-
return organiseBlueprints(paths);
|
|
2368
|
-
}
|
|
2369
|
-
function buildNoIntersectionResult(first, second) {
|
|
2370
|
-
const firstCurve = first.curves[0];
|
|
2371
|
-
const secondCurve = second.curves[0];
|
|
2372
|
-
return {
|
|
2373
|
-
identical: false,
|
|
2374
|
-
firstCurveInSecond: firstCurve !== void 0 && second.isInside(curveMidPoint(firstCurve)),
|
|
2375
|
-
secondCurveInFirst: secondCurve !== void 0 && first.isInside(curveMidPoint(secondCurve))
|
|
2376
|
-
};
|
|
2377
|
-
}
|
|
2378
|
-
//#endregion
|
|
2379
|
-
//#region src/2d/blueprints/booleanOperations.ts
|
|
2380
|
-
/**
|
|
2381
|
-
* Boolean operations on 2D blueprints: fuse, cut, and intersect.
|
|
2382
|
-
*
|
|
2383
|
-
* This module is the public API. Internal logic is split across:
|
|
2384
|
-
* - `booleanHelpers.ts` — hashing, segment types, rotation utilities
|
|
2385
|
-
* - `intersectionSegments.ts` — curve intersection and segment pairing
|
|
2386
|
-
* - `segmentAssembly.ts` — segment selection and path assembly
|
|
2387
|
-
*/
|
|
2388
|
-
/**
|
|
2389
|
-
* Compute the boolean union of two simple blueprints.
|
|
2390
|
-
*
|
|
2391
|
-
* Segments each blueprint at their intersection points, discards segments
|
|
2392
|
-
* inside the other shape, and reassembles the remaining curves.
|
|
2393
|
-
*
|
|
2394
|
-
* @param first - First blueprint operand.
|
|
2395
|
-
* @param second - Second blueprint operand.
|
|
2396
|
-
* @returns The fused outline, a {@link Blueprints} if the result is
|
|
2397
|
-
* disjoint, or `null` if the operation produces no geometry.
|
|
2398
|
-
*
|
|
2399
|
-
* @remarks Both blueprints must be closed. For compound or multi-blueprint
|
|
2400
|
-
* inputs, use {@link fuse2D} instead.
|
|
2401
|
-
*/
|
|
2402
|
-
function fuseBlueprints(first, second) {
|
|
2403
|
-
const result = booleanOperation(first, second, {
|
|
2404
|
-
firstInside: "remove",
|
|
2405
|
-
secondInside: "remove"
|
|
2406
|
-
});
|
|
2407
|
-
if (result === null || result instanceof require_blueprint.Blueprint || result instanceof Blueprints) return result;
|
|
2408
|
-
if (result.identical) return first.clone();
|
|
2409
|
-
if (result.firstCurveInSecond) return second.clone();
|
|
2410
|
-
if (result.secondCurveInFirst) return first.clone();
|
|
2411
|
-
return new Blueprints([first, second]);
|
|
2412
|
-
}
|
|
2413
|
-
/**
|
|
2414
|
-
* Compute the boolean difference of two simple blueprints (first minus second).
|
|
2415
|
-
*
|
|
2416
|
-
* Segments the blueprints at their intersections, keeps segments of the first
|
|
2417
|
-
* that are outside the second, and segments of the second that are inside the
|
|
2418
|
-
* first (reversed to form the boundary of the cut).
|
|
2419
|
-
*
|
|
2420
|
-
* @param first - Base blueprint to cut from.
|
|
2421
|
-
* @param second - Tool blueprint to subtract.
|
|
2422
|
-
* @returns The remaining outline, or `null` if nothing remains.
|
|
2423
|
-
*
|
|
2424
|
-
* @remarks Both blueprints must be closed. For compound inputs use {@link cut2D}.
|
|
2425
|
-
*/
|
|
2426
|
-
function cutBlueprints(first, second) {
|
|
2427
|
-
const result = booleanOperation(first, second, {
|
|
2428
|
-
firstInside: "remove",
|
|
2429
|
-
secondInside: "keep"
|
|
2430
|
-
});
|
|
2431
|
-
if (result === null || result instanceof require_blueprint.Blueprint || result instanceof Blueprints) return result;
|
|
2432
|
-
if (result.identical) return null;
|
|
2433
|
-
if (result.firstCurveInSecond) return null;
|
|
2434
|
-
if (result.secondCurveInFirst) return new Blueprints([new CompoundBlueprint([first, second])]);
|
|
2435
|
-
return first.clone();
|
|
2436
|
-
}
|
|
2437
|
-
/**
|
|
2438
|
-
* Compute the boolean intersection of two simple blueprints.
|
|
2439
|
-
*
|
|
2440
|
-
* Keeps only the segments of each blueprint that lie inside the other,
|
|
2441
|
-
* producing the overlapping region.
|
|
2442
|
-
*
|
|
2443
|
-
* @param first - First blueprint operand.
|
|
2444
|
-
* @param second - Second blueprint operand.
|
|
2445
|
-
* @returns The intersection outline, or `null` if the blueprints do not overlap.
|
|
2446
|
-
*
|
|
2447
|
-
* @remarks Both blueprints must be closed. For compound inputs use {@link intersect2D}.
|
|
2448
|
-
*/
|
|
2449
|
-
function intersectBlueprints(first, second) {
|
|
2450
|
-
const result = booleanOperation(first, second, {
|
|
2451
|
-
firstInside: "keep",
|
|
2452
|
-
secondInside: "keep"
|
|
2453
|
-
});
|
|
2454
|
-
if (result === null || result instanceof require_blueprint.Blueprint || result instanceof Blueprints) return result;
|
|
2455
|
-
if (result.identical) return first.clone();
|
|
2456
|
-
if (result.firstCurveInSecond) return first.clone();
|
|
2457
|
-
if (result.secondCurveInFirst) return second.clone();
|
|
2458
|
-
return null;
|
|
2459
|
-
}
|
|
2460
|
-
//#endregion
|
|
2461
|
-
//#region src/2d/blueprints/boolean2D.ts
|
|
2462
|
-
var genericIntersects = (first, second) => {
|
|
2463
|
-
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) {
|
|
2464
|
-
let allIntersections = [];
|
|
2465
|
-
first.curves.forEach((thisCurve) => {
|
|
2466
|
-
second.curves.forEach((otherCurve) => {
|
|
2467
|
-
const { intersections, commonSegmentsPoints } = require_errors.unwrap(intersectCurves(thisCurve, otherCurve));
|
|
2468
|
-
allIntersections.push(...intersections);
|
|
2469
|
-
allIntersections.push(...commonSegmentsPoints);
|
|
2470
|
-
});
|
|
2471
|
-
});
|
|
2472
|
-
allIntersections = require_blueprint.removeDuplicatePoints(allIntersections);
|
|
2473
|
-
return allIntersections.length > 1;
|
|
2474
|
-
}
|
|
2475
|
-
if (first instanceof CompoundBlueprint || first instanceof Blueprints) return first.blueprints.some((bp) => genericIntersects(bp, second));
|
|
2476
|
-
if (second instanceof CompoundBlueprint || second instanceof Blueprints) return second.blueprints.some((bp) => genericIntersects(first, bp));
|
|
2477
|
-
require_errors.bug("genericIntersects", "Unhandled shape combination in genericIntersects");
|
|
2478
|
-
};
|
|
2479
|
-
var genericFuse = (first, second) => {
|
|
2480
|
-
if (first instanceof CompoundBlueprint) {
|
|
2481
|
-
if (second instanceof require_blueprint.Blueprint) return fuseBlueprintWithCompound(second, first);
|
|
2482
|
-
if (second instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
|
|
2483
|
-
}
|
|
2484
|
-
if (second instanceof CompoundBlueprint) {
|
|
2485
|
-
if (first instanceof require_blueprint.Blueprint) return fuseBlueprintWithCompound(first, second);
|
|
2486
|
-
if (first instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
|
|
2487
|
-
}
|
|
2488
|
-
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) return fuseBlueprints(first, second);
|
|
2489
|
-
require_errors.bug("genericFuse", "Unhandled shape combination in genericFuse");
|
|
2490
|
-
};
|
|
2491
|
-
var fuseIntersectingBlueprints = (blueprints) => {
|
|
2492
|
-
const fused = /* @__PURE__ */ new Map();
|
|
2493
|
-
const output = [];
|
|
2494
|
-
blueprints.forEach((inputBlueprint, i) => {
|
|
2495
|
-
let savedBlueprint;
|
|
2496
|
-
if (fused.has(i)) savedBlueprint = fused.get(i);
|
|
2497
|
-
else {
|
|
2498
|
-
savedBlueprint = {
|
|
2499
|
-
current: inputBlueprint,
|
|
2500
|
-
fusedWith: new Set([i])
|
|
2501
|
-
};
|
|
2502
|
-
output.push(savedBlueprint);
|
|
2503
|
-
}
|
|
2504
|
-
blueprints.slice(i + 1).forEach((inputOtherBlueprint, j) => {
|
|
2505
|
-
const blueprint = savedBlueprint.current;
|
|
2506
|
-
const currentIndex = i + j + 1;
|
|
2507
|
-
if (savedBlueprint.fusedWith.has(currentIndex)) return;
|
|
2508
|
-
let otherBlueprint = inputOtherBlueprint;
|
|
2509
|
-
let otherIsFused = false;
|
|
2510
|
-
if (fused.has(currentIndex)) {
|
|
2511
|
-
otherBlueprint = fused.get(currentIndex).current;
|
|
2512
|
-
otherIsFused = true;
|
|
2513
|
-
}
|
|
2514
|
-
if (blueprint.boundingBox.isOut(otherBlueprint.boundingBox)) return;
|
|
2515
|
-
if (!genericIntersects(blueprint, otherBlueprint)) return;
|
|
2516
|
-
let newFused;
|
|
2517
|
-
if (blueprint instanceof Blueprints || otherBlueprint instanceof Blueprints) {
|
|
2518
|
-
const fused = fuse2D(blueprint, otherBlueprint);
|
|
2519
|
-
if (fused === null) require_errors.bug("fuseIntersectingBlueprints", "fuse2D returned null for non-null inputs");
|
|
2520
|
-
newFused = fused;
|
|
2521
|
-
} else newFused = genericFuse(blueprint, otherBlueprint);
|
|
2522
|
-
if (!(newFused instanceof require_blueprint.Blueprint || newFused instanceof CompoundBlueprint)) {
|
|
2523
|
-
if (newFused instanceof Blueprints && newFused.blueprints.length === 2) return;
|
|
2524
|
-
else if (newFused instanceof Blueprints && newFused.blueprints.length === 1) newFused = require_errors.safeIndex(newFused.blueprints, 0, "fuseIntersectingBlueprints");
|
|
2525
|
-
else if (!(newFused instanceof Blueprints)) require_errors.bug("fuseIntersectingBlueprints", "Fuse produced unexpected non-blueprint result");
|
|
2526
|
-
}
|
|
2527
|
-
savedBlueprint.fusedWith.add(currentIndex);
|
|
2528
|
-
savedBlueprint.current = newFused;
|
|
2529
|
-
if (!otherIsFused) fused.set(currentIndex, savedBlueprint);
|
|
2530
|
-
});
|
|
2531
|
-
});
|
|
2532
|
-
return organiseBlueprints(output.map(({ current }) => current).flatMap((b) => allBlueprints(b)));
|
|
2533
|
-
};
|
|
2534
|
-
var allBlueprints = (shape) => {
|
|
2535
|
-
if (shape instanceof require_blueprint.Blueprint) return [shape];
|
|
2536
|
-
if (shape instanceof CompoundBlueprint) return shape.blueprints;
|
|
2537
|
-
if (shape instanceof Blueprints) return shape.blueprints.flatMap((b) => allBlueprints(b));
|
|
2538
|
-
return [];
|
|
2539
|
-
};
|
|
2540
|
-
var fuseBlueprintWithCompound = (blueprint, compound) => {
|
|
2541
|
-
const outerFused = fuseBlueprints(blueprint, require_errors.safeIndex(compound.blueprints, 0, "fuseBlueprintWithCompound"));
|
|
2542
|
-
const innerFused = compound.blueprints.slice(1).map((c) => cutBlueprints(c, blueprint));
|
|
2543
|
-
return organiseBlueprints([...allBlueprints(outerFused), ...innerFused.flatMap((fused) => allBlueprints(fused))]);
|
|
2544
|
-
};
|
|
2545
|
-
function allPairs(list1, list2) {
|
|
2546
|
-
const result = [];
|
|
2547
|
-
for (const l1 of list1) for (const l2 of list2) result.push([l1, l2]);
|
|
2548
|
-
return result;
|
|
2549
|
-
}
|
|
2550
|
-
var fuseCompoundWithCompound = (first, second) => {
|
|
2551
|
-
const firstOuter = require_errors.safeIndex(first.blueprints, 0, "fuseCompoundWithCompound");
|
|
2552
|
-
const secondOuter = require_errors.safeIndex(second.blueprints, 0, "fuseCompoundWithCompound");
|
|
2553
|
-
const outerFused = fuseBlueprints(firstOuter, secondOuter);
|
|
2554
|
-
const inner1Fused = second.blueprints.slice(1).map((c) => cutBlueprints(c, firstOuter));
|
|
2555
|
-
const inner2Fused = first.blueprints.slice(1).map((c) => cutBlueprints(c, secondOuter));
|
|
2556
|
-
const innerIntersections = allPairs(first.blueprints.slice(1), second.blueprints.slice(1)).flatMap(([first, second]) => {
|
|
2557
|
-
return allBlueprints(intersectBlueprints(first, second));
|
|
2558
|
-
});
|
|
2559
|
-
return organiseBlueprints([
|
|
2560
|
-
...allBlueprints(outerFused),
|
|
2561
|
-
...inner1Fused.flatMap((fused) => allBlueprints(fused)),
|
|
2562
|
-
...inner2Fused.flatMap((fused) => allBlueprints(fused)),
|
|
2563
|
-
...innerIntersections
|
|
2564
|
-
]);
|
|
2565
|
-
};
|
|
2566
|
-
/**
|
|
2567
|
-
* Compute the boolean union of two 2D shapes.
|
|
2568
|
-
*
|
|
2569
|
-
* Handles all combinations of {@link Blueprint}, {@link CompoundBlueprint},
|
|
2570
|
-
* {@link Blueprints}, and `null`. When both inputs are simple blueprints the
|
|
2571
|
-
* operation delegates to {@link fuseBlueprints}; compound and multi-blueprint
|
|
2572
|
-
* cases are decomposed recursively.
|
|
2573
|
-
*
|
|
2574
|
-
* @param first - First operand (or `null` for empty).
|
|
2575
|
-
* @param second - Second operand (or `null` for empty).
|
|
2576
|
-
* @returns The fused shape, or `null` if both operands are empty.
|
|
2577
|
-
*
|
|
2578
|
-
* @example
|
|
2579
|
-
* ```ts
|
|
2580
|
-
* const union = fuse2D(circleBlueprint, squareBlueprint);
|
|
2581
|
-
* ```
|
|
2582
|
-
*
|
|
2583
|
-
* @see {@link fuse2D} for the functional API.
|
|
2584
|
-
*/
|
|
2585
|
-
var fuse2D = (first, second) => {
|
|
2586
|
-
if (first === null) return second?.clone() ?? null;
|
|
2587
|
-
if (second === null) return first.clone();
|
|
2588
|
-
if (!(first instanceof Blueprints) && second instanceof Blueprints) return fuseIntersectingBlueprints([first, ...second.blueprints]);
|
|
2589
|
-
if (!(second instanceof Blueprints) && first instanceof Blueprints) return fuseIntersectingBlueprints([second, ...first.blueprints]);
|
|
2590
|
-
if (first instanceof Blueprints && second instanceof Blueprints) {
|
|
2591
|
-
let out = fuse2D(require_errors.safeIndex(first.blueprints, 0, "fuse2D"), second);
|
|
2592
|
-
first.blueprints.slice(1).forEach((bp) => {
|
|
2593
|
-
out = fuse2D(bp, out);
|
|
2594
|
-
});
|
|
2595
|
-
return out;
|
|
2596
|
-
}
|
|
2597
|
-
if (first instanceof CompoundBlueprint) {
|
|
2598
|
-
if (second instanceof Blueprints) return fuse2D(second, first);
|
|
2599
|
-
if (second instanceof require_blueprint.Blueprint) return fuseBlueprintWithCompound(second, first);
|
|
2600
|
-
if (second instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
|
|
2601
|
-
}
|
|
2602
|
-
if (second instanceof CompoundBlueprint) {
|
|
2603
|
-
if (first instanceof Blueprints) return fuse2D(first, second);
|
|
2604
|
-
if (first instanceof require_blueprint.Blueprint) return fuseBlueprintWithCompound(first, second);
|
|
2605
|
-
if (first instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
|
|
2606
|
-
}
|
|
2607
|
-
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) return fuseBlueprints(first, second);
|
|
2608
|
-
return null;
|
|
2609
|
-
};
|
|
2610
|
-
var mergeNonIntersecting = (shapes) => {
|
|
2611
|
-
const exploded = shapes.flatMap((s) => {
|
|
2612
|
-
if (s === null) return [];
|
|
2613
|
-
if (s instanceof Blueprints) return s.blueprints;
|
|
2614
|
-
return s;
|
|
2615
|
-
});
|
|
2616
|
-
if (exploded.length === 1) return require_errors.safeIndex(exploded, 0, "mergeNonIntersecting");
|
|
2617
|
-
return new Blueprints(exploded);
|
|
2618
|
-
};
|
|
2619
|
-
/**
|
|
2620
|
-
* Compute the boolean difference of two 2D shapes (first minus second).
|
|
2621
|
-
*
|
|
2622
|
-
* Removes the region covered by `second` from `first`. When the tool is fully
|
|
2623
|
-
* inside the base, the result is a {@link CompoundBlueprint} (base with a
|
|
2624
|
-
* hole).
|
|
2625
|
-
*
|
|
2626
|
-
* @param first - Base shape to cut from.
|
|
2627
|
-
* @param second - Tool shape to subtract.
|
|
2628
|
-
* @returns The remaining shape, or `null` if nothing remains.
|
|
2629
|
-
*
|
|
2630
|
-
* @example
|
|
2631
|
-
* ```ts
|
|
2632
|
-
* const withHole = cut2D(outerRect, innerCircle);
|
|
2633
|
-
* ```
|
|
2634
|
-
*
|
|
2635
|
-
* @see {@link cut2D} for the functional API.
|
|
2636
|
-
*/
|
|
2637
|
-
var cut2D = (first, second) => {
|
|
2638
|
-
if (first === null) return null;
|
|
2639
|
-
if (second === null) return first.clone();
|
|
2640
|
-
if (first instanceof Blueprints) return mergeNonIntersecting(first.blueprints.map((bp) => cut2D(bp, second)));
|
|
2641
|
-
if (first instanceof CompoundBlueprint) {
|
|
2642
|
-
const wrapper = require_errors.safeIndex(first.blueprints, 0, "cut2D");
|
|
2643
|
-
if (second instanceof require_blueprint.Blueprint && !second.intersects(wrapper)) {
|
|
2644
|
-
if (!wrapper.isInside(second.firstPoint)) return first.clone();
|
|
2645
|
-
return organiseBlueprints([wrapper, ...allBlueprints(fuse2D(second, new Blueprints(first.blueprints.slice(1))))]);
|
|
2646
|
-
} else {
|
|
2647
|
-
let out = cut2D(wrapper, second);
|
|
2648
|
-
first.blueprints.slice(1).forEach((bp) => {
|
|
2649
|
-
out = cut2D(out, bp);
|
|
2650
|
-
});
|
|
2651
|
-
return out;
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
if (second instanceof Blueprints) {
|
|
2655
|
-
let out = first;
|
|
2656
|
-
for (const bp of second.blueprints) out = cut2D(out, bp);
|
|
2657
|
-
return out;
|
|
2658
|
-
}
|
|
2659
|
-
if (second instanceof CompoundBlueprint) {
|
|
2660
|
-
let out = cutBlueprints(first, require_errors.safeIndex(second.blueprints, 0, "cut2D"));
|
|
2661
|
-
second.blueprints.slice(1).forEach((bp) => {
|
|
2662
|
-
out = fuse2D(out, intersectBlueprints(bp, first));
|
|
2663
|
-
});
|
|
2664
|
-
return out;
|
|
2665
|
-
}
|
|
2666
|
-
return cutBlueprints(first, second);
|
|
2667
|
-
};
|
|
2668
|
-
/**
|
|
2669
|
-
* Compute the boolean intersection of two 2D shapes.
|
|
2670
|
-
*
|
|
2671
|
-
* Returns only the region common to both shapes. Compound and multi-blueprint
|
|
2672
|
-
* operands are decomposed recursively, with holes handled via complementary
|
|
2673
|
-
* cut operations.
|
|
2674
|
-
*
|
|
2675
|
-
* @param first - First operand.
|
|
2676
|
-
* @param second - Second operand.
|
|
2677
|
-
* @returns The intersection shape, or `null` if the shapes do not overlap.
|
|
2678
|
-
*
|
|
2679
|
-
* @example
|
|
2680
|
-
* ```ts
|
|
2681
|
-
* const overlap = intersect2D(circle, rectangle);
|
|
2682
|
-
* ```
|
|
2683
|
-
*
|
|
2684
|
-
* @see {@link intersect2D} for the functional API.
|
|
2685
|
-
*/
|
|
2686
|
-
function intersect2D(first, second) {
|
|
2687
|
-
if (first === null || second === null) return null;
|
|
2688
|
-
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) return intersectBlueprints(first, second);
|
|
2689
|
-
if (first instanceof Blueprints) return mergeNonIntersecting(first.blueprints.map((bp) => intersect2D(bp, second)));
|
|
2690
|
-
if (first instanceof CompoundBlueprint) {
|
|
2691
|
-
const wrapper = require_errors.safeIndex(first.blueprints, 0, "intersect2D");
|
|
2692
|
-
const cuts = first.blueprints.slice(1);
|
|
2693
|
-
if (cuts.length === 0) return intersect2D(wrapper, second);
|
|
2694
|
-
let result = intersect2D(wrapper, second);
|
|
2695
|
-
for (const cut of cuts) result = cut2D(result, cut);
|
|
2696
|
-
return result;
|
|
2697
|
-
}
|
|
2698
|
-
if (second instanceof Blueprints) return mergeNonIntersecting(second.blueprints.map((bp) => intersect2D(first, bp)));
|
|
2699
|
-
if (second instanceof CompoundBlueprint) {
|
|
2700
|
-
const wrapper = require_errors.safeIndex(second.blueprints, 0, "intersect2D");
|
|
2701
|
-
const cuts = second.blueprints.slice(1);
|
|
2702
|
-
if (cuts.length === 0) return intersect2D(wrapper, first);
|
|
2703
|
-
let result = intersect2D(wrapper, first);
|
|
2704
|
-
for (const cut of cuts) result = cut2D(result, cut);
|
|
2705
|
-
return result;
|
|
2706
|
-
}
|
|
2707
|
-
require_errors.bug("intersect2D", "Unhandled Shape2D combination");
|
|
2708
|
-
}
|
|
2709
|
-
//#endregion
|
|
2710
1464
|
Object.defineProperty(exports, "BaseSketcher2d", {
|
|
2711
1465
|
enumerable: true,
|
|
2712
1466
|
get: function() {
|
|
@@ -2731,90 +1485,30 @@ Object.defineProperty(exports, "CompoundBlueprint", {
|
|
|
2731
1485
|
return CompoundBlueprint;
|
|
2732
1486
|
}
|
|
2733
1487
|
});
|
|
2734
|
-
Object.defineProperty(exports, "FaceSketcher", {
|
|
2735
|
-
enumerable: true,
|
|
2736
|
-
get: function() {
|
|
2737
|
-
return FaceSketcher;
|
|
2738
|
-
}
|
|
2739
|
-
});
|
|
2740
1488
|
Object.defineProperty(exports, "Flatbush", {
|
|
2741
1489
|
enumerable: true,
|
|
2742
1490
|
get: function() {
|
|
2743
1491
|
return Flatbush;
|
|
2744
1492
|
}
|
|
2745
1493
|
});
|
|
2746
|
-
Object.defineProperty(exports, "Sketch", {
|
|
2747
|
-
enumerable: true,
|
|
2748
|
-
get: function() {
|
|
2749
|
-
return Sketch;
|
|
2750
|
-
}
|
|
2751
|
-
});
|
|
2752
1494
|
Object.defineProperty(exports, "chamferCurves", {
|
|
2753
1495
|
enumerable: true,
|
|
2754
1496
|
get: function() {
|
|
2755
1497
|
return chamferCurves;
|
|
2756
1498
|
}
|
|
2757
1499
|
});
|
|
2758
|
-
Object.defineProperty(exports, "cut2D", {
|
|
2759
|
-
enumerable: true,
|
|
2760
|
-
get: function() {
|
|
2761
|
-
return cut2D;
|
|
2762
|
-
}
|
|
2763
|
-
});
|
|
2764
|
-
Object.defineProperty(exports, "cutBlueprints", {
|
|
2765
|
-
enumerable: true,
|
|
2766
|
-
get: function() {
|
|
2767
|
-
return cutBlueprints;
|
|
2768
|
-
}
|
|
2769
|
-
});
|
|
2770
1500
|
Object.defineProperty(exports, "filletCurves", {
|
|
2771
1501
|
enumerable: true,
|
|
2772
1502
|
get: function() {
|
|
2773
1503
|
return filletCurves;
|
|
2774
1504
|
}
|
|
2775
1505
|
});
|
|
2776
|
-
Object.defineProperty(exports, "fuse2D", {
|
|
2777
|
-
enumerable: true,
|
|
2778
|
-
get: function() {
|
|
2779
|
-
return fuse2D;
|
|
2780
|
-
}
|
|
2781
|
-
});
|
|
2782
|
-
Object.defineProperty(exports, "fuseBlueprints", {
|
|
2783
|
-
enumerable: true,
|
|
2784
|
-
get: function() {
|
|
2785
|
-
return fuseBlueprints;
|
|
2786
|
-
}
|
|
2787
|
-
});
|
|
2788
|
-
Object.defineProperty(exports, "intersect2D", {
|
|
2789
|
-
enumerable: true,
|
|
2790
|
-
get: function() {
|
|
2791
|
-
return intersect2D;
|
|
2792
|
-
}
|
|
2793
|
-
});
|
|
2794
|
-
Object.defineProperty(exports, "intersectBlueprints", {
|
|
2795
|
-
enumerable: true,
|
|
2796
|
-
get: function() {
|
|
2797
|
-
return intersectBlueprints;
|
|
2798
|
-
}
|
|
2799
|
-
});
|
|
2800
1506
|
Object.defineProperty(exports, "intersectCurves", {
|
|
2801
1507
|
enumerable: true,
|
|
2802
1508
|
get: function() {
|
|
2803
1509
|
return intersectCurves;
|
|
2804
1510
|
}
|
|
2805
1511
|
});
|
|
2806
|
-
Object.defineProperty(exports, "loft", {
|
|
2807
|
-
enumerable: true,
|
|
2808
|
-
get: function() {
|
|
2809
|
-
return loft;
|
|
2810
|
-
}
|
|
2811
|
-
});
|
|
2812
|
-
Object.defineProperty(exports, "loftAll", {
|
|
2813
|
-
enumerable: true,
|
|
2814
|
-
get: function() {
|
|
2815
|
-
return loftAll;
|
|
2816
|
-
}
|
|
2817
|
-
});
|
|
2818
1512
|
Object.defineProperty(exports, "make2dOffset", {
|
|
2819
1513
|
enumerable: true,
|
|
2820
1514
|
get: function() {
|
|
@@ -2827,15 +1521,3 @@ Object.defineProperty(exports, "organiseBlueprints", {
|
|
|
2827
1521
|
return organiseBlueprints;
|
|
2828
1522
|
}
|
|
2829
1523
|
});
|
|
2830
|
-
Object.defineProperty(exports, "polysidesBlueprint", {
|
|
2831
|
-
enumerable: true,
|
|
2832
|
-
get: function() {
|
|
2833
|
-
return polysidesBlueprint;
|
|
2834
|
-
}
|
|
2835
|
-
});
|
|
2836
|
-
Object.defineProperty(exports, "roundedRectangleBlueprint", {
|
|
2837
|
-
enumerable: true,
|
|
2838
|
-
get: function() {
|
|
2839
|
-
return roundedRectangleBlueprint;
|
|
2840
|
-
}
|
|
2841
|
-
});
|