brepjs 18.124.0 → 18.124.2
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 +10 -8
- package/dist/2d.js +10 -8
- package/dist/{adjacencyFns-BJ6jcQ-N.cjs → adjacencyFns-CpKlADYt.cjs} +3 -3
- package/dist/{adjacencyFns-CnehwLNj.js → adjacencyFns-DECdcer5.js} +3 -3
- package/dist/{blueprint-BGWbpQ-w.js → blueprint-CaY00-X2.js} +16 -11
- package/dist/{blueprint-BSfG0Uik.cjs → blueprint-CpJLcUJV.cjs} +14 -10
- package/dist/{blueprintFns-C0-nGqlW.cjs → blueprintFns-B5nFaJI0.cjs} +2 -2
- package/dist/{blueprintFns-Bt1hKlL7.js → blueprintFns-vgwEIgI0.js} +2 -2
- package/dist/{blueprintSketcher-Bd5ZS9p6.cjs → blueprintSketcher-4e0yYtCY.cjs} +19 -11
- package/dist/{blueprintSketcher-BTGRoQ_G.js → blueprintSketcher-BjBjj2cK.js} +19 -11
- package/dist/{boolean2D-Cr6oLsbf.cjs → boolean2D-7heWA1co.cjs} +12 -8
- package/dist/{boolean2D-zZ9-qR5a.js → boolean2D-Bk-VrRyQ.js} +14 -9
- package/dist/brepjs.cjs +121 -81
- package/dist/brepjs.js +132 -85
- package/dist/{cameraFns-j2I9G3L_.cjs → cameraFns-CGwrxgqB.cjs} +5 -4
- package/dist/{cameraFns-CGMawqfi.js → cameraFns-DKEilV2v.js} +5 -4
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-CaXBdZz9.js → cornerFinder-C4s6pVZ-.js} +1 -1
- package/dist/{cornerFinder-CPwSLgpM.cjs → cornerFinder-zEgIFMnk.cjs} +1 -1
- package/dist/{curveFns-BBLaLG1U.cjs → curveFns-BZZYHVow.cjs} +8 -5
- package/dist/{curveFns-BoHbhtqX.js → curveFns-RczIU30U.js} +8 -5
- package/dist/{drawFns-DOkSdo8E.cjs → drawFns-BcXzWFfn.cjs} +59 -30
- package/dist/{drawFns-BrRbAeYB.js → drawFns-BjT3RaeQ.js} +59 -30
- package/dist/{faceFns-UozswcwP.cjs → faceFns-C4xNv2zn.cjs} +4 -3
- package/dist/{faceFns-Ce7Fq6j5.js → faceFns-fvp_zfuI.js} +6 -4
- package/dist/{healingFns-Dn0EFSHm.js → healingFns-AE5182Ds.js} +38 -21
- package/dist/{healingFns-mKogaVOk.cjs → healingFns-SxSiVPQa.cjs} +38 -21
- package/dist/{helpers-DuTAcGVX.cjs → helpers-CHYzwQMk.cjs} +6 -6
- package/dist/{helpers-CZsK8STz.js → helpers-CyLQ07aD.js} +6 -6
- package/dist/{importFns-Ch2YwieP.cjs → importFns-90S7P_7P.cjs} +5 -6
- package/dist/{importFns-CE4byS-8.js → importFns-DdXOAX6k.js} +5 -6
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-BYiUcAxk.cjs → loftFns-B3mbh5RA.cjs} +15 -9
- package/dist/{loftFns-DQVg8qxM.js → loftFns-CyY4qfvC.js} +15 -9
- package/dist/{measureFns-BbLLBg5q.js → measureFns-B1uLQugf.js} +3 -3
- package/dist/{measureFns-Cao9gY1L.cjs → measureFns-Cx2XJVVC.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CnYIUU9b.cjs → meshFns-2ZxW-X9I.cjs} +3 -3
- package/dist/{meshFns-B6NveFwc.js → meshFns-DrO3d03M.js} +3 -3
- package/dist/{occtWasmAdapter-BQKQXF63.js → occtWasmAdapter-BEe---7w.js} +3 -1
- package/dist/{occtWasmAdapter-Aubfbks6.cjs → occtWasmAdapter-DEpy64ji.cjs} +3 -1
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-uz38yuMp.cjs → originTrackingFns-D3rUK08B.cjs} +2 -2
- package/dist/{originTrackingFns-DXcggmgf.js → originTrackingFns-DIAwMSih.js} +2 -2
- package/dist/{primitiveFns-CmmTWOkO.js → primitiveFns-CDPqVTcc.js} +7 -5
- package/dist/{primitiveFns-DmEPf6av.cjs → primitiveFns-c7wqS-K2.cjs} +7 -5
- 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-CnPEaqHw.cjs → refResolveFns-Cm8ZHPl5.cjs} +10 -8
- package/dist/{refResolveFns-DqY7Cd00.js → refResolveFns-o3-Gdnjn.js} +10 -8
- package/dist/{rolldown-runtime-DakpK96I.cjs → rolldown-runtime-C0BPl7ul.cjs} +1 -1
- package/dist/{shapeFns-BLZ1dDSz.cjs → shapeFns-CJ6mph9b.cjs} +2 -2
- package/dist/{shapeFns-mYczuWOy.js → shapeFns-DEpbxB9Z.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-bHlssytH.js → shapeTypes-BHRboc_x.js} +235 -20
- package/dist/{shapeTypes-DZKuRt24.cjs → shapeTypes-D5Y41q7x.cjs} +219 -12
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-5tA9O1SM.cjs → solidBuilders-CsUkRC69.cjs} +14 -9
- package/dist/{solidBuilders-9s-j-ZiW.js → solidBuilders-DQQ0re9T.js} +14 -9
- package/dist/{surfaceBuilders-0x7j0ibk.cjs → surfaceBuilders-BXNZydNl.cjs} +7 -5
- package/dist/{surfaceBuilders-B7UnwkQz.js → surfaceBuilders-C8k0K7DR.js} +7 -5
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-DE3M-E9o.js → textBlueprints-BAyLXffK.js} +36 -21
- package/dist/{textBlueprints-BPbIpA4-.cjs → textBlueprints-t8MdWfki.cjs} +37 -22
- package/dist/{textMetrics-D3Bly1w4.js → textMetrics-CefI-bMN.js} +3 -2
- package/dist/{textMetrics-rRuWxQG_.cjs → textMetrics-DUEI9s5M.cjs} +3 -2
- package/dist/{threadFns-BAjFNk2_.js → threadFns-Bau5Sqad.js} +17 -12
- package/dist/{threadFns-BMT6ziG_.cjs → threadFns-OVYAleOH.cjs} +17 -12
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-DVhWxBwT.js → topologyQueryFns-QvPyCF-7.js} +1 -1
- package/dist/{topologyQueryFns-DZUpJz2p.cjs → topologyQueryFns-gah07J7-.cjs} +1 -1
- package/dist/{validityTypes-19mfqWVv.js → validityTypes-DokbYKzd.js} +1 -1
- package/dist/{validityTypes-CCnRq3A9.cjs → validityTypes-Dx-04qO0.cjs} +1 -1
- package/package.json +7 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as isSolid, E as getShapeKind, K as getKernel, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
1
|
+
import { C as isSolid, E as getShapeKind, K as getKernel, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, x as isShape3D, y as isFace } from "./shapeTypes-BHRboc_x.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, x as isOk } from "./errors-MHLiNE-C.js";
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-QvPyCF-7.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { y as downcast } from "./faceFns-
|
|
6
|
-
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-
|
|
5
|
+
import { y as downcast } from "./faceFns-fvp_zfuI.js";
|
|
6
|
+
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-DQQ0re9T.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -474,7 +474,8 @@ function filletWithEvolution(shape, edges, radius) {
|
|
|
474
474
|
evolution
|
|
475
475
|
});
|
|
476
476
|
} catch (e) {
|
|
477
|
-
|
|
477
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
478
|
+
return err(kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
|
|
478
479
|
operation: "fillet",
|
|
479
480
|
edgeCount: selectedEdges.length,
|
|
480
481
|
radius
|
|
@@ -521,7 +522,8 @@ function chamferWithEvolution(shape, edges, distance) {
|
|
|
521
522
|
evolution
|
|
522
523
|
});
|
|
523
524
|
} catch (e) {
|
|
524
|
-
|
|
525
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
526
|
+
return err(kernelError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
525
527
|
operation: "chamfer",
|
|
526
528
|
edgeCount: selectedEdges.length,
|
|
527
529
|
distance
|
|
@@ -556,7 +558,8 @@ function shellWithEvolution(shape, faces, thickness, tolerance = .001) {
|
|
|
556
558
|
evolution
|
|
557
559
|
});
|
|
558
560
|
} catch (e) {
|
|
559
|
-
|
|
561
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
562
|
+
return err(kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
560
563
|
operation: "shell",
|
|
561
564
|
faceCount: faces.length,
|
|
562
565
|
thickness
|
|
@@ -581,7 +584,8 @@ function shellWithEvolution(shape, faces, thickness, tolerance = .001) {
|
|
|
581
584
|
*/
|
|
582
585
|
function positionOnCurve(shape, spine, param) {
|
|
583
586
|
try {
|
|
584
|
-
const
|
|
587
|
+
const result = getKernel().positionOnCurve(shape.wrapped, spine.wrapped, param);
|
|
588
|
+
const wrapped = castResultShape(result);
|
|
585
589
|
if (!isShape3D(wrapped)) {
|
|
586
590
|
disposeResultShape(wrapped);
|
|
587
591
|
return err(kernelError(BrepErrorCode.POSITION_ON_CURVE_FAILED, "positionOnCurve did not produce a 3D shape"));
|
|
@@ -696,7 +700,8 @@ function thicken(shape, thickness) {
|
|
|
696
700
|
propagateAllMetadata(evolution, [shape], cast);
|
|
697
701
|
return ok(cast);
|
|
698
702
|
} catch (e) {
|
|
699
|
-
|
|
703
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
704
|
+
return err(kernelError("THICKEN_FAILED", `Thicken operation failed: ${raw}`, e));
|
|
700
705
|
}
|
|
701
706
|
}
|
|
702
707
|
/**
|
|
@@ -745,7 +750,8 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
|
|
|
745
750
|
try {
|
|
746
751
|
const edgeShapes = filteredEdges.map((e) => e.wrapped);
|
|
747
752
|
if (!trackEvolution) {
|
|
748
|
-
const
|
|
753
|
+
const resultShape = getKernel().fillet(shape.wrapped, edgeShapes, kernelRadius);
|
|
754
|
+
const cast = castResultShape(resultShape);
|
|
749
755
|
if (!isShape3D(cast)) {
|
|
750
756
|
disposeResultShape(cast);
|
|
751
757
|
return err(kernelError(BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
|
|
@@ -756,7 +762,8 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
|
|
|
756
762
|
const { shape: resultShape, evolution } = getKernel().filletWithHistory(shape.wrapped, edgeShapes, kernelRadius, inputFaceHashes, HASH_CODE_MAX);
|
|
757
763
|
return finalizeShape3D(evolution, resultShape, [shape], BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape");
|
|
758
764
|
} catch (e) {
|
|
759
|
-
|
|
765
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
766
|
+
return err(kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
|
|
760
767
|
operation: "fillet",
|
|
761
768
|
edgeCount: selectedCount,
|
|
762
769
|
radius
|
|
@@ -799,7 +806,8 @@ function chamfer(shape, edges, distance) {
|
|
|
799
806
|
const { shape: resultShape, evolution } = getKernel().chamferWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelDistance, inputFaceHashes, HASH_CODE_MAX);
|
|
800
807
|
return finalizeShape3D(evolution, resultShape, [shape], BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape");
|
|
801
808
|
} catch (e) {
|
|
802
|
-
|
|
809
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
810
|
+
return err(kernelError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
803
811
|
operation: "chamfer",
|
|
804
812
|
edgeCount: selectedEdges.length,
|
|
805
813
|
distance
|
|
@@ -821,7 +829,8 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
821
829
|
if (faces.length === 0) return err(validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
822
830
|
try {
|
|
823
831
|
if (!trackEvolution) {
|
|
824
|
-
const
|
|
832
|
+
const resultShape = getKernel().shell(shape.wrapped, faces.map((f) => f.wrapped), thickness, tolerance);
|
|
833
|
+
const cast = castResultShape(resultShape);
|
|
825
834
|
if (!isShape3D(cast)) {
|
|
826
835
|
disposeResultShape(cast);
|
|
827
836
|
return err(kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
@@ -838,7 +847,8 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
838
847
|
propagateAllMetadata(evolution, [shape], cast);
|
|
839
848
|
return ok(cast);
|
|
840
849
|
} catch (e) {
|
|
841
|
-
|
|
850
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
851
|
+
return err(kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
842
852
|
operation: "shell",
|
|
843
853
|
faceCount: faces.length,
|
|
844
854
|
thickness
|
|
@@ -867,7 +877,8 @@ function offset(shape, distance, tolerance = 1e-6) {
|
|
|
867
877
|
propagateAllMetadata(evolution, [shape], cast);
|
|
868
878
|
return ok(cast);
|
|
869
879
|
} catch (e) {
|
|
870
|
-
|
|
880
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
881
|
+
return err(kernelError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e));
|
|
871
882
|
}
|
|
872
883
|
}
|
|
873
884
|
/**
|
|
@@ -944,7 +955,8 @@ function variableFillet(shape, edge, radii) {
|
|
|
944
955
|
radius: r.radius
|
|
945
956
|
}))
|
|
946
957
|
});
|
|
947
|
-
const
|
|
958
|
+
const result = kernel.filletVariable(shape.wrapped, spec);
|
|
959
|
+
const wrapped = castResultShape(result);
|
|
948
960
|
if (!isShape3D(wrapped)) {
|
|
949
961
|
disposeResultShape(wrapped);
|
|
950
962
|
return err(kernelError(BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet did not produce a 3D shape"));
|
|
@@ -1009,7 +1021,8 @@ function healSolid(solid) {
|
|
|
1009
1021
|
function healFace(face) {
|
|
1010
1022
|
if (!isFace(face)) return err(validationError("NOT_A_FACE", "Input shape is not a face"));
|
|
1011
1023
|
try {
|
|
1012
|
-
const
|
|
1024
|
+
const result = getKernel().healFace(face.wrapped);
|
|
1025
|
+
const cast = castResultShape(result);
|
|
1013
1026
|
if (!isFace(cast)) {
|
|
1014
1027
|
disposeResultShape(cast);
|
|
1015
1028
|
return err(kernelError("HEAL_RESULT_NOT_FACE", "Healed result is not a face"));
|
|
@@ -1028,7 +1041,8 @@ function healFace(face) {
|
|
|
1028
1041
|
function healWire(wire, face) {
|
|
1029
1042
|
if (!isWire(wire)) return err(validationError("NOT_A_WIRE", "Input shape is not a wire"));
|
|
1030
1043
|
try {
|
|
1031
|
-
const
|
|
1044
|
+
const result = getKernel().healWire(wire.wrapped, face?.wrapped);
|
|
1045
|
+
const cast = castResultShape(result);
|
|
1032
1046
|
if (!isWire(cast)) {
|
|
1033
1047
|
disposeResultShape(cast);
|
|
1034
1048
|
return err(kernelError("HEAL_RESULT_NOT_WIRE", "Healed result is not a wire"));
|
|
@@ -1198,7 +1212,8 @@ function autoHeal(shape, options) {
|
|
|
1198
1212
|
*/
|
|
1199
1213
|
function fixShape(shape) {
|
|
1200
1214
|
try {
|
|
1201
|
-
|
|
1215
|
+
const fixed = getKernel().fixShape(shape.wrapped);
|
|
1216
|
+
return ok(castResultShape(fixed));
|
|
1202
1217
|
} catch (e) {
|
|
1203
1218
|
return err(kernelError(BrepErrorCode.FIX_SHAPE_FAILED, "ShapeFix_Shape failed", e));
|
|
1204
1219
|
}
|
|
@@ -1210,7 +1225,8 @@ function fixShape(shape) {
|
|
|
1210
1225
|
*/
|
|
1211
1226
|
function solidFromShell(shell) {
|
|
1212
1227
|
try {
|
|
1213
|
-
const
|
|
1228
|
+
const solidShape = getKernel().solidFromShell(shell.wrapped);
|
|
1229
|
+
const wrapped = castResultShape(solidShape);
|
|
1214
1230
|
if (!isSolid(wrapped)) {
|
|
1215
1231
|
disposeResultShape(wrapped);
|
|
1216
1232
|
return err(kernelError(BrepErrorCode.SOLID_FROM_SHELL_FAILED, "solidFromShell did not produce a solid"));
|
|
@@ -1231,7 +1247,8 @@ function solidFromShell(shell) {
|
|
|
1231
1247
|
*/
|
|
1232
1248
|
function fixSelfIntersection(wire) {
|
|
1233
1249
|
try {
|
|
1234
|
-
const
|
|
1250
|
+
const fixed = getKernel().fixSelfIntersection(wire.wrapped);
|
|
1251
|
+
const wrapped = castResultShape(fixed);
|
|
1235
1252
|
if (!isWire(wrapped)) {
|
|
1236
1253
|
disposeResultShape(wrapped);
|
|
1237
1254
|
return err(kernelError(BrepErrorCode.FIX_SELF_INTERSECTION_FAILED, "Result is not a wire"));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D5Y41q7x.cjs");
|
|
2
2
|
const require_errors = require("./errors-RHkKO5bZ.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-gah07J7-.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
5
|
+
const require_faceFns = require("./faceFns-C4xNv2zn.cjs");
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-CsUkRC69.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -474,7 +474,8 @@ function filletWithEvolution(shape, edges, radius) {
|
|
|
474
474
|
evolution
|
|
475
475
|
});
|
|
476
476
|
} catch (e) {
|
|
477
|
-
|
|
477
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
478
|
+
return require_errors.err(require_errors.kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
|
|
478
479
|
operation: "fillet",
|
|
479
480
|
edgeCount: selectedEdges.length,
|
|
480
481
|
radius
|
|
@@ -521,7 +522,8 @@ function chamferWithEvolution(shape, edges, distance) {
|
|
|
521
522
|
evolution
|
|
522
523
|
});
|
|
523
524
|
} catch (e) {
|
|
524
|
-
|
|
525
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
526
|
+
return require_errors.err(require_errors.kernelError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
525
527
|
operation: "chamfer",
|
|
526
528
|
edgeCount: selectedEdges.length,
|
|
527
529
|
distance
|
|
@@ -556,7 +558,8 @@ function shellWithEvolution(shape, faces, thickness, tolerance = .001) {
|
|
|
556
558
|
evolution
|
|
557
559
|
});
|
|
558
560
|
} catch (e) {
|
|
559
|
-
|
|
561
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
562
|
+
return require_errors.err(require_errors.kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
560
563
|
operation: "shell",
|
|
561
564
|
faceCount: faces.length,
|
|
562
565
|
thickness
|
|
@@ -581,7 +584,8 @@ function shellWithEvolution(shape, faces, thickness, tolerance = .001) {
|
|
|
581
584
|
*/
|
|
582
585
|
function positionOnCurve(shape, spine, param) {
|
|
583
586
|
try {
|
|
584
|
-
const
|
|
587
|
+
const result = require_shapeTypes.getKernel().positionOnCurve(shape.wrapped, spine.wrapped, param);
|
|
588
|
+
const wrapped = require_shapeTypes.castResultShape(result);
|
|
585
589
|
if (!require_shapeTypes.isShape3D(wrapped)) {
|
|
586
590
|
require_shapeTypes.disposeResultShape(wrapped);
|
|
587
591
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.POSITION_ON_CURVE_FAILED, "positionOnCurve did not produce a 3D shape"));
|
|
@@ -696,7 +700,8 @@ function thicken(shape, thickness) {
|
|
|
696
700
|
require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
|
|
697
701
|
return require_errors.ok(cast);
|
|
698
702
|
} catch (e) {
|
|
699
|
-
|
|
703
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
704
|
+
return require_errors.err(require_errors.kernelError("THICKEN_FAILED", `Thicken operation failed: ${raw}`, e));
|
|
700
705
|
}
|
|
701
706
|
}
|
|
702
707
|
/**
|
|
@@ -745,7 +750,8 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
|
|
|
745
750
|
try {
|
|
746
751
|
const edgeShapes = filteredEdges.map((e) => e.wrapped);
|
|
747
752
|
if (!trackEvolution) {
|
|
748
|
-
const
|
|
753
|
+
const resultShape = require_shapeTypes.getKernel().fillet(shape.wrapped, edgeShapes, kernelRadius);
|
|
754
|
+
const cast = require_shapeTypes.castResultShape(resultShape);
|
|
749
755
|
if (!require_shapeTypes.isShape3D(cast)) {
|
|
750
756
|
require_shapeTypes.disposeResultShape(cast);
|
|
751
757
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
|
|
@@ -756,7 +762,8 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
|
|
|
756
762
|
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().filletWithHistory(shape.wrapped, edgeShapes, kernelRadius, inputFaceHashes, require_constants.HASH_CODE_MAX);
|
|
757
763
|
return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape");
|
|
758
764
|
} catch (e) {
|
|
759
|
-
|
|
765
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
766
|
+
return require_errors.err(require_errors.kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
|
|
760
767
|
operation: "fillet",
|
|
761
768
|
edgeCount: selectedCount,
|
|
762
769
|
radius
|
|
@@ -799,7 +806,8 @@ function chamfer(shape, edges, distance) {
|
|
|
799
806
|
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().chamferWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelDistance, inputFaceHashes, require_constants.HASH_CODE_MAX);
|
|
800
807
|
return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape");
|
|
801
808
|
} catch (e) {
|
|
802
|
-
|
|
809
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
810
|
+
return require_errors.err(require_errors.kernelError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
803
811
|
operation: "chamfer",
|
|
804
812
|
edgeCount: selectedEdges.length,
|
|
805
813
|
distance
|
|
@@ -821,7 +829,8 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
821
829
|
if (faces.length === 0) return require_errors.err(require_errors.validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
822
830
|
try {
|
|
823
831
|
if (!trackEvolution) {
|
|
824
|
-
const
|
|
832
|
+
const resultShape = require_shapeTypes.getKernel().shell(shape.wrapped, faces.map((f) => f.wrapped), thickness, tolerance);
|
|
833
|
+
const cast = require_shapeTypes.castResultShape(resultShape);
|
|
825
834
|
if (!require_shapeTypes.isShape3D(cast)) {
|
|
826
835
|
require_shapeTypes.disposeResultShape(cast);
|
|
827
836
|
return require_errors.err(require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
@@ -838,7 +847,8 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
|
|
|
838
847
|
require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
|
|
839
848
|
return require_errors.ok(cast);
|
|
840
849
|
} catch (e) {
|
|
841
|
-
|
|
850
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
851
|
+
return require_errors.err(require_errors.kernelError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
842
852
|
operation: "shell",
|
|
843
853
|
faceCount: faces.length,
|
|
844
854
|
thickness
|
|
@@ -867,7 +877,8 @@ function offset(shape, distance, tolerance = 1e-6) {
|
|
|
867
877
|
require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
|
|
868
878
|
return require_errors.ok(cast);
|
|
869
879
|
} catch (e) {
|
|
870
|
-
|
|
880
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
881
|
+
return require_errors.err(require_errors.kernelError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e));
|
|
871
882
|
}
|
|
872
883
|
}
|
|
873
884
|
/**
|
|
@@ -944,7 +955,8 @@ function variableFillet(shape, edge, radii) {
|
|
|
944
955
|
radius: r.radius
|
|
945
956
|
}))
|
|
946
957
|
});
|
|
947
|
-
const
|
|
958
|
+
const result = kernel.filletVariable(shape.wrapped, spec);
|
|
959
|
+
const wrapped = require_shapeTypes.castResultShape(result);
|
|
948
960
|
if (!require_shapeTypes.isShape3D(wrapped)) {
|
|
949
961
|
require_shapeTypes.disposeResultShape(wrapped);
|
|
950
962
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet did not produce a 3D shape"));
|
|
@@ -1009,7 +1021,8 @@ function healSolid(solid) {
|
|
|
1009
1021
|
function healFace(face) {
|
|
1010
1022
|
if (!require_shapeTypes.isFace(face)) return require_errors.err(require_errors.validationError("NOT_A_FACE", "Input shape is not a face"));
|
|
1011
1023
|
try {
|
|
1012
|
-
const
|
|
1024
|
+
const result = require_shapeTypes.getKernel().healFace(face.wrapped);
|
|
1025
|
+
const cast = require_shapeTypes.castResultShape(result);
|
|
1013
1026
|
if (!require_shapeTypes.isFace(cast)) {
|
|
1014
1027
|
require_shapeTypes.disposeResultShape(cast);
|
|
1015
1028
|
return require_errors.err(require_errors.kernelError("HEAL_RESULT_NOT_FACE", "Healed result is not a face"));
|
|
@@ -1028,7 +1041,8 @@ function healFace(face) {
|
|
|
1028
1041
|
function healWire(wire, face) {
|
|
1029
1042
|
if (!require_shapeTypes.isWire(wire)) return require_errors.err(require_errors.validationError("NOT_A_WIRE", "Input shape is not a wire"));
|
|
1030
1043
|
try {
|
|
1031
|
-
const
|
|
1044
|
+
const result = require_shapeTypes.getKernel().healWire(wire.wrapped, face?.wrapped);
|
|
1045
|
+
const cast = require_shapeTypes.castResultShape(result);
|
|
1032
1046
|
if (!require_shapeTypes.isWire(cast)) {
|
|
1033
1047
|
require_shapeTypes.disposeResultShape(cast);
|
|
1034
1048
|
return require_errors.err(require_errors.kernelError("HEAL_RESULT_NOT_WIRE", "Healed result is not a wire"));
|
|
@@ -1198,7 +1212,8 @@ function autoHeal(shape, options) {
|
|
|
1198
1212
|
*/
|
|
1199
1213
|
function fixShape(shape) {
|
|
1200
1214
|
try {
|
|
1201
|
-
|
|
1215
|
+
const fixed = require_shapeTypes.getKernel().fixShape(shape.wrapped);
|
|
1216
|
+
return require_errors.ok(require_shapeTypes.castResultShape(fixed));
|
|
1202
1217
|
} catch (e) {
|
|
1203
1218
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.FIX_SHAPE_FAILED, "ShapeFix_Shape failed", e));
|
|
1204
1219
|
}
|
|
@@ -1210,7 +1225,8 @@ function fixShape(shape) {
|
|
|
1210
1225
|
*/
|
|
1211
1226
|
function solidFromShell(shell) {
|
|
1212
1227
|
try {
|
|
1213
|
-
const
|
|
1228
|
+
const solidShape = require_shapeTypes.getKernel().solidFromShell(shell.wrapped);
|
|
1229
|
+
const wrapped = require_shapeTypes.castResultShape(solidShape);
|
|
1214
1230
|
if (!require_shapeTypes.isSolid(wrapped)) {
|
|
1215
1231
|
require_shapeTypes.disposeResultShape(wrapped);
|
|
1216
1232
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.SOLID_FROM_SHELL_FAILED, "solidFromShell did not produce a solid"));
|
|
@@ -1231,7 +1247,8 @@ function solidFromShell(shell) {
|
|
|
1231
1247
|
*/
|
|
1232
1248
|
function fixSelfIntersection(wire) {
|
|
1233
1249
|
try {
|
|
1234
|
-
const
|
|
1250
|
+
const fixed = require_shapeTypes.getKernel().fixSelfIntersection(wire.wrapped);
|
|
1251
|
+
const wrapped = require_shapeTypes.castResultShape(fixed);
|
|
1235
1252
|
if (!require_shapeTypes.isWire(wrapped)) {
|
|
1236
1253
|
require_shapeTypes.disposeResultShape(wrapped);
|
|
1237
1254
|
return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.FIX_SELF_INTERSECTION_FAILED, "Result is not a wire"));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D5Y41q7x.cjs");
|
|
2
2
|
const require_errors = require("./errors-RHkKO5bZ.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-gah07J7-.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CCnJt-yH.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-C4xNv2zn.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-CJ6mph9b.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-BZZYHVow.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-Cx2XJVVC.cjs");
|
|
10
10
|
//#region 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 { K as getKernel, y as isFace } from "./shapeTypes-
|
|
1
|
+
import { K as getKernel, y as isFace } from "./shapeTypes-BHRboc_x.js";
|
|
2
2
|
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-MHLiNE-C.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-QvPyCF-7.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.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-fvp_zfuI.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-DEpbxB9Z.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-RczIU30U.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-B1uLQugf.js";
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D5Y41q7x.cjs");
|
|
2
2
|
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
3
3
|
const require_errors = require("./errors-RHkKO5bZ.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-CpJLcUJV.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1160,9 +1160,7 @@ function parseSVGPathToCurves(d) {
|
|
|
1160
1160
|
case "A":
|
|
1161
1161
|
handleArc(args, cursor, isRelative, curves);
|
|
1162
1162
|
break;
|
|
1163
|
-
case "Z":
|
|
1164
|
-
handleClosePath(cursor, curves);
|
|
1165
|
-
break;
|
|
1163
|
+
case "Z": handleClosePath(cursor, curves);
|
|
1166
1164
|
}
|
|
1167
1165
|
if (cmd !== "S" && cmd !== "T") cursor.lastCmd = cmd;
|
|
1168
1166
|
}
|
|
@@ -1261,7 +1259,8 @@ function exportSTEPConfigured(parts, options) {
|
|
|
1261
1259
|
name: p.name,
|
|
1262
1260
|
color: p.color ? [...p.color] : void 0
|
|
1263
1261
|
}));
|
|
1264
|
-
|
|
1262
|
+
const result = kernel.exportSTEPConfigured(kernelParts, options);
|
|
1263
|
+
return require_errors.ok(result);
|
|
1265
1264
|
} catch (e) {
|
|
1266
1265
|
return require_errors.err(require_errors.ioError(require_errors.BrepErrorCode.STEP_EXPORT_CONFIGURED_FAILED, "Configured STEP export failed", e));
|
|
1267
1266
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { K as getKernel, n as castResultShape } from "./shapeTypes-
|
|
1
|
+
import { K as getKernel, n as castResultShape } from "./shapeTypes-BHRboc_x.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At$1 } from "./bug-BdOHwn_e.js";
|
|
3
3
|
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-MHLiNE-C.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-CaY00-X2.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1160,9 +1160,7 @@ function parseSVGPathToCurves(d) {
|
|
|
1160
1160
|
case "A":
|
|
1161
1161
|
handleArc(args, cursor, isRelative, curves);
|
|
1162
1162
|
break;
|
|
1163
|
-
case "Z":
|
|
1164
|
-
handleClosePath(cursor, curves);
|
|
1165
|
-
break;
|
|
1163
|
+
case "Z": handleClosePath(cursor, curves);
|
|
1166
1164
|
}
|
|
1167
1165
|
if (cmd !== "S" && cmd !== "T") cursor.lastCmd = cmd;
|
|
1168
1166
|
}
|
|
@@ -1261,7 +1259,8 @@ function exportSTEPConfigured(parts, options) {
|
|
|
1261
1259
|
name: p.name,
|
|
1262
1260
|
color: p.color ? [...p.color] : void 0
|
|
1263
1261
|
}));
|
|
1264
|
-
|
|
1262
|
+
const result = kernel.exportSTEPConfigured(kernelParts, options);
|
|
1263
|
+
return ok(result);
|
|
1265
1264
|
} catch (e) {
|
|
1266
1265
|
return err(ioError(BrepErrorCode.STEP_EXPORT_CONFIGURED_FAILED, "Configured STEP export failed", e));
|
|
1267
1266
|
}
|
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-2ZxW-X9I.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-90S7P_7P.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 importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-DrO3d03M.js";
|
|
2
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-DdXOAX6k.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-DEpy64ji.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-BEe---7w.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-D5Y41q7x.cjs");
|
|
2
2
|
const require_errors = require("./errors-RHkKO5bZ.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
@@ -22,7 +22,8 @@ const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
|
22
22
|
function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
23
23
|
if (extrusionLength < 1e-10) return require_errors.err(require_errors.validationError("INVALID_EXTRUSION_LENGTH", "Extrusion length too small (< 1e-10)"));
|
|
24
24
|
if (profile !== "s-curve" && profile !== "linear") return require_errors.err(require_errors.validationError("UNSUPPORTED_PROFILE", `Unsupported extrusion profile: ${String(profile)}`));
|
|
25
|
-
|
|
25
|
+
const law = require_shapeTypes.getKernel().buildExtrusionLaw(profile, extrusionLength, endFactor);
|
|
26
|
+
return require_errors.ok(law.Trim(0, extrusionLength, 1e-6));
|
|
26
27
|
}
|
|
27
28
|
//#endregion
|
|
28
29
|
//#region src/operations/sweepFns.ts
|
|
@@ -42,7 +43,8 @@ function makeSpineWire(start, end) {
|
|
|
42
43
|
}
|
|
43
44
|
/** Build a helix wire for twist extrusion. */
|
|
44
45
|
function makeHelixWire(pitch, height, radius, center, dir, leftHanded = false) {
|
|
45
|
-
|
|
46
|
+
const kernel = require_shapeTypes.getKernel();
|
|
47
|
+
return require_shapeTypes.castResultShape(kernel.makeHelixWire(pitch, height, radius, [...center], [...dir], leftHanded));
|
|
46
48
|
}
|
|
47
49
|
/** Cast a shell-mode sweep result `[shell, startWire, endWire]`, releasing all three on any reject. */
|
|
48
50
|
function castSweepShellTuple(result) {
|
|
@@ -86,7 +88,8 @@ function castSweepShellTuple(result) {
|
|
|
86
88
|
*/
|
|
87
89
|
function sweep(wire, spine, config = {}, shellMode = false) {
|
|
88
90
|
if (config.mode === "simple" && !shellMode) {
|
|
89
|
-
const
|
|
91
|
+
const resultOc = require_shapeTypes.getKernel().simplePipe(wire.wrapped, spine.wrapped);
|
|
92
|
+
const shape = require_shapeTypes.castResultShape(resultOc);
|
|
90
93
|
if (!require_shapeTypes.isShape3D(shape)) {
|
|
91
94
|
require_shapeTypes.disposeResultShape(shape);
|
|
92
95
|
return require_errors.err(require_errors.typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
|
|
@@ -279,11 +282,12 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
279
282
|
positioned.push(p);
|
|
280
283
|
positionedWires.push(kernel.downcast(p, "wire"));
|
|
281
284
|
}
|
|
282
|
-
const
|
|
285
|
+
const loftResult = kernel.loftAdvanced(positionedWires, {
|
|
283
286
|
solid,
|
|
284
287
|
ruled,
|
|
285
288
|
tolerance
|
|
286
|
-
})
|
|
289
|
+
});
|
|
290
|
+
const result = require_shapeTypes.castResultShape(loftResult);
|
|
287
291
|
if (!require_shapeTypes.isShape3D(result)) {
|
|
288
292
|
require_shapeTypes.disposeResultShape(result);
|
|
289
293
|
return require_errors.err(require_errors.typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape"));
|
|
@@ -325,7 +329,8 @@ function guidedSweep(profile, spine, guides, options = {}) {
|
|
|
325
329
|
boundTolerance: tolerance
|
|
326
330
|
} : {}
|
|
327
331
|
});
|
|
328
|
-
const
|
|
332
|
+
const ocShape = typeof sweepResult === "object" && "shape" in sweepResult ? sweepResult.shape : sweepResult;
|
|
333
|
+
const result = require_shapeTypes.castResultShape(ocShape);
|
|
329
334
|
if (!require_shapeTypes.isShape3D(result)) {
|
|
330
335
|
require_shapeTypes.disposeResultShape(result);
|
|
331
336
|
return require_errors.err(require_errors.typeCastError("GUIDED_SWEEP_NOT_3D", "Guided sweep did not produce a 3D shape"));
|
|
@@ -366,13 +371,14 @@ function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } =
|
|
|
366
371
|
const startVertex = startPoint ? kernel.makeVertex(...require_types.toVec3(startPoint)) : void 0;
|
|
367
372
|
const endVertex = endPoint ? kernel.makeVertex(...require_types.toVec3(endPoint)) : void 0;
|
|
368
373
|
try {
|
|
369
|
-
const
|
|
374
|
+
const shape = kernel.loftAdvanced(wires.map((w) => w.wrapped), {
|
|
370
375
|
solid: !returnShell,
|
|
371
376
|
ruled,
|
|
372
377
|
tolerance,
|
|
373
378
|
...startVertex ? { startVertex } : {},
|
|
374
379
|
...endVertex ? { endVertex } : {}
|
|
375
|
-
})
|
|
380
|
+
});
|
|
381
|
+
const result = require_shapeTypes.castResultShape(shape);
|
|
376
382
|
if (!require_shapeTypes.isShape3D(result)) {
|
|
377
383
|
require_shapeTypes.disposeResultShape(result);
|
|
378
384
|
return require_errors.err(require_errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|