brepjs 15.1.9 → 15.1.11
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/blueprintOffset.d.ts.map +1 -1
- package/dist/2d/blueprints/intersectionSegments.d.ts.map +1 -1
- package/dist/2d/blueprints/segmentAssembly.d.ts.map +1 -1
- package/dist/2d/curve2dGeometryFns.d.ts +6 -0
- package/dist/2d/curve2dGeometryFns.d.ts.map +1 -1
- package/dist/2d/curves.d.ts.map +1 -1
- package/dist/2d.cjs +22 -5
- package/dist/2d.d.ts +1 -1
- package/dist/2d.d.ts.map +1 -1
- package/dist/2d.js +20 -6
- package/dist/{blueprint-BqfmnE-a.cjs → blueprint-BvUKWbkE.cjs} +28 -23
- package/dist/{blueprint-TAP5VKvS.js → blueprint-DD20bL3n.js} +28 -23
- package/dist/{blueprintFns-CBw4356y.cjs → blueprintFns-CXdRmpJv.cjs} +2 -2
- package/dist/{blueprintFns-CjV2S9wl.js → blueprintFns-DgUIqFgy.js} +2 -2
- package/dist/{boolean2D-BqZa2eCz.js → boolean2D-BtmgEhzg.js} +77 -21
- package/dist/{boolean2D-DC81hlIZ.cjs → boolean2D-Cpk3Ieie.cjs} +77 -21
- package/dist/{booleanFns-Y3xwUQYq.cjs → booleanFns-8kJL7byz.cjs} +21 -7
- package/dist/{booleanFns-D1kEkLvp.js → booleanFns-BmOsJHAY.js} +21 -7
- package/dist/brepjs.cjs +20 -20
- package/dist/brepjs.js +20 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-Ct8gd2nn.cjs → cornerFinder-BybcZVxL.cjs} +1 -1
- package/dist/{cornerFinder-QAC3VdiI.js → cornerFinder-C7k0yipe.js} +1 -1
- package/dist/{curveFns-xOx617Vs.cjs → curveFns-BErRtKDj.cjs} +1 -1
- package/dist/{curveFns-DkM157b8.js → curveFns-DbIakl9J.js} +1 -1
- package/dist/{drawFns-JPBjBePH.cjs → drawFns-PktTJbzy.cjs} +24 -13
- package/dist/{drawFns-DtC9rW-f.js → drawFns-Rn-dEfBR.js} +24 -13
- package/dist/{extrudeFns-Bzsx_rmn.cjs → extrudeFns-7_WDVoEg.cjs} +1 -1
- package/dist/{extrudeFns-DtHg7Uao.js → extrudeFns-pjrR5ECA.js} +1 -1
- package/dist/{faceFns-DLQ0-OBU.cjs → faceFns-B8y0xqpK.cjs} +1 -1
- package/dist/{faceFns-C7_zbEch.js → faceFns-wSgaAQrJ.js} +1 -1
- package/dist/{helpers-DU_FI6Oh.cjs → helpers-CpCe09zS.cjs} +5 -5
- package/dist/{helpers-BTv-yY8r.js → helpers-DsVYL2Ri.js} +5 -5
- package/dist/{historyFns-CY-46Ivn.js → historyFns-B3d7YiP9.js} +4 -4
- package/dist/{historyFns-BtesqCmL.cjs → historyFns-DbUJQAXI.cjs} +4 -4
- package/dist/{importFns-DCru75oa.cjs → importFns-B-5chCzB.cjs} +2 -2
- package/dist/{importFns-DVMhnD9T.js → importFns-C0Edyiov.js} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/geometry2d.d.ts.map +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{measureFns-BcRXbP7I.js → measureFns-gRr84qGk.js} +2 -2
- package/dist/{measureFns-5TTtVcT9.cjs → measureFns-vgnbVhDc.cjs} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-B2T-lpvP.js → meshFns-CA6fJ-Z0.js} +2 -2
- package/dist/{meshFns-ULSYlg76.cjs → meshFns-rMEka_pV.cjs} +2 -2
- package/dist/{occtWasmAdapter-B8K7kN7m.js → occtWasmAdapter-BBr9e9ej.js} +30 -1
- package/dist/{occtWasmAdapter-DYjViuTQ.cjs → occtWasmAdapter-DcGOi3MQ.cjs} +30 -1
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-7P5Hf3WY.cjs → primitiveFns-B1R8RWjt.cjs} +5 -5
- package/dist/{primitiveFns-VqIM41Rz.js → primitiveFns-DtfUR91z.js} +5 -5
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{shapeFns-BXaKHIQ3.cjs → shapeFns-BtGq6ZqD.cjs} +2 -2
- package/dist/{shapeFns-C_RXS-bz.js → shapeFns-ClKIHb3P.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-BJNRYexW.js → shapeRefFns-DjWRttT2.js} +3 -3
- package/dist/{shapeRefFns-DvwSQrkl.cjs → shapeRefFns-MA4_U4Fn.cjs} +3 -3
- package/dist/{shapeTypes-rKIgWjDk.cjs → shapeTypes-Cs7uihz8.cjs} +1 -1
- package/dist/{shapeTypes-cnUTQRbe.js → shapeTypes-Qh4ErtGx.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-D687wjsQ.cjs → solidBuilders-BMv6UQUY.cjs} +2 -2
- package/dist/{solidBuilders-Ca7lRUxh.js → solidBuilders-CHvrwtLL.js} +2 -2
- package/dist/{surfaceBuilders-CuTfdkEc.cjs → surfaceBuilders-Bgc5TlIe.cjs} +2 -2
- package/dist/{surfaceBuilders-Dd49hsUf.js → surfaceBuilders-CL8MJABt.js} +2 -2
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprintOffset.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/blueprintOffset.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,OAAO,EAQR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAuLxE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,oBAAoB,EAAE,OAAO,EAAE,EAAE,EACjC,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,OAAO,GAClB,OAAO,CAQT;AAMD;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,mBAAmB,EAAE,GAAG,IAAI,CAsF9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentAssembly.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/segmentAssembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"segmentAssembly.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/segmentAssembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAkE9C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CA6BzD;AAMD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,UAAU,GACV,IAAI,GACJ,eAAe,GACf,oBAAoB,CAAC;AAMzB,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1C;AAmGD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAmExB"}
|
|
@@ -104,4 +104,10 @@ export declare function distanceBetweenCurves2d(c1: Curve2DHandle, c2: Curve2DHa
|
|
|
104
104
|
export declare function liftCurve2dToPlane(curve: Curve2DHandle, plane: Plane): Result<Edge>;
|
|
105
105
|
/** Extract the 2D parametric curve of a 3D edge on a face. */
|
|
106
106
|
export declare function extractCurve2dFromEdge(edge: Edge, face: Face): Result<Curve2DHandle>;
|
|
107
|
+
/** Trim a 2D curve to a sub-range of its parameter domain. */
|
|
108
|
+
export declare function trimCurve2d(curve: Curve2DHandle, start: number, end: number): Result<Curve2DHandle>;
|
|
109
|
+
/** Create an independent deep copy of a 2D curve. */
|
|
110
|
+
export declare function copyCurve2d(curve: Curve2DHandle): Result<Curve2DHandle>;
|
|
111
|
+
/** Split a 2D curve at the given parameter values. */
|
|
112
|
+
export declare function splitCurve2d(curve: Curve2DHandle, params: number[]): Result<Curve2DHandle[]>;
|
|
107
113
|
//# sourceMappingURL=curve2dGeometryFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve2dGeometryFns.d.ts","sourceRoot":"","sources":["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ACd,gBAaF,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,SAAQ,OAAgB,KAAG,gBAE3E,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,GAC3B,aAAa,MAAM,EACnB,SAAQ,OAAgB,KACvB,gBAEF,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EAAE,EACjB,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,SAAsB,GAC5B,MAAM,CAAC,IAAI,EAAE,CAAC,CAyEhB;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAQxD"}
|
package/dist/2d.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXRNVCec.cjs");
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
5
|
-
const require_boolean2D = require("./boolean2D-
|
|
6
|
-
const require_blueprint = require("./blueprint-
|
|
7
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
4
|
+
const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
|
|
5
|
+
const require_boolean2D = require("./boolean2D-Cpk3Ieie.cjs");
|
|
6
|
+
const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
|
|
7
|
+
const require_blueprintFns = require("./blueprintFns-CXdRmpJv.cjs");
|
|
8
8
|
//#region src/core/curve2dHandle.ts
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
@@ -204,6 +204,20 @@ function liftCurve2dToPlane(curve, plane) {
|
|
|
204
204
|
function extractCurve2dFromEdge(edge, face) {
|
|
205
205
|
return curveCall(() => require_shapeTypes.getKernel2D().extractCurve2dFromEdge(edge.wrapped, face.wrapped), CURVE2D_BRIDGE_FAILED, "Failed to extract 2D curve from edge");
|
|
206
206
|
}
|
|
207
|
+
/** Trim a 2D curve to a sub-range of its parameter domain. */
|
|
208
|
+
function trimCurve2d(curve, start, end) {
|
|
209
|
+
return curveCall(() => require_shapeTypes.getKernel2D().trimCurve2d(curve.raw, start, end), CURVE2D_CONSTRUCTION_FAILED, "Failed to trim 2D curve");
|
|
210
|
+
}
|
|
211
|
+
/** Create an independent deep copy of a 2D curve. */
|
|
212
|
+
function copyCurve2d(curve) {
|
|
213
|
+
return curveCall(() => require_shapeTypes.getKernel2D().copyCurve2d(curve.raw), CURVE2D_CONSTRUCTION_FAILED, "Failed to copy 2D curve");
|
|
214
|
+
}
|
|
215
|
+
/** Split a 2D curve at the given parameter values. */
|
|
216
|
+
function splitCurve2d(curve, params) {
|
|
217
|
+
return require_faceFns.kernelCallRaw(() => {
|
|
218
|
+
return require_shapeTypes.getKernel2D().splitCurve2d(curve.raw, params).map((h) => wrapRawHandle(h));
|
|
219
|
+
}, CURVE2D_CONSTRUCTION_FAILED, "Failed to split 2D curve");
|
|
220
|
+
}
|
|
207
221
|
//#endregion
|
|
208
222
|
exports.Blueprint = require_blueprint.Blueprint;
|
|
209
223
|
exports.Blueprints = require_boolean2D.Blueprints;
|
|
@@ -216,6 +230,7 @@ exports.bezier2d = bezier2d;
|
|
|
216
230
|
exports.boundsCurve2d = boundsCurve2d;
|
|
217
231
|
exports.bspline2d = bspline2d;
|
|
218
232
|
exports.circle2d = circle2d;
|
|
233
|
+
exports.copyCurve2d = copyCurve2d;
|
|
219
234
|
exports.createBlueprint = require_blueprintFns.createBlueprint;
|
|
220
235
|
exports.createCurve2DHandle = createCurve2DHandle;
|
|
221
236
|
exports.curve2dBoundingBox = require_blueprintFns.curve2dBoundingBox;
|
|
@@ -258,9 +273,11 @@ exports.scale2D = require_blueprintFns.scale2D;
|
|
|
258
273
|
exports.scaleCurve2d = scaleCurve2d;
|
|
259
274
|
exports.sketchOnFace2D = require_blueprintFns.sketchOnFace2D;
|
|
260
275
|
exports.sketchOnPlane2D = require_blueprintFns.sketchOnPlane2D;
|
|
276
|
+
exports.splitCurve2d = splitCurve2d;
|
|
261
277
|
exports.stretch2D = require_blueprintFns.stretch2D;
|
|
262
278
|
exports.tangentCurve2d = tangentCurve2d;
|
|
263
279
|
exports.toSVGPathD = require_blueprintFns.toSVGPathD;
|
|
264
280
|
exports.translate2D = require_blueprintFns.translate2D;
|
|
265
281
|
exports.translateCurve2d = translateCurve2d;
|
|
282
|
+
exports.trimCurve2d = trimCurve2d;
|
|
266
283
|
exports.typeCurve2d = typeCurve2d;
|
package/dist/2d.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD,
|
|
|
17
17
|
export { fuseBlueprints, cutBlueprints, intersectBlueprints, } from './2d/blueprints/booleanOperations.js';
|
|
18
18
|
export { fuse2D, cut2D, intersect2D, type Shape2D } from './2d/blueprints/boolean2D.js';
|
|
19
19
|
export { reverseCurve, curve2dBoundingBox, curve2dFirstPoint, curve2dLastPoint, curve2dSplitAt, curve2dParameter, curve2dTangentAt, curve2dIsOnCurve, curve2dDistanceFrom, } from './2d/lib/curve2dFns.js';
|
|
20
|
-
export { line2d, circle2d, arc2d, arc2dTangent, ellipse2d, ellipseArc2d, bezier2d, bspline2d, translateCurve2d, rotateCurve2d, scaleCurve2d, mirrorCurve2d, mirrorCurve2dAcrossAxis, offsetCurve2d, evaluateCurve2d, tangentCurve2d, boundsCurve2d, typeCurve2d, intersectCurves2d, projectPointOnCurve2d, distanceBetweenCurves2d, liftCurve2dToPlane, extractCurve2dFromEdge, type Ellipse2dOptions, type BSpline2dOptions, } from './2d/curve2dGeometryFns.js';
|
|
20
|
+
export { line2d, circle2d, arc2d, arc2dTangent, ellipse2d, ellipseArc2d, bezier2d, bspline2d, translateCurve2d, rotateCurve2d, scaleCurve2d, mirrorCurve2d, mirrorCurve2dAcrossAxis, offsetCurve2d, evaluateCurve2d, tangentCurve2d, boundsCurve2d, typeCurve2d, intersectCurves2d, projectPointOnCurve2d, distanceBetweenCurves2d, liftCurve2dToPlane, extractCurve2dFromEdge, trimCurve2d, copyCurve2d, splitCurve2d, type Ellipse2dOptions, type BSpline2dOptions, } from './2d/curve2dGeometryFns.js';
|
|
21
21
|
export { type Point2D, BoundingBox2d, Curve2D } from './2d/lib/index.js';
|
|
22
22
|
export { type Curve2DHandle, createCurve2DHandle } from './core/curve2dHandle.js';
|
|
23
23
|
export { organiseBlueprints } from './2d/blueprints/lib.js';
|
package/dist/2d.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2d.d.ts","sourceRoot":"","sources":["../src/2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EACL,eAAe,EAEf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAIxF,OAAO,EACL,YAAY,EACZ,kBAAkB,E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AAe,EACf,cAAc,GACf,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAIxF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACpG,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/2d.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as createKernelHandle, Z as getKernel2D, a as createEdge } from "./shapeTypes-
|
|
1
|
+
import { B as createKernelHandle, Z as getKernel2D, a as createEdge } from "./shapeTypes-Qh4ErtGx.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DboJwVCf.js";
|
|
3
|
-
import { B as kernelCallRaw } from "./faceFns-
|
|
4
|
-
import { _ as Blueprints, a as fuseBlueprints, c as roundedRectangleBlueprint, g as CompoundBlueprint, h as organiseBlueprints, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
5
|
-
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-
|
|
6
|
-
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-
|
|
3
|
+
import { B as kernelCallRaw } from "./faceFns-wSgaAQrJ.js";
|
|
4
|
+
import { _ as Blueprints, a as fuseBlueprints, c as roundedRectangleBlueprint, g as CompoundBlueprint, h as organiseBlueprints, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BtmgEhzg.js";
|
|
5
|
+
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-DD20bL3n.js";
|
|
6
|
+
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-DgUIqFgy.js";
|
|
7
7
|
//#region src/core/curve2dHandle.ts
|
|
8
8
|
/**
|
|
9
9
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
@@ -203,5 +203,19 @@ function liftCurve2dToPlane(curve, plane) {
|
|
|
203
203
|
function extractCurve2dFromEdge(edge, face) {
|
|
204
204
|
return curveCall(() => getKernel2D().extractCurve2dFromEdge(edge.wrapped, face.wrapped), CURVE2D_BRIDGE_FAILED, "Failed to extract 2D curve from edge");
|
|
205
205
|
}
|
|
206
|
+
/** Trim a 2D curve to a sub-range of its parameter domain. */
|
|
207
|
+
function trimCurve2d(curve, start, end) {
|
|
208
|
+
return curveCall(() => getKernel2D().trimCurve2d(curve.raw, start, end), CURVE2D_CONSTRUCTION_FAILED, "Failed to trim 2D curve");
|
|
209
|
+
}
|
|
210
|
+
/** Create an independent deep copy of a 2D curve. */
|
|
211
|
+
function copyCurve2d(curve) {
|
|
212
|
+
return curveCall(() => getKernel2D().copyCurve2d(curve.raw), CURVE2D_CONSTRUCTION_FAILED, "Failed to copy 2D curve");
|
|
213
|
+
}
|
|
214
|
+
/** Split a 2D curve at the given parameter values. */
|
|
215
|
+
function splitCurve2d(curve, params) {
|
|
216
|
+
return kernelCallRaw(() => {
|
|
217
|
+
return getKernel2D().splitCurve2d(curve.raw, params).map((h) => wrapRawHandle(h));
|
|
218
|
+
}, CURVE2D_CONSTRUCTION_FAILED, "Failed to split 2D curve");
|
|
219
|
+
}
|
|
206
220
|
//#endregion
|
|
207
|
-
export { Blueprint, Blueprints, BoundingBox2d, CompoundBlueprint, Curve2D, arc2d, arc2dTangent, bezier2d, boundsCurve2d, bspline2d, circle2d, 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, stretch2D, tangentCurve2d, toSVGPathD, translate2D, translateCurve2d, typeCurve2d };
|
|
221
|
+
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,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXRNVCec.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
|
|
4
4
|
const require_types = require("./types-hXSlplF3.cjs");
|
|
5
5
|
const require_planeOps = require("./planeOps-DoTESDTM.cjs");
|
|
6
|
-
const require_curveFns = require("./curveFns-
|
|
6
|
+
const require_curveFns = require("./curveFns-BErRtKDj.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
|
|
8
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
9
|
-
const require_helpers = require("./helpers-
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-Bgc5TlIe.cjs");
|
|
9
|
+
const require_helpers = require("./helpers-CpCe09zS.cjs");
|
|
10
10
|
//#region src/2d/lib/definitions.ts
|
|
11
11
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
12
12
|
function isPoint2D(point) {
|
|
@@ -626,24 +626,29 @@ function curvesAsEdgesOnFace(curves, face, scale = "original") {
|
|
|
626
626
|
}
|
|
627
627
|
if (scale === "bounds") {
|
|
628
628
|
transformation = kernel.createIdentityGTrsf2d();
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
629
|
+
try {
|
|
630
|
+
kernel.setGTrsf2dTranslationPart(transformation, 0, 0);
|
|
631
|
+
const uAffinity = kernel.createAffinityGTrsf2d(0, 0, 0, 1, bounds.uMax - bounds.uMin);
|
|
632
|
+
kernel.multiplyGTrsf2d(transformation, uAffinity);
|
|
633
|
+
uAffinity.delete();
|
|
634
|
+
if (bounds.uMin !== 0) {
|
|
635
|
+
const trans = kernel.createIdentityGTrsf2d();
|
|
636
|
+
kernel.setGTrsf2dTranslationPart(trans, -bounds.uMin, 0);
|
|
637
|
+
kernel.multiplyGTrsf2d(transformation, trans);
|
|
638
|
+
trans.delete();
|
|
639
|
+
}
|
|
640
|
+
const vAffinity = kernel.createAffinityGTrsf2d(0, 0, 1, 0, bounds.vMax - bounds.vMin);
|
|
641
|
+
kernel.multiplyGTrsf2d(transformation, vAffinity);
|
|
642
|
+
vAffinity.delete();
|
|
643
|
+
if (bounds.vMin !== 0) {
|
|
644
|
+
const trans = kernel.createIdentityGTrsf2d();
|
|
645
|
+
kernel.setGTrsf2dTranslationPart(trans, 0, -bounds.vMin);
|
|
646
|
+
kernel.multiplyGTrsf2d(transformation, trans);
|
|
647
|
+
trans.delete();
|
|
648
|
+
}
|
|
649
|
+
} catch (e) {
|
|
650
|
+
transformation.delete();
|
|
651
|
+
throw e;
|
|
647
652
|
}
|
|
648
653
|
}
|
|
649
654
|
const edges = curvesAsEdgesOnSurface(transformCurves(curves, transformation), geomSurf);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { G as unregisterFromCleanup, U as registerForCleanup, X as getKernel, Z as getKernel2D, a as createEdge, u as createWire } from "./shapeTypes-
|
|
1
|
+
import { G as unregisterFromCleanup, U as registerForCleanup, X as getKernel, Z as getKernel2D, a as createEdge, u as createWire } from "./shapeTypes-Qh4ErtGx.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-DboJwVCf.js";
|
|
3
|
-
import { N as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-
|
|
3
|
+
import { N as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-wSgaAQrJ.js";
|
|
4
4
|
import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-SLY3VwcI.js";
|
|
5
5
|
import { r as makePlane } from "./planeOps-C94s53Ia.js";
|
|
6
|
-
import { f as getOrientation } from "./curveFns-
|
|
6
|
+
import { f as getOrientation } from "./curveFns-DbIakl9J.js";
|
|
7
7
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
|
|
8
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
9
|
-
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-
|
|
8
|
+
import { r as makeFace } from "./surfaceBuilders-CL8MJABt.js";
|
|
9
|
+
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-DsVYL2Ri.js";
|
|
10
10
|
//#region src/2d/lib/definitions.ts
|
|
11
11
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
12
12
|
function isPoint2D(point) {
|
|
@@ -626,24 +626,29 @@ function curvesAsEdgesOnFace(curves, face, scale = "original") {
|
|
|
626
626
|
}
|
|
627
627
|
if (scale === "bounds") {
|
|
628
628
|
transformation = kernel.createIdentityGTrsf2d();
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
629
|
+
try {
|
|
630
|
+
kernel.setGTrsf2dTranslationPart(transformation, 0, 0);
|
|
631
|
+
const uAffinity = kernel.createAffinityGTrsf2d(0, 0, 0, 1, bounds.uMax - bounds.uMin);
|
|
632
|
+
kernel.multiplyGTrsf2d(transformation, uAffinity);
|
|
633
|
+
uAffinity.delete();
|
|
634
|
+
if (bounds.uMin !== 0) {
|
|
635
|
+
const trans = kernel.createIdentityGTrsf2d();
|
|
636
|
+
kernel.setGTrsf2dTranslationPart(trans, -bounds.uMin, 0);
|
|
637
|
+
kernel.multiplyGTrsf2d(transformation, trans);
|
|
638
|
+
trans.delete();
|
|
639
|
+
}
|
|
640
|
+
const vAffinity = kernel.createAffinityGTrsf2d(0, 0, 1, 0, bounds.vMax - bounds.vMin);
|
|
641
|
+
kernel.multiplyGTrsf2d(transformation, vAffinity);
|
|
642
|
+
vAffinity.delete();
|
|
643
|
+
if (bounds.vMin !== 0) {
|
|
644
|
+
const trans = kernel.createIdentityGTrsf2d();
|
|
645
|
+
kernel.setGTrsf2dTranslationPart(trans, 0, -bounds.vMin);
|
|
646
|
+
kernel.multiplyGTrsf2d(transformation, trans);
|
|
647
|
+
trans.delete();
|
|
648
|
+
}
|
|
649
|
+
} catch (e) {
|
|
650
|
+
transformation.delete();
|
|
651
|
+
throw e;
|
|
647
652
|
}
|
|
648
653
|
}
|
|
649
654
|
const edges = curvesAsEdgesOnSurface(transformCurves(curves, transformation), geomSurf);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors-CXRNVCec.cjs");
|
|
2
|
-
const require_boolean2D = require("./boolean2D-
|
|
3
|
-
const require_blueprint = require("./blueprint-
|
|
2
|
+
const require_boolean2D = require("./boolean2D-Cpk3Ieie.cjs");
|
|
3
|
+
const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DboJwVCf.js";
|
|
2
|
-
import { g as CompoundBlueprint } from "./boolean2D-
|
|
3
|
-
import { t as Blueprint } from "./blueprint-
|
|
2
|
+
import { g as CompoundBlueprint } from "./boolean2D-BtmgEhzg.js";
|
|
3
|
+
import { t as Blueprint } from "./blueprint-DD20bL3n.js";
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { R as DisposalScope, X as getKernel, Y as _usingCtx, Z as getKernel2D, a as createEdge, h as isShape3D, o as createFace, t as castShape, u as createWire } from "./shapeTypes-
|
|
1
|
+
import { R as DisposalScope, X as getKernel, Y as _usingCtx, Z as getKernel2D, a as createEdge, h as isShape3D, o as createFace, t as castShape, u as createWire } from "./shapeTypes-Qh4ErtGx.js";
|
|
2
2
|
import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, i as kernelError, l as typeCastError, n as computationError, s as safeIndex } from "./errors-DboJwVCf.js";
|
|
3
|
-
import { P as downcast, c as normalAt, p as uvBounds, u as pointOnSurface } from "./faceFns-
|
|
3
|
+
import { P as downcast, c as normalAt, p as uvBounds, u as pointOnSurface } from "./faceFns-wSgaAQrJ.js";
|
|
4
4
|
import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-SLY3VwcI.js";
|
|
5
5
|
import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-D9etjPgV.js";
|
|
6
6
|
import { n as createPlane } from "./planeOps-C94s53Ia.js";
|
|
7
|
-
import { c as curveStartPoint, l as curveTangentAt, r as curveIsClosed } from "./curveFns-
|
|
7
|
+
import { c as curveStartPoint, l as curveTangentAt, r as curveIsClosed } from "./curveFns-DbIakl9J.js";
|
|
8
8
|
import { r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
|
|
9
|
-
import { _ as zip, i as makeNewFaceWithinFace, r as makeFace, s as assembleWire } from "./surfaceBuilders-
|
|
10
|
-
import { _ as samePoint$1, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, s as PRECISION_INTERSECTION, v as scalarMultiply2d } from "./helpers-
|
|
11
|
-
import { _ as Curve2D, b as removeDuplicatePoints, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-
|
|
12
|
-
import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-
|
|
9
|
+
import { _ as zip, i as makeNewFaceWithinFace, r as makeFace, s as assembleWire } from "./surfaceBuilders-CL8MJABt.js";
|
|
10
|
+
import { _ as samePoint$1, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, s as PRECISION_INTERSECTION, v as scalarMultiply2d } from "./helpers-DsVYL2Ri.js";
|
|
11
|
+
import { _ as Curve2D, b as removeDuplicatePoints, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-DD20bL3n.js";
|
|
12
|
+
import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-pjrR5ECA.js";
|
|
13
13
|
//#region node_modules/flatqueue/index.js
|
|
14
14
|
/** @template T */
|
|
15
15
|
var FlatQueue = class {
|
|
@@ -2099,17 +2099,26 @@ function findAllIntersections(first, second) {
|
|
|
2099
2099
|
const allCommonSegments = [];
|
|
2100
2100
|
const firstCurvePoints = first.curves.map(() => []);
|
|
2101
2101
|
const secondCurvePoints = second.curves.map(() => []);
|
|
2102
|
-
|
|
2103
|
-
|
|
2102
|
+
const secondIndex = new Flatbush(second.curves.length);
|
|
2103
|
+
for (const curve of second.curves) {
|
|
2104
|
+
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
2105
|
+
secondIndex.add(xMin, yMin, xMax, yMax);
|
|
2106
|
+
}
|
|
2107
|
+
secondIndex.finish();
|
|
2108
|
+
first.curves.forEach((thisCurve, firstIdx) => {
|
|
2109
|
+
const [[xMin, yMin], [xMax, yMax]] = thisCurve.boundingBox.bounds;
|
|
2110
|
+
const candidates = secondIndex.search(xMin, yMin, xMax, yMax);
|
|
2111
|
+
for (const secondIdx of candidates) {
|
|
2112
|
+
const otherCurve = second.curves[secondIdx];
|
|
2104
2113
|
const { intersections, commonSegments, commonSegmentsPoints } = unwrap(intersectCurves(thisCurve, otherCurve, PRECISION_INTERSECTION / 100));
|
|
2105
2114
|
allIntersections.push(...intersections);
|
|
2106
|
-
firstCurvePoints[
|
|
2107
|
-
secondCurvePoints[
|
|
2115
|
+
firstCurvePoints[firstIdx]?.push(...intersections);
|
|
2116
|
+
secondCurvePoints[secondIdx]?.push(...intersections);
|
|
2108
2117
|
allCommonSegments.push(...commonSegments);
|
|
2109
2118
|
allIntersections.push(...commonSegmentsPoints);
|
|
2110
|
-
firstCurvePoints[
|
|
2111
|
-
secondCurvePoints[
|
|
2112
|
-
}
|
|
2119
|
+
firstCurvePoints[firstIdx]?.push(...commonSegmentsPoints);
|
|
2120
|
+
secondCurvePoints[secondIdx]?.push(...commonSegmentsPoints);
|
|
2121
|
+
}
|
|
2113
2122
|
});
|
|
2114
2123
|
return {
|
|
2115
2124
|
allIntersections: removeDuplicatePoints(allIntersections, PRECISION_INTERSECTION),
|
|
@@ -2152,7 +2161,7 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
2152
2161
|
let firstCurveSegments = splitCurvesAtIntersections(first.curves, firstCurvePoints);
|
|
2153
2162
|
let secondCurveSegments = splitCurvesAtIntersections(second.curves, secondCurvePoints);
|
|
2154
2163
|
const commonSegmentsPoints = allCommonSegments.map((c) => [c.firstPoint, c.lastPoint]);
|
|
2155
|
-
const allIntersections = removeNonCrossingPoints(rawIntersections, firstCurveSegments, second);
|
|
2164
|
+
const allIntersections = removeNonCrossingPoints(removeNonCrossingPoints(rawIntersections, firstCurveSegments, second), secondCurveSegments, first);
|
|
2156
2165
|
if (allIntersections.length === 0 && allCommonSegments.length === 0) return null;
|
|
2157
2166
|
if (allCommonSegments.length === 0) {
|
|
2158
2167
|
const startAt = allIntersections[0];
|
|
@@ -2174,15 +2183,62 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
2174
2183
|
const commonSegmentLengthMismatch = allCommonSegments.length > 0 && secondSeg.length !== 1;
|
|
2175
2184
|
if (endpointsMismatch || commonSegmentLengthMismatch) secondIntersectedSegments = reverseSegments(secondIntersectedSegments);
|
|
2176
2185
|
}
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2186
|
+
const maxLen = Math.max(firstIntersectedSegments.length, secondIntersectedSegments.length);
|
|
2187
|
+
const result = [];
|
|
2188
|
+
for (let i = 0; i < maxLen; i++) {
|
|
2189
|
+
const firstSeg2 = firstIntersectedSegments[i];
|
|
2190
|
+
const secondSeg2 = secondIntersectedSegments[i];
|
|
2191
|
+
if (firstSeg2 === void 0 || secondSeg2 === void 0) {
|
|
2192
|
+
const available = firstSeg2 ?? secondSeg2;
|
|
2193
|
+
if (available === void 0) continue;
|
|
2194
|
+
result.push([available, available]);
|
|
2195
|
+
continue;
|
|
2196
|
+
}
|
|
2197
|
+
if (isCommonSegmentMatch(commonSegmentsPoints, startOfSegment(firstSeg2), endOfSegment(firstSeg2))) result.push([firstSeg2, "same"]);
|
|
2198
|
+
else result.push([firstSeg2, secondSeg2]);
|
|
2199
|
+
}
|
|
2200
|
+
return result;
|
|
2182
2201
|
}
|
|
2183
2202
|
//#endregion
|
|
2184
2203
|
//#region src/2d/blueprints/segmentAssembly.ts
|
|
2185
2204
|
/**
|
|
2205
|
+
* Merge adjacent collinear line segments into single segments.
|
|
2206
|
+
*
|
|
2207
|
+
* Boolean operations can split a line at intersection points that lie on the
|
|
2208
|
+
* line itself (e.g. when a cut rectangle's edge is collinear with the
|
|
2209
|
+
* profile's edge). The extra split creates a C0 discontinuity in swept
|
|
2210
|
+
* surfaces. Merging eliminates unnecessary vertices.
|
|
2211
|
+
*/
|
|
2212
|
+
function mergeCollinearSegments(curves) {
|
|
2213
|
+
if (curves.length < 2) return curves;
|
|
2214
|
+
const result = [];
|
|
2215
|
+
let i = 0;
|
|
2216
|
+
while (i < curves.length) {
|
|
2217
|
+
const current = curves[i];
|
|
2218
|
+
if (current.geomType !== "LINE") {
|
|
2219
|
+
result.push(current);
|
|
2220
|
+
i++;
|
|
2221
|
+
continue;
|
|
2222
|
+
}
|
|
2223
|
+
let endPoint = current.lastPoint;
|
|
2224
|
+
let j = i + 1;
|
|
2225
|
+
while (j < curves.length) {
|
|
2226
|
+
const next = curves[j];
|
|
2227
|
+
if (next.geomType !== "LINE") break;
|
|
2228
|
+
if (!samePoint(endPoint, next.firstPoint)) break;
|
|
2229
|
+
const dir1 = subtract2d(endPoint, current.firstPoint);
|
|
2230
|
+
const dir2 = subtract2d(next.lastPoint, next.firstPoint);
|
|
2231
|
+
if (Math.abs(crossProduct2d(dir1, dir2)) > 1e-9) break;
|
|
2232
|
+
endPoint = next.lastPoint;
|
|
2233
|
+
j++;
|
|
2234
|
+
}
|
|
2235
|
+
if (j > i + 1) result.push(make2dSegmentCurve(current.firstPoint, endPoint));
|
|
2236
|
+
else result.push(current);
|
|
2237
|
+
i = j;
|
|
2238
|
+
}
|
|
2239
|
+
return result;
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2186
2242
|
* Split an array of curves into separate continuous paths. A discontinuity
|
|
2187
2243
|
* occurs where one curve's lastPoint does not match the next curve's
|
|
2188
2244
|
* firstPoint.
|
|
@@ -2288,7 +2344,7 @@ function booleanOperation(first, second, config) {
|
|
|
2288
2344
|
});
|
|
2289
2345
|
const finalLastWasSame = lastWasSame;
|
|
2290
2346
|
if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
|
|
2291
|
-
const paths = splitPaths(assembledCurves).filter((b) => b.length > 0).map((b) => new Blueprint(b));
|
|
2347
|
+
const paths = splitPaths(mergeCollinearSegments(assembledCurves)).filter((b) => b.length > 0).map((b) => new Blueprint(b));
|
|
2292
2348
|
if (paths.length === 0) return null;
|
|
2293
2349
|
if (paths.length === 1) {
|
|
2294
2350
|
const single = paths[0];
|