brepjs 12.8.2 → 12.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/blueprints/{approximations.d.ts → blueprintApproximations.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintApproximations.d.ts.map +1 -0
- package/dist/2d/blueprints/{customCorners.d.ts → blueprintCustomCorners.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +1 -0
- package/dist/2d/blueprints/blueprintFns.d.ts +17 -3
- package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
- package/dist/2d/blueprints/{offset.d.ts → blueprintOffset.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintOffset.d.ts.map +1 -0
- package/dist/2d/blueprints/index.d.ts +4 -4
- package/dist/2d/blueprints/index.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts +1 -1
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d/lib/vectorOperations.d.ts +4 -1
- package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
- package/dist/2d-CzEysb7A.js +108 -0
- package/dist/2d-DCxS_sb_.cjs +107 -0
- package/dist/2d.cjs +24 -88
- package/dist/2d.d.ts +1 -1
- package/dist/2d.js +34 -99
- package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-BoC0DsDm.cjs} +15 -45
- package/dist/{Blueprint-DbVaf6k7.js → Blueprint-CQNRtmYG.js} +33 -63
- package/dist/{boolean2D-y3E92F0u.js → boolean2D-DXAt4GAK.js} +132 -62
- package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-N9Pgumgg.cjs} +112 -42
- package/dist/{booleanFns-BCTjYZAg.js → booleanFns-BXV7Oh0h.js} +53 -50
- package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-CxArUj_q.cjs} +43 -40
- package/dist/brepjs.cjs +448 -379
- package/dist/brepjs.js +1634 -1563
- package/dist/core/dimensionTypes.d.ts +52 -0
- package/dist/core/dimensionTypes.d.ts.map +1 -0
- package/dist/core/disposal.d.ts +18 -0
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +7 -8
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/kernelErrorTranslation.d.ts +15 -0
- package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
- package/dist/core/planeOps.d.ts +14 -0
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/result.d.ts +4 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +14 -146
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/{definitionMaps.d.ts → typeDiscriminants.d.ts} +5 -1
- package/dist/core/typeDiscriminants.d.ts.map +1 -0
- package/dist/core/validityTypes.d.ts +100 -0
- package/dist/core/validityTypes.d.ts.map +1 -0
- package/dist/core.cjs +52 -11
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +119 -76
- package/dist/{curveFns-BZngcnQ1.cjs → curveFns-CWZRuXQ3.cjs} +2 -2
- package/dist/{curveFns-mROFhiuG.js → curveFns-OmbtFSG8.js} +14 -14
- package/dist/{drawFns-Bwakrq7w.js → drawFns-8S0ULGRj.js} +146 -118
- package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-voV2wEp8.cjs} +153 -125
- package/dist/{faceFns-B8GnxjdY.js → faceFns-Bn2seBfp.js} +16 -24
- package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-CmIrjdt1.cjs} +2 -10
- package/dist/{helpers-X0juxnwj.js → helpers-CEn618MW.js} +89 -21
- package/dist/{helpers-C8NoT0Wu.cjs → helpers-mipaxDTy.cjs} +77 -9
- package/dist/index.d.ts +20 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/io/gltfImportFns.d.ts +18 -0
- package/dist/io/gltfImportFns.d.ts.map +1 -0
- package/dist/io/ioUtils.d.ts +16 -0
- package/dist/io/ioUtils.d.ts.map +1 -0
- package/dist/io/objImportFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
- package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/helpers.d.ts +84 -0
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
- package/dist/kernel/brepkit/internalOps.d.ts +28 -0
- package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/ioOps.d.ts +43 -0
- package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/measureOps.d.ts +30 -0
- package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/meshOps.d.ts +7 -0
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
- package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/repairOps.d.ts +14 -0
- package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
- package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
- package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/transformOps.d.ts +14 -0
- package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
- package/dist/kernel/brepkitAdapter.d.ts +1 -1
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/extendedConstructorOps.d.ts +9 -1
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
- package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/builder-ops.d.ts +57 -0
- package/dist/kernel/interfaces/builder-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/core.d.ts +30 -0
- package/dist/kernel/interfaces/core.d.ts.map +1 -0
- package/dist/kernel/interfaces/curve-ops.d.ts +41 -0
- package/dist/kernel/interfaces/curve-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/index.d.ts +37 -0
- package/dist/kernel/interfaces/index.d.ts.map +1 -0
- package/dist/kernel/interfaces/io-ops.d.ts +66 -0
- package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
- package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts +13 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
- package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/surface-ops.d.ts +50 -0
- package/dist/kernel/interfaces/surface-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
- package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/transform-ops.d.ts +35 -0
- package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
- package/dist/kernel/modifierOps.d.ts +2 -2
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +2 -446
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/measurement/measureCache.d.ts +11 -9
- package/dist/measurement/measureCache.d.ts.map +1 -1
- package/dist/measurement/measureFns.d.ts +24 -71
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/measurement/measureTypes.d.ts +30 -0
- package/dist/measurement/measureTypes.d.ts.map +1 -0
- package/dist/{measurement-D8EJ694A.js → measurement-fJWDEpz0.js} +53 -34
- package/dist/measurement-ph-kanQ7.cjs +154 -0
- package/dist/measurement.cjs +2 -1
- package/dist/measurement.d.ts +1 -1
- package/dist/measurement.d.ts.map +1 -1
- package/dist/measurement.js +4 -3
- package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-B9p4EVV8.cjs} +4 -4
- package/dist/{meshFns-nQjK38EC.js → meshFns-D0qIoxm-.js} +3 -3
- package/dist/operations/compoundOpsFns.d.ts +38 -0
- package/dist/operations/compoundOpsFns.d.ts.map +1 -0
- package/dist/operations/convexHullFns.d.ts +21 -0
- package/dist/operations/convexHullFns.d.ts.map +1 -0
- package/dist/operations/extrudeFns.d.ts +2 -93
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +3 -22
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts +3 -29
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts +2 -2
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/straightSkeleton.d.ts.map +1 -1
- package/dist/operations/sweepFns.d.ts +121 -0
- package/dist/operations/sweepFns.d.ts.map +1 -0
- package/dist/{operations-BfbkK6DU.js → operations-DX_qy_TB.js} +29 -177
- package/dist/{operations-CYpmLSC4.cjs → operations-Ds4xoyxR.cjs} +6 -154
- package/dist/operations.cjs +6 -10
- package/dist/operations.d.ts +0 -2
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +26 -30
- package/dist/originTrackingFns-BOCAMfd0.js +137 -0
- package/dist/originTrackingFns-SPU7ly3_.cjs +136 -0
- package/dist/query/edgeFinder.d.ts +4 -14
- package/dist/query/edgeFinder.d.ts.map +1 -1
- package/dist/query/faceFinder.d.ts +4 -14
- package/dist/query/faceFinder.d.ts.map +1 -1
- package/dist/query/finderCore.d.ts +6 -0
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query/shapeFinders.d.ts +32 -0
- package/dist/query/shapeFinders.d.ts.map +1 -0
- package/dist/query/wireFinder.d.ts +4 -9
- package/dist/query/wireFinder.d.ts.map +1 -1
- package/dist/query.cjs +54 -32
- package/dist/query.js +56 -34
- package/dist/{result-BaSD1fqR.js → result-CoDaWsvc.js} +48 -90
- package/dist/{result-fAX0OZzI.cjs → result-DULetAht.cjs} +17 -59
- package/dist/result.cjs +1 -1
- package/dist/result.js +23 -23
- package/dist/shapeFns-BZ6zk7nd.js +34 -0
- package/dist/shapeFns-bRkrwI8R.cjs +33 -0
- package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-T0n6mRmt.cjs} +170 -137
- package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-dhhm-T5A.js} +205 -172
- package/dist/sketching/CompoundSketch.d.ts +4 -4
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts +3 -3
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketches.d.ts +1 -1
- package/dist/sketching/Sketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts +1 -20
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching/draw3d.d.ts +22 -0
- package/dist/sketching/draw3d.d.ts.map +1 -0
- package/dist/sketching/sketchFns.d.ts +3 -3
- package/dist/sketching/sketchFns.d.ts.map +1 -1
- package/dist/sketching/sketchLib.d.ts +2 -2
- package/dist/sketching/sketchLib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.d.ts +2 -1
- package/dist/sketching.d.ts.map +1 -1
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BEAoLYvr.cjs} +3 -3
- package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-tVmD3R7Z.js} +12 -12
- package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-DYS8AMSS.cjs} +3 -3
- package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dl0ATFbO.js} +15 -15
- package/dist/sweepFns-BKnQs59A.js +215 -0
- package/dist/sweepFns-COqeYIUp.cjs +214 -0
- package/dist/text/textBlueprints.d.ts +4 -3
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +1 -5
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts +3 -35
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/curveFns.d.ts +1 -1
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +2 -3
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/{colorFns.d.ts → metadata/colorFns.d.ts} +2 -2
- package/dist/topology/metadata/colorFns.d.ts.map +1 -0
- package/dist/topology/{faceTagFns.d.ts → metadata/faceTagFns.d.ts} +2 -2
- package/dist/topology/metadata/faceTagFns.d.ts.map +1 -0
- package/dist/topology/metadata/metadataPropagation.d.ts +30 -0
- package/dist/topology/metadata/metadataPropagation.d.ts.map +1 -0
- package/dist/topology/metadata/originTrackingFns.d.ts +23 -0
- package/dist/topology/metadata/originTrackingFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +6 -120
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts +67 -0
- package/dist/topology/topologyQueryFns.d.ts.map +1 -0
- package/dist/topology/transformFns.d.ts +49 -0
- package/dist/topology/transformFns.d.ts.map +1 -0
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-C7x98OVn.js → topology-C1oUQXZS.js} +235 -50
- package/dist/{topology-ANwCzGL8.cjs → topology-xyDYbkHW.cjs} +205 -20
- package/dist/topology.cjs +18 -17
- package/dist/topology.js +97 -96
- package/dist/topologyQueryFns-0IptTUCo.cjs +118 -0
- package/dist/topologyQueryFns-Dj4Xd5kx.js +119 -0
- package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
- package/dist/utils/precisionRound.d.ts +4 -0
- package/dist/utils/precisionRound.d.ts.map +1 -1
- package/dist/utils/vec2d.d.ts +5 -0
- package/dist/utils/vec2d.d.ts.map +1 -1
- package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
- package/dist/{vectors-Bx8wkNui.js → vectors-B8juLsQB.js} +15 -7
- package/dist/{vectors-D_IiZx0q.cjs → vectors-I_0zdD3O.cjs} +9 -1
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +23 -23
- package/package.json +9 -9
- package/dist/2d/blueprints/approximations.d.ts.map +0 -1
- package/dist/2d/blueprints/customCorners.d.ts.map +0 -1
- package/dist/2d/blueprints/offset.d.ts.map +0 -1
- package/dist/core/definitionMaps.d.ts.map +0 -1
- package/dist/core/geometryHelpers.d.ts +0 -30
- package/dist/core/geometryHelpers.d.ts.map +0 -1
- package/dist/core/memory.d.ts +0 -6
- package/dist/core/memory.d.ts.map +0 -1
- package/dist/core/typeErrors.d.ts +0 -17
- package/dist/core/typeErrors.d.ts.map +0 -1
- package/dist/cornerFinder-Ckz-mPHE.js +0 -59
- package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
- package/dist/loft-Bhw-FMoL.js +0 -228
- package/dist/loft-hp3pc1M7.cjs +0 -227
- package/dist/measurement-BoNTUBAp.cjs +0 -135
- package/dist/operations/extrude.d.ts +0 -72
- package/dist/operations/extrude.d.ts.map +0 -1
- package/dist/operations/loft.d.ts +0 -33
- package/dist/operations/loft.d.ts.map +0 -1
- package/dist/shapeFns-C2SnNvdH.cjs +0 -468
- package/dist/shapeFns-FDuKkrDR.js +0 -469
- package/dist/topology/colorFns.d.ts.map +0 -1
- package/dist/topology/faceTagFns.d.ts.map +0 -1
- package/dist/utils/round2.d.ts +0 -3
- package/dist/utils/round2.d.ts.map +0 -1
- package/dist/utils/round5.d.ts +0 -3
- package/dist/utils/round5.d.ts.map +0 -1
package/dist/core.cjs
CHANGED
|
@@ -2,9 +2,50 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const result = require("./result-
|
|
6
|
-
const vectors = require("./vectors-
|
|
7
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
+
const result = require("./result-DULetAht.cjs");
|
|
6
|
+
const vectors = require("./vectors-I_0zdD3O.cjs");
|
|
7
|
+
const shapeTypes = require("./shapeTypes-T0n6mRmt.cjs");
|
|
8
|
+
function isClosedWire(wire) {
|
|
9
|
+
return shapeTypes.getKernel().curveIsClosed(wire.wrapped);
|
|
10
|
+
}
|
|
11
|
+
function isOrientedFace(face) {
|
|
12
|
+
return shapeTypes.getKernel().isValid(face.wrapped);
|
|
13
|
+
}
|
|
14
|
+
function isManifoldShell(shell) {
|
|
15
|
+
const kernel = shapeTypes.getKernel();
|
|
16
|
+
if (!kernel.isValid(shell.wrapped)) return false;
|
|
17
|
+
const validate = kernel.isValidStrict?.bind(kernel) ?? kernel.isValid.bind(kernel);
|
|
18
|
+
try {
|
|
19
|
+
const solid = kernel.solidFromShell(shell.wrapped);
|
|
20
|
+
const valid = validate(solid);
|
|
21
|
+
try {
|
|
22
|
+
kernel.dispose(solid);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
return valid;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function isValidSolid(solid) {
|
|
31
|
+
return shapeTypes.getKernel().isValid(solid.wrapped);
|
|
32
|
+
}
|
|
33
|
+
function closedWire(wire) {
|
|
34
|
+
if (isClosedWire(wire)) return result.ok(wire);
|
|
35
|
+
return result.err("Wire is not closed: start and end points do not coincide");
|
|
36
|
+
}
|
|
37
|
+
function orientedFace(face) {
|
|
38
|
+
if (isOrientedFace(face)) return result.ok(face);
|
|
39
|
+
return result.err("Face orientation is inconsistent or face is invalid");
|
|
40
|
+
}
|
|
41
|
+
function manifoldShell(shell) {
|
|
42
|
+
if (isManifoldShell(shell)) return result.ok(shell);
|
|
43
|
+
return result.err("Shell is not manifold: has free edges or is invalid");
|
|
44
|
+
}
|
|
45
|
+
function validSolid(solid) {
|
|
46
|
+
if (isValidSolid(solid)) return result.ok(solid);
|
|
47
|
+
return result.err("Solid failed BRepCheck validation");
|
|
48
|
+
}
|
|
8
49
|
exports.resolveDirection = types.resolveDirection;
|
|
9
50
|
exports.toVec2 = types.toVec2;
|
|
10
51
|
exports.toVec3 = types.toVec3;
|
|
@@ -62,29 +103,29 @@ exports.resolvePlane = vectors.resolvePlane;
|
|
|
62
103
|
exports.translatePlane = vectors.translatePlane;
|
|
63
104
|
exports.DisposalScope = shapeTypes.DisposalScope;
|
|
64
105
|
exports.castShape = shapeTypes.castShape;
|
|
65
|
-
exports.closedWire = shapeTypes.closedWire;
|
|
66
106
|
exports.createHandle = shapeTypes.createHandle;
|
|
67
107
|
exports.createKernelHandle = shapeTypes.createKernelHandle;
|
|
68
108
|
exports.getShapeKind = shapeTypes.getShapeKind;
|
|
69
109
|
exports.is2D = shapeTypes.is2D;
|
|
70
110
|
exports.is3D = shapeTypes.is3D;
|
|
71
|
-
exports.isClosedWire = shapeTypes.isClosedWire;
|
|
72
111
|
exports.isCompound = shapeTypes.isCompound;
|
|
73
112
|
exports.isEdge = shapeTypes.isEdge;
|
|
74
113
|
exports.isFace = shapeTypes.isFace;
|
|
75
114
|
exports.isLive = shapeTypes.isLive;
|
|
76
|
-
exports.isManifoldShell = shapeTypes.isManifoldShell;
|
|
77
|
-
exports.isOrientedFace = shapeTypes.isOrientedFace;
|
|
78
115
|
exports.isShape1D = shapeTypes.isShape1D;
|
|
79
116
|
exports.isShape3D = shapeTypes.isShape3D;
|
|
80
117
|
exports.isShell = shapeTypes.isShell;
|
|
81
118
|
exports.isSolid = shapeTypes.isSolid;
|
|
82
|
-
exports.isValidSolid = shapeTypes.isValidSolid;
|
|
83
119
|
exports.isVertex = shapeTypes.isVertex;
|
|
84
120
|
exports.isWire = shapeTypes.isWire;
|
|
85
|
-
exports.manifoldShell = shapeTypes.manifoldShell;
|
|
86
|
-
exports.orientedFace = shapeTypes.orientedFace;
|
|
87
|
-
exports.validSolid = shapeTypes.validSolid;
|
|
88
121
|
exports.withScope = shapeTypes.withScope;
|
|
89
122
|
exports.withScopeResult = shapeTypes.withScopeResult;
|
|
90
123
|
exports.withScopeResultAsync = shapeTypes.withScopeResultAsync;
|
|
124
|
+
exports.closedWire = closedWire;
|
|
125
|
+
exports.isClosedWire = isClosedWire;
|
|
126
|
+
exports.isManifoldShell = isManifoldShell;
|
|
127
|
+
exports.isOrientedFace = isOrientedFace;
|
|
128
|
+
exports.isValidSolid = isValidSolid;
|
|
129
|
+
exports.manifoldShell = manifoldShell;
|
|
130
|
+
exports.orientedFace = orientedFace;
|
|
131
|
+
exports.validSolid = validSolid;
|
package/dist/core.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { type BrepError, type BrepErrorKind, kernelError, validationError, typeC
|
|
|
10
10
|
export { DEG2RAD, RAD2DEG, HASH_CODE_MAX } from './core/constants.js';
|
|
11
11
|
export type { Plane as FnPlane, PlaneName as FnPlaneName, PlaneInput } from './core/planeTypes.js';
|
|
12
12
|
export { createPlane, createNamedPlane, resolvePlane, translatePlane, pivotPlane, } from './core/planeOps.js';
|
|
13
|
-
export type { Dimension, ShapeKind, Vertex, Edge, Wire, Face, Shell, Solid, CompSolid, Compound, AnyShape, Shape1D, Shape3D, ClosedWire, OrientedFace, ManifoldShell, ValidSolid,
|
|
13
|
+
export type { Dimension, ShapeKind, Vertex, Edge, Wire, Face, Shell, Solid, CompSolid, Compound, AnyShape, Shape1D, Shape3D, ClosedWire, OrientedFace, ManifoldShell, ValidSolid, } from './core/shapeTypes.js';
|
|
14
14
|
export { castShape, getShapeKind, isVertex, isEdge, isWire, isFace, isShell, isSolid, isCompound, isShape3D, isShape1D, is3D, is2D, closedWire, orientedFace, manifoldShell, validSolid, isClosedWire, isOrientedFace, isManifoldShell, isValidSolid, } from './core/shapeTypes.js';
|
|
15
15
|
export type { ShapeHandle, KernelHandle } from './core/disposal.js';
|
|
16
16
|
export { createHandle, createKernelHandle, DisposalScope, withScope, withScopeResult, withScopeResultAsync, isLive, } from './core/disposal.js';
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EACL,M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AS,EACT,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,MAAM,GACP,MAAM,oBAAoB,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -1,90 +1,133 @@
|
|
|
1
|
-
import { r,
|
|
2
|
-
import { D, H, R,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { r, a, t } from "./types-CcKqsmd0.js";
|
|
2
|
+
import { D, H, R, a as a2, j, e, h, d, k, i, v, l, m, c, n, o, g, b, f } from "./vecOps-LTN--A58.js";
|
|
3
|
+
import { o as ok, e as err } from "./result-CoDaWsvc.js";
|
|
4
|
+
import { g as g2, O, a as a3, d as d2, j as j2, f as f2, l as l2, i as i2, b as b2, c as c2, k as k2, p, w, x, y, q, D as D2, G, H as H2, t as t2, I, u, J, K, L, v as v2 } from "./result-CoDaWsvc.js";
|
|
5
|
+
import { a as a4, c as c3, b as b3, r as r2, t as t3 } from "./vectors-B8juLsQB.js";
|
|
6
|
+
import { g as getKernel } from "./shapeTypes-dhhm-T5A.js";
|
|
7
|
+
import { D as D3, c as c4, v as v3, w as w2, a as a5, A, B, C, i as i3, o as o2, E, F, h as h2, d as d3, k as k3, G as G2, b as b4, K as K2, L as L2, M } from "./shapeTypes-dhhm-T5A.js";
|
|
8
|
+
function isClosedWire(wire) {
|
|
9
|
+
return getKernel().curveIsClosed(wire.wrapped);
|
|
10
|
+
}
|
|
11
|
+
function isOrientedFace(face) {
|
|
12
|
+
return getKernel().isValid(face.wrapped);
|
|
13
|
+
}
|
|
14
|
+
function isManifoldShell(shell) {
|
|
15
|
+
const kernel = getKernel();
|
|
16
|
+
if (!kernel.isValid(shell.wrapped)) return false;
|
|
17
|
+
const validate = kernel.isValidStrict?.bind(kernel) ?? kernel.isValid.bind(kernel);
|
|
18
|
+
try {
|
|
19
|
+
const solid = kernel.solidFromShell(shell.wrapped);
|
|
20
|
+
const valid = validate(solid);
|
|
21
|
+
try {
|
|
22
|
+
kernel.dispose(solid);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
return valid;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function isValidSolid(solid) {
|
|
31
|
+
return getKernel().isValid(solid.wrapped);
|
|
32
|
+
}
|
|
33
|
+
function closedWire(wire) {
|
|
34
|
+
if (isClosedWire(wire)) return ok(wire);
|
|
35
|
+
return err("Wire is not closed: start and end points do not coincide");
|
|
36
|
+
}
|
|
37
|
+
function orientedFace(face) {
|
|
38
|
+
if (isOrientedFace(face)) return ok(face);
|
|
39
|
+
return err("Face orientation is inconsistent or face is invalid");
|
|
40
|
+
}
|
|
41
|
+
function manifoldShell(shell) {
|
|
42
|
+
if (isManifoldShell(shell)) return ok(shell);
|
|
43
|
+
return err("Shell is not manifold: has free edges or is invalid");
|
|
44
|
+
}
|
|
45
|
+
function validSolid(solid) {
|
|
46
|
+
if (isValidSolid(solid)) return ok(solid);
|
|
47
|
+
return err("Solid failed BRepCheck validation");
|
|
48
|
+
}
|
|
6
49
|
export {
|
|
7
|
-
|
|
50
|
+
g2 as BrepBugError,
|
|
8
51
|
D as DEG2RAD,
|
|
9
|
-
|
|
52
|
+
D3 as DisposalScope,
|
|
10
53
|
H as HASH_CODE_MAX,
|
|
11
54
|
O as OK,
|
|
12
55
|
R as RAD2DEG,
|
|
13
56
|
a3 as andThen,
|
|
14
|
-
|
|
57
|
+
d2 as bug,
|
|
15
58
|
c4 as castShape,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
closedWire,
|
|
60
|
+
j2 as collect,
|
|
61
|
+
f2 as computationError,
|
|
62
|
+
v3 as createHandle,
|
|
63
|
+
w2 as createKernelHandle,
|
|
64
|
+
a4 as createNamedPlane,
|
|
65
|
+
c3 as createPlane,
|
|
66
|
+
err,
|
|
67
|
+
l2 as flatMap,
|
|
68
|
+
a5 as getShapeKind,
|
|
26
69
|
i2 as ioError,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
70
|
+
A as is2D,
|
|
71
|
+
B as is3D,
|
|
72
|
+
isClosedWire,
|
|
73
|
+
C as isCompound,
|
|
74
|
+
i3 as isEdge,
|
|
75
|
+
b2 as isErr,
|
|
76
|
+
o2 as isFace,
|
|
77
|
+
E as isLive,
|
|
78
|
+
isManifoldShell,
|
|
79
|
+
c2 as isOk,
|
|
80
|
+
isOrientedFace,
|
|
81
|
+
F as isShape1D,
|
|
82
|
+
h2 as isShape3D,
|
|
83
|
+
d3 as isShell,
|
|
84
|
+
k3 as isSolid,
|
|
85
|
+
isValidSolid,
|
|
86
|
+
G2 as isVertex,
|
|
87
|
+
b4 as isWire,
|
|
45
88
|
k2 as kernelError,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
89
|
+
manifoldShell,
|
|
90
|
+
p as map,
|
|
91
|
+
w as mapErr,
|
|
92
|
+
x as match,
|
|
93
|
+
y as moduleInitError,
|
|
94
|
+
ok,
|
|
95
|
+
orientedFace,
|
|
96
|
+
b3 as pivotPlane,
|
|
54
97
|
q as queryError,
|
|
55
98
|
r as resolveDirection,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
r2 as resolvePlane,
|
|
100
|
+
D2 as sketcherStateError,
|
|
101
|
+
a as toVec2,
|
|
102
|
+
t as toVec3,
|
|
60
103
|
t3 as translatePlane,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
104
|
+
G as tryCatch,
|
|
105
|
+
H2 as tryCatchAsync,
|
|
106
|
+
t2 as typeCastError,
|
|
107
|
+
I as unsupportedError,
|
|
108
|
+
u as unwrap,
|
|
109
|
+
J as unwrapErr,
|
|
110
|
+
K as unwrapOr,
|
|
111
|
+
L as unwrapOrElse,
|
|
112
|
+
validSolid,
|
|
113
|
+
v2 as validationError,
|
|
114
|
+
a2 as vecAdd,
|
|
115
|
+
j as vecAngle,
|
|
116
|
+
e as vecCross,
|
|
117
|
+
h as vecDistance,
|
|
75
118
|
d as vecDot,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
119
|
+
k as vecEquals,
|
|
120
|
+
i as vecIsZero,
|
|
121
|
+
v as vecLength,
|
|
122
|
+
l as vecLengthSq,
|
|
123
|
+
m as vecNegate,
|
|
124
|
+
c as vecNormalize,
|
|
125
|
+
n as vecProjectToPlane,
|
|
126
|
+
o as vecRepr,
|
|
127
|
+
g as vecRotate,
|
|
128
|
+
b as vecScale,
|
|
129
|
+
f as vecSub,
|
|
130
|
+
K2 as withScope,
|
|
131
|
+
L2 as withScopeResult,
|
|
132
|
+
M as withScopeResultAsync
|
|
90
133
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
3
|
-
const result = require("./result-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-T0n6mRmt.cjs");
|
|
3
|
+
const result = require("./result-DULetAht.cjs");
|
|
4
4
|
function getCurveType(shape) {
|
|
5
5
|
return shapeTypes.getKernel().curveType(shape.wrapped);
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as err,
|
|
1
|
+
import { g as getKernel, c as castShape, i as isEdge, b as isWire } from "./shapeTypes-dhhm-T5A.js";
|
|
2
|
+
import { e as err, t as typeCastError, o as ok } from "./result-CoDaWsvc.js";
|
|
3
3
|
function getCurveType(shape) {
|
|
4
4
|
return getKernel().curveType(shape.wrapped);
|
|
5
5
|
}
|
|
@@ -97,18 +97,18 @@ function offsetWire2D(wire, offset, kind = "arc") {
|
|
|
97
97
|
return ok(wrapped);
|
|
98
98
|
}
|
|
99
99
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
curveIsClosed as a,
|
|
101
|
+
getOrientation as b,
|
|
102
|
+
curveLength as c,
|
|
103
|
+
curveStartPoint as d,
|
|
104
|
+
curveTangentAt as e,
|
|
105
|
+
curvePointAt as f,
|
|
106
|
+
getCurveType as g,
|
|
107
|
+
curveEndPoint as h,
|
|
108
|
+
approximateCurve as i,
|
|
109
|
+
curveIsPeriodic as j,
|
|
110
|
+
curvePeriod as k,
|
|
111
|
+
flipOrientation as l,
|
|
112
112
|
interpolateCurve as m,
|
|
113
113
|
offsetWire2D as o
|
|
114
114
|
};
|