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
|
@@ -1,41 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
2
|
+
const vectors = require("./vectors-I_0zdD3O.cjs");
|
|
3
|
+
const shapeTypes = require("./shapeTypes-T0n6mRmt.cjs");
|
|
4
|
+
const faceFns = require("./faceFns-CmIrjdt1.cjs");
|
|
5
|
+
const curveFns = require("./curveFns-CWZRuXQ3.cjs");
|
|
6
|
+
const result = require("./result-DULetAht.cjs");
|
|
7
|
+
const helpers = require("./helpers-mipaxDTy.cjs");
|
|
3
8
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
|
-
const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
|
|
5
|
-
const faceFns = require("./faceFns-DB1Fc5gy.cjs");
|
|
6
|
-
const curveFns = require("./curveFns-BZngcnQ1.cjs");
|
|
7
|
-
const result = require("./result-fAX0OZzI.cjs");
|
|
8
|
-
const helpers = require("./helpers-C8NoT0Wu.cjs");
|
|
9
9
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
11
|
-
function makePlane(plane, origin) {
|
|
12
|
-
if (plane && typeof plane !== "string") {
|
|
13
|
-
return { ...plane };
|
|
14
|
-
} else {
|
|
15
|
-
return vectors.resolvePlane(plane ?? "XY", origin);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function mirror(shape, inputPlane, origin) {
|
|
19
|
-
let originVec;
|
|
20
|
-
let directionVec;
|
|
21
|
-
if (typeof inputPlane === "string") {
|
|
22
|
-
const plane = vectors.resolvePlane(inputPlane, origin);
|
|
23
|
-
originVec = plane.origin;
|
|
24
|
-
directionVec = plane.zDir;
|
|
25
|
-
} else if (inputPlane && typeof inputPlane === "object" && "origin" in inputPlane && "zDir" in inputPlane) {
|
|
26
|
-
originVec = origin ? types.toVec3(origin) : inputPlane.origin;
|
|
27
|
-
directionVec = inputPlane.zDir;
|
|
28
|
-
} else if (inputPlane) {
|
|
29
|
-
originVec = origin ? types.toVec3(origin) : [0, 0, 0];
|
|
30
|
-
directionVec = types.toVec3(inputPlane);
|
|
31
|
-
} else {
|
|
32
|
-
const plane = vectors.resolvePlane("YZ", origin);
|
|
33
|
-
originVec = plane.origin;
|
|
34
|
-
directionVec = plane.zDir;
|
|
35
|
-
}
|
|
36
|
-
const newShape = shapeTypes.getKernel().mirror(shape, originVec, directionVec);
|
|
37
|
-
return newShape;
|
|
38
|
-
}
|
|
10
|
+
const surfaceBuilders = require("./surfaceBuilders-DYS8AMSS.cjs");
|
|
39
11
|
function isPoint2D(point) {
|
|
40
12
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
41
13
|
}
|
|
@@ -47,6 +19,9 @@ function precisionRound(number, precision) {
|
|
|
47
19
|
function round2(v) {
|
|
48
20
|
return Math.round(v * 100) / 100;
|
|
49
21
|
}
|
|
22
|
+
function round5(v) {
|
|
23
|
+
return Math.round(v * 1e5) / 1e5;
|
|
24
|
+
}
|
|
50
25
|
const reprPnt = ([x, y]) => {
|
|
51
26
|
return `(${round2(x)},${round2(y)})`;
|
|
52
27
|
};
|
|
@@ -138,12 +113,12 @@ class BoundingBox2d {
|
|
|
138
113
|
return !shapeTypes.getKernel2D().isBBox2dOutPoint(this.wrapped, other[0], other[1]);
|
|
139
114
|
}
|
|
140
115
|
}
|
|
141
|
-
const normalize2d = ([
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
116
|
+
const normalize2d = ([x, y]) => {
|
|
117
|
+
const result$1 = helpers.normalize2d([x, y]);
|
|
118
|
+
if (result$1[0] === 0 && result$1[1] === 0) {
|
|
144
119
|
result.bug("normalize2d", "Cannot normalize zero-length vector");
|
|
145
120
|
}
|
|
146
|
-
return
|
|
121
|
+
return result$1;
|
|
147
122
|
};
|
|
148
123
|
function deserializeCurve2D(data) {
|
|
149
124
|
return new Curve2D(shapeTypes.getKernel().deserializeCurve2d(data));
|
|
@@ -517,9 +492,6 @@ const make2dArcFromCenter = (startPoint, endPoint, center, longArc = false) => {
|
|
|
517
492
|
endPoint
|
|
518
493
|
);
|
|
519
494
|
};
|
|
520
|
-
function round5(v) {
|
|
521
|
-
return Math.round(v * 1e5) / 1e5;
|
|
522
|
-
}
|
|
523
495
|
const adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
524
496
|
const k2d = shapeTypes.getKernel2D();
|
|
525
497
|
const curveType = curve.geomType;
|
|
@@ -825,7 +797,7 @@ class Blueprint {
|
|
|
825
797
|
* @returns Sketch data containing the projected wire and default orientation.
|
|
826
798
|
*/
|
|
827
799
|
sketchOnPlane(inputPlane, origin) {
|
|
828
|
-
const plane = inputPlane && typeof inputPlane !== "string" ? { ...inputPlane } : makePlane(inputPlane, origin);
|
|
800
|
+
const plane = inputPlane && typeof inputPlane !== "string" ? { ...inputPlane } : vectors.makePlane(inputPlane, origin);
|
|
829
801
|
const edges = curvesAsEdgesOnPlane(this.curves, plane);
|
|
830
802
|
const wire = assembleWire(edges);
|
|
831
803
|
return {
|
|
@@ -996,8 +968,6 @@ exports.make2dInerpolatedBSplineCurve = make2dInerpolatedBSplineCurve;
|
|
|
996
968
|
exports.make2dSegmentCurve = make2dSegmentCurve;
|
|
997
969
|
exports.make2dTangentArc = make2dTangentArc;
|
|
998
970
|
exports.make2dThreePointArc = make2dThreePointArc;
|
|
999
|
-
exports.makePlane = makePlane;
|
|
1000
|
-
exports.mirror = mirror;
|
|
1001
971
|
exports.normalize2d = normalize2d;
|
|
1002
972
|
exports.removeDuplicatePoints = removeDuplicatePoints;
|
|
1003
973
|
exports.viewbox = viewbox;
|
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-
|
|
9
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
10
|
-
function makePlane(plane, origin) {
|
|
11
|
-
if (plane && typeof plane !== "string") {
|
|
12
|
-
return { ...plane };
|
|
13
|
-
} else {
|
|
14
|
-
return resolvePlane(plane ?? "XY", origin);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function mirror(shape, inputPlane, origin) {
|
|
18
|
-
let originVec;
|
|
19
|
-
let directionVec;
|
|
20
|
-
if (typeof inputPlane === "string") {
|
|
21
|
-
const plane = resolvePlane(inputPlane, origin);
|
|
22
|
-
originVec = plane.origin;
|
|
23
|
-
directionVec = plane.zDir;
|
|
24
|
-
} else if (inputPlane && typeof inputPlane === "object" && "origin" in inputPlane && "zDir" in inputPlane) {
|
|
25
|
-
originVec = origin ? toVec3(origin) : inputPlane.origin;
|
|
26
|
-
directionVec = inputPlane.zDir;
|
|
27
|
-
} else if (inputPlane) {
|
|
28
|
-
originVec = origin ? toVec3(origin) : [0, 0, 0];
|
|
29
|
-
directionVec = toVec3(inputPlane);
|
|
30
|
-
} else {
|
|
31
|
-
const plane = resolvePlane("YZ", origin);
|
|
32
|
-
originVec = plane.origin;
|
|
33
|
-
directionVec = plane.zDir;
|
|
34
|
-
}
|
|
35
|
-
const newShape = getKernel().mirror(shape, originVec, directionVec);
|
|
36
|
-
return newShape;
|
|
37
|
-
}
|
|
1
|
+
import { m as makePlane } from "./vectors-B8juLsQB.js";
|
|
2
|
+
import { p as getKernel2D, r as registerForCleanup, u as unregisterFromCleanup, g as getKernel, m as createEdge, l as createWire } from "./shapeTypes-dhhm-T5A.js";
|
|
3
|
+
import { u as uvBounds, f as faceGeomType, a as faceCenter, b as uvCoordinates, c as cast } from "./faceFns-Bn2seBfp.js";
|
|
4
|
+
import { b as getOrientation } from "./curveFns-OmbtFSG8.js";
|
|
5
|
+
import { d as bug, o as ok, e as err, f as computationError, u as unwrap, v as validationError } from "./result-CoDaWsvc.js";
|
|
6
|
+
import { n as normalize2d$1, d as distance2d, s as samePoint, a as scalarMultiply2d, b as add2d, c as subtract2d, g as getSingleFace } from "./helpers-CEn618MW.js";
|
|
7
|
+
import { t as toVec3 } from "./types-CcKqsmd0.js";
|
|
8
|
+
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-LTN--A58.js";
|
|
9
|
+
import { m as makeFace } from "./surfaceBuilders-Dl0ATFbO.js";
|
|
38
10
|
function isPoint2D(point) {
|
|
39
11
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
40
12
|
}
|
|
@@ -46,6 +18,9 @@ function precisionRound(number, precision) {
|
|
|
46
18
|
function round2(v) {
|
|
47
19
|
return Math.round(v * 100) / 100;
|
|
48
20
|
}
|
|
21
|
+
function round5(v) {
|
|
22
|
+
return Math.round(v * 1e5) / 1e5;
|
|
23
|
+
}
|
|
49
24
|
const reprPnt = ([x, y]) => {
|
|
50
25
|
return `(${round2(x)},${round2(y)})`;
|
|
51
26
|
};
|
|
@@ -137,12 +112,12 @@ class BoundingBox2d {
|
|
|
137
112
|
return !getKernel2D().isBBox2dOutPoint(this.wrapped, other[0], other[1]);
|
|
138
113
|
}
|
|
139
114
|
}
|
|
140
|
-
const normalize2d = ([
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
115
|
+
const normalize2d = ([x, y]) => {
|
|
116
|
+
const result = normalize2d$1([x, y]);
|
|
117
|
+
if (result[0] === 0 && result[1] === 0) {
|
|
143
118
|
bug("normalize2d", "Cannot normalize zero-length vector");
|
|
144
119
|
}
|
|
145
|
-
return
|
|
120
|
+
return result;
|
|
146
121
|
};
|
|
147
122
|
function deserializeCurve2D(data) {
|
|
148
123
|
return new Curve2D(getKernel().deserializeCurve2d(data));
|
|
@@ -516,9 +491,6 @@ const make2dArcFromCenter = (startPoint, endPoint, center, longArc = false) => {
|
|
|
516
491
|
endPoint
|
|
517
492
|
);
|
|
518
493
|
};
|
|
519
|
-
function round5(v) {
|
|
520
|
-
return Math.round(v * 1e5) / 1e5;
|
|
521
|
-
}
|
|
522
494
|
const adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
523
495
|
const k2d = getKernel2D();
|
|
524
496
|
const curveType = curve.geomType;
|
|
@@ -979,26 +951,24 @@ class Blueprint {
|
|
|
979
951
|
export {
|
|
980
952
|
Blueprint as B,
|
|
981
953
|
Curve2D as C,
|
|
982
|
-
|
|
983
|
-
|
|
954
|
+
make2dArcFromCenter as a,
|
|
955
|
+
approximateAsSvgCompatibleCurve as b,
|
|
984
956
|
curvesAsEdgesOnPlane as c,
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
957
|
+
BoundingBox2d as d,
|
|
958
|
+
make2dInerpolatedBSplineCurve as e,
|
|
959
|
+
make2dCircle as f,
|
|
960
|
+
make2dEllipse as g,
|
|
961
|
+
deserializeCurve2D as h,
|
|
962
|
+
edgeToCurve as i,
|
|
963
|
+
approximateAsBSpline as j,
|
|
964
|
+
isPoint2D as k,
|
|
965
|
+
make2dThreePointArc as l,
|
|
966
|
+
make2dSegmentCurve as m,
|
|
995
967
|
normalize2d as n,
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
removeDuplicatePoints as t,
|
|
1002
|
-
makePlane as u,
|
|
968
|
+
asSVG as o,
|
|
969
|
+
make2dEllipseArc as p,
|
|
970
|
+
make2dTangentArc as q,
|
|
971
|
+
make2dBezierCurve as r,
|
|
972
|
+
removeDuplicatePoints as s,
|
|
1003
973
|
viewbox as v
|
|
1004
974
|
};
|
|
@@ -43,17 +43,17 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import {
|
|
47
|
-
import { o as ok, e as err,
|
|
48
|
-
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import { m as makeFace,
|
|
55
|
-
import { s as samePoint$1,
|
|
56
|
-
import { C as Curve2D,
|
|
46
|
+
import { c as createPlane } from "./vectors-B8juLsQB.js";
|
|
47
|
+
import { o as ok, e as err, f as computationError, u as unwrap, c as isOk, s as safeIndex, v as validationError, B as BrepErrorCode, k as kernelError, t as typeCastError, d as bug } from "./result-CoDaWsvc.js";
|
|
48
|
+
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-Bn2seBfp.js";
|
|
49
|
+
import { t as toVec3 } from "./types-CcKqsmd0.js";
|
|
50
|
+
import { v as vecLength, c as vecNormalize, b as vecScale, e as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-LTN--A58.js";
|
|
51
|
+
import { p as getKernel2D, g as getKernel, f as createSolid, c as castShape, h as isShape3D, n as createFace, l as createWire, m as createEdge, D as DisposalScope } from "./shapeTypes-dhhm-T5A.js";
|
|
52
|
+
import { c as complexExtrude, t as twistExtrude, s as sweep } from "./sweepFns-BKnQs59A.js";
|
|
53
|
+
import { d as curveStartPoint, e as curveTangentAt, a as curveIsClosed } from "./curveFns-OmbtFSG8.js";
|
|
54
|
+
import { m as makeFace, g as makeNewFaceWithinFace, a as assembleWire, z as zip } from "./surfaceBuilders-Dl0ATFbO.js";
|
|
55
|
+
import { s as samePoint$1, c as subtract2d, b as add2d, f as crossProduct2d, a as scalarMultiply2d, p as polarToCartesian, r as rotate2d, h as cartesianToPolar, d as distance2d, i as polarAngle2d, j as PRECISION_INTERSECTION } from "./helpers-CEn618MW.js";
|
|
56
|
+
import { C as Curve2D, m as make2dSegmentCurve, j as approximateAsBSpline, n as normalize2d, a as make2dArcFromCenter, k as isPoint2D, f as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, o as asSVG, B as Blueprint, p as make2dEllipseArc, q as make2dTangentArc, r as make2dBezierCurve, s as removeDuplicatePoints } from "./Blueprint-CQNRtmYG.js";
|
|
57
57
|
const intersectCurves = (first, second, precision = 1e-9) => {
|
|
58
58
|
if (first.boundingBox.isOut(second.boundingBox))
|
|
59
59
|
return ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
|
|
@@ -566,33 +566,29 @@ function upperBound(value, arr) {
|
|
|
566
566
|
return arr[i];
|
|
567
567
|
}
|
|
568
568
|
function sort(values, boxes, indices, left, right, nodeSize) {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
swap(values, boxes, indices, i, j);
|
|
593
|
-
}
|
|
594
|
-
sort(values, boxes, indices, left, j, nodeSize);
|
|
595
|
-
sort(values, boxes, indices, j + 1, right, nodeSize);
|
|
569
|
+
const stack = [left, right];
|
|
570
|
+
while (stack.length) {
|
|
571
|
+
const r = stack.pop() || 0;
|
|
572
|
+
const l = stack.pop() || 0;
|
|
573
|
+
if (r - l <= nodeSize && Math.floor(l / nodeSize) >= Math.floor(r / nodeSize)) continue;
|
|
574
|
+
const a = values[l];
|
|
575
|
+
const b = values[l + r >> 1];
|
|
576
|
+
const c = values[r];
|
|
577
|
+
const pivot = a > b !== a > c ? a : b < a !== b < c ? b : c;
|
|
578
|
+
let i = l - 1;
|
|
579
|
+
let j = r + 1;
|
|
580
|
+
while (true) {
|
|
581
|
+
do
|
|
582
|
+
i++;
|
|
583
|
+
while (values[i] < pivot);
|
|
584
|
+
do
|
|
585
|
+
j--;
|
|
586
|
+
while (values[j] > pivot);
|
|
587
|
+
if (i >= j) break;
|
|
588
|
+
swap(values, boxes, indices, i, j);
|
|
589
|
+
}
|
|
590
|
+
stack.push(l, j, j + 1, r);
|
|
591
|
+
}
|
|
596
592
|
}
|
|
597
593
|
function swap(values, boxes, indices, i, j) {
|
|
598
594
|
const temp = values[i];
|
|
@@ -947,6 +943,69 @@ const organiseBlueprints = (blueprints) => {
|
|
|
947
943
|
})
|
|
948
944
|
);
|
|
949
945
|
};
|
|
946
|
+
function extrude(face, extrusionVec) {
|
|
947
|
+
if (getKernel().isNull(face.wrapped)) {
|
|
948
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "extrude: face is a null shape"));
|
|
949
|
+
}
|
|
950
|
+
if (vecLength(extrusionVec) === 0) {
|
|
951
|
+
return err(validationError("EXTRUDE_ZERO_VECTOR", "extrude: extrusion vector has zero length"));
|
|
952
|
+
}
|
|
953
|
+
try {
|
|
954
|
+
const kernel = getKernel();
|
|
955
|
+
const len = vecLength(extrusionVec);
|
|
956
|
+
const dir = vecNormalize(extrusionVec);
|
|
957
|
+
const shape = kernel.extrude(face.wrapped, [...dir], len);
|
|
958
|
+
const downcastShape = kernel.downcast(shape, "solid");
|
|
959
|
+
const solid = createSolid(downcastShape);
|
|
960
|
+
return ok(solid);
|
|
961
|
+
} catch (e) {
|
|
962
|
+
return err(
|
|
963
|
+
kernelError("EXTRUDE_FAILED", "Extrusion operation failed", e, {
|
|
964
|
+
operation: "extrude",
|
|
965
|
+
vectorLength: vecLength(extrusionVec)
|
|
966
|
+
})
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function revolve(face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) {
|
|
971
|
+
if (getKernel().isNull(face.wrapped)) {
|
|
972
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "revolve: face is a null shape"));
|
|
973
|
+
}
|
|
974
|
+
const kernel = getKernel();
|
|
975
|
+
const shape = kernel.revolveVec(face.wrapped, [...center], [...direction], angle);
|
|
976
|
+
const result = castShape(shape);
|
|
977
|
+
if (!isShape3D(result)) {
|
|
978
|
+
return err(typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
|
|
979
|
+
}
|
|
980
|
+
return ok(result);
|
|
981
|
+
}
|
|
982
|
+
function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
983
|
+
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
984
|
+
return err(validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
985
|
+
}
|
|
986
|
+
const kernel = getKernel();
|
|
987
|
+
const startVertex = startPoint ? kernel.makeVertex(...toVec3(startPoint)) : void 0;
|
|
988
|
+
const endVertex = endPoint ? kernel.makeVertex(...toVec3(endPoint)) : void 0;
|
|
989
|
+
try {
|
|
990
|
+
const shape = kernel.loftAdvanced(
|
|
991
|
+
wires.map((w) => w.wrapped),
|
|
992
|
+
{
|
|
993
|
+
solid: !returnShell,
|
|
994
|
+
ruled,
|
|
995
|
+
tolerance,
|
|
996
|
+
...startVertex ? { startVertex } : {},
|
|
997
|
+
...endVertex ? { endVertex } : {}
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1000
|
+
const result = castShape(shape);
|
|
1001
|
+
if (!isShape3D(result)) {
|
|
1002
|
+
return err(typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
1003
|
+
}
|
|
1004
|
+
return ok(result);
|
|
1005
|
+
} catch {
|
|
1006
|
+
return err(kernelError("LOFT_FAILED", "Loft operation failed"));
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
950
1009
|
class Sketch {
|
|
951
1010
|
wire;
|
|
952
1011
|
/**
|
|
@@ -1031,7 +1090,9 @@ class Sketch {
|
|
|
1031
1090
|
*/
|
|
1032
1091
|
revolve(revolutionAxis, { origin } = {}) {
|
|
1033
1092
|
const face = unwrap(makeFace(this.wire));
|
|
1034
|
-
const
|
|
1093
|
+
const center = origin ? toVec3(origin) : this.defaultOrigin;
|
|
1094
|
+
const dir = revolutionAxis ? toVec3(revolutionAxis) : [0, 0, 1];
|
|
1095
|
+
const solid = unwrap(revolve(face, center, dir));
|
|
1035
1096
|
face.delete();
|
|
1036
1097
|
this.delete();
|
|
1037
1098
|
return solid;
|
|
@@ -1064,13 +1125,19 @@ class Sketch {
|
|
|
1064
1125
|
}
|
|
1065
1126
|
if (twistAngle) {
|
|
1066
1127
|
const solid2 = unwrap(
|
|
1067
|
-
twistExtrude(
|
|
1128
|
+
twistExtrude(
|
|
1129
|
+
this.wire,
|
|
1130
|
+
twistAngle,
|
|
1131
|
+
[...originVec],
|
|
1132
|
+
[...extrusionVec],
|
|
1133
|
+
extrusionProfile
|
|
1134
|
+
)
|
|
1068
1135
|
);
|
|
1069
1136
|
this.delete();
|
|
1070
1137
|
return solid2;
|
|
1071
1138
|
}
|
|
1072
1139
|
const face = unwrap(makeFace(this.wire));
|
|
1073
|
-
const solid =
|
|
1140
|
+
const solid = unwrap(extrude(face, [...extrusionVec]));
|
|
1074
1141
|
this.delete();
|
|
1075
1142
|
return solid;
|
|
1076
1143
|
}
|
|
@@ -1094,7 +1161,7 @@ class Sketch {
|
|
|
1094
1161
|
if (this.baseFace) {
|
|
1095
1162
|
config.support = this.baseFace.wrapped;
|
|
1096
1163
|
}
|
|
1097
|
-
const shape = unwrap(
|
|
1164
|
+
const shape = unwrap(sweep(sketch.wire, this.wire, config));
|
|
1098
1165
|
this.delete();
|
|
1099
1166
|
return shape;
|
|
1100
1167
|
}
|
|
@@ -1245,7 +1312,7 @@ function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
|
|
|
1245
1312
|
rotationAngle: rotation
|
|
1246
1313
|
};
|
|
1247
1314
|
}
|
|
1248
|
-
function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis,
|
|
1315
|
+
function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep2, convertToUV) {
|
|
1249
1316
|
const radRotationAngle = rotationAngleDeg * DEG2RAD;
|
|
1250
1317
|
const convertAxis = (ax) => distance2d(convertToUV(ax));
|
|
1251
1318
|
const r1 = convertAxis(polarToCartesian(majorRadius, radRotationAngle));
|
|
@@ -1259,7 +1326,7 @@ function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, r
|
|
|
1259
1326
|
r2,
|
|
1260
1327
|
newRotationAngle,
|
|
1261
1328
|
longAxis,
|
|
1262
|
-
|
|
1329
|
+
sweep2
|
|
1263
1330
|
);
|
|
1264
1331
|
const arc = make2dEllipseArc(
|
|
1265
1332
|
rx,
|
|
@@ -1496,7 +1563,7 @@ class BaseSketcher2d {
|
|
|
1496
1563
|
}
|
|
1497
1564
|
// ── Ellipse arcs ──
|
|
1498
1565
|
/** Draw an elliptical arc to an absolute end point (SVG-style parameters). */
|
|
1499
|
-
ellipseTo(end, horizontalRadius, verticalRadius, rotation = 0, longAxis = false,
|
|
1566
|
+
ellipseTo(end, horizontalRadius, verticalRadius, rotation = 0, longAxis = false, sweep2 = false) {
|
|
1500
1567
|
const { majorRadius, minorRadius, rotationAngle } = normalizeEllipseRadii(
|
|
1501
1568
|
horizontalRadius,
|
|
1502
1569
|
verticalRadius,
|
|
@@ -1509,31 +1576,31 @@ class BaseSketcher2d {
|
|
|
1509
1576
|
minorRadius,
|
|
1510
1577
|
rotationAngle,
|
|
1511
1578
|
longAxis,
|
|
1512
|
-
|
|
1579
|
+
sweep2,
|
|
1513
1580
|
(p) => this._convertToUV(p)
|
|
1514
1581
|
);
|
|
1515
1582
|
return this._saveCurveAndAdvance(arc, end);
|
|
1516
1583
|
}
|
|
1517
1584
|
/** Draw an elliptical arc to a relative end point (SVG-style parameters). */
|
|
1518
|
-
ellipse(xDist, yDist, horizontalRadius, verticalRadius, rotation = 0, longAxis = false,
|
|
1585
|
+
ellipse(xDist, yDist, horizontalRadius, verticalRadius, rotation = 0, longAxis = false, sweep2 = false) {
|
|
1519
1586
|
return this.ellipseTo(
|
|
1520
1587
|
this._resolveRelative(xDist, yDist),
|
|
1521
1588
|
horizontalRadius,
|
|
1522
1589
|
verticalRadius,
|
|
1523
1590
|
rotation,
|
|
1524
1591
|
longAxis,
|
|
1525
|
-
|
|
1592
|
+
sweep2
|
|
1526
1593
|
);
|
|
1527
1594
|
}
|
|
1528
1595
|
/** Draw a half-ellipse arc to an absolute end point with a given minor radius. */
|
|
1529
|
-
halfEllipseTo(end, minorRadius,
|
|
1596
|
+
halfEllipseTo(end, minorRadius, sweep2 = false) {
|
|
1530
1597
|
const angle = polarAngle2d(end, this.pointer);
|
|
1531
1598
|
const dist = distance2d(end, this.pointer);
|
|
1532
|
-
return this.ellipseTo(end, dist / 2, minorRadius, angle * RAD2DEG, true,
|
|
1599
|
+
return this.ellipseTo(end, dist / 2, minorRadius, angle * RAD2DEG, true, sweep2);
|
|
1533
1600
|
}
|
|
1534
1601
|
/** Draw a half-ellipse arc to a relative end point with a given minor radius. */
|
|
1535
|
-
halfEllipse(xDist, yDist, minorRadius,
|
|
1536
|
-
return this.halfEllipseTo(this._resolveRelative(xDist, yDist), minorRadius,
|
|
1602
|
+
halfEllipse(xDist, yDist, minorRadius, sweep2 = false) {
|
|
1603
|
+
return this.halfEllipseTo(this._resolveRelative(xDist, yDist), minorRadius, sweep2);
|
|
1537
1604
|
}
|
|
1538
1605
|
// ── Bezier curves ──
|
|
1539
1606
|
/** Draw a Bezier curve to an absolute end point through one or more control points. */
|
|
@@ -2474,18 +2541,21 @@ export {
|
|
|
2474
2541
|
Sketch as S,
|
|
2475
2542
|
BlueprintSketcher as a,
|
|
2476
2543
|
Flatbush as b,
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2544
|
+
roundedRectangleBlueprint as c,
|
|
2545
|
+
Blueprints as d,
|
|
2546
|
+
extrude as e,
|
|
2547
|
+
cut2D as f,
|
|
2548
|
+
fuse2D as g,
|
|
2549
|
+
filletCurves as h,
|
|
2483
2550
|
intersectCurves as i,
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2551
|
+
chamferCurves as j,
|
|
2552
|
+
intersect2D as k,
|
|
2553
|
+
loft as l,
|
|
2487
2554
|
make2dOffset as m,
|
|
2555
|
+
cutBlueprints as n,
|
|
2488
2556
|
organiseBlueprints as o,
|
|
2489
2557
|
polysidesBlueprint as p,
|
|
2490
|
-
|
|
2558
|
+
fuseBlueprints as q,
|
|
2559
|
+
revolve as r,
|
|
2560
|
+
intersectBlueprints as s
|
|
2491
2561
|
};
|