brepjs 20.12.11 → 20.12.13
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.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-DfPO5LGP.js → adjacencyFns-DBN26xm_.js} +2 -2
- package/dist/{adjacencyFns-DSGyqGyy.cjs → adjacencyFns-Djv832MP.cjs} +2 -2
- package/dist/{blueprint-DbNFPHzC.js → blueprint-BTccTqFy.js} +5 -5
- package/dist/{blueprint-BY2aygt_.cjs → blueprint-nVQsEilp.cjs} +5 -5
- package/dist/{blueprintFns-AfHtvBKP.cjs → blueprintFns-DFDOgqqe.cjs} +2 -2
- package/dist/{blueprintFns-dU5V5WcD.js → blueprintFns-DX7yLZpR.js} +2 -2
- package/dist/{blueprintSketcher-DHp6AeEM.cjs → blueprintSketcher-CoGp1dM9.cjs} +3 -3
- package/dist/{blueprintSketcher-nBI9PlsW.js → blueprintSketcher-rk64lh8e.js} +3 -3
- package/dist/{boolean2D-C6TS6oFP.cjs → boolean2D-DP2DiMfT.cjs} +4 -4
- package/dist/{boolean2D-DuWgyjOR.js → boolean2D-Dv-57m9d.js} +4 -4
- package/dist/{booleanFns-BwzBRGqj.js → booleanFns-CjIZaNBh.js} +59 -33
- package/dist/{booleanFns-D0qfjH0a.cjs → booleanFns-ewBwy7V_.cjs} +64 -32
- package/dist/brepjs.cjs +30 -30
- package/dist/brepjs.js +30 -30
- package/dist/{cameraFns-CLkNCsYU.js → cameraFns-D0JDXxwO.js} +3 -3
- package/dist/{cameraFns-B9xKg36U.cjs → cameraFns-DmIQsPIr.cjs} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-Da8Dv4bp.cjs → cornerFinder-CZ1XbVx7.cjs} +1 -1
- package/dist/{cornerFinder-CeyQ5JMA.js → cornerFinder-Df7ajnlz.js} +1 -1
- package/dist/{curveFns-EsJgIpc6.js → curveFns-CUrIF9LG.js} +1 -1
- package/dist/{curveFns-B8mm5cou.cjs → curveFns-DK5eG57I.cjs} +1 -1
- package/dist/{drawFns-JZV96JGO.cjs → drawFns-B2CPxqd1.cjs} +12 -12
- package/dist/{drawFns-BQIHgHQg.js → drawFns-BKKWQ4JW.js} +12 -12
- package/dist/{faceFns-2jGPfqvB.js → faceFns-B3vblI_s.js} +2 -2
- package/dist/{faceFns-Jo9hMVqL.cjs → faceFns-C1Ii1MJ-.cjs} +2 -2
- package/dist/{healingFns-D6mUhe0Z.js → healingFns-CqiHrJcx.js} +114 -29
- package/dist/{healingFns-qioD81Of.cjs → healingFns-sfguIlrW.cjs} +114 -29
- package/dist/{helpers-BvYkHZK7.cjs → helpers-CTxyRIoE.cjs} +6 -6
- package/dist/{helpers-CsHdKbfF.js → helpers-Dy1moMMd.js} +6 -6
- package/dist/{importFns-C8yUNPzJ.js → importFns-BXiAHbyn.js} +5 -5
- package/dist/{importFns-BzzUvnKA.cjs → importFns-C3ILnGTv.cjs} +5 -5
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{loftFns-jnQL_zpD.js → loftFns-BJqF1p_f.js} +1 -1
- package/dist/{loftFns-CnerVgTM.cjs → loftFns-CzERU_TY.cjs} +1 -1
- package/dist/{measureFns-D3egqKcW.js → measureFns-CT2TRojo.js} +15 -9
- package/dist/{measureFns-R85865k9.cjs → measureFns-DN5YMfKZ.cjs} +26 -8
- package/dist/measurement/measureFns.d.ts +18 -3
- package/dist/measurement/principalBoxFns.d.ts +2 -1
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-Cs_qrlXI.cjs → meshFns-BDn_nIVv.cjs} +3 -3
- package/dist/{meshFns-Bo4EQJFO.js → meshFns-Cp8uEpVt.js} +3 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-eiM6OjWU.cjs → primitiveFns-1FcmvZ6Y.cjs} +5 -5
- package/dist/{primitiveFns-NxbTqKy7.js → primitiveFns-BzJi89Y6.js} +5 -5
- package/dist/{principalBoxFns-DepJW5im.cjs → principalBoxFns-DT4ngNuy.cjs} +29 -20
- package/dist/{principalBoxFns-BgetPvvQ.js → principalBoxFns-farY7tvh.js} +29 -20
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-DpWvqRm0.cjs → refResolveFns-By31fyEv.cjs} +6 -6
- package/dist/{refResolveFns-Bl10yOGJ.js → refResolveFns-dNAt7W9t.js} +6 -6
- package/dist/{shapeFns-kFm-m8jh.js → shapeFns-381QqZ8n.js} +2 -2
- package/dist/{shapeFns-D47cmLG8.cjs → shapeFns-DhTfkxbN.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-C06KHgTm.cjs → shapeTypes-C0NcoN5g.cjs} +11 -14
- package/dist/{shapeTypes-DoPnZHn_.js → shapeTypes-DfBx__EF.js} +11 -14
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-ZDGdvaTU.js → solidBuilders-BZ1qXlFZ.js} +3 -3
- package/dist/{solidBuilders-Dwm0hXn5.cjs → solidBuilders-VPkj5ChQ.cjs} +3 -3
- package/dist/{surfaceBuilders-D5kFAV1i.cjs → surfaceBuilders-DQre19g8.cjs} +3 -3
- package/dist/{surfaceBuilders-BBs6D6Km.js → surfaceBuilders-sBre5aYy.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-D3XhH1kb.cjs → textBlueprints-ChDNr0L4.cjs} +8 -8
- package/dist/{textBlueprints-BvZNjVwM.js → textBlueprints-DCorV4gM.js} +8 -8
- package/dist/{textMetrics-BGPUxjiq.js → textMetrics-ByzyMC1I.js} +1 -1
- package/dist/{textMetrics-zk48vXsM.cjs → textMetrics-C0qTX3sH.cjs} +1 -1
- package/dist/{threadFns-CEr8JDsu.js → threadFns-AJP69FU6.js} +7 -7
- package/dist/{threadFns-DNFoBBrH.cjs → threadFns-CzWqzDN_.cjs} +7 -7
- package/dist/topology/apiTypes.d.ts +4 -2
- package/dist/topology/booleanFns.d.ts +15 -3
- package/dist/topology/chamferAngleFns.d.ts +6 -4
- package/dist/topology/evolutionFns.d.ts +2 -0
- package/dist/topology/metadata/metadataPropagation.d.ts +4 -1
- package/dist/topology/modifierFns.d.ts +8 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-yOGEI9hO.js → topologyQueryFns-CTCsQIH_.js} +1 -1
- package/dist/{topologyQueryFns-BUhKY2Kj.cjs → topologyQueryFns-svM8Yfsk.cjs} +1 -1
- package/dist/{validityTypes-lfyOkCQm.cjs → validityTypes-BCUWXQNA.cjs} +1 -1
- package/dist/{validityTypes-CGrEOscY.js → validityTypes-DrWg6_qM.js} +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_occtWasmAdapter = require("./occtWasmAdapter-BK--kx4R.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-svM8Yfsk.cjs");
|
|
5
5
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_booleanFns = require("./booleanFns-
|
|
6
|
+
const require_faceFns = require("./faceFns-C1Ii1MJ-.cjs");
|
|
7
|
+
const require_booleanFns = require("./booleanFns-ewBwy7V_.cjs");
|
|
8
8
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
9
9
|
// src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
@@ -386,11 +386,25 @@ function edgeTreatmentError(operation, e, edges, metadata) {
|
|
|
386
386
|
}, failedEdges && failedEdges.length > 0 ? `The ${operation} could not be built on metadata.failedEdges: use a smaller size there, or leave those edges out` : void 0);
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
389
|
+
* `UNSUPPORTED_CAPABILITY` for a chamfer the kernel cannot build as asked
|
|
390
|
+
* (asymmetric or per-edge distances), from its `UnsupportedKernelOperationError`.
|
|
391
|
+
*/
|
|
392
|
+
function chamferUnsupportedError(e) {
|
|
393
|
+
const kernelId = require_shapeTypes.getKernel().kernelId;
|
|
394
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
395
|
+
return require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `chamfer: the ${kernelId} kernel cannot build this chamfer (${raw})`, e, {
|
|
396
|
+
kernel: kernelId,
|
|
397
|
+
operation: "chamfer"
|
|
398
|
+
}, "Use one symmetric distance for every edge, or use the occt-wasm kernel (5.9.0 or later)");
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
389
401
|
* Apply a chamfer (beveled edge) to selected edges of a 3D shape.
|
|
390
402
|
*
|
|
391
403
|
* @param shape - The shape to modify.
|
|
392
404
|
* @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
|
|
393
405
|
* @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
|
|
406
|
+
* @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
|
|
407
|
+
* distances asked for (brepkit has no asymmetric chamfer).
|
|
394
408
|
*/
|
|
395
409
|
function chamfer(shape, edges, distance) {
|
|
396
410
|
const check = validateNotNull$1(shape, "chamfer: shape");
|
|
@@ -421,6 +435,7 @@ function chamfer(shape, edges, distance) {
|
|
|
421
435
|
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().chamferWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelDistance, inputFaceHashes, require_constants.HASH_CODE_MAX);
|
|
422
436
|
return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape");
|
|
423
437
|
} catch (e) {
|
|
438
|
+
if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(chamferUnsupportedError(e));
|
|
424
439
|
return require_errors.err(edgeTreatmentError("chamfer", e, filteredEdges, {
|
|
425
440
|
edgeCount: selectedEdges.length,
|
|
426
441
|
distance
|
|
@@ -730,8 +745,11 @@ function chamferAngleFailed(operation, e, edges, metadata) {
|
|
|
730
745
|
...failedEdges ? { failedEdges } : {}
|
|
731
746
|
}, failedEdges && failedEdges.length > 0 ? "The chamfer could not be built on metadata.failedEdges: use a smaller distance there, or leave those edges out" : void 0));
|
|
732
747
|
}
|
|
733
|
-
/**
|
|
734
|
-
|
|
748
|
+
/**
|
|
749
|
+
* Cast a fresh kernel result to a 3D shape, releasing every intermediate slot,
|
|
750
|
+
* and carry the face origins of `input` over to it.
|
|
751
|
+
*/
|
|
752
|
+
function castChamferResult(input, raw) {
|
|
735
753
|
const downcastResult = require_faceFns.downcast(raw);
|
|
736
754
|
if (require_errors.isErr(downcastResult)) {
|
|
737
755
|
require_shapeTypes.getKernel().dispose(raw);
|
|
@@ -743,6 +761,7 @@ function castChamferResult(raw) {
|
|
|
743
761
|
require_shapeTypes.disposeResultShape(wrapped);
|
|
744
762
|
return require_errors.err(require_errors.typeCastError("CHAMFER_ANGLE_NOT_3D", "chamferDistAngle did not produce a 3D shape"));
|
|
745
763
|
}
|
|
764
|
+
require_booleanFns.propagateMetadataByHash([input], wrapped);
|
|
746
765
|
return require_errors.ok(wrapped);
|
|
747
766
|
}
|
|
748
767
|
/**
|
|
@@ -755,7 +774,9 @@ function castChamferResult(raw) {
|
|
|
755
774
|
* @param edges - Edges to chamfer (must not be empty).
|
|
756
775
|
* @param distance - Chamfer distance along the face (must be positive).
|
|
757
776
|
* @param angleDeg - Chamfer angle in degrees (must be in range (0, 90)).
|
|
758
|
-
* @returns Ok with the chamfered shape, or Err on invalid input or kernel
|
|
777
|
+
* @returns Ok with the chamfered shape, or Err on invalid input or kernel
|
|
778
|
+
* failure. A kernel without a distance-angle chamfer (brepkit) returns
|
|
779
|
+
* `UNSUPPORTED_CAPABILITY`.
|
|
759
780
|
*
|
|
760
781
|
* @remarks Uses `BRepFilletAPI_MakeChamfer.AddDA(dist, angle, edge, face)` internally.
|
|
761
782
|
*/
|
|
@@ -763,30 +784,31 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
|
763
784
|
if (edges.length === 0) return require_errors.err(require_errors.validationError("CHAMFER_ANGLE_NO_EDGES", "chamferDistAngle requires at least one edge", void 0, { edgeCount: 0 }));
|
|
764
785
|
const invalid = validateDistAngle(distance, angleDeg);
|
|
765
786
|
if (invalid) return invalid;
|
|
787
|
+
const kernel = require_shapeTypes.getKernel();
|
|
766
788
|
let raw;
|
|
767
789
|
try {
|
|
768
|
-
const kernel = require_shapeTypes.getKernel();
|
|
769
790
|
const rawEdges = edges.map((e) => e.wrapped);
|
|
770
791
|
raw = kernel.chamferDistAngle(shape.wrapped, rawEdges, distance, angleDeg);
|
|
771
792
|
} catch (e) {
|
|
793
|
+
if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `chamferDistAngle: the ${kernel.kernelId} kernel has no distance-angle chamfer`, e, { kernel: kernel.kernelId }, "Chamfer by one symmetric distance instead, or use the occt-wasm kernel"));
|
|
772
794
|
return chamferAngleFailed("chamferDistAngle", e, edges, {
|
|
773
795
|
distance,
|
|
774
796
|
angleDeg,
|
|
775
797
|
edgeCount: edges.length
|
|
776
798
|
});
|
|
777
799
|
}
|
|
778
|
-
return castChamferResult(raw);
|
|
800
|
+
return castChamferResult(shape, raw);
|
|
779
801
|
}
|
|
780
802
|
function perEdgeUnsupported(kernelId, cause) {
|
|
781
|
-
return require_errors.err(require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `chamferDistAngles: the ${kernelId} kernel cannot give each edge its own distance and angle`, cause, { kernel: kernelId }, "
|
|
803
|
+
return require_errors.err(require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `chamferDistAngles: the ${kernelId} kernel cannot give each edge its own distance and angle`, cause, { kernel: kernelId }, "Use the occt-wasm kernel (5.9.0 or later), or give every edge the same { distance, angle } on a kernel that has a distance-angle chamfer"));
|
|
782
804
|
}
|
|
783
805
|
/**
|
|
784
806
|
* Chamfer each edge by its own distance and angle, in one operation.
|
|
785
807
|
*
|
|
786
808
|
* Edges that all share one distance and angle go through
|
|
787
|
-
* {@link chamferDistAngle}, which every kernel provides. Different
|
|
788
|
-
* a kernel with a per-edge distance-angle chamfer (occt-wasm 5.9.0
|
|
789
|
-
* on any other kernel the result is an `UNSUPPORTED_CAPABILITY` error. On
|
|
809
|
+
* {@link chamferDistAngle}, which every kernel but brepkit provides. Different
|
|
810
|
+
* values need a kernel with a per-edge distance-angle chamfer (occt-wasm 5.9.0
|
|
811
|
+
* or later); on any other kernel the result is an `UNSUPPORTED_CAPABILITY` error. On
|
|
790
812
|
* occt-wasm the edges of one tangent-continuous contour must share their
|
|
791
813
|
* distance and angle, or the result is `CHAMFER_ANGLE_FAILED`.
|
|
792
814
|
*
|
|
@@ -818,7 +840,7 @@ function chamferDistAngles(shape, entries) {
|
|
|
818
840
|
if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return perEdgeUnsupported(kernel.kernelId, e);
|
|
819
841
|
return chamferAngleFailed("chamferDistAngles", e, edges, { edgeCount: entries.length });
|
|
820
842
|
}
|
|
821
|
-
return castChamferResult(raw);
|
|
843
|
+
return castChamferResult(shape, raw);
|
|
822
844
|
}
|
|
823
845
|
// src/topology/nurbsFns.ts
|
|
824
846
|
/**
|
|
@@ -855,6 +877,22 @@ function freezeTelemetry(t) {
|
|
|
855
877
|
failedInputs: [...t.failedInputs].sort((a, b) => a - b)
|
|
856
878
|
};
|
|
857
879
|
}
|
|
880
|
+
function releaseOwned(node) {
|
|
881
|
+
if (node.owned) require_shapeTypes.disposeResultShape(node.shape);
|
|
882
|
+
}
|
|
883
|
+
/** If the run was cancelled, release the `held` nodes this frame owns and throw. */
|
|
884
|
+
function throwIfAborted(options, ...held) {
|
|
885
|
+
if (!options.signal?.aborted) return;
|
|
886
|
+
for (const node of held) releaseOwned(node);
|
|
887
|
+
throw options.signal.reason;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The caller's copy of the final node. A caller's own input can survive to the
|
|
891
|
+
* top (nothing combined, or every step failed), so it comes back as a copy.
|
|
892
|
+
*/
|
|
893
|
+
function ownedResult(node, options) {
|
|
894
|
+
return node.owned ? require_errors.ok(node.shape) : require_booleanFns.copyAsBooleanResult(node.shape, options.trackEvolution ?? true);
|
|
895
|
+
}
|
|
858
896
|
function cutAllBisect(base, tools, options = {}) {
|
|
859
897
|
return cutAllBisectWith(REAL_OPS, base, tools, options);
|
|
860
898
|
}
|
|
@@ -868,23 +906,36 @@ function cutAllBisectWith(ops, base, tools, options = {}) {
|
|
|
868
906
|
singletonFallbacks: 0,
|
|
869
907
|
failedInputs: /* @__PURE__ */ new Set()
|
|
870
908
|
};
|
|
871
|
-
const result = bisectCut(ops,
|
|
909
|
+
const result = bisectCut(ops, {
|
|
910
|
+
shape: base,
|
|
911
|
+
owned: false
|
|
912
|
+
}, tools, 0, options, telemetry);
|
|
872
913
|
if (require_errors.isErr(result)) return result;
|
|
914
|
+
const shape = ownedResult(result.value, options);
|
|
915
|
+
if (require_errors.isErr(shape)) return shape;
|
|
873
916
|
return require_errors.ok({
|
|
874
|
-
shape:
|
|
917
|
+
shape: shape.value,
|
|
875
918
|
telemetry: freezeTelemetry(telemetry)
|
|
876
919
|
});
|
|
877
920
|
}
|
|
921
|
+
/**
|
|
922
|
+
* Cut `tools` from `base`. An owned base is consumed: it comes back as the
|
|
923
|
+
* result when nothing was cut, and is released otherwise, on a throw included.
|
|
924
|
+
*/
|
|
878
925
|
function bisectCut(ops, base, tools, startIdx, options, telemetry) {
|
|
879
926
|
if (tools.length === 0) return require_errors.ok(base);
|
|
880
927
|
if (tools.length === 1) return applySingletonCut(ops, base, tools, startIdx, options, telemetry);
|
|
881
928
|
telemetry.batchAttempts++;
|
|
882
|
-
const batchResult = tryBatch(() => ops.cutAll(base, tools, options));
|
|
929
|
+
const batchResult = tryBatch(() => ops.cutAll(base.shape, tools, options));
|
|
883
930
|
if (batchResult && batchResult.ok) {
|
|
884
931
|
telemetry.batchSucceeded++;
|
|
885
|
-
|
|
932
|
+
releaseOwned(base);
|
|
933
|
+
return require_errors.ok({
|
|
934
|
+
shape: batchResult.value,
|
|
935
|
+
owned: true
|
|
936
|
+
});
|
|
886
937
|
}
|
|
887
|
-
|
|
938
|
+
throwIfAborted(options, base);
|
|
888
939
|
const mid = Math.floor(tools.length / 2);
|
|
889
940
|
const left = bisectCut(ops, base, tools.slice(0, mid), startIdx, options, telemetry);
|
|
890
941
|
if (!left.ok) return left;
|
|
@@ -893,9 +944,15 @@ function bisectCut(ops, base, tools, startIdx, options, telemetry) {
|
|
|
893
944
|
function applySingletonCut(ops, base, tools, startIdx, options, telemetry) {
|
|
894
945
|
telemetry.singletonFallbacks++;
|
|
895
946
|
const tool = require_arrayAccess.firstOrThrow(tools);
|
|
896
|
-
const pairResult = tryBatch(() => ops.cut(base, tool, options));
|
|
897
|
-
if (pairResult && pairResult.ok)
|
|
898
|
-
|
|
947
|
+
const pairResult = tryBatch(() => ops.cut(base.shape, tool, options));
|
|
948
|
+
if (pairResult && pairResult.ok) {
|
|
949
|
+
releaseOwned(base);
|
|
950
|
+
return require_errors.ok({
|
|
951
|
+
shape: pairResult.value,
|
|
952
|
+
owned: true
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
throwIfAborted(options, base);
|
|
899
956
|
telemetry.failedInputs.add(startIdx);
|
|
900
957
|
return require_errors.ok(base);
|
|
901
958
|
}
|
|
@@ -915,29 +972,54 @@ function fuseAllBisectWith(ops, shapes, options = {}) {
|
|
|
915
972
|
};
|
|
916
973
|
const result = bisectFuse(ops, shapes, 0, options, telemetry);
|
|
917
974
|
if (require_errors.isErr(result)) return result;
|
|
975
|
+
const shape = ownedResult(result.value, options);
|
|
976
|
+
if (require_errors.isErr(shape)) return shape;
|
|
918
977
|
return require_errors.ok({
|
|
919
|
-
shape:
|
|
978
|
+
shape: shape.value,
|
|
920
979
|
telemetry: freezeTelemetry(telemetry)
|
|
921
980
|
});
|
|
922
981
|
}
|
|
923
982
|
function bisectFuse(ops, shapes, startIdx, options, telemetry) {
|
|
924
|
-
if (shapes.length === 1) return require_errors.ok(
|
|
983
|
+
if (shapes.length === 1) return require_errors.ok({
|
|
984
|
+
shape: require_arrayAccess.firstOrThrow(shapes),
|
|
985
|
+
owned: false
|
|
986
|
+
});
|
|
925
987
|
telemetry.batchAttempts++;
|
|
926
988
|
const batchResult = tryBatch(() => ops.fuseAll(shapes, options));
|
|
927
989
|
if (batchResult && batchResult.ok) {
|
|
928
990
|
telemetry.batchSucceeded++;
|
|
929
|
-
return
|
|
991
|
+
return require_errors.ok({
|
|
992
|
+
shape: batchResult.value,
|
|
993
|
+
owned: true
|
|
994
|
+
});
|
|
930
995
|
}
|
|
931
|
-
|
|
996
|
+
throwIfAborted(options);
|
|
932
997
|
const mid = Math.floor(shapes.length / 2);
|
|
933
|
-
|
|
998
|
+
const left = bisectFuse(ops, shapes.slice(0, mid), startIdx, options, telemetry);
|
|
999
|
+
let right;
|
|
1000
|
+
try {
|
|
1001
|
+
right = bisectFuse(ops, shapes.slice(mid), startIdx + mid, options, telemetry);
|
|
1002
|
+
} catch (cause) {
|
|
1003
|
+
if (left.ok) releaseOwned(left.value);
|
|
1004
|
+
throw cause;
|
|
1005
|
+
}
|
|
1006
|
+
return combineFuseHalves(ops, left, right, shapes, startIdx, mid, options, telemetry);
|
|
934
1007
|
}
|
|
935
1008
|
function combineFuseHalves(ops, left, right, shapes, startIdx, mid, options, telemetry) {
|
|
936
1009
|
if (left.ok && right.ok) {
|
|
937
1010
|
telemetry.singletonFallbacks++;
|
|
938
|
-
const merged = tryBatch(() => ops.fuse(left.value, right.value, options));
|
|
939
|
-
if (merged && merged.ok)
|
|
1011
|
+
const merged = tryBatch(() => ops.fuse(left.value.shape, right.value.shape, options));
|
|
1012
|
+
if (merged && merged.ok) {
|
|
1013
|
+
releaseOwned(left.value);
|
|
1014
|
+
releaseOwned(right.value);
|
|
1015
|
+
return require_errors.ok({
|
|
1016
|
+
shape: merged.value,
|
|
1017
|
+
owned: true
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
throwIfAborted(options, left.value, right.value);
|
|
940
1021
|
for (let i = mid; i < shapes.length; i++) telemetry.failedInputs.add(startIdx + i);
|
|
1022
|
+
releaseOwned(right.value);
|
|
941
1023
|
return left;
|
|
942
1024
|
}
|
|
943
1025
|
if (left.ok) {
|
|
@@ -1148,6 +1230,8 @@ function filletWithEvolution(shape, edges, radius) {
|
|
|
1148
1230
|
* @param shape - The shape to modify.
|
|
1149
1231
|
* @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
|
|
1150
1232
|
* @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
|
|
1233
|
+
* @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
|
|
1234
|
+
* distances asked for (brepkit has no asymmetric chamfer).
|
|
1151
1235
|
*/
|
|
1152
1236
|
function chamferWithEvolution(shape, edges, distance) {
|
|
1153
1237
|
const check = validateNotNull(shape, "chamferWithEvolution: shape");
|
|
@@ -1181,6 +1265,7 @@ function chamferWithEvolution(shape, edges, distance) {
|
|
|
1181
1265
|
evolution
|
|
1182
1266
|
});
|
|
1183
1267
|
} catch (e) {
|
|
1268
|
+
if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(chamferUnsupportedError(e));
|
|
1184
1269
|
const raw = e instanceof Error ? e.message : String(e);
|
|
1185
1270
|
return require_errors.err(require_errors.kernelError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
1186
1271
|
operation: "chamfer",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-svM8Yfsk.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_faceFns = require("./faceFns-C1Ii1MJ-.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-DhTfkxbN.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-DK5eG57I.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-DN5YMfKZ.cjs");
|
|
10
10
|
// src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { q as getKernel, y as isFace } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, y as isFace } from "./shapeTypes-DfBx__EF.js";
|
|
2
2
|
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-CTCsQIH_.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-S-m9H_fe.js";
|
|
6
|
-
import { l as normalAt, s as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { l as normalAt, s as getSurfaceType } from "./faceFns-B3vblI_s.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-381QqZ8n.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CUrIF9LG.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-CT2TRojo.js";
|
|
10
10
|
// src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as isSolid, G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { C as isSolid, G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-DfBx__EF.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-
|
|
4
|
+
import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-CTCsQIH_.js";
|
|
5
5
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
6
|
-
import { t as makeCompound } from "./solidBuilders-
|
|
7
|
-
import { u as igesUnsupportedError } from "./meshFns-
|
|
6
|
+
import { t as makeCompound } from "./solidBuilders-BZ1qXlFZ.js";
|
|
7
|
+
import { u as igesUnsupportedError } from "./meshFns-Cp8uEpVt.js";
|
|
8
8
|
import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
9
|
-
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-
|
|
9
|
+
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-BTccTqFy.js";
|
|
10
10
|
// src/io/objExportFns.ts
|
|
11
11
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
12
12
|
function vec3At(arr, i) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-svM8Yfsk.cjs");
|
|
5
5
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
7
|
-
const require_meshFns = require("./meshFns-
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-VPkj5ChQ.cjs");
|
|
7
|
+
const require_meshFns = require("./meshFns-BDn_nIVv.cjs");
|
|
8
8
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
9
|
-
const require_blueprint = require("./blueprint-
|
|
9
|
+
const require_blueprint = require("./blueprint-nVQsEilp.cjs");
|
|
10
10
|
// src/io/objExportFns.ts
|
|
11
11
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
12
12
|
function vec3At(arr, i) {
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-BDn_nIVv.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-C3ILnGTv.cjs");
|
|
4
4
|
exports.blueprintToDXF = require_importFns.blueprintToDXF;
|
|
5
5
|
exports.exportDXF = require_importFns.exportDXF;
|
|
6
6
|
exports.exportGlb = require_importFns.exportGlb;
|
package/dist/io.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-
|
|
2
|
-
import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-Cp8uEpVt.js";
|
|
2
|
+
import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-BXiAHbyn.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DfBx__EF.js";
|
|
2
2
|
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
3
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
4
4
|
import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
3
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-DfBx__EF.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { E as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-CTCsQIH_.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-B3vblI_s.js";
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -30,6 +30,8 @@ function nullShapeErr(fn) {
|
|
|
30
30
|
* Run `fn` on fresh handles to the distinct sub-shapes of `type`, releasing them
|
|
31
31
|
* afterwards. Unlike getFaces and friends this leaves the shape's topology cache
|
|
32
32
|
* alone, so a measurement allocates nothing that outlives it.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
33
35
|
*/
|
|
34
36
|
function withSubShapes(shape, type, fn) {
|
|
35
37
|
const kernel = getKernel();
|
|
@@ -40,7 +42,11 @@ function withSubShapes(shape, type, fn) {
|
|
|
40
42
|
for (const item of items) kernel.dispose(item);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Run `fn` on a throwaway compound of `parts`, releasing the compound afterwards.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
44
50
|
function withCompoundOf(parts, fn) {
|
|
45
51
|
const kernel = getKernel();
|
|
46
52
|
const c = kernel.makeCompound(parts);
|
|
@@ -141,9 +147,9 @@ function measureSurfaceProps(shape) {
|
|
|
141
147
|
/**
|
|
142
148
|
* Measure linear properties of any shape.
|
|
143
149
|
*
|
|
144
|
-
* For edges this is the arc length; for wires
|
|
145
|
-
*
|
|
146
|
-
* their distinct edges, each counted once.
|
|
150
|
+
* For edges this is the arc length; for wires it is the total length of their
|
|
151
|
+
* edges; for faces, shells, solids, and compounds it is the total length of
|
|
152
|
+
* their distinct edges, each counted once (a face's seam edge included).
|
|
147
153
|
*
|
|
148
154
|
* @param shape - Any shape whose linear extent is to be measured.
|
|
149
155
|
* @returns `Result` containing length, center of mass, and raw mass property.
|
|
@@ -164,7 +170,7 @@ function measureLinearProps(shape) {
|
|
|
164
170
|
};
|
|
165
171
|
};
|
|
166
172
|
let result;
|
|
167
|
-
if (type === "vertex" || type === "edge" || type === "wire"
|
|
173
|
+
if (type === "vertex" || type === "edge" || type === "wire") result = linearOf(shape.wrapped);
|
|
168
174
|
else result = withSubShapes(shape, "edge", (edges) => edges.length === 0 ? {
|
|
169
175
|
mass: 0,
|
|
170
176
|
length: 0,
|
|
@@ -289,4 +295,4 @@ function measureCurvatureAtMid(face) {
|
|
|
289
295
|
minDirection: result.minDirection
|
|
290
296
|
});
|
|
291
297
|
}
|
|
292
|
-
export { measureDistance as a, measureLinearProps as c, measureVolumeProps as d,
|
|
298
|
+
export { measureDistance as a, measureLinearProps as c, measureVolumeProps as d, withCompoundOf as f, setCachedMeasurement as h, measureCurvatureAtMid as i, measureSurfaceProps as l, getCachedMeasurement as m, measureArea as n, measureDistanceProps as o, withSubShapes as p, measureCurvatureAt as r, measureLength as s, createDistanceQuery as t, measureVolume as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-svM8Yfsk.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-C1Ii1MJ-.cjs");
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -30,6 +30,8 @@ function nullShapeErr(fn) {
|
|
|
30
30
|
* Run `fn` on fresh handles to the distinct sub-shapes of `type`, releasing them
|
|
31
31
|
* afterwards. Unlike getFaces and friends this leaves the shape's topology cache
|
|
32
32
|
* alone, so a measurement allocates nothing that outlives it.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
33
35
|
*/
|
|
34
36
|
function withSubShapes(shape, type, fn) {
|
|
35
37
|
const kernel = require_shapeTypes.getKernel();
|
|
@@ -40,7 +42,11 @@ function withSubShapes(shape, type, fn) {
|
|
|
40
42
|
for (const item of items) kernel.dispose(item);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Run `fn` on a throwaway compound of `parts`, releasing the compound afterwards.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
44
50
|
function withCompoundOf(parts, fn) {
|
|
45
51
|
const kernel = require_shapeTypes.getKernel();
|
|
46
52
|
const c = kernel.makeCompound(parts);
|
|
@@ -141,9 +147,9 @@ function measureSurfaceProps(shape) {
|
|
|
141
147
|
/**
|
|
142
148
|
* Measure linear properties of any shape.
|
|
143
149
|
*
|
|
144
|
-
* For edges this is the arc length; for wires
|
|
145
|
-
*
|
|
146
|
-
* their distinct edges, each counted once.
|
|
150
|
+
* For edges this is the arc length; for wires it is the total length of their
|
|
151
|
+
* edges; for faces, shells, solids, and compounds it is the total length of
|
|
152
|
+
* their distinct edges, each counted once (a face's seam edge included).
|
|
147
153
|
*
|
|
148
154
|
* @param shape - Any shape whose linear extent is to be measured.
|
|
149
155
|
* @returns `Result` containing length, center of mass, and raw mass property.
|
|
@@ -164,7 +170,7 @@ function measureLinearProps(shape) {
|
|
|
164
170
|
};
|
|
165
171
|
};
|
|
166
172
|
let result;
|
|
167
|
-
if (type === "vertex" || type === "edge" || type === "wire"
|
|
173
|
+
if (type === "vertex" || type === "edge" || type === "wire") result = linearOf(shape.wrapped);
|
|
168
174
|
else result = withSubShapes(shape, "edge", (edges) => edges.length === 0 ? {
|
|
169
175
|
mass: 0,
|
|
170
176
|
length: 0,
|
|
@@ -367,3 +373,15 @@ Object.defineProperty(exports, "setCachedMeasurement", {
|
|
|
367
373
|
return setCachedMeasurement;
|
|
368
374
|
}
|
|
369
375
|
});
|
|
376
|
+
Object.defineProperty(exports, "withCompoundOf", {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
get: function() {
|
|
379
|
+
return withCompoundOf;
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
Object.defineProperty(exports, "withSubShapes", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function() {
|
|
385
|
+
return withSubShapes;
|
|
386
|
+
}
|
|
387
|
+
});
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import { KernelShape, ShapeType } from '../kernel/types.js';
|
|
1
2
|
import { AnyShape, Dimension, Face, OrientedFace, Shape3D } from '../core/shapeTypes.js';
|
|
2
3
|
import { Result } from '../core/result.js';
|
|
3
4
|
import { CurvatureResult } from '../kernel/occt/measureOps.js';
|
|
4
5
|
import { PhysicalProps, VolumeProps, SurfaceProps, LinearProps, DistanceProps } from './measureTypes.js';
|
|
5
6
|
export type { PhysicalProps, VolumeProps, SurfaceProps, LinearProps, DistanceProps };
|
|
7
|
+
/**
|
|
8
|
+
* Run `fn` on fresh handles to the distinct sub-shapes of `type`, releasing them
|
|
9
|
+
* afterwards. Unlike getFaces and friends this leaves the shape's topology cache
|
|
10
|
+
* alone, so a measurement allocates nothing that outlives it.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function withSubShapes<R>(shape: AnyShape<Dimension>, type: ShapeType, fn: (items: KernelShape[]) => R): R;
|
|
15
|
+
/**
|
|
16
|
+
* Run `fn` on a throwaway compound of `parts`, releasing the compound afterwards.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function withCompoundOf<R>(parts: KernelShape[], fn: (c: KernelShape) => R): R;
|
|
6
21
|
/**
|
|
7
22
|
* Measure volume properties of a 3D shape.
|
|
8
23
|
*
|
|
@@ -22,9 +37,9 @@ export declare function measureSurfaceProps(shape: Face<Dimension> | Shape3D): R
|
|
|
22
37
|
/**
|
|
23
38
|
* Measure linear properties of any shape.
|
|
24
39
|
*
|
|
25
|
-
* For edges this is the arc length; for wires
|
|
26
|
-
*
|
|
27
|
-
* their distinct edges, each counted once.
|
|
40
|
+
* For edges this is the arc length; for wires it is the total length of their
|
|
41
|
+
* edges; for faces, shells, solids, and compounds it is the total length of
|
|
42
|
+
* their distinct edges, each counted once (a face's seam edge included).
|
|
28
43
|
*
|
|
29
44
|
* @param shape - Any shape whose linear extent is to be measured.
|
|
30
45
|
* @returns `Result` containing length, center of mass, and raw mass property.
|
|
@@ -16,7 +16,8 @@ export type { PrincipalBoundingBox };
|
|
|
16
16
|
* Z reports 136.6 x 136.6 x 2, because any in-plane pair of axes is principal
|
|
17
17
|
* for a square plate.
|
|
18
18
|
*
|
|
19
|
-
* @param shape - A solid, compsolid, or compound containing solids.
|
|
19
|
+
* @param shape - A solid, compsolid, or compound containing solids. A compound
|
|
20
|
+
* is measured by its solids alone: loose faces, shells, or wires in it are ignored.
|
|
20
21
|
* @returns `Result` with the box center in world coordinates, orthonormal
|
|
21
22
|
* right-handed axes ordered by decreasing extent, and the full edge lengths
|
|
22
23
|
* along those axes. Fails with `NOT_A_SOLID` for any other shape type
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
3
|
-
const require_principalBoxFns = require("./principalBoxFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-DN5YMfKZ.cjs");
|
|
3
|
+
const require_principalBoxFns = require("./principalBoxFns-DT4ngNuy.cjs");
|
|
4
4
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
5
5
|
exports.measureArea = require_measureFns.measureArea;
|
|
6
6
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
2
|
-
import { t as principalBoundingBox } from "./principalBoxFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-CT2TRojo.js";
|
|
2
|
+
import { t as principalBoundingBox } from "./principalBoxFns-farY7tvh.js";
|
|
3
3
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-C0NcoN5g.cjs");
|
|
2
2
|
const require_occtWasmAdapter = require("./occtWasmAdapter-BK--kx4R.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-svM8Yfsk.cjs");
|
|
5
|
+
const require_solidBuilders = require("./solidBuilders-VPkj5ChQ.cjs");
|
|
6
6
|
// src/topology/meshCache.ts
|
|
7
7
|
/**
|
|
8
8
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-DfBx__EF.js";
|
|
2
2
|
import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-C-Qi-jxS.js";
|
|
3
3
|
import { E as ok, g as err, r as ioError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
5
|
-
import { d as getFaceOrigins } from "./solidBuilders-
|
|
4
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-CTCsQIH_.js";
|
|
5
|
+
import { d as getFaceOrigins } from "./solidBuilders-BZ1qXlFZ.js";
|
|
6
6
|
// src/topology/meshCache.ts
|
|
7
7
|
/**
|
|
8
8
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_threadFns = require("./threadFns-
|
|
3
|
-
const require_loftFns = require("./loftFns-
|
|
2
|
+
const require_threadFns = require("./threadFns-CzWqzDN_.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-CzERU_TY.cjs");
|
|
4
4
|
exports.addChild = require_threadFns.addChild;
|
|
5
5
|
exports.addJoint = require_threadFns.addJoint;
|
|
6
6
|
exports.addStep = require_threadFns.addStep;
|