brepjs 20.5.0 → 20.6.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/README.md +1 -0
- package/dist/2d.cjs +9 -11
- package/dist/2d.js +9 -11
- package/dist/{adjacencyFns-1rxgJ6Hw.cjs → adjacencyFns-CmNvIFu1.cjs} +5 -6
- package/dist/{adjacencyFns-DeyXahej.js → adjacencyFns-DO9_F2YJ.js} +5 -6
- package/dist/{arrayAccess-DrUGPADn.js → arrayAccess-BpgouNir.js} +1 -2
- package/dist/{arrayAccess-e4H9cBfh.cjs → arrayAccess-DpJYARwv.cjs} +1 -2
- package/dist/{blueprint-Yyoiz-U1.cjs → blueprint-Ci2Mw5v-.cjs} +24 -37
- package/dist/{blueprint-rwJjYPzo.js → blueprint-DHKul4EN.js} +24 -37
- package/dist/{blueprintFns-Ce6OoPSX.cjs → blueprintFns-CbJPSd5r.cjs} +5 -7
- package/dist/{blueprintFns-Q3Sq-Fse.js → blueprintFns-D68_PxRl.js} +5 -7
- package/dist/{blueprintSketcher-FywUpRiV.js → blueprintSketcher-j9vJAniE.js} +19 -31
- package/dist/{blueprintSketcher-CzKbxeTk.cjs → blueprintSketcher-pVbM0BHf.cjs} +19 -31
- package/dist/{boolean2D-D8igCYc9.js → boolean2D-D6Oc8tBx.js} +13 -19
- package/dist/{boolean2D-BzZ9iBSn.cjs → boolean2D-Dq29HCr9.cjs} +13 -19
- package/dist/brepjs.cjs +113 -187
- package/dist/brepjs.js +113 -188
- package/dist/{bug-O02CsAmt.cjs → bug-CBcpIPuf.cjs} +2 -4
- package/dist/{bug-BdOHwn_e.js → bug-ClMTAJhe.js} +2 -4
- package/dist/{cameraFns-RHCb1F1s.cjs → cameraFns-BMXugx7m.cjs} +8 -11
- package/dist/{cameraFns-Cs6v3bWQ.js → cameraFns-DVZkA2eq.js} +8 -11
- package/dist/{constants-ITRzCnCp.js → constants-iraOnb2p.js} +1 -2
- package/dist/{constants-BOVyEYGH.cjs → constants-oee0S_x6.cjs} +1 -2
- package/dist/core.cjs +8 -8
- package/dist/core.js +8 -8
- package/dist/{cornerFinder-Dlae8IX5.js → cornerFinder-DSnn8gRP.js} +4 -5
- package/dist/{cornerFinder-Cji_BK-R.cjs → cornerFinder-DshfhGHG.cjs} +4 -5
- package/dist/{curveFns-KS1BWGhF.js → curveFns-CEb6TLxC.js} +3 -4
- package/dist/{curveFns-6-ULFrEB.cjs → curveFns-Cxq5lFqU.cjs} +3 -4
- package/dist/{drawFns-Ddlgp9gQ.cjs → drawFns-CH0q-0JP.cjs} +32 -45
- package/dist/{drawFns-3yRVBDgI.js → drawFns-DMhKXGgG.js} +32 -45
- package/dist/{errors-Zb3jBa0u.js → errors-B3espUT6.js} +3 -5
- package/dist/{errors-jwhfQJZK.cjs → errors-DoMAp7mQ.cjs} +3 -5
- package/dist/{faceFns-CZeHWke7.cjs → faceFns-B8ctN5Te.cjs} +6 -8
- package/dist/{faceFns-CTlJC5IY.js → faceFns-C-wc4fX-.js} +6 -8
- package/dist/{faceRoleFns-CWU1-Pm8.js → faceRoleFns-BPxzQF-n.js} +1 -2
- package/dist/{faceRoleFns-CtH_48MO.cjs → faceRoleFns-Db5bYj4Q.cjs} +1 -2
- package/dist/{healingFns-Ct3gEMvk.js → healingFns-CJfuZMw2.js} +16 -25
- package/dist/{healingFns-DwSpJZfg.cjs → healingFns-D3mNy1rp.cjs} +16 -25
- package/dist/{helpers-BN1mVMuZ.js → helpers-BXoAMWe3.js} +15 -21
- package/dist/{helpers-NRZVshPb.cjs → helpers-BhHbDu6-.cjs} +15 -21
- package/dist/{importFns-BEi-HsSw.cjs → importFns-DHaw1x5R.cjs} +12 -19
- package/dist/{importFns-0kHGg-b8.js → importFns-YZyGYu_M.js} +12 -19
- 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 -2
- package/dist/{loftFns-B5mq1WDh.js → loftFns-CTTia_cZ.js} +7 -10
- package/dist/{loftFns-DL9UsQhd.cjs → loftFns-DVr6PaTM.cjs} +7 -10
- package/dist/{measureFns-CyDVZomf.js → measureFns-BmdVG0_8.js} +6 -8
- package/dist/{measureFns-D_GpQw5z.cjs → measureFns-C6wgH_1a.cjs} +6 -8
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-CAxkaRTm.cjs → meshFns-r_p0RRoO.cjs} +6 -8
- package/dist/{meshFns-COlno8TY.js → meshFns-uNRS602U.js} +6 -8
- package/dist/{occtWasmAdapter-CA6PmIIj.cjs → occtWasmAdapter-CxSY6Ty2.cjs} +37 -56
- package/dist/{occtWasmAdapter-BX10fyla.js → occtWasmAdapter-cnV8J7Y-.js} +37 -56
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-DiHy5BZC.js → originTrackingFns-BIa3TdgX.js} +4 -5
- package/dist/{originTrackingFns-CWo6NWHK.cjs → originTrackingFns-DgJ-MTtE.cjs} +4 -5
- package/dist/{planeOps-DJuclNxa.cjs → planeOps-BDt05NAD.cjs} +5 -6
- package/dist/{planeOps-Cxws4Tiu.js → planeOps-BkwaqhUj.js} +5 -6
- package/dist/{primitiveFns-ZV3aMbqG.cjs → primitiveFns-CktCbLBo.cjs} +8 -10
- package/dist/{primitiveFns-CGJzS4MO.js → primitiveFns-h_zOAbmf.js} +8 -10
- package/dist/{principalBoxFns-5FSbxAj-.cjs → principalBoxFns-28BQIeo8.cjs} +7 -8
- package/dist/{principalBoxFns-BJgGEoik.js → principalBoxFns-DkP-681E.js} +7 -8
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -2
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-CpVZoeOT.js → refResolveFns-DUDJqfOM.js} +14 -21
- package/dist/{refResolveFns-Ct52Uw7R.cjs → refResolveFns-fSzDZ1rx.cjs} +14 -21
- package/dist/result.cjs +2 -2
- package/dist/result.js +2 -2
- package/dist/{rolldown-runtime-C0BPl7ul.cjs → rolldown-runtime-BW-eSwOZ.cjs} +1 -2
- package/dist/{shapeFns--1wNlcc_.js → shapeFns-B5hzkmwe.js} +5 -6
- package/dist/{shapeFns-C2j6oZ2u.cjs → shapeFns-DKDlt3k2.cjs} +5 -6
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -2
- package/dist/{shapeTypes-CqNJoSam.js → shapeTypes-Bva18qvE.js} +81 -160
- package/dist/{shapeTypes-DH2ShBU_.cjs → shapeTypes-CkxvJRpq.cjs} +81 -160
- package/dist/sketching.cjs +4 -5
- package/dist/sketching.js +4 -5
- package/dist/{solidBuilders-CgicU3le.cjs → solidBuilders-BFEnqrU0.cjs} +17 -23
- package/dist/{solidBuilders-IstbiWju.js → solidBuilders-BpTN-NfM.js} +17 -23
- package/dist/{surfaceBuilders-vYgSvgI6.cjs → surfaceBuilders-CTk2lGlw.cjs} +8 -12
- package/dist/{surfaceBuilders-8nLk2PWk.js → surfaceBuilders-DAZCPa5O.js} +8 -12
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-fa7VHJZz.cjs → textBlueprints-DbEWBdhF.cjs} +24 -32
- package/dist/{textBlueprints-C13NAA3C.js → textBlueprints-DuwP72D6.js} +23 -31
- package/dist/{textMetrics--cikHkGX.cjs → textMetrics-CbNBlPsl.cjs} +4 -6
- package/dist/{textMetrics-Dcc63qRm.js → textMetrics-q6RSXX9Z.js} +4 -6
- package/dist/{threadFns-BUQPg_vI.cjs → threadFns-5FXCN-9R.cjs} +21 -33
- package/dist/{threadFns-3U9x4v_M.js → threadFns-BcsScbp4.js} +21 -33
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-q2bGyuEV.cjs → topologyQueryFns-C6HwYYpi.cjs} +6 -9
- package/dist/{topologyQueryFns-DnfjQgP7.js → topologyQueryFns-CY6YiGsk.js} +6 -9
- package/dist/{types-D24Y27N0.js → types-CKXsIm9-.js} +1 -2
- package/dist/{types-KjA8tY4Y.cjs → types-CjF9Rofr.cjs} +1 -2
- package/dist/{validityTypes-r0A2YdNq.cjs → validityTypes-D0IDDMbY.cjs} +3 -4
- package/dist/{validityTypes-t7JpS0Ki.js → validityTypes-MiXYsBZi.js} +3 -4
- package/dist/{vecOps-CCnJt-yH.cjs → vecOps-CrGEPPQM.cjs} +1 -2
- package/dist/{vecOps-SKPRvPH-.js → vecOps-S-m9H_fe.js} +1 -2
- package/dist/vectors.cjs +4 -4
- package/dist/vectors.js +4 -4
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -2
- package/dist/{workerPool-XcYX2UZ0.js → workerPool-Bc5hmJc4.js} +5 -10
- package/dist/{workerPool-D30NsiIW.cjs → workerPool-D5tiNXrI.cjs} +5 -10
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -166,6 +166,7 @@ See the [**Declarative Models**](https://brepjs.dev/families/overview) guide.
|
|
|
166
166
|
## Projects Using brepjs
|
|
167
167
|
|
|
168
168
|
- [Gridfinity Layout Tool](https://github.com/andymai/gridfinity-layout-tool): Web-based layout generator for Gridfinity storage systems
|
|
169
|
+
- [layerling](https://github.com/henmedia/layerling): Free browser-based 3D CAD for 3D printing
|
|
169
170
|
|
|
170
171
|
## Get in touch
|
|
171
172
|
|
package/dist/2d.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_blueprint = require("./blueprint-
|
|
7
|
-
const require_boolean2D = require("./boolean2D-
|
|
8
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
9
|
-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-CkxvJRpq.cjs");
|
|
3
|
+
const require_errors = require("./errors-DoMAp7mQ.cjs");
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C6HwYYpi.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-pVbM0BHf.cjs");
|
|
6
|
+
const require_blueprint = require("./blueprint-Ci2Mw5v-.cjs");
|
|
7
|
+
const require_boolean2D = require("./boolean2D-Dq29HCr9.cjs");
|
|
8
|
+
const require_blueprintFns = require("./blueprintFns-CbJPSd5r.cjs");
|
|
9
|
+
// src/core/curve2dHandle.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
12
12
|
*
|
|
@@ -29,8 +29,7 @@ function createCurve2DHandle(rawHandle) {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
//#region src/2d/curve2dGeometryFns.ts
|
|
32
|
+
// src/2d/curve2dGeometryFns.ts
|
|
34
33
|
/**
|
|
35
34
|
* Public functional API for 2D curve geometry.
|
|
36
35
|
*
|
|
@@ -221,7 +220,6 @@ function splitCurve2d(curve, params) {
|
|
|
221
220
|
return require_shapeTypes.getKernel2D().splitCurve2d(curve.raw, params).map((h) => wrapRawHandle(h));
|
|
222
221
|
}, CURVE2D_CONSTRUCTION_FAILED, "Failed to split 2D curve");
|
|
223
222
|
}
|
|
224
|
-
//#endregion
|
|
225
223
|
exports.Blueprint = require_blueprint.Blueprint;
|
|
226
224
|
exports.Blueprints = require_blueprintSketcher.Blueprints;
|
|
227
225
|
exports.BoundingBox2d = require_blueprint.BoundingBox2d;
|
package/dist/2d.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { F as createKernelHandle, J as getKernel2D, c as createEdge } from "./shapeTypes-
|
|
2
|
-
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-
|
|
3
|
-
import { E as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-
|
|
5
|
-
import { t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-
|
|
6
|
-
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
7
|
-
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-
|
|
8
|
-
|
|
1
|
+
import { F as createKernelHandle, J as getKernel2D, c as createEdge } from "./shapeTypes-Bva18qvE.js";
|
|
2
|
+
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-B3espUT6.js";
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-CY6YiGsk.js";
|
|
4
|
+
import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-j9vJAniE.js";
|
|
5
|
+
import { t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-DHKul4EN.js";
|
|
6
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-D6Oc8tBx.js";
|
|
7
|
+
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-D68_PxRl.js";
|
|
8
|
+
// src/core/curve2dHandle.ts
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
11
11
|
*
|
|
@@ -28,8 +28,7 @@ function createCurve2DHandle(rawHandle) {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#region src/2d/curve2dGeometryFns.ts
|
|
31
|
+
// src/2d/curve2dGeometryFns.ts
|
|
33
32
|
/**
|
|
34
33
|
* Public functional API for 2D curve geometry.
|
|
35
34
|
*
|
|
@@ -220,5 +219,4 @@ function splitCurve2d(curve, params) {
|
|
|
220
219
|
return getKernel2D().splitCurve2d(curve.raw, params).map((h) => wrapRawHandle(h));
|
|
221
220
|
}, CURVE2D_CONSTRUCTION_FAILED, "Failed to split 2D curve");
|
|
222
221
|
}
|
|
223
|
-
//#endregion
|
|
224
222
|
export { Blueprint, Blueprints, BoundingBox2d, CompoundBlueprint, Curve2D, arc2d, arc2dTangent, bezier2d, boundsCurve2d, bspline2d, circle2d, copyCurve2d, createBlueprint, createCurve2DHandle, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, cut2D, cutBlueprints, distanceBetweenCurves2d, ellipse2d, ellipseArc2d, evaluateCurve2d, extractCurve2dFromEdge, fuse2D, fuseBlueprints, getBounds2D, getOrientation2D, intersect2D, intersectBlueprints, intersectCurves2d, isInside2D, liftCurve2dToPlane, line2d, mirror2D, mirrorCurve2d, mirrorCurve2dAcrossAxis, offsetCurve2d, organiseBlueprints, polysidesBlueprint, projectPointOnCurve2d, reverseCurve, rotate2D, rotateCurve2d, roundedRectangleBlueprint, scale2D, scaleCurve2d, sketchOnFace2D, sketchOnPlane2D, splitCurve2d, stretch2D, tangentCurve2d, toSVGPathD, translate2D, translateCurve2d, trimCurve2d, typeCurve2d };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_constants = require("./constants-
|
|
5
|
-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CkxvJRpq.cjs");
|
|
2
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-CxSY6Ty2.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C6HwYYpi.cjs");
|
|
4
|
+
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
|
+
// src/topology/adjacencyFns.ts
|
|
6
6
|
/**
|
|
7
7
|
* Topology adjacency queries — find related sub-shapes within a parent shape.
|
|
8
8
|
*
|
|
@@ -377,7 +377,6 @@ function adjacentFaceHashes(parent, face) {
|
|
|
377
377
|
}
|
|
378
378
|
return adjacentFaces(parent, face).map((f) => kernel.hashCode(f.wrapped, require_constants.HASH_CODE_MAX));
|
|
379
379
|
}
|
|
380
|
-
//#endregion
|
|
381
380
|
Object.defineProperty(exports, "adjacentFaceHashes", {
|
|
382
381
|
enumerable: true,
|
|
383
382
|
get: function() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as GeometryCleanupError, K as getActiveKernelId, q as getKernel, r as castResultShapeWithKnownType, t as borrowShapeWithKnownType } from "./shapeTypes-
|
|
2
|
-
import { O as isUnsupportedKernelOperationError } from "./occtWasmAdapter-
|
|
3
|
-
import { c as getFaces, f as getVertices, l as getOrCreateCache, s as getEdges } from "./topologyQueryFns-
|
|
4
|
-
import { n as HASH_CODE_MAX } from "./constants-
|
|
5
|
-
|
|
1
|
+
import { E as GeometryCleanupError, K as getActiveKernelId, q as getKernel, r as castResultShapeWithKnownType, t as borrowShapeWithKnownType } from "./shapeTypes-Bva18qvE.js";
|
|
2
|
+
import { O as isUnsupportedKernelOperationError } from "./occtWasmAdapter-cnV8J7Y-.js";
|
|
3
|
+
import { c as getFaces, f as getVertices, l as getOrCreateCache, s as getEdges } from "./topologyQueryFns-CY6YiGsk.js";
|
|
4
|
+
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
|
+
// src/topology/adjacencyFns.ts
|
|
6
6
|
/**
|
|
7
7
|
* Topology adjacency queries — find related sub-shapes within a parent shape.
|
|
8
8
|
*
|
|
@@ -377,5 +377,4 @@ function adjacentFaceHashes(parent, face) {
|
|
|
377
377
|
}
|
|
378
378
|
return adjacentFaces(parent, face).map((f) => kernel.hashCode(f.wrapped, HASH_CODE_MAX));
|
|
379
379
|
}
|
|
380
|
-
//#endregion
|
|
381
380
|
export { facesOfVertex as a, verticesOfFace as c, facesOfEdge as i, wiresOfFace as l, adjacentFaces as n, sharedEdges as o, edgesOfFace as r, verticesOfEdge as s, adjacentFaceHashes as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/arrayAccess.ts
|
|
2
2
|
/**
|
|
3
3
|
* Safe array access utilities.
|
|
4
4
|
* Replaces `arr[i]!` patterns where TypeScript's `noUncheckedIndexedAccess` requires
|
|
@@ -19,5 +19,4 @@ function lastOrThrow(arr, msg) {
|
|
|
19
19
|
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
20
20
|
return arr[arr.length - 1];
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { getAtOrThrow as n, lastOrThrow as r, firstOrThrow as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/arrayAccess.ts
|
|
2
2
|
/**
|
|
3
3
|
* Safe array access utilities.
|
|
4
4
|
* Replaces `arr[i]!` patterns where TypeScript's `noUncheckedIndexedAccess` requires
|
|
@@ -19,7 +19,6 @@ function lastOrThrow(arr, msg) {
|
|
|
19
19
|
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
20
20
|
return arr[arr.length - 1];
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
Object.defineProperty(exports, "firstOrThrow", {
|
|
24
23
|
enumerable: true,
|
|
25
24
|
get: function() {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_bug = require("./bug-
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_constants = require("./constants-
|
|
5
|
-
const require_types = require("./types-
|
|
6
|
-
const require_planeOps = require("./planeOps-
|
|
7
|
-
const require_faceFns = require("./faceFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
10
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
11
|
-
const require_helpers = require("./helpers-
|
|
12
|
-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CkxvJRpq.cjs");
|
|
2
|
+
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
|
+
const require_errors = require("./errors-DoMAp7mQ.cjs");
|
|
4
|
+
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
|
+
const require_types = require("./types-CjF9Rofr.cjs");
|
|
6
|
+
const require_planeOps = require("./planeOps-BDt05NAD.cjs");
|
|
7
|
+
const require_faceFns = require("./faceFns-B8ctN5Te.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-Cxq5lFqU.cjs");
|
|
9
|
+
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CTk2lGlw.cjs");
|
|
11
|
+
const require_helpers = require("./helpers-BhHbDu6-.cjs");
|
|
12
|
+
// src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
15
15
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
//#region src/utils/precisionRound.ts
|
|
17
|
+
// src/utils/precisionRound.ts
|
|
19
18
|
/**
|
|
20
19
|
* Round a number to a given number of decimal places.
|
|
21
20
|
*
|
|
@@ -34,8 +33,7 @@ function round2(v) {
|
|
|
34
33
|
function round5(v) {
|
|
35
34
|
return Math.round(v * 1e5) / 1e5;
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/2d/lib/utils.ts
|
|
36
|
+
// src/2d/lib/utils.ts
|
|
39
37
|
/** Format a `Point2D` as a human-readable string `(x,y)` rounded to 2 decimals. */
|
|
40
38
|
var reprPnt = ([x, y]) => {
|
|
41
39
|
return `(${round2(x)},${round2(y)})`;
|
|
@@ -54,8 +52,7 @@ var asFixed = (p, precision = 1e-9) => {
|
|
|
54
52
|
var removeDuplicatePoints = (points, precision = 1e-9) => {
|
|
55
53
|
return Array.from(new Map(points.map(([p0, p1]) => [`[${asFixed(p0, precision)},${asFixed(p1, precision)}]`, [p0, p1]])).values());
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
//#region src/2d/lib/boundingBox2d.ts
|
|
55
|
+
// src/2d/lib/boundingBox2d.ts
|
|
59
56
|
/**
|
|
60
57
|
* Axis-aligned 2D bounding box backed by an kernel `Bnd_Box2d`.
|
|
61
58
|
*
|
|
@@ -132,8 +129,7 @@ var BoundingBox2d = class {
|
|
|
132
129
|
return !require_shapeTypes.getKernel2D().isBBox2dOutPoint(this.wrapped, other[0], other[1]);
|
|
133
130
|
}
|
|
134
131
|
};
|
|
135
|
-
|
|
136
|
-
//#region src/2d/lib/vectorOperations.ts
|
|
132
|
+
// src/2d/lib/vectorOperations.ts
|
|
137
133
|
/**
|
|
138
134
|
* Normalize a 2D vector to unit length.
|
|
139
135
|
*
|
|
@@ -147,8 +143,7 @@ var normalize2d = ([x, y]) => {
|
|
|
147
143
|
if (result[0] === 0 && result[1] === 0) require_bug.bug("normalize2d", "Cannot normalize zero-length vector");
|
|
148
144
|
return result;
|
|
149
145
|
};
|
|
150
|
-
|
|
151
|
-
//#region src/2d/lib/curve2D.ts
|
|
146
|
+
// src/2d/lib/curve2D.ts
|
|
152
147
|
/**
|
|
153
148
|
* Deserialize a curve from a string produced by {@link Curve2D.serialize}.
|
|
154
149
|
*
|
|
@@ -351,8 +346,7 @@ var Curve2D = class Curve2D {
|
|
|
351
346
|
return require_shapeTypes.getKernel().splitCurve2d(this.wrapped, parameters).map((h) => new Curve2D(h));
|
|
352
347
|
}
|
|
353
348
|
};
|
|
354
|
-
|
|
355
|
-
//#region src/2d/lib/approximations.ts
|
|
349
|
+
// src/2d/lib/approximations.ts
|
|
356
350
|
/**
|
|
357
351
|
* Approximate a 2D curve as a B-spline via the kernel's
|
|
358
352
|
* `approximateCurve2dAsBSpline` method.
|
|
@@ -419,8 +413,7 @@ function approximateAsSvgCompatibleCurve(curves, options = {
|
|
|
419
413
|
return approximateAsSvgCompatibleCurve(BSplineToBezier(approximateAsBSpline(curve, options.tolerance, options.continuity, options.maxSegments)), options);
|
|
420
414
|
});
|
|
421
415
|
}
|
|
422
|
-
|
|
423
|
-
//#region src/2d/lib/makeCurves.ts
|
|
416
|
+
// src/2d/lib/makeCurves.ts
|
|
424
417
|
/**
|
|
425
418
|
* Creates a 2D segment curve between two points.
|
|
426
419
|
*
|
|
@@ -527,8 +520,7 @@ var make2dArcFromCenter = (startPoint, endPoint, center, longArc = false) => {
|
|
|
527
520
|
const midChordDir = normalize2d(require_helpers.subtract2d(midChord, center));
|
|
528
521
|
return make2dThreePointArc(startPoint, require_helpers.add2d(require_helpers.scalarMultiply2d(midChordDir, orientedRadius), center), endPoint);
|
|
529
522
|
};
|
|
530
|
-
|
|
531
|
-
//#region src/2d/lib/ellipseArcFlags.ts
|
|
523
|
+
// src/2d/lib/ellipseArcFlags.ts
|
|
532
524
|
function rotInto(p, phi) {
|
|
533
525
|
const c = Math.cos(phi);
|
|
534
526
|
const s = Math.sin(phi);
|
|
@@ -580,8 +572,7 @@ function ellipseArcFlags(from, to, onArc, majorRadius, minorRadius, xAxisAngle)
|
|
|
580
572
|
ccw
|
|
581
573
|
};
|
|
582
574
|
}
|
|
583
|
-
|
|
584
|
-
//#region src/2d/lib/svgPath.ts
|
|
575
|
+
// src/2d/lib/svgPath.ts
|
|
585
576
|
/**
|
|
586
577
|
* Convert a 2D curve to an SVG path command string.
|
|
587
578
|
*
|
|
@@ -663,8 +654,7 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
|
663
654
|
}
|
|
664
655
|
require_bug.bug("adaptedCurveToPathElem", `Unsupported curve type: ${curveType}`);
|
|
665
656
|
};
|
|
666
|
-
|
|
667
|
-
//#region src/2d/curves.ts
|
|
657
|
+
// src/2d/curves.ts
|
|
668
658
|
/** Compute the 2D bounding box enclosing all given curves. */
|
|
669
659
|
var curvesBoundingBox = (curves) => {
|
|
670
660
|
const kernel = require_shapeTypes.getKernel();
|
|
@@ -773,8 +763,7 @@ function edgeToCurve(e, face) {
|
|
|
773
763
|
if (require_curveFns.getOrientation(e) === "backward") kernel.reverseCurve2d(curve.wrapped);
|
|
774
764
|
return curve;
|
|
775
765
|
}
|
|
776
|
-
|
|
777
|
-
//#region src/2d/blueprints/svg.ts
|
|
766
|
+
// src/2d/blueprints/svg.ts
|
|
778
767
|
/**
|
|
779
768
|
* Compute an SVG `viewBox` attribute string from a 2D bounding box.
|
|
780
769
|
*
|
|
@@ -801,8 +790,7 @@ var asSVG = (body, boundingBox, margin = 1) => {
|
|
|
801
790
|
${body}
|
|
802
791
|
</svg>`;
|
|
803
792
|
};
|
|
804
|
-
|
|
805
|
-
//#region src/2d/blueprints/blueprint.ts
|
|
793
|
+
// src/2d/blueprints/blueprint.ts
|
|
806
794
|
/**
|
|
807
795
|
* Assembles a list of edges into a wire.
|
|
808
796
|
*/
|
|
@@ -1113,7 +1101,6 @@ var Blueprint = class Blueprint {
|
|
|
1113
1101
|
return false;
|
|
1114
1102
|
}
|
|
1115
1103
|
};
|
|
1116
|
-
//#endregion
|
|
1117
1104
|
Object.defineProperty(exports, "Blueprint", {
|
|
1118
1105
|
enumerable: true,
|
|
1119
1106
|
get: function() {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { B as unregisterFromCleanup, J as getKernel2D, R as registerForCleanup, c as createEdge, p as createWire, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { i as wasmIndex, n as bug } from "./bug-
|
|
3
|
-
import { E as ok, P as unwrap, d as validationError, g as err, n as computationError } from "./errors-
|
|
4
|
-
import { r as RAD2DEG, t as DEG2RAD } from "./constants-
|
|
5
|
-
import { r as toVec3 } from "./types-
|
|
6
|
-
import { r as makePlane } from "./planeOps-
|
|
7
|
-
import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-
|
|
8
|
-
import { p as getOrientation } from "./curveFns-
|
|
9
|
-
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-
|
|
10
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
11
|
-
import { l as add2d, m as normalize2d$1, p as distance2d, t as getSingleFace, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-
|
|
12
|
-
|
|
1
|
+
import { B as unregisterFromCleanup, J as getKernel2D, R as registerForCleanup, c as createEdge, p as createWire, q as getKernel } from "./shapeTypes-Bva18qvE.js";
|
|
2
|
+
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
|
+
import { E as ok, P as unwrap, d as validationError, g as err, n as computationError } from "./errors-B3espUT6.js";
|
|
4
|
+
import { r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
|
+
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
6
|
+
import { r as makePlane } from "./planeOps-BkwaqhUj.js";
|
|
7
|
+
import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-C-wc4fX-.js";
|
|
8
|
+
import { p as getOrientation } from "./curveFns-CEb6TLxC.js";
|
|
9
|
+
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
10
|
+
import { r as makeFace } from "./surfaceBuilders-DAZCPa5O.js";
|
|
11
|
+
import { l as add2d, m as normalize2d$1, p as distance2d, t as getSingleFace, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-BXoAMWe3.js";
|
|
12
|
+
// src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
15
15
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
//#region src/utils/precisionRound.ts
|
|
17
|
+
// src/utils/precisionRound.ts
|
|
19
18
|
/**
|
|
20
19
|
* Round a number to a given number of decimal places.
|
|
21
20
|
*
|
|
@@ -34,8 +33,7 @@ function round2(v) {
|
|
|
34
33
|
function round5(v) {
|
|
35
34
|
return Math.round(v * 1e5) / 1e5;
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/2d/lib/utils.ts
|
|
36
|
+
// src/2d/lib/utils.ts
|
|
39
37
|
/** Format a `Point2D` as a human-readable string `(x,y)` rounded to 2 decimals. */
|
|
40
38
|
var reprPnt = ([x, y]) => {
|
|
41
39
|
return `(${round2(x)},${round2(y)})`;
|
|
@@ -54,8 +52,7 @@ var asFixed = (p, precision = 1e-9) => {
|
|
|
54
52
|
var removeDuplicatePoints = (points, precision = 1e-9) => {
|
|
55
53
|
return Array.from(new Map(points.map(([p0, p1]) => [`[${asFixed(p0, precision)},${asFixed(p1, precision)}]`, [p0, p1]])).values());
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
//#region src/2d/lib/boundingBox2d.ts
|
|
55
|
+
// src/2d/lib/boundingBox2d.ts
|
|
59
56
|
/**
|
|
60
57
|
* Axis-aligned 2D bounding box backed by an kernel `Bnd_Box2d`.
|
|
61
58
|
*
|
|
@@ -132,8 +129,7 @@ var BoundingBox2d = class {
|
|
|
132
129
|
return !getKernel2D().isBBox2dOutPoint(this.wrapped, other[0], other[1]);
|
|
133
130
|
}
|
|
134
131
|
};
|
|
135
|
-
|
|
136
|
-
//#region src/2d/lib/vectorOperations.ts
|
|
132
|
+
// src/2d/lib/vectorOperations.ts
|
|
137
133
|
/**
|
|
138
134
|
* Normalize a 2D vector to unit length.
|
|
139
135
|
*
|
|
@@ -147,8 +143,7 @@ var normalize2d = ([x, y]) => {
|
|
|
147
143
|
if (result[0] === 0 && result[1] === 0) bug("normalize2d", "Cannot normalize zero-length vector");
|
|
148
144
|
return result;
|
|
149
145
|
};
|
|
150
|
-
|
|
151
|
-
//#region src/2d/lib/curve2D.ts
|
|
146
|
+
// src/2d/lib/curve2D.ts
|
|
152
147
|
/**
|
|
153
148
|
* Deserialize a curve from a string produced by {@link Curve2D.serialize}.
|
|
154
149
|
*
|
|
@@ -351,8 +346,7 @@ var Curve2D = class Curve2D {
|
|
|
351
346
|
return getKernel().splitCurve2d(this.wrapped, parameters).map((h) => new Curve2D(h));
|
|
352
347
|
}
|
|
353
348
|
};
|
|
354
|
-
|
|
355
|
-
//#region src/2d/lib/approximations.ts
|
|
349
|
+
// src/2d/lib/approximations.ts
|
|
356
350
|
/**
|
|
357
351
|
* Approximate a 2D curve as a B-spline via the kernel's
|
|
358
352
|
* `approximateCurve2dAsBSpline` method.
|
|
@@ -419,8 +413,7 @@ function approximateAsSvgCompatibleCurve(curves, options = {
|
|
|
419
413
|
return approximateAsSvgCompatibleCurve(BSplineToBezier(approximateAsBSpline(curve, options.tolerance, options.continuity, options.maxSegments)), options);
|
|
420
414
|
});
|
|
421
415
|
}
|
|
422
|
-
|
|
423
|
-
//#region src/2d/lib/makeCurves.ts
|
|
416
|
+
// src/2d/lib/makeCurves.ts
|
|
424
417
|
/**
|
|
425
418
|
* Creates a 2D segment curve between two points.
|
|
426
419
|
*
|
|
@@ -527,8 +520,7 @@ var make2dArcFromCenter = (startPoint, endPoint, center, longArc = false) => {
|
|
|
527
520
|
const midChordDir = normalize2d(subtract2d(midChord, center));
|
|
528
521
|
return make2dThreePointArc(startPoint, add2d(scalarMultiply2d(midChordDir, orientedRadius), center), endPoint);
|
|
529
522
|
};
|
|
530
|
-
|
|
531
|
-
//#region src/2d/lib/ellipseArcFlags.ts
|
|
523
|
+
// src/2d/lib/ellipseArcFlags.ts
|
|
532
524
|
function rotInto(p, phi) {
|
|
533
525
|
const c = Math.cos(phi);
|
|
534
526
|
const s = Math.sin(phi);
|
|
@@ -580,8 +572,7 @@ function ellipseArcFlags(from, to, onArc, majorRadius, minorRadius, xAxisAngle)
|
|
|
580
572
|
ccw
|
|
581
573
|
};
|
|
582
574
|
}
|
|
583
|
-
|
|
584
|
-
//#region src/2d/lib/svgPath.ts
|
|
575
|
+
// src/2d/lib/svgPath.ts
|
|
585
576
|
/**
|
|
586
577
|
* Convert a 2D curve to an SVG path command string.
|
|
587
578
|
*
|
|
@@ -663,8 +654,7 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
|
663
654
|
}
|
|
664
655
|
bug("adaptedCurveToPathElem", `Unsupported curve type: ${curveType}`);
|
|
665
656
|
};
|
|
666
|
-
|
|
667
|
-
//#region src/2d/curves.ts
|
|
657
|
+
// src/2d/curves.ts
|
|
668
658
|
/** Compute the 2D bounding box enclosing all given curves. */
|
|
669
659
|
var curvesBoundingBox = (curves) => {
|
|
670
660
|
const kernel = getKernel();
|
|
@@ -773,8 +763,7 @@ function edgeToCurve(e, face) {
|
|
|
773
763
|
if (getOrientation(e) === "backward") kernel.reverseCurve2d(curve.wrapped);
|
|
774
764
|
return curve;
|
|
775
765
|
}
|
|
776
|
-
|
|
777
|
-
//#region src/2d/blueprints/svg.ts
|
|
766
|
+
// src/2d/blueprints/svg.ts
|
|
778
767
|
/**
|
|
779
768
|
* Compute an SVG `viewBox` attribute string from a 2D bounding box.
|
|
780
769
|
*
|
|
@@ -801,8 +790,7 @@ var asSVG = (body, boundingBox, margin = 1) => {
|
|
|
801
790
|
${body}
|
|
802
791
|
</svg>`;
|
|
803
792
|
};
|
|
804
|
-
|
|
805
|
-
//#region src/2d/blueprints/blueprint.ts
|
|
793
|
+
// src/2d/blueprints/blueprint.ts
|
|
806
794
|
/**
|
|
807
795
|
* Assembles a list of edges into a wire.
|
|
808
796
|
*/
|
|
@@ -1113,5 +1101,4 @@ var Blueprint = class Blueprint {
|
|
|
1113
1101
|
return false;
|
|
1114
1102
|
}
|
|
1115
1103
|
};
|
|
1116
|
-
//#endregion
|
|
1117
1104
|
export { isPoint2D as C, removeDuplicatePoints as S, approximateAsSvgCompatibleCurve as _, edgeToCurve as a, normalize2d as b, make2dBezierCurve as c, make2dEllipseArc as d, make2dInerpolatedBSplineCurve as f, approximateAsBSpline as g, make2dThreePointArc as h, curvesAsEdgesOnPlane as i, make2dCircle as l, make2dTangentArc as m, asSVG as n, ellipseArcFlags as o, make2dSegmentCurve as p, viewbox as r, make2dArcFromCenter as s, Blueprint as t, make2dEllipse as u, Curve2D as v, BoundingBox2d as x, deserializeCurve2D as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
3
|
-
const require_blueprint = require("./blueprint-
|
|
4
|
-
|
|
1
|
+
const require_errors = require("./errors-DoMAp7mQ.cjs");
|
|
2
|
+
const require_blueprintSketcher = require("./blueprintSketcher-pVbM0BHf.cjs");
|
|
3
|
+
const require_blueprint = require("./blueprint-Ci2Mw5v-.cjs");
|
|
4
|
+
// src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
7
7
|
*
|
|
@@ -62,8 +62,7 @@ function curve2dIsOnCurve(curve, point) {
|
|
|
62
62
|
function curve2dDistanceFrom(curve, point) {
|
|
63
63
|
return curve.distanceFrom(point);
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region src/2d/blueprints/blueprintFns.ts
|
|
65
|
+
// src/2d/blueprints/blueprintFns.ts
|
|
67
66
|
/**
|
|
68
67
|
* Create a new Blueprint from an ordered array of 2D curves.
|
|
69
68
|
*
|
|
@@ -132,7 +131,6 @@ function sketchOnPlane2D(bp, inputPlane, origin) {
|
|
|
132
131
|
function sketchOnFace2D(bp, face, scaleMode) {
|
|
133
132
|
return bp.sketchOnFace(face, scaleMode);
|
|
134
133
|
}
|
|
135
|
-
//#endregion
|
|
136
134
|
Object.defineProperty(exports, "createBlueprint", {
|
|
137
135
|
enumerable: true,
|
|
138
136
|
get: function() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-
|
|
2
|
-
import { i as CompoundBlueprint } from "./blueprintSketcher-
|
|
3
|
-
import { t as Blueprint } from "./blueprint-
|
|
4
|
-
|
|
1
|
+
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-B3espUT6.js";
|
|
2
|
+
import { i as CompoundBlueprint } from "./blueprintSketcher-j9vJAniE.js";
|
|
3
|
+
import { t as Blueprint } from "./blueprint-DHKul4EN.js";
|
|
4
|
+
// src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
7
7
|
*
|
|
@@ -62,8 +62,7 @@ function curve2dIsOnCurve(curve, point) {
|
|
|
62
62
|
function curve2dDistanceFrom(curve, point) {
|
|
63
63
|
return curve.distanceFrom(point);
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region src/2d/blueprints/blueprintFns.ts
|
|
65
|
+
// src/2d/blueprints/blueprintFns.ts
|
|
67
66
|
/**
|
|
68
67
|
* Create a new Blueprint from an ordered array of 2D curves.
|
|
69
68
|
*
|
|
@@ -132,5 +131,4 @@ function sketchOnPlane2D(bp, inputPlane, origin) {
|
|
|
132
131
|
function sketchOnFace2D(bp, face, scaleMode) {
|
|
133
132
|
return bp.sketchOnFace(face, scaleMode);
|
|
134
133
|
}
|
|
135
|
-
//#endregion
|
|
136
134
|
export { reverseCurve as S, curve2dIsOnCurve as _, isInside2D as a, curve2dSplitAt as b, scale2D as c, stretch2D as d, toSVGPathD as f, curve2dFirstPoint as g, curve2dDistanceFrom as h, getOrientation2D as i, sketchOnFace2D as l, curve2dBoundingBox as m, createCompoundBlueprint as n, mirror2D as o, translate2D as p, getBounds2D as r, rotate2D as s, createBlueprint as t, sketchOnPlane2D as u, curve2dLastPoint as v, curve2dTangentAt as x, curve2dParameter as y };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { J as getKernel2D, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { i as wasmIndex, n as bug } from "./bug-
|
|
3
|
-
import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-
|
|
4
|
-
import { r as RAD2DEG, t as DEG2RAD } from "./constants-
|
|
5
|
-
import { t as firstOrThrow } from "./arrayAccess-
|
|
6
|
-
import { _ as rotate2d, d as cartesianToPolar, f as crossProduct2d, g as polarToCartesian, h as polarAngle2d, l as add2d, p as distance2d, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-
|
|
7
|
-
import { C as isPoint2D, b as normalize2d, c as make2dBezierCurve, d as make2dEllipseArc, g as approximateAsBSpline, h as make2dThreePointArc, l as make2dCircle, m as make2dTangentArc, n as asSVG, p as make2dSegmentCurve, r as viewbox, s as make2dArcFromCenter, t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-
|
|
8
|
-
|
|
1
|
+
import { J as getKernel2D, q as getKernel } from "./shapeTypes-Bva18qvE.js";
|
|
2
|
+
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
|
+
import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-B3espUT6.js";
|
|
4
|
+
import { r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
|
+
import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
6
|
+
import { _ as rotate2d, d as cartesianToPolar, f as crossProduct2d, g as polarToCartesian, h as polarAngle2d, l as add2d, p as distance2d, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-BXoAMWe3.js";
|
|
7
|
+
import { C as isPoint2D, b as normalize2d, c as make2dBezierCurve, d as make2dEllipseArc, g as approximateAsBSpline, h as make2dThreePointArc, l as make2dCircle, m as make2dTangentArc, n as asSVG, p as make2dSegmentCurve, r as viewbox, s as make2dArcFromCenter, t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-DHKul4EN.js";
|
|
8
|
+
// node_modules/flatqueue/index.js
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
|
|
11
11
|
* Uint32ArrayConstructor | Int32ArrayConstructor | Uint16ArrayConstructor |
|
|
@@ -112,8 +112,7 @@ var FlatQueue = class {
|
|
|
112
112
|
if (Array.isArray(this.values)) this.values.length = this.length;
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
//#region node_modules/flatbush/index.js
|
|
115
|
+
// node_modules/flatbush/index.js
|
|
117
116
|
var ARRAY_TYPES = [
|
|
118
117
|
Int8Array,
|
|
119
118
|
Uint8Array,
|
|
@@ -522,8 +521,7 @@ function hilbert(x, y) {
|
|
|
522
521
|
b = (b | b << 1) & 1431655765;
|
|
523
522
|
return ((b << 1 | a) >>> 0) - 2147483648;
|
|
524
523
|
}
|
|
525
|
-
|
|
526
|
-
//#region src/2d/lib/intersections.ts
|
|
524
|
+
// src/2d/lib/intersections.ts
|
|
527
525
|
/**
|
|
528
526
|
* Compute intersection points and common segments between two 2D curves.
|
|
529
527
|
*
|
|
@@ -591,8 +589,7 @@ var selfIntersections = (curve, precision = 1e-9) => {
|
|
|
591
589
|
}
|
|
592
590
|
return ok(intersections);
|
|
593
591
|
};
|
|
594
|
-
|
|
595
|
-
//#region src/2d/lib/offset.ts
|
|
592
|
+
// src/2d/lib/offset.ts
|
|
596
593
|
var offsetEndPoints = (firstPoint, lastPoint, offset) => {
|
|
597
594
|
const tangent = normalize2d(subtract2d(lastPoint, firstPoint));
|
|
598
595
|
const normal = [tangent[1], -tangent[0]];
|
|
@@ -675,8 +672,7 @@ var make2dOffset = (curve, offset) => {
|
|
|
675
672
|
}
|
|
676
673
|
return approximation;
|
|
677
674
|
};
|
|
678
|
-
|
|
679
|
-
//#region src/2d/lib/customCorners.ts
|
|
675
|
+
// src/2d/lib/customCorners.ts
|
|
680
676
|
/** Unwrap an intersection, discarding the common-segment curves the caller does not use. */
|
|
681
677
|
function intersectionPoints(first, second) {
|
|
682
678
|
const result = unwrap(intersectCurves(first, second));
|
|
@@ -872,8 +868,7 @@ function dogboneFilletCurves(firstCurve, secondCurve, radius) {
|
|
|
872
868
|
circle?.delete();
|
|
873
869
|
}
|
|
874
870
|
}
|
|
875
|
-
|
|
876
|
-
//#region src/2d/blueprints/blueprints.ts
|
|
871
|
+
// src/2d/blueprints/blueprints.ts
|
|
877
872
|
/**
|
|
878
873
|
* Hold a collection of disjoint 2D profiles (simple or compound).
|
|
879
874
|
*
|
|
@@ -982,8 +977,7 @@ var Blueprints = class Blueprints {
|
|
|
982
977
|
return asSVG(elements.join("\n "), this.boundingBox, margin);
|
|
983
978
|
}
|
|
984
979
|
};
|
|
985
|
-
|
|
986
|
-
//#region src/2d/blueprints/compoundBlueprint.ts
|
|
980
|
+
// src/2d/blueprints/compoundBlueprint.ts
|
|
987
981
|
/**
|
|
988
982
|
* Represent a 2D profile with holes (an outer boundary minus inner cutouts).
|
|
989
983
|
*
|
|
@@ -1111,8 +1105,7 @@ var CompoundBlueprint = class CompoundBlueprint {
|
|
|
1111
1105
|
return asSVG(this.toSVGGroup(), this.boundingBox, margin);
|
|
1112
1106
|
}
|
|
1113
1107
|
};
|
|
1114
|
-
|
|
1115
|
-
//#region src/2d/blueprints/lib.ts
|
|
1108
|
+
// src/2d/blueprints/lib.ts
|
|
1116
1109
|
/**
|
|
1117
1110
|
* Groups blueprints by bounding box overlap using a spatial index.
|
|
1118
1111
|
* Uses Flatbush for O(n log n) performance instead of O(n²) pairwise comparison.
|
|
@@ -1188,8 +1181,7 @@ var organiseBlueprints = (blueprints) => {
|
|
|
1188
1181
|
return new CompoundBlueprint(compounds.map(({ blueprint }) => blueprint));
|
|
1189
1182
|
}));
|
|
1190
1183
|
};
|
|
1191
|
-
|
|
1192
|
-
//#region src/2d/blueprints/genericSketcher.ts
|
|
1184
|
+
// src/2d/blueprints/genericSketcher.ts
|
|
1193
1185
|
var isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
|
|
1194
1186
|
/** Resolve a {@link SplineOptions} into fully-expanded tangent directions and factors. */
|
|
1195
1187
|
var defaultsSplineOptions = (config) => {
|
|
@@ -1214,8 +1206,7 @@ var defaultsSplineOptions = (config) => {
|
|
|
1214
1206
|
startTangent
|
|
1215
1207
|
};
|
|
1216
1208
|
};
|
|
1217
|
-
|
|
1218
|
-
//#region src/2d/blueprints/ellipseUtils.ts
|
|
1209
|
+
// src/2d/blueprints/ellipseUtils.ts
|
|
1219
1210
|
/**
|
|
1220
1211
|
* Normalize ellipse radii so that major >= minor, adjusting the rotation
|
|
1221
1212
|
* angle by 90 degrees when the radii need to be swapped.
|
|
@@ -1335,8 +1326,7 @@ function convertSvgEllipseParams([x1, y1], [x2, y2], rx, ry, phi, fA, fS) {
|
|
|
1335
1326
|
ry
|
|
1336
1327
|
};
|
|
1337
1328
|
}
|
|
1338
|
-
|
|
1339
|
-
//#region src/2d/blueprints/baseSketcher2d.ts
|
|
1329
|
+
// src/2d/blueprints/baseSketcher2d.ts
|
|
1340
1330
|
var cornerModeFns = {
|
|
1341
1331
|
chamfer: chamferCurves,
|
|
1342
1332
|
dogbone: dogboneFilletCurves,
|
|
@@ -1629,8 +1619,7 @@ var BaseSketcher2d = class {
|
|
|
1629
1619
|
this.pointer = this.firstPoint;
|
|
1630
1620
|
}
|
|
1631
1621
|
};
|
|
1632
|
-
|
|
1633
|
-
//#region src/2d/blueprints/blueprintSketcher.ts
|
|
1622
|
+
// src/2d/blueprints/blueprintSketcher.ts
|
|
1634
1623
|
/**
|
|
1635
1624
|
* Draw 2D curves and produce a {@link Blueprint} (pure-2D shape, no kernel wire).
|
|
1636
1625
|
*
|
|
@@ -1673,5 +1662,4 @@ var BlueprintSketcher = class extends BaseSketcher2d {
|
|
|
1673
1662
|
return this.done();
|
|
1674
1663
|
}
|
|
1675
1664
|
};
|
|
1676
|
-
//#endregion
|
|
1677
1665
|
export { Blueprints as a, make2dOffset as c, CompoundBlueprint as i, intersectCurves as l, BaseSketcher2d as n, chamferCurves as o, organiseBlueprints as r, filletCurves as s, BlueprintSketcher as t, Flatbush as u };
|