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,6 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_types = require("./types-gLi9wL0N.cjs");
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTt_LLbk.cjs");
|
|
2
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
4
3
|
//#region src/core/kernelCall.ts
|
|
5
4
|
function buildError(kind, code, message, cause, suggestion) {
|
|
6
5
|
const base = {
|
|
@@ -91,89 +90,6 @@ function kernelCallScoped(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
//#endregion
|
|
94
|
-
//#region src/topology/cast.ts
|
|
95
|
-
var TOPO_ENUM = {
|
|
96
|
-
compound: 0,
|
|
97
|
-
solidCompound: 1,
|
|
98
|
-
solid: 2,
|
|
99
|
-
shell: 3,
|
|
100
|
-
face: 4,
|
|
101
|
-
wire: 5,
|
|
102
|
-
edge: 6,
|
|
103
|
-
vertex: 7,
|
|
104
|
-
shape: 8
|
|
105
|
-
};
|
|
106
|
-
/** Convert a TopoEntity string to its kernel TopAbs_ShapeEnum value. */
|
|
107
|
-
var asTopo = (entity) => {
|
|
108
|
-
return TOPO_ENUM[entity];
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Iterate over all sub-shapes of a given type within a shape.
|
|
112
|
-
*
|
|
113
|
-
* @remarks Uses the kernel adapter's iterShapes rather than direct TopExp_Explorer.
|
|
114
|
-
*/
|
|
115
|
-
var TOPO_TO_SHAPE_TYPE = {
|
|
116
|
-
vertex: "vertex",
|
|
117
|
-
edge: "edge",
|
|
118
|
-
wire: "wire",
|
|
119
|
-
face: "face",
|
|
120
|
-
shell: "shell",
|
|
121
|
-
solid: "solid",
|
|
122
|
-
solidCompound: "compsolid",
|
|
123
|
-
compound: "compound",
|
|
124
|
-
shape: "compound"
|
|
125
|
-
};
|
|
126
|
-
var iterTopo = function* iterTopo(shape, topo) {
|
|
127
|
-
const shapeType = TOPO_TO_SHAPE_TYPE[topo];
|
|
128
|
-
if (shapeType) {
|
|
129
|
-
const shapes = require_shapeTypes.getKernel().iterShapes(shape, shapeType);
|
|
130
|
-
for (const s of shapes) yield s;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
/** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
|
|
134
|
-
var shapeType = (shape) => {
|
|
135
|
-
if (require_shapeTypes.getKernel().isNull(shape)) return require_errors.err(require_errors.typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
|
|
136
|
-
return require_errors.ok(shape.ShapeType());
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Downcast a generic KernelShape to its concrete kernel type (e.g., kernel topology_Face).
|
|
140
|
-
*
|
|
141
|
-
* @remarks Uses the kernel adapter's downcast method.
|
|
142
|
-
* @returns Ok with the downcasted shape, or Err if the shape type is unknown.
|
|
143
|
-
*/
|
|
144
|
-
function downcast(shape) {
|
|
145
|
-
if (require_shapeTypes.getKernel().isNull(shape)) return require_errors.err(require_errors.typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
|
|
146
|
-
try {
|
|
147
|
-
return require_errors.ok(require_shapeTypes.getKernel().downcast(shape));
|
|
148
|
-
} catch {
|
|
149
|
-
return require_errors.err(require_errors.typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Cast a raw kernel shape to its corresponding branded brepjs type (Vertex, Edge, Face, etc.).
|
|
154
|
-
*
|
|
155
|
-
* Performs downcast + branded handle creation in one step.
|
|
156
|
-
*
|
|
157
|
-
* @returns Ok with a typed AnyShape, or Err if the shape type is unknown.
|
|
158
|
-
*/
|
|
159
|
-
function cast(shape) {
|
|
160
|
-
if (require_shapeTypes.getKernel().isNull(shape)) return require_errors.err(require_errors.typeCastError("NULL_SHAPE", "Cannot cast a null shape"));
|
|
161
|
-
return require_errors.ok(require_shapeTypes.castShape(shape));
|
|
162
|
-
}
|
|
163
|
-
/** Type guard: return true if the shape is a CompSolid. */
|
|
164
|
-
function isCompSolid(shape) {
|
|
165
|
-
return require_shapeTypes.getKernel().shapeType(shape.wrapped) === "compsolid";
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Deserialize a shape from a BREP string representation.
|
|
169
|
-
*
|
|
170
|
-
* @param data - BREP string produced by toBREP().
|
|
171
|
-
* @returns Ok with the deserialized shape, or Err if parsing fails.
|
|
172
|
-
*/
|
|
173
|
-
function fromBREP(data) {
|
|
174
|
-
return cast(require_shapeTypes.getKernel().fromBREP(data));
|
|
175
|
-
}
|
|
176
|
-
//#endregion
|
|
177
93
|
//#region src/topology/topologyQueryFns.ts
|
|
178
94
|
/**
|
|
179
95
|
* Topology query functions — extract sub-shapes, compute bounds, and
|
|
@@ -317,196 +233,12 @@ function vertexPosition(vertex) {
|
|
|
317
233
|
return require_shapeTypes.getKernel().vertexPosition(vertex.wrapped);
|
|
318
234
|
}
|
|
319
235
|
//#endregion
|
|
320
|
-
//#region src/topology/faceFns.ts
|
|
321
|
-
/**
|
|
322
|
-
* Face-specific functions — functional replacements for Face class methods.
|
|
323
|
-
* All functions accept branded Face handles and return plain values or branded shapes.
|
|
324
|
-
*/
|
|
325
|
-
/** Map kernel surface type strings to the public API surface type constants. */
|
|
326
|
-
var KERNEL_TO_PUBLIC_SURFACE_TYPE = {
|
|
327
|
-
plane: "PLANE",
|
|
328
|
-
cylinder: "CYLINDRE",
|
|
329
|
-
cone: "CONE",
|
|
330
|
-
sphere: "SPHERE",
|
|
331
|
-
torus: "TORUS",
|
|
332
|
-
bezier: "BEZIER_SURFACE",
|
|
333
|
-
bspline: "BSPLINE_SURFACE",
|
|
334
|
-
revolution: "REVOLUTION_SURFACE",
|
|
335
|
-
extrusion: "EXTRUSION_SURFACE",
|
|
336
|
-
offset: "OFFSET_SURFACE",
|
|
337
|
-
other: "OTHER_SURFACE"
|
|
338
|
-
};
|
|
339
|
-
/**
|
|
340
|
-
* Get the geometric surface type of a face.
|
|
341
|
-
*
|
|
342
|
-
* @returns Ok with the surface type, or Err for unrecognized kernel surface types.
|
|
343
|
-
*/
|
|
344
|
-
function getSurfaceType(face) {
|
|
345
|
-
return require_errors.ok(KERNEL_TO_PUBLIC_SURFACE_TYPE[getCachedSurfaceType(face)]);
|
|
346
|
-
}
|
|
347
|
-
/** Get the surface type of a face (unwrapped convenience). */
|
|
348
|
-
function faceGeomType(face) {
|
|
349
|
-
return require_errors.unwrap(getSurfaceType(face));
|
|
350
|
-
}
|
|
351
|
-
/** Get the topological orientation of a face. */
|
|
352
|
-
function faceOrientation(face) {
|
|
353
|
-
return require_shapeTypes.getKernel().shapeOrientation(face.wrapped) === "forward" ? "forward" : "backward";
|
|
354
|
-
}
|
|
355
|
-
/** Flip the orientation of a face. Returns a new face. */
|
|
356
|
-
function flipFaceOrientation(face) {
|
|
357
|
-
return require_shapeTypes.castShape(require_shapeTypes.getKernel().reverseShape(face.wrapped));
|
|
358
|
-
}
|
|
359
|
-
/** Get the UV parameter bounds of a face. */
|
|
360
|
-
function uvBounds(face) {
|
|
361
|
-
return require_shapeTypes.getKernel().uvBounds(face.wrapped);
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Get a point on a face surface at normalized UV coordinates (0-1 range).
|
|
365
|
-
*
|
|
366
|
-
* @param face - The face to evaluate.
|
|
367
|
-
* @param u - Normalized U parameter (0-1).
|
|
368
|
-
* @param v - Normalized V parameter (0-1).
|
|
369
|
-
*/
|
|
370
|
-
function pointOnSurface(face, u, v) {
|
|
371
|
-
const bounds = uvBounds(face);
|
|
372
|
-
const absU = u * (bounds.uMax - bounds.uMin) + bounds.uMin;
|
|
373
|
-
const absV = v * (bounds.vMax - bounds.vMin) + bounds.vMin;
|
|
374
|
-
return require_shapeTypes.getKernel().pointOnSurface(face.wrapped, absU, absV);
|
|
375
|
-
}
|
|
376
|
-
/** Get the UV coordinates on a face for a given 3D point. */
|
|
377
|
-
function uvCoordinates(face, point) {
|
|
378
|
-
const v = require_types.toVec3(point);
|
|
379
|
-
const result = require_shapeTypes.getKernel().uvFromPoint(face.wrapped, v);
|
|
380
|
-
if (!result) return [0, 0];
|
|
381
|
-
return result;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Project a 3D point onto a face surface.
|
|
385
|
-
*
|
|
386
|
-
* Returns the projected point, its UV coordinates, and the distance
|
|
387
|
-
* from the original point to the surface.
|
|
388
|
-
*/
|
|
389
|
-
function projectPointOnFace(face, point) {
|
|
390
|
-
const v = require_types.toVec3(point);
|
|
391
|
-
try {
|
|
392
|
-
const vMut = v;
|
|
393
|
-
const uvResult = require_shapeTypes.getKernel().uvFromPoint(face.wrapped, vMut);
|
|
394
|
-
if (!uvResult) return require_errors.err(require_errors.typeCastError("PROJECTION_FAILED", "No projection found on the face"));
|
|
395
|
-
const projectedPoint = require_shapeTypes.getKernel().projectPointOnFace(face.wrapped, vMut);
|
|
396
|
-
const dx = v[0] - projectedPoint[0];
|
|
397
|
-
const dy = v[1] - projectedPoint[1];
|
|
398
|
-
const dz = v[2] - projectedPoint[2];
|
|
399
|
-
return require_errors.ok({
|
|
400
|
-
uv: uvResult,
|
|
401
|
-
point: projectedPoint,
|
|
402
|
-
distance: Math.sqrt(dx * dx + dy * dy + dz * dz)
|
|
403
|
-
});
|
|
404
|
-
} catch (e) {
|
|
405
|
-
return require_errors.err(require_errors.typeCastError("PROJECTION_FAILED", `Point projection failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
/** Get the surface normal at a point (or at the center if no point given). */
|
|
409
|
-
function normalAt(face, locationPoint) {
|
|
410
|
-
let u;
|
|
411
|
-
let v;
|
|
412
|
-
if (!locationPoint) {
|
|
413
|
-
const bounds = uvBounds(face);
|
|
414
|
-
u = .5 * (bounds.uMin + bounds.uMax);
|
|
415
|
-
v = .5 * (bounds.vMin + bounds.vMax);
|
|
416
|
-
} else [u, v] = uvCoordinates(face, locationPoint);
|
|
417
|
-
return require_shapeTypes.getKernel().surfaceNormal(face.wrapped, u, v);
|
|
418
|
-
}
|
|
419
|
-
/** Get the center of mass of a face. */
|
|
420
|
-
function faceCenter(face) {
|
|
421
|
-
return require_shapeTypes.getKernel().surfaceCenterOfMass(face.wrapped);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Classify a 3D point's position relative to a face boundary.
|
|
425
|
-
* Projects the point onto the face's surface and classifies the UV result.
|
|
426
|
-
*
|
|
427
|
-
* @returns 'in' if inside, 'on' if on the boundary, 'out' if outside
|
|
428
|
-
*/
|
|
429
|
-
function classifyPointOnFace(face, point, tolerance = 1e-6) {
|
|
430
|
-
const [u, v] = uvCoordinates(face, point);
|
|
431
|
-
return require_shapeTypes.getKernel().classifyPointOnFace(face.wrapped, u, v, tolerance);
|
|
432
|
-
}
|
|
433
|
-
/** Get the outer wire of a face. The outer boundary of a face is always closed. */
|
|
434
|
-
function outerWire(face) {
|
|
435
|
-
return require_shapeTypes.castShape(require_shapeTypes.getKernel().outerWire(face.wrapped));
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Remove all holes (inner wires) from a face, returning a new face with only the outer boundary.
|
|
439
|
-
* Useful for defeaturing workflows where holes need to be temporarily or permanently filled.
|
|
440
|
-
*/
|
|
441
|
-
function removeHolesFromFace(face) {
|
|
442
|
-
return require_shapeTypes.castShape(require_shapeTypes.getKernel().removeHolesFromFace(face.wrapped));
|
|
443
|
-
}
|
|
444
|
-
/** Get the inner wires (holes) of a face. Hole boundaries are always closed. */
|
|
445
|
-
function innerWires(face) {
|
|
446
|
-
const outer = outerWire(face);
|
|
447
|
-
return Array.from(iterTopo(face.wrapped, "wire")).map((w) => require_shapeTypes.castShape(require_errors.unwrap(downcast(w)))).filter((w) => !require_shapeTypes.getKernel().isSame(w.wrapped, outer.wrapped));
|
|
448
|
-
}
|
|
449
|
-
//#endregion
|
|
450
|
-
Object.defineProperty(exports, "asTopo", {
|
|
451
|
-
enumerable: true,
|
|
452
|
-
get: function() {
|
|
453
|
-
return asTopo;
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
Object.defineProperty(exports, "cast", {
|
|
457
|
-
enumerable: true,
|
|
458
|
-
get: function() {
|
|
459
|
-
return cast;
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
Object.defineProperty(exports, "classifyPointOnFace", {
|
|
463
|
-
enumerable: true,
|
|
464
|
-
get: function() {
|
|
465
|
-
return classifyPointOnFace;
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
236
|
Object.defineProperty(exports, "describe", {
|
|
469
237
|
enumerable: true,
|
|
470
238
|
get: function() {
|
|
471
239
|
return describe;
|
|
472
240
|
}
|
|
473
241
|
});
|
|
474
|
-
Object.defineProperty(exports, "downcast", {
|
|
475
|
-
enumerable: true,
|
|
476
|
-
get: function() {
|
|
477
|
-
return downcast;
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
Object.defineProperty(exports, "faceCenter", {
|
|
481
|
-
enumerable: true,
|
|
482
|
-
get: function() {
|
|
483
|
-
return faceCenter;
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
Object.defineProperty(exports, "faceGeomType", {
|
|
487
|
-
enumerable: true,
|
|
488
|
-
get: function() {
|
|
489
|
-
return faceGeomType;
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
Object.defineProperty(exports, "faceOrientation", {
|
|
493
|
-
enumerable: true,
|
|
494
|
-
get: function() {
|
|
495
|
-
return faceOrientation;
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
Object.defineProperty(exports, "flipFaceOrientation", {
|
|
499
|
-
enumerable: true,
|
|
500
|
-
get: function() {
|
|
501
|
-
return flipFaceOrientation;
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
Object.defineProperty(exports, "fromBREP", {
|
|
505
|
-
enumerable: true,
|
|
506
|
-
get: function() {
|
|
507
|
-
return fromBREP;
|
|
508
|
-
}
|
|
509
|
-
});
|
|
510
242
|
Object.defineProperty(exports, "getBounds", {
|
|
511
243
|
enumerable: true,
|
|
512
244
|
get: function() {
|
|
@@ -549,12 +281,6 @@ Object.defineProperty(exports, "getOrCreateCache", {
|
|
|
549
281
|
return getOrCreateCache;
|
|
550
282
|
}
|
|
551
283
|
});
|
|
552
|
-
Object.defineProperty(exports, "getSurfaceType", {
|
|
553
|
-
enumerable: true,
|
|
554
|
-
get: function() {
|
|
555
|
-
return getSurfaceType;
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
284
|
Object.defineProperty(exports, "getVertices", {
|
|
559
285
|
enumerable: true,
|
|
560
286
|
get: function() {
|
|
@@ -567,24 +293,12 @@ Object.defineProperty(exports, "getWires", {
|
|
|
567
293
|
return getWires;
|
|
568
294
|
}
|
|
569
295
|
});
|
|
570
|
-
Object.defineProperty(exports, "innerWires", {
|
|
571
|
-
enumerable: true,
|
|
572
|
-
get: function() {
|
|
573
|
-
return innerWires;
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
296
|
Object.defineProperty(exports, "invalidateShapeCache", {
|
|
577
297
|
enumerable: true,
|
|
578
298
|
get: function() {
|
|
579
299
|
return invalidateShapeCache;
|
|
580
300
|
}
|
|
581
301
|
});
|
|
582
|
-
Object.defineProperty(exports, "isCompSolid", {
|
|
583
|
-
enumerable: true,
|
|
584
|
-
get: function() {
|
|
585
|
-
return isCompSolid;
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
302
|
Object.defineProperty(exports, "iterEdges", {
|
|
589
303
|
enumerable: true,
|
|
590
304
|
get: function() {
|
|
@@ -597,12 +311,6 @@ Object.defineProperty(exports, "iterFaces", {
|
|
|
597
311
|
return iterFaces;
|
|
598
312
|
}
|
|
599
313
|
});
|
|
600
|
-
Object.defineProperty(exports, "iterTopo", {
|
|
601
|
-
enumerable: true,
|
|
602
|
-
get: function() {
|
|
603
|
-
return iterTopo;
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
314
|
Object.defineProperty(exports, "iterVertices", {
|
|
607
315
|
enumerable: true,
|
|
608
316
|
get: function() {
|
|
@@ -633,54 +341,6 @@ Object.defineProperty(exports, "kernelCallScoped", {
|
|
|
633
341
|
return kernelCallScoped;
|
|
634
342
|
}
|
|
635
343
|
});
|
|
636
|
-
Object.defineProperty(exports, "normalAt", {
|
|
637
|
-
enumerable: true,
|
|
638
|
-
get: function() {
|
|
639
|
-
return normalAt;
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
Object.defineProperty(exports, "outerWire", {
|
|
643
|
-
enumerable: true,
|
|
644
|
-
get: function() {
|
|
645
|
-
return outerWire;
|
|
646
|
-
}
|
|
647
|
-
});
|
|
648
|
-
Object.defineProperty(exports, "pointOnSurface", {
|
|
649
|
-
enumerable: true,
|
|
650
|
-
get: function() {
|
|
651
|
-
return pointOnSurface;
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
Object.defineProperty(exports, "projectPointOnFace", {
|
|
655
|
-
enumerable: true,
|
|
656
|
-
get: function() {
|
|
657
|
-
return projectPointOnFace;
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
Object.defineProperty(exports, "removeHolesFromFace", {
|
|
661
|
-
enumerable: true,
|
|
662
|
-
get: function() {
|
|
663
|
-
return removeHolesFromFace;
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
Object.defineProperty(exports, "shapeType", {
|
|
667
|
-
enumerable: true,
|
|
668
|
-
get: function() {
|
|
669
|
-
return shapeType;
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
Object.defineProperty(exports, "uvBounds", {
|
|
673
|
-
enumerable: true,
|
|
674
|
-
get: function() {
|
|
675
|
-
return uvBounds;
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
Object.defineProperty(exports, "uvCoordinates", {
|
|
679
|
-
enumerable: true,
|
|
680
|
-
get: function() {
|
|
681
|
-
return uvCoordinates;
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
344
|
Object.defineProperty(exports, "vertexPosition", {
|
|
685
345
|
enumerable: true,
|
|
686
346
|
get: function() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { N as getOrQueryType, R as DisposalScope, X as getKernel, Y as _usingCtx, r as castShapeWithKnownType, t as castShape } from "./shapeTypes-
|
|
2
|
-
import { A as ok,
|
|
3
|
-
import { r as toVec3 } from "./types--GD-LVc6.js";
|
|
1
|
+
import { N as getOrQueryType, R as DisposalScope, X as getKernel, Y as _usingCtx, r as castShapeWithKnownType, t as castShape } from "./shapeTypes-C--1jaT1.js";
|
|
2
|
+
import { A as ok, b as err, f as getSuggestionForCode, p as translateKernelError } from "./errors-0fYW_YnO.js";
|
|
4
3
|
//#region src/core/kernelCall.ts
|
|
5
4
|
function buildError(kind, code, message, cause, suggestion) {
|
|
6
5
|
const base = {
|
|
@@ -91,89 +90,6 @@ function kernelCallScoped(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
//#endregion
|
|
94
|
-
//#region src/topology/cast.ts
|
|
95
|
-
var TOPO_ENUM = {
|
|
96
|
-
compound: 0,
|
|
97
|
-
solidCompound: 1,
|
|
98
|
-
solid: 2,
|
|
99
|
-
shell: 3,
|
|
100
|
-
face: 4,
|
|
101
|
-
wire: 5,
|
|
102
|
-
edge: 6,
|
|
103
|
-
vertex: 7,
|
|
104
|
-
shape: 8
|
|
105
|
-
};
|
|
106
|
-
/** Convert a TopoEntity string to its kernel TopAbs_ShapeEnum value. */
|
|
107
|
-
var asTopo = (entity) => {
|
|
108
|
-
return TOPO_ENUM[entity];
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Iterate over all sub-shapes of a given type within a shape.
|
|
112
|
-
*
|
|
113
|
-
* @remarks Uses the kernel adapter's iterShapes rather than direct TopExp_Explorer.
|
|
114
|
-
*/
|
|
115
|
-
var TOPO_TO_SHAPE_TYPE = {
|
|
116
|
-
vertex: "vertex",
|
|
117
|
-
edge: "edge",
|
|
118
|
-
wire: "wire",
|
|
119
|
-
face: "face",
|
|
120
|
-
shell: "shell",
|
|
121
|
-
solid: "solid",
|
|
122
|
-
solidCompound: "compsolid",
|
|
123
|
-
compound: "compound",
|
|
124
|
-
shape: "compound"
|
|
125
|
-
};
|
|
126
|
-
var iterTopo = function* iterTopo(shape, topo) {
|
|
127
|
-
const shapeType = TOPO_TO_SHAPE_TYPE[topo];
|
|
128
|
-
if (shapeType) {
|
|
129
|
-
const shapes = getKernel().iterShapes(shape, shapeType);
|
|
130
|
-
for (const s of shapes) yield s;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
/** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
|
|
134
|
-
var shapeType = (shape) => {
|
|
135
|
-
if (getKernel().isNull(shape)) return err(typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
|
|
136
|
-
return ok(shape.ShapeType());
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Downcast a generic KernelShape to its concrete kernel type (e.g., kernel topology_Face).
|
|
140
|
-
*
|
|
141
|
-
* @remarks Uses the kernel adapter's downcast method.
|
|
142
|
-
* @returns Ok with the downcasted shape, or Err if the shape type is unknown.
|
|
143
|
-
*/
|
|
144
|
-
function downcast(shape) {
|
|
145
|
-
if (getKernel().isNull(shape)) return err(typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
|
|
146
|
-
try {
|
|
147
|
-
return ok(getKernel().downcast(shape));
|
|
148
|
-
} catch {
|
|
149
|
-
return err(typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Cast a raw kernel shape to its corresponding branded brepjs type (Vertex, Edge, Face, etc.).
|
|
154
|
-
*
|
|
155
|
-
* Performs downcast + branded handle creation in one step.
|
|
156
|
-
*
|
|
157
|
-
* @returns Ok with a typed AnyShape, or Err if the shape type is unknown.
|
|
158
|
-
*/
|
|
159
|
-
function cast(shape) {
|
|
160
|
-
if (getKernel().isNull(shape)) return err(typeCastError("NULL_SHAPE", "Cannot cast a null shape"));
|
|
161
|
-
return ok(castShape(shape));
|
|
162
|
-
}
|
|
163
|
-
/** Type guard: return true if the shape is a CompSolid. */
|
|
164
|
-
function isCompSolid(shape) {
|
|
165
|
-
return getKernel().shapeType(shape.wrapped) === "compsolid";
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Deserialize a shape from a BREP string representation.
|
|
169
|
-
*
|
|
170
|
-
* @param data - BREP string produced by toBREP().
|
|
171
|
-
* @returns Ok with the deserialized shape, or Err if parsing fails.
|
|
172
|
-
*/
|
|
173
|
-
function fromBREP(data) {
|
|
174
|
-
return cast(getKernel().fromBREP(data));
|
|
175
|
-
}
|
|
176
|
-
//#endregion
|
|
177
93
|
//#region src/topology/topologyQueryFns.ts
|
|
178
94
|
/**
|
|
179
95
|
* Topology query functions — extract sub-shapes, compute bounds, and
|
|
@@ -317,134 +233,4 @@ function vertexPosition(vertex) {
|
|
|
317
233
|
return getKernel().vertexPosition(vertex.wrapped);
|
|
318
234
|
}
|
|
319
235
|
//#endregion
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Face-specific functions — functional replacements for Face class methods.
|
|
323
|
-
* All functions accept branded Face handles and return plain values or branded shapes.
|
|
324
|
-
*/
|
|
325
|
-
/** Map kernel surface type strings to the public API surface type constants. */
|
|
326
|
-
var KERNEL_TO_PUBLIC_SURFACE_TYPE = {
|
|
327
|
-
plane: "PLANE",
|
|
328
|
-
cylinder: "CYLINDRE",
|
|
329
|
-
cone: "CONE",
|
|
330
|
-
sphere: "SPHERE",
|
|
331
|
-
torus: "TORUS",
|
|
332
|
-
bezier: "BEZIER_SURFACE",
|
|
333
|
-
bspline: "BSPLINE_SURFACE",
|
|
334
|
-
revolution: "REVOLUTION_SURFACE",
|
|
335
|
-
extrusion: "EXTRUSION_SURFACE",
|
|
336
|
-
offset: "OFFSET_SURFACE",
|
|
337
|
-
other: "OTHER_SURFACE"
|
|
338
|
-
};
|
|
339
|
-
/**
|
|
340
|
-
* Get the geometric surface type of a face.
|
|
341
|
-
*
|
|
342
|
-
* @returns Ok with the surface type, or Err for unrecognized kernel surface types.
|
|
343
|
-
*/
|
|
344
|
-
function getSurfaceType(face) {
|
|
345
|
-
return ok(KERNEL_TO_PUBLIC_SURFACE_TYPE[getCachedSurfaceType(face)]);
|
|
346
|
-
}
|
|
347
|
-
/** Get the surface type of a face (unwrapped convenience). */
|
|
348
|
-
function faceGeomType(face) {
|
|
349
|
-
return unwrap(getSurfaceType(face));
|
|
350
|
-
}
|
|
351
|
-
/** Get the topological orientation of a face. */
|
|
352
|
-
function faceOrientation(face) {
|
|
353
|
-
return getKernel().shapeOrientation(face.wrapped) === "forward" ? "forward" : "backward";
|
|
354
|
-
}
|
|
355
|
-
/** Flip the orientation of a face. Returns a new face. */
|
|
356
|
-
function flipFaceOrientation(face) {
|
|
357
|
-
return castShape(getKernel().reverseShape(face.wrapped));
|
|
358
|
-
}
|
|
359
|
-
/** Get the UV parameter bounds of a face. */
|
|
360
|
-
function uvBounds(face) {
|
|
361
|
-
return getKernel().uvBounds(face.wrapped);
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Get a point on a face surface at normalized UV coordinates (0-1 range).
|
|
365
|
-
*
|
|
366
|
-
* @param face - The face to evaluate.
|
|
367
|
-
* @param u - Normalized U parameter (0-1).
|
|
368
|
-
* @param v - Normalized V parameter (0-1).
|
|
369
|
-
*/
|
|
370
|
-
function pointOnSurface(face, u, v) {
|
|
371
|
-
const bounds = uvBounds(face);
|
|
372
|
-
const absU = u * (bounds.uMax - bounds.uMin) + bounds.uMin;
|
|
373
|
-
const absV = v * (bounds.vMax - bounds.vMin) + bounds.vMin;
|
|
374
|
-
return getKernel().pointOnSurface(face.wrapped, absU, absV);
|
|
375
|
-
}
|
|
376
|
-
/** Get the UV coordinates on a face for a given 3D point. */
|
|
377
|
-
function uvCoordinates(face, point) {
|
|
378
|
-
const v = toVec3(point);
|
|
379
|
-
const result = getKernel().uvFromPoint(face.wrapped, v);
|
|
380
|
-
if (!result) return [0, 0];
|
|
381
|
-
return result;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Project a 3D point onto a face surface.
|
|
385
|
-
*
|
|
386
|
-
* Returns the projected point, its UV coordinates, and the distance
|
|
387
|
-
* from the original point to the surface.
|
|
388
|
-
*/
|
|
389
|
-
function projectPointOnFace(face, point) {
|
|
390
|
-
const v = toVec3(point);
|
|
391
|
-
try {
|
|
392
|
-
const vMut = v;
|
|
393
|
-
const uvResult = getKernel().uvFromPoint(face.wrapped, vMut);
|
|
394
|
-
if (!uvResult) return err(typeCastError("PROJECTION_FAILED", "No projection found on the face"));
|
|
395
|
-
const projectedPoint = getKernel().projectPointOnFace(face.wrapped, vMut);
|
|
396
|
-
const dx = v[0] - projectedPoint[0];
|
|
397
|
-
const dy = v[1] - projectedPoint[1];
|
|
398
|
-
const dz = v[2] - projectedPoint[2];
|
|
399
|
-
return ok({
|
|
400
|
-
uv: uvResult,
|
|
401
|
-
point: projectedPoint,
|
|
402
|
-
distance: Math.sqrt(dx * dx + dy * dy + dz * dz)
|
|
403
|
-
});
|
|
404
|
-
} catch (e) {
|
|
405
|
-
return err(typeCastError("PROJECTION_FAILED", `Point projection failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
/** Get the surface normal at a point (or at the center if no point given). */
|
|
409
|
-
function normalAt(face, locationPoint) {
|
|
410
|
-
let u;
|
|
411
|
-
let v;
|
|
412
|
-
if (!locationPoint) {
|
|
413
|
-
const bounds = uvBounds(face);
|
|
414
|
-
u = .5 * (bounds.uMin + bounds.uMax);
|
|
415
|
-
v = .5 * (bounds.vMin + bounds.vMax);
|
|
416
|
-
} else [u, v] = uvCoordinates(face, locationPoint);
|
|
417
|
-
return getKernel().surfaceNormal(face.wrapped, u, v);
|
|
418
|
-
}
|
|
419
|
-
/** Get the center of mass of a face. */
|
|
420
|
-
function faceCenter(face) {
|
|
421
|
-
return getKernel().surfaceCenterOfMass(face.wrapped);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Classify a 3D point's position relative to a face boundary.
|
|
425
|
-
* Projects the point onto the face's surface and classifies the UV result.
|
|
426
|
-
*
|
|
427
|
-
* @returns 'in' if inside, 'on' if on the boundary, 'out' if outside
|
|
428
|
-
*/
|
|
429
|
-
function classifyPointOnFace(face, point, tolerance = 1e-6) {
|
|
430
|
-
const [u, v] = uvCoordinates(face, point);
|
|
431
|
-
return getKernel().classifyPointOnFace(face.wrapped, u, v, tolerance);
|
|
432
|
-
}
|
|
433
|
-
/** Get the outer wire of a face. The outer boundary of a face is always closed. */
|
|
434
|
-
function outerWire(face) {
|
|
435
|
-
return castShape(getKernel().outerWire(face.wrapped));
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Remove all holes (inner wires) from a face, returning a new face with only the outer boundary.
|
|
439
|
-
* Useful for defeaturing workflows where holes need to be temporarily or permanently filled.
|
|
440
|
-
*/
|
|
441
|
-
function removeHolesFromFace(face) {
|
|
442
|
-
return castShape(getKernel().removeHolesFromFace(face.wrapped));
|
|
443
|
-
}
|
|
444
|
-
/** Get the inner wires (holes) of a face. Hole boundaries are always closed. */
|
|
445
|
-
function innerWires(face) {
|
|
446
|
-
const outer = outerWire(face);
|
|
447
|
-
return Array.from(iterTopo(face.wrapped, "wire")).map((w) => castShape(unwrap(downcast(w)))).filter((w) => !getKernel().isSame(w.wrapped, outer.wrapped));
|
|
448
|
-
}
|
|
449
|
-
//#endregion
|
|
450
|
-
export { vertexPosition as A, kernelCallScoped as B, getVertices as C, iterFaces as D, iterEdges as E, isCompSolid as F, iterTopo as I, shapeType as L, cast as M, downcast as N, iterVertices as O, fromBREP as P, kernelCall as R, getOrCreateCache as S, invalidateShapeCache as T, getCacheEntry as _, flipFaceOrientation as a, getEdges as b, normalAt as c, projectPointOnFace as d, removeHolesFromFace as f, getBounds as g, describe as h, faceOrientation as i, asTopo as j, iterWires as k, outerWire as l, uvCoordinates as m, faceCenter as n, getSurfaceType as o, uvBounds as p, faceGeomType as r, innerWires as s, classifyPointOnFace as t, pointOnSurface as u, getCachedIsValid as v, getWires as w, getFaces as x, getCachedSurfaceType as y, kernelCallRaw as z };
|
|
236
|
+
export { kernelCall as _, getCachedSurfaceType as a, getOrCreateCache as c, invalidateShapeCache as d, iterEdges as f, vertexPosition as g, iterWires as h, getCachedIsValid as i, getVertices as l, iterVertices as m, getBounds as n, getEdges as o, iterFaces as p, getCacheEntry as r, getFaces as s, describe as t, getWires as u, kernelCallRaw as v, kernelCallScoped as y };
|
|
@@ -9,4 +9,3 @@ export declare function getAtOrThrow<T>(arr: readonly T[], index: number, msg?:
|
|
|
9
9
|
export declare function firstOrThrow<T>(arr: readonly T[], msg?: string): T;
|
|
10
10
|
/** Get the last element of a non-empty array, throwing if empty. */
|
|
11
11
|
export declare function lastOrThrow<T>(arr: readonly T[], msg?: string): T;
|
|
12
|
-
//# sourceMappingURL=arrayAccess.d.ts.map
|
package/dist/utils/bug.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export default function precisionRound(number: number, precision: number): numbe
|
|
|
8
8
|
export declare function round2(v: number): number;
|
|
9
9
|
/** Round a number to 5 decimal places. */
|
|
10
10
|
export declare function round5(v: number): number;
|
|
11
|
-
//# sourceMappingURL=precisionRound.d.ts.map
|
package/dist/utils/range.d.ts
CHANGED
package/dist/utils/uuid.d.ts
CHANGED
package/dist/utils/vec2d.d.ts
CHANGED
package/dist/utils/vec3.d.ts
CHANGED
|
@@ -21,4 +21,11 @@ export type Vec3 = readonly [number, number, number];
|
|
|
21
21
|
* Equivalent to `arr[i]!` but typed as `T` directly — no eslint-disable needed.
|
|
22
22
|
*/
|
|
23
23
|
export declare function wasmIndex<T>(arr: ArrayLike<T>, i: number): T;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Extract a 3-element tuple from a numeric array starting at `offset`.
|
|
26
|
+
* Equivalent to `[arr[offset]!, arr[offset+1]!, arr[offset+2]!]` but typed
|
|
27
|
+
* as `[T, T, T]` so no eslint-disable comments are needed at the call site.
|
|
28
|
+
*
|
|
29
|
+
* Common use cases: WASM result buffers (xyz, bbox min/max, witness points).
|
|
30
|
+
*/
|
|
31
|
+
export declare function vec3At<T>(arr: ArrayLike<T>, offset?: number): [T, T, T];
|
package/dist/utils/zip.d.ts
CHANGED