brepjs 12.13.0 → 12.13.1
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/Blueprint.d.ts.map +1 -1
- package/dist/2d/blueprints/Blueprints.d.ts.map +1 -1
- package/dist/2d/blueprints/CompoundBlueprint.d.ts.map +1 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +1 -1
- package/dist/2d/blueprints/cannedBlueprints.d.ts.map +1 -1
- package/dist/2d.cjs +3 -3
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-D1qS-Zyd.cjs → Blueprint-DX6dM_fB.cjs} +12 -11
- package/dist/{Blueprint-7b-gvX_p.js → Blueprint-JYd_kdC5.js} +12 -11
- package/dist/{shapeFns-DFkO3e8a.cjs → arrayAccess-BrH0ase6.cjs} +76 -23
- package/dist/{shapeFns-CO_837FR.js → arrayAccess-CswTjB3U.js} +59 -24
- package/dist/{blueprintFns--fsdFjx9.cjs → blueprintFns-DNiRsh4S.cjs} +3 -3
- package/dist/{blueprintFns-DM5lmYDI.js → blueprintFns-DUyzBTeF.js} +3 -3
- package/dist/{boolean2D-CaZrebEm.cjs → boolean2D-ByJ-oeX1.cjs} +350 -349
- package/dist/{boolean2D-BnJQsw1Q.js → boolean2D-SeTIJXii.js} +351 -350
- package/dist/{booleanFns-DX08b6Hh.cjs → booleanFns-BfdopMkS.cjs} +23 -23
- package/dist/{booleanFns-DyoSwthi.js → booleanFns-C5YHveic.js} +12 -12
- package/dist/brepjs.cjs +110 -111
- package/dist/brepjs.js +41 -32
- package/dist/core/dimensionTypes.d.ts.map +1 -1
- package/dist/core/errors.d.ts +2 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +7 -1
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/typeDiscriminants.d.ts +3 -1
- package/dist/core/typeDiscriminants.d.ts.map +1 -1
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-C9L0wY8v.js → cornerFinder-BBLIbDCi.js} +3 -2
- package/dist/{cornerFinder-D3a4o3vN.cjs → cornerFinder-a_a15ABE.cjs} +3 -2
- package/dist/{curveFns-Bse_M07l.js → curveFns-BYBUrMfs.js} +2 -2
- package/dist/{curveFns-B40hdZon.cjs → curveFns-QSHCv-03.cjs} +2 -2
- package/dist/{drawFns-WOquG2I9.js → drawFns-BKeDnnWz.js} +126 -125
- package/dist/{drawFns-BB2_R1zc.cjs → drawFns-DzssRCeR.cjs} +127 -126
- package/dist/{errors-B2qrBS1S.js → errors-BR1gOLRZ.js} +2 -0
- package/dist/{errors-Bkxm3vs2.cjs → errors-Czwm1_Ti.cjs} +2 -0
- package/dist/{extrudeFns-D4euaVFA.js → extrudeFns-BdEbnHiq.js} +2 -2
- package/dist/{extrudeFns-B4Fwc4sm.cjs → extrudeFns-C8hZmh0E.cjs} +2 -2
- package/dist/{faceFns-wT8HTsiI.cjs → faceFns-B-maQLT5.cjs} +2 -2
- package/dist/{faceFns-BN95alxi.js → faceFns-ClROnDk8.js} +2 -2
- package/dist/{helpers-BSRZXwBR.js → helpers-B4DtSiHU.js} +6 -6
- package/dist/{helpers-WmqZmmA1.cjs → helpers-VApXqQXy.cjs} +9 -9
- package/dist/{historyFns-B_76a2HE.cjs → historyFns-B6wY5d78.cjs} +6 -6
- package/dist/{historyFns-4FWw2_qZ.js → historyFns-BVmGuJJJ.js} +5 -5
- package/dist/{importFns-BRH3Fz3H.cjs → importFns-BeGWqiwF.cjs} +11 -10
- package/dist/{importFns-CM94X6iT.js → importFns-DoazdU3-.js} +11 -10
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/io/gltfExportFns.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/advancedOps.d.ts.map +1 -1
- package/dist/kernel/evolutionOps.d.ts +5 -6
- package/dist/kernel/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +15 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/wasm-types/externals.d.ts +41 -0
- package/dist/kernel/wasm-types/externals.d.ts.map +1 -0
- package/dist/kernel/wasm-types/index.d.ts +3 -0
- package/dist/kernel/wasm-types/index.d.ts.map +1 -0
- package/dist/kernel/wasm-types/occtBuilders.d.ts +48 -0
- package/dist/kernel/wasm-types/occtBuilders.d.ts.map +1 -0
- package/dist/{measureFns-DlBUu9Mw.js → measureFns-BkWSCYIc.js} +3 -3
- package/dist/{measureFns-BPbSMRrS.cjs → measureFns-DBRrplFM.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BfYhsH55.js → meshFns-B-g1WpYc.js} +3 -3
- package/dist/{meshFns-BU2utE_P.cjs → meshFns-DobRCF8g.cjs} +4 -4
- package/dist/operations/compoundOpsFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/straightSkeleton.d.ts +2 -5
- package/dist/operations/straightSkeleton.d.ts.map +1 -1
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-CXJOsSMJ.cjs → planeOps-CSs66pta.cjs} +1 -1
- package/dist/{planeOps-PYHm_Q9z.js → planeOps-DOannb3i.js} +1 -1
- package/dist/{primitiveFns-DsVrQcFZ.cjs → primitiveFns-CQI47Dnn.cjs} +16 -16
- package/dist/{primitiveFns-CrmdLwQr.js → primitiveFns-X4y5Xuai.js} +6 -6
- package/dist/query/cornerFinder.d.ts.map +1 -1
- package/dist/query/vertexFinder.d.ts.map +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeTypes-CBc5OTQ4.cjs → shapeTypes-CU-C-shE.cjs} +53 -4
- package/dist/{shapeTypes-BmN9vAte.js → shapeTypes-mvXCEAMH.js} +42 -5
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/cannedSketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching/drawFns.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-CCQZBE9x.js → solidBuilders-BNuFyNAn.js} +3 -3
- package/dist/{solidBuilders-B73M8VgU.cjs → solidBuilders-CGNnvfYb.cjs} +3 -3
- package/dist/{surfaceBuilders-Ccaf33Q_.js → surfaceBuilders-CLOCsrlS.js} +3 -3
- package/dist/{surfaceBuilders-B1CDCs7m.cjs → surfaceBuilders-DHId1EJI.cjs} +3 -3
- package/dist/text/textBlueprints.d.ts +3 -2
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/api.d.ts +1 -1
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts.map +1 -1
- package/dist/topology/transformFns.d.ts +5 -4
- package/dist/topology/transformFns.d.ts.map +1 -1
- package/dist/topology.cjs +20 -20
- package/dist/topology.js +6 -6
- package/dist/utils/arrayAccess.d.ts +12 -0
- package/dist/utils/arrayAccess.d.ts.map +1 -0
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/Blueprint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Blueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/Blueprint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAY9C,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQvE,OAAO,KAAK,EA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U,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KAChB;IASR,+DAA+D;IAC/D,YAAY,CAAC,MAAM,SAAI;IAIvB,2EAA2E;IAC3E,UAAU;IAIV,sEAAsE;IACtE,KAAK,CAAC,MAAM,SAAI;CAQjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompoundBlueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/CompoundBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"CompoundBlueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/CompoundBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,gBAAgB;IAChE;;;OAGG;IACH,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,SAAS,CAAC,YAAY,EAAE,aAAa,GAAG,IA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CAAC;KAChB,GACL,QAAQ,CAAC,SAAS,CAAC;IAItB,uEAAuE;IACvE,YAAY,CAAC,MAAM,SAAI;IAIvB,6DAA6D;IAC7D,UAAU;IAIV,gEAAgE;IAChE,UAAU;IAIV,yEAAyE;IACzE,KAAK,CAAC,MAAM,SAAI;CAGjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprintCustomCorners.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/blueprintCustomCorners.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"blueprintCustomCorners.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/blueprintCustomCorners.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA2E9C;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,WAE7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,WAE9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cannedBlueprints.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/cannedBlueprints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"cannedBlueprints.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/cannedBlueprints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAI5C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,YAAY,MAAM,EAAE,gBAAW,KAAG,SAiBpF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,IAAG,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAM,cAwC7C,CAAC"}
|
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_blueprintFns = require("./blueprintFns
|
|
2
|
+
const require_boolean2D = require("./boolean2D-ByJ-oeX1.cjs");
|
|
3
|
+
const require_Blueprint = require("./Blueprint-DX6dM_fB.cjs");
|
|
4
|
+
const require_blueprintFns = require("./blueprintFns-DNiRsh4S.cjs");
|
|
5
5
|
exports.Blueprint = require_Blueprint.Blueprint;
|
|
6
6
|
exports.Blueprints = require_boolean2D.Blueprints;
|
|
7
7
|
exports.BoundingBox2d = require_Blueprint.BoundingBox2d;
|
package/dist/2d.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
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-
|
|
1
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, g as Blueprints, h as CompoundBlueprint, i as cutBlueprints, m as organiseBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-SeTIJXii.js";
|
|
2
|
+
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./Blueprint-JYd_kdC5.js";
|
|
3
|
+
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-DUyzBTeF.js";
|
|
4
4
|
export { Blueprint, Blueprints, BoundingBox2d, CompoundBlueprint, Curve2D, createBlueprint, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, cut2D, cutBlueprints, fuse2D, fuseBlueprints, getBounds2D, getOrientation2D, intersect2D, intersectBlueprints, isInside2D, mirror2D, organiseBlueprints, polysidesBlueprint, reverseCurve, rotate2D, roundedRectangleBlueprint, scale2D, sketchOnFace2D, sketchOnPlane2D, stretch2D, toSVGPathD, translate2D };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CU-C-shE.cjs");
|
|
2
|
+
const require_errors = require("./errors-Czwm1_Ti.cjs");
|
|
3
3
|
const require_vecOps = require("./vecOps-4iBMiet9.cjs");
|
|
4
4
|
const require_types = require("./types-BD-VVaWB.cjs");
|
|
5
|
-
const require_planeOps = require("./planeOps-
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const require_planeOps = require("./planeOps-CSs66pta.cjs");
|
|
6
|
+
const require_faceFns = require("./faceFns-B-maQLT5.cjs");
|
|
7
|
+
const require_arrayAccess = require("./arrayAccess-BrH0ase6.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-QSHCv-03.cjs");
|
|
9
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DHId1EJI.cjs");
|
|
10
|
+
const require_helpers = require("./helpers-VApXqQXy.cjs");
|
|
10
11
|
//#region src/2d/lib/definitions.ts
|
|
11
12
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
12
13
|
function isPoint2D(point) {
|
|
@@ -764,7 +765,7 @@ var Blueprint = class Blueprint {
|
|
|
764
765
|
return [c.firstPoint];
|
|
765
766
|
});
|
|
766
767
|
this._guessedOrientation = vertices.map((v1, i) => {
|
|
767
|
-
const v2 = vertices
|
|
768
|
+
const v2 = require_arrayAccess.getAtOrThrow(vertices, (i + 1) % vertices.length);
|
|
768
769
|
return (v2[0] - v1[0]) * (v2[1] + v1[1]);
|
|
769
770
|
}).reduce((a, b) => a + b, 0) > 0 ? "clockwise" : "counterClockwise";
|
|
770
771
|
return this._guessedOrientation;
|
|
@@ -881,7 +882,7 @@ var Blueprint = class Blueprint {
|
|
|
881
882
|
const path = approximateAsSvgCompatibleCurve(bp.curves).flatMap((c) => {
|
|
882
883
|
return adaptedCurveToPathElem(c, c.lastPoint);
|
|
883
884
|
});
|
|
884
|
-
const [startX, startY] = bp.curves
|
|
885
|
+
const [startX, startY] = require_arrayAccess.firstOrThrow(bp.curves).firstPoint;
|
|
885
886
|
return `M ${round5(startX)} ${round5(startY)} ${path.join(" ")}${bp.isClosed() ? " Z" : ""}`;
|
|
886
887
|
}
|
|
887
888
|
/** Wrap the SVG path data in a `<path>` element string. */
|
|
@@ -910,11 +911,11 @@ var Blueprint = class Blueprint {
|
|
|
910
911
|
}
|
|
911
912
|
/** Get the start point of the first curve. */
|
|
912
913
|
get firstPoint() {
|
|
913
|
-
return this.curves
|
|
914
|
+
return require_arrayAccess.firstOrThrow(this.curves).firstPoint;
|
|
914
915
|
}
|
|
915
916
|
/** Get the end point of the last curve. */
|
|
916
917
|
get lastPoint() {
|
|
917
|
-
return
|
|
918
|
+
return require_arrayAccess.lastOrThrow(this.curves).lastPoint;
|
|
918
919
|
}
|
|
919
920
|
/**
|
|
920
921
|
* Test whether a 2D point lies inside this closed blueprint.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L as unwrap, d as validationError, k as ok, m as bug, n as computationError, y as err } from "./errors-
|
|
1
|
+
import { B as unregisterFromCleanup, G as getKernel, K as getKernel2D, R as registerForCleanup, a as createEdge, u as createWire } from "./shapeTypes-mvXCEAMH.js";
|
|
2
|
+
import { L as unwrap, d as validationError, k as ok, m as bug, n as computationError, y as err } from "./errors-BR1gOLRZ.js";
|
|
3
3
|
import { _ as DEG2RAD, y as RAD2DEG } from "./vecOps-B9-MTeC8.js";
|
|
4
4
|
import { r as toVec3 } from "./types-Bb4KK_iG.js";
|
|
5
|
-
import { r as makePlane } from "./planeOps-
|
|
6
|
-
import { g as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { r as makePlane } from "./planeOps-DOannb3i.js";
|
|
6
|
+
import { g as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-ClROnDk8.js";
|
|
7
|
+
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-CswTjB3U.js";
|
|
8
|
+
import { f as getOrientation } from "./curveFns-BYBUrMfs.js";
|
|
9
|
+
import { r as makeFace } from "./surfaceBuilders-CLOCsrlS.js";
|
|
10
|
+
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-B4DtSiHU.js";
|
|
10
11
|
//#region src/2d/lib/definitions.ts
|
|
11
12
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
12
13
|
function isPoint2D(point) {
|
|
@@ -764,7 +765,7 @@ var Blueprint = class Blueprint {
|
|
|
764
765
|
return [c.firstPoint];
|
|
765
766
|
});
|
|
766
767
|
this._guessedOrientation = vertices.map((v1, i) => {
|
|
767
|
-
const v2 = vertices
|
|
768
|
+
const v2 = getAtOrThrow(vertices, (i + 1) % vertices.length);
|
|
768
769
|
return (v2[0] - v1[0]) * (v2[1] + v1[1]);
|
|
769
770
|
}).reduce((a, b) => a + b, 0) > 0 ? "clockwise" : "counterClockwise";
|
|
770
771
|
return this._guessedOrientation;
|
|
@@ -881,7 +882,7 @@ var Blueprint = class Blueprint {
|
|
|
881
882
|
const path = approximateAsSvgCompatibleCurve(bp.curves).flatMap((c) => {
|
|
882
883
|
return adaptedCurveToPathElem(c, c.lastPoint);
|
|
883
884
|
});
|
|
884
|
-
const [startX, startY] = bp.curves
|
|
885
|
+
const [startX, startY] = firstOrThrow(bp.curves).firstPoint;
|
|
885
886
|
return `M ${round5(startX)} ${round5(startY)} ${path.join(" ")}${bp.isClosed() ? " Z" : ""}`;
|
|
886
887
|
}
|
|
887
888
|
/** Wrap the SVG path data in a `<path>` element string. */
|
|
@@ -910,11 +911,11 @@ var Blueprint = class Blueprint {
|
|
|
910
911
|
}
|
|
911
912
|
/** Get the start point of the first curve. */
|
|
912
913
|
get firstPoint() {
|
|
913
|
-
return this.curves
|
|
914
|
+
return firstOrThrow(this.curves).firstPoint;
|
|
914
915
|
}
|
|
915
916
|
/** Get the end point of the last curve. */
|
|
916
917
|
get lastPoint() {
|
|
917
|
-
return this.curves
|
|
918
|
+
return lastOrThrow(this.curves).lastPoint;
|
|
918
919
|
}
|
|
919
920
|
/**
|
|
920
921
|
* Test whether a 2D point lies inside this closed blueprint.
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CU-C-shE.cjs");
|
|
2
|
+
const require_errors = require("./errors-Czwm1_Ti.cjs");
|
|
3
3
|
const require_vecOps = require("./vecOps-4iBMiet9.cjs");
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
4
|
+
const require_faceFns = require("./faceFns-B-maQLT5.cjs");
|
|
5
5
|
//#region src/topology/topologyQueryFns.ts
|
|
6
6
|
/**
|
|
7
7
|
* Topology query functions — extract sub-shapes, compute bounds, and
|
|
8
8
|
* describe shape topology. All results are lazily cached per shape.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Extract sub-shapes of a known type, bypassing the generator wrapper and
|
|
12
|
+
* redundant downcast calls. Uses iterShapes (C++ bulk extraction) directly
|
|
13
|
+
* and passes the known type to castShape to skip the shapeType() WASM call.
|
|
14
|
+
*/
|
|
15
|
+
function castSubShapes(parentShape, type) {
|
|
16
|
+
const rawShapes = require_shapeTypes.getKernel().iterShapes(parentShape, type);
|
|
17
|
+
const result = new Array(rawShapes.length);
|
|
18
|
+
for (let i = 0; i < rawShapes.length; i++) result[i] = require_shapeTypes.castShapeWithKnownType(rawShapes[i], type);
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
10
21
|
var topoCache = /* @__PURE__ */ new WeakMap();
|
|
11
22
|
/** @internal Get or create a cache entry for a shape. Used by originTrackingFns. */
|
|
12
23
|
function getOrCreateCache(shape) {
|
|
@@ -32,7 +43,7 @@ function invalidateShapeCache(shape) {
|
|
|
32
43
|
function getEdges(shape) {
|
|
33
44
|
const cache = getOrCreateCache(shape);
|
|
34
45
|
if (cache.edges) return cache.edges;
|
|
35
|
-
const edges =
|
|
46
|
+
const edges = castSubShapes(shape.wrapped, "edge");
|
|
36
47
|
cache.edges = edges;
|
|
37
48
|
return edges;
|
|
38
49
|
}
|
|
@@ -45,7 +56,7 @@ function getEdges(shape) {
|
|
|
45
56
|
function getFaces(shape) {
|
|
46
57
|
const cache = getOrCreateCache(shape);
|
|
47
58
|
if (cache.faces) return cache.faces;
|
|
48
|
-
const faces =
|
|
59
|
+
const faces = castSubShapes(shape.wrapped, "face");
|
|
49
60
|
cache.faces = faces;
|
|
50
61
|
return faces;
|
|
51
62
|
}
|
|
@@ -53,7 +64,7 @@ function getFaces(shape) {
|
|
|
53
64
|
function getWires(shape) {
|
|
54
65
|
const cache = getOrCreateCache(shape);
|
|
55
66
|
if (cache.wires) return cache.wires;
|
|
56
|
-
const wires =
|
|
67
|
+
const wires = castSubShapes(shape.wrapped, "wire");
|
|
57
68
|
cache.wires = wires;
|
|
58
69
|
return wires;
|
|
59
70
|
}
|
|
@@ -61,25 +72,25 @@ function getWires(shape) {
|
|
|
61
72
|
function getVertices(shape) {
|
|
62
73
|
const cache = getOrCreateCache(shape);
|
|
63
74
|
if (cache.vertices) return cache.vertices;
|
|
64
|
-
const vertices =
|
|
75
|
+
const vertices = castSubShapes(shape.wrapped, "vertex");
|
|
65
76
|
cache.vertices = vertices;
|
|
66
77
|
return vertices;
|
|
67
78
|
}
|
|
68
79
|
/** Lazily iterate edges of a shape, yielding branded Edge handles one at a time. */
|
|
69
80
|
function* iterEdges(shape) {
|
|
70
|
-
for (const e of
|
|
81
|
+
for (const e of require_shapeTypes.getKernel().iterShapes(shape.wrapped, "edge")) yield require_shapeTypes.castShapeWithKnownType(e, "edge");
|
|
71
82
|
}
|
|
72
83
|
/** Lazily iterate faces of a shape, yielding branded Face handles one at a time. */
|
|
73
84
|
function* iterFaces(shape) {
|
|
74
|
-
for (const f of
|
|
85
|
+
for (const f of require_shapeTypes.getKernel().iterShapes(shape.wrapped, "face")) yield require_shapeTypes.castShapeWithKnownType(f, "face");
|
|
75
86
|
}
|
|
76
87
|
/** Lazily iterate wires of a shape, yielding branded Wire handles one at a time. */
|
|
77
88
|
function* iterWires(shape) {
|
|
78
|
-
for (const w of
|
|
89
|
+
for (const w of require_shapeTypes.getKernel().iterShapes(shape.wrapped, "wire")) yield require_shapeTypes.castShapeWithKnownType(w, "wire");
|
|
79
90
|
}
|
|
80
91
|
/** Lazily iterate vertices of a shape, yielding branded Vertex handles one at a time. */
|
|
81
92
|
function* iterVertices(shape) {
|
|
82
|
-
for (const v of
|
|
93
|
+
for (const v of require_shapeTypes.getKernel().iterShapes(shape.wrapped, "vertex")) yield require_shapeTypes.castShapeWithKnownType(v, "vertex");
|
|
83
94
|
}
|
|
84
95
|
/** Get the axis-aligned bounding box of a shape. Cached per shape. */
|
|
85
96
|
function getBounds(shape) {
|
|
@@ -588,22 +599,22 @@ function resize(shape, dimensions, options) {
|
|
|
588
599
|
factor(dimensions[1], size[1], autoFactor),
|
|
589
600
|
factor(dimensions[2], size[2], autoFactor)
|
|
590
601
|
];
|
|
591
|
-
if (!(Math.abs(factors[0] - factors[1]) < 1e-6 && Math.abs(factors[1] - factors[2]) < 1e-6))
|
|
592
|
-
return scale(shape, factors[0]);
|
|
602
|
+
if (!(Math.abs(factors[0] - factors[1]) < 1e-6 && Math.abs(factors[1] - factors[2]) < 1e-6)) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VALIDATION_FAILED, "resize: non-uniform scaling is not supported (WASM build lacks BRepBuilderAPI_GTransform).", void 0, void 0, "Use auto: true to scale proportionally, or set all three dimensions to achieve uniform scaling."));
|
|
603
|
+
return require_errors.ok(scale(shape, factors[0]));
|
|
593
604
|
}
|
|
594
605
|
/**
|
|
595
606
|
* Parse a MatrixInput into a 3x3 linear part and translation vector.
|
|
596
607
|
* Validates the bottom row of a Matrix4x4.
|
|
597
608
|
*/
|
|
598
609
|
function parseMatrixInput(input) {
|
|
599
|
-
if ("linear" in input) return {
|
|
610
|
+
if ("linear" in input) return require_errors.ok({
|
|
600
611
|
linear: input.linear,
|
|
601
612
|
translation: input.translation
|
|
602
|
-
};
|
|
613
|
+
});
|
|
603
614
|
const [r0, r1, r2, r3] = input;
|
|
604
615
|
const TOL = 1e-10;
|
|
605
|
-
if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL)
|
|
606
|
-
return {
|
|
616
|
+
if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VALIDATION_FAILED, `applyMatrix: invalid bottom row [${String(r3[0])}, ${String(r3[1])}, ${String(r3[2])}, ${String(r3[3])}]. Must be [0, 0, 0, 1] for an affine transform.`));
|
|
617
|
+
return require_errors.ok({
|
|
607
618
|
linear: [
|
|
608
619
|
r0[0],
|
|
609
620
|
r0[1],
|
|
@@ -620,7 +631,7 @@ function parseMatrixInput(input) {
|
|
|
620
631
|
r1[3],
|
|
621
632
|
r2[3]
|
|
622
633
|
]
|
|
623
|
-
};
|
|
634
|
+
});
|
|
624
635
|
}
|
|
625
636
|
/** Determinant of a 3x3 matrix given as 9 row-major values. */
|
|
626
637
|
function det3x3(m) {
|
|
@@ -653,23 +664,25 @@ function isOrthogonalMatrix(m) {
|
|
|
653
664
|
* and the general `gp_GTrsf` path for non-orthogonal transforms (shear, non-uniform scale).
|
|
654
665
|
*/
|
|
655
666
|
function applyMatrix(shape, matrix) {
|
|
656
|
-
const
|
|
667
|
+
const parsed = parseMatrixInput(matrix);
|
|
668
|
+
if (!parsed.ok) return parsed;
|
|
669
|
+
const { linear, translation } = parsed.value;
|
|
657
670
|
const d = det3x3(linear);
|
|
658
|
-
if (Math.abs(d) < 1e-12)
|
|
671
|
+
if (Math.abs(d) < 1e-12) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VALIDATION_FAILED, "applyMatrix: singular matrix (determinant ≈ 0). Cannot apply a non-invertible transform."));
|
|
659
672
|
if (isOrthogonalMatrix(linear)) {
|
|
660
673
|
const inputFaceHashes = collectInputFaceHashes([shape]);
|
|
661
674
|
const { shape: resultShape, evolution } = require_shapeTypes.getKernel().generalTransformWithHistory(shape.wrapped, linear, translation, true, inputFaceHashes, require_vecOps.HASH_CODE_MAX);
|
|
662
675
|
const result = require_shapeTypes.castShape(resultShape);
|
|
663
676
|
propagateAllMetadata(evolution, [shape], result);
|
|
664
|
-
return result;
|
|
677
|
+
return require_errors.ok(result);
|
|
665
678
|
}
|
|
666
679
|
const result = require_shapeTypes.castShape(require_shapeTypes.getKernel().generalTransformNonOrthogonal(shape.wrapped, linear, translation));
|
|
667
680
|
propagateMetadataByHash([shape], result);
|
|
668
|
-
return result;
|
|
681
|
+
return require_errors.ok(result);
|
|
669
682
|
/* v8 ignore stop */
|
|
670
683
|
}
|
|
671
684
|
/**
|
|
672
|
-
* Compose multiple translate/rotate operations into a single kernel
|
|
685
|
+
* Compose multiple translate/rotate operations into a single kernel transform.
|
|
673
686
|
* Operations are applied in order (first element applied first).
|
|
674
687
|
* Call `.cleanup()` on the result when done to free the kernel object.
|
|
675
688
|
*/
|
|
@@ -744,6 +757,28 @@ function simplify(shape) {
|
|
|
744
757
|
return require_shapeTypes.castShape(require_shapeTypes.getKernel().simplify(shape.wrapped));
|
|
745
758
|
}
|
|
746
759
|
//#endregion
|
|
760
|
+
//#region src/utils/arrayAccess.ts
|
|
761
|
+
/**
|
|
762
|
+
* Safe array access utilities.
|
|
763
|
+
* Replaces `arr[i]!` patterns where TypeScript's `noUncheckedIndexedAccess` requires
|
|
764
|
+
* a non-null assertion but bounds are proven by surrounding code.
|
|
765
|
+
*/
|
|
766
|
+
/** Access element by index, throwing if out of bounds. Use when bounds are logically guaranteed. */
|
|
767
|
+
function getAtOrThrow(arr, index, msg) {
|
|
768
|
+
if (index < 0 || index >= arr.length) throw new Error(msg ?? `Index ${index} out of bounds (length ${arr.length})`);
|
|
769
|
+
return arr[index];
|
|
770
|
+
}
|
|
771
|
+
/** Get the first element of a non-empty array, throwing if empty. */
|
|
772
|
+
function firstOrThrow(arr, msg) {
|
|
773
|
+
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
774
|
+
return arr[0];
|
|
775
|
+
}
|
|
776
|
+
/** Get the last element of a non-empty array, throwing if empty. */
|
|
777
|
+
function lastOrThrow(arr, msg) {
|
|
778
|
+
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
779
|
+
return arr[arr.length - 1];
|
|
780
|
+
}
|
|
781
|
+
//#endregion
|
|
747
782
|
Object.defineProperty(exports, "applyMatrix", {
|
|
748
783
|
enumerable: true,
|
|
749
784
|
get: function() {
|
|
@@ -792,6 +827,18 @@ Object.defineProperty(exports, "findFacesByTag", {
|
|
|
792
827
|
return findFacesByTag;
|
|
793
828
|
}
|
|
794
829
|
});
|
|
830
|
+
Object.defineProperty(exports, "firstOrThrow", {
|
|
831
|
+
enumerable: true,
|
|
832
|
+
get: function() {
|
|
833
|
+
return firstOrThrow;
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
Object.defineProperty(exports, "getAtOrThrow", {
|
|
837
|
+
enumerable: true,
|
|
838
|
+
get: function() {
|
|
839
|
+
return getAtOrThrow;
|
|
840
|
+
}
|
|
841
|
+
});
|
|
795
842
|
Object.defineProperty(exports, "getBounds", {
|
|
796
843
|
enumerable: true,
|
|
797
844
|
get: function() {
|
|
@@ -906,6 +953,12 @@ Object.defineProperty(exports, "iterWires", {
|
|
|
906
953
|
return iterWires;
|
|
907
954
|
}
|
|
908
955
|
});
|
|
956
|
+
Object.defineProperty(exports, "lastOrThrow", {
|
|
957
|
+
enumerable: true,
|
|
958
|
+
get: function() {
|
|
959
|
+
return lastOrThrow;
|
|
960
|
+
}
|
|
961
|
+
});
|
|
909
962
|
Object.defineProperty(exports, "mirror", {
|
|
910
963
|
enumerable: true,
|
|
911
964
|
get: function() {
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L as unwrap } from "./errors-
|
|
1
|
+
import { G as getKernel, O as getShapeKind, r as castShapeWithKnownType, t as castShape } from "./shapeTypes-mvXCEAMH.js";
|
|
2
|
+
import { L as unwrap, d as validationError, k as ok, t as BrepErrorCode, y as err } from "./errors-BR1gOLRZ.js";
|
|
3
3
|
import { _ as DEG2RAD, v as HASH_CODE_MAX } from "./vecOps-B9-MTeC8.js";
|
|
4
|
-
import { _ as downcast
|
|
4
|
+
import { _ as downcast } from "./faceFns-ClROnDk8.js";
|
|
5
5
|
//#region src/topology/topologyQueryFns.ts
|
|
6
6
|
/**
|
|
7
7
|
* Topology query functions — extract sub-shapes, compute bounds, and
|
|
8
8
|
* describe shape topology. All results are lazily cached per shape.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Extract sub-shapes of a known type, bypassing the generator wrapper and
|
|
12
|
+
* redundant downcast calls. Uses iterShapes (C++ bulk extraction) directly
|
|
13
|
+
* and passes the known type to castShape to skip the shapeType() WASM call.
|
|
14
|
+
*/
|
|
15
|
+
function castSubShapes(parentShape, type) {
|
|
16
|
+
const rawShapes = getKernel().iterShapes(parentShape, type);
|
|
17
|
+
const result = new Array(rawShapes.length);
|
|
18
|
+
for (let i = 0; i < rawShapes.length; i++) result[i] = castShapeWithKnownType(rawShapes[i], type);
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
10
21
|
var topoCache = /* @__PURE__ */ new WeakMap();
|
|
11
22
|
/** @internal Get or create a cache entry for a shape. Used by originTrackingFns. */
|
|
12
23
|
function getOrCreateCache(shape) {
|
|
@@ -32,7 +43,7 @@ function invalidateShapeCache(shape) {
|
|
|
32
43
|
function getEdges(shape) {
|
|
33
44
|
const cache = getOrCreateCache(shape);
|
|
34
45
|
if (cache.edges) return cache.edges;
|
|
35
|
-
const edges =
|
|
46
|
+
const edges = castSubShapes(shape.wrapped, "edge");
|
|
36
47
|
cache.edges = edges;
|
|
37
48
|
return edges;
|
|
38
49
|
}
|
|
@@ -45,7 +56,7 @@ function getEdges(shape) {
|
|
|
45
56
|
function getFaces(shape) {
|
|
46
57
|
const cache = getOrCreateCache(shape);
|
|
47
58
|
if (cache.faces) return cache.faces;
|
|
48
|
-
const faces =
|
|
59
|
+
const faces = castSubShapes(shape.wrapped, "face");
|
|
49
60
|
cache.faces = faces;
|
|
50
61
|
return faces;
|
|
51
62
|
}
|
|
@@ -53,7 +64,7 @@ function getFaces(shape) {
|
|
|
53
64
|
function getWires(shape) {
|
|
54
65
|
const cache = getOrCreateCache(shape);
|
|
55
66
|
if (cache.wires) return cache.wires;
|
|
56
|
-
const wires =
|
|
67
|
+
const wires = castSubShapes(shape.wrapped, "wire");
|
|
57
68
|
cache.wires = wires;
|
|
58
69
|
return wires;
|
|
59
70
|
}
|
|
@@ -61,25 +72,25 @@ function getWires(shape) {
|
|
|
61
72
|
function getVertices(shape) {
|
|
62
73
|
const cache = getOrCreateCache(shape);
|
|
63
74
|
if (cache.vertices) return cache.vertices;
|
|
64
|
-
const vertices =
|
|
75
|
+
const vertices = castSubShapes(shape.wrapped, "vertex");
|
|
65
76
|
cache.vertices = vertices;
|
|
66
77
|
return vertices;
|
|
67
78
|
}
|
|
68
79
|
/** Lazily iterate edges of a shape, yielding branded Edge handles one at a time. */
|
|
69
80
|
function* iterEdges(shape) {
|
|
70
|
-
for (const e of
|
|
81
|
+
for (const e of getKernel().iterShapes(shape.wrapped, "edge")) yield castShapeWithKnownType(e, "edge");
|
|
71
82
|
}
|
|
72
83
|
/** Lazily iterate faces of a shape, yielding branded Face handles one at a time. */
|
|
73
84
|
function* iterFaces(shape) {
|
|
74
|
-
for (const f of
|
|
85
|
+
for (const f of getKernel().iterShapes(shape.wrapped, "face")) yield castShapeWithKnownType(f, "face");
|
|
75
86
|
}
|
|
76
87
|
/** Lazily iterate wires of a shape, yielding branded Wire handles one at a time. */
|
|
77
88
|
function* iterWires(shape) {
|
|
78
|
-
for (const w of
|
|
89
|
+
for (const w of getKernel().iterShapes(shape.wrapped, "wire")) yield castShapeWithKnownType(w, "wire");
|
|
79
90
|
}
|
|
80
91
|
/** Lazily iterate vertices of a shape, yielding branded Vertex handles one at a time. */
|
|
81
92
|
function* iterVertices(shape) {
|
|
82
|
-
for (const v of
|
|
93
|
+
for (const v of getKernel().iterShapes(shape.wrapped, "vertex")) yield castShapeWithKnownType(v, "vertex");
|
|
83
94
|
}
|
|
84
95
|
/** Get the axis-aligned bounding box of a shape. Cached per shape. */
|
|
85
96
|
function getBounds(shape) {
|
|
@@ -588,22 +599,22 @@ function resize(shape, dimensions, options) {
|
|
|
588
599
|
factor(dimensions[1], size[1], autoFactor),
|
|
589
600
|
factor(dimensions[2], size[2], autoFactor)
|
|
590
601
|
];
|
|
591
|
-
if (!(Math.abs(factors[0] - factors[1]) < 1e-6 && Math.abs(factors[1] - factors[2]) < 1e-6))
|
|
592
|
-
return scale(shape, factors[0]);
|
|
602
|
+
if (!(Math.abs(factors[0] - factors[1]) < 1e-6 && Math.abs(factors[1] - factors[2]) < 1e-6)) return err(validationError(BrepErrorCode.VALIDATION_FAILED, "resize: non-uniform scaling is not supported (WASM build lacks BRepBuilderAPI_GTransform).", void 0, void 0, "Use auto: true to scale proportionally, or set all three dimensions to achieve uniform scaling."));
|
|
603
|
+
return ok(scale(shape, factors[0]));
|
|
593
604
|
}
|
|
594
605
|
/**
|
|
595
606
|
* Parse a MatrixInput into a 3x3 linear part and translation vector.
|
|
596
607
|
* Validates the bottom row of a Matrix4x4.
|
|
597
608
|
*/
|
|
598
609
|
function parseMatrixInput(input) {
|
|
599
|
-
if ("linear" in input) return {
|
|
610
|
+
if ("linear" in input) return ok({
|
|
600
611
|
linear: input.linear,
|
|
601
612
|
translation: input.translation
|
|
602
|
-
};
|
|
613
|
+
});
|
|
603
614
|
const [r0, r1, r2, r3] = input;
|
|
604
615
|
const TOL = 1e-10;
|
|
605
|
-
if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL)
|
|
606
|
-
return {
|
|
616
|
+
if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL) return err(validationError(BrepErrorCode.VALIDATION_FAILED, `applyMatrix: invalid bottom row [${String(r3[0])}, ${String(r3[1])}, ${String(r3[2])}, ${String(r3[3])}]. Must be [0, 0, 0, 1] for an affine transform.`));
|
|
617
|
+
return ok({
|
|
607
618
|
linear: [
|
|
608
619
|
r0[0],
|
|
609
620
|
r0[1],
|
|
@@ -620,7 +631,7 @@ function parseMatrixInput(input) {
|
|
|
620
631
|
r1[3],
|
|
621
632
|
r2[3]
|
|
622
633
|
]
|
|
623
|
-
};
|
|
634
|
+
});
|
|
624
635
|
}
|
|
625
636
|
/** Determinant of a 3x3 matrix given as 9 row-major values. */
|
|
626
637
|
function det3x3(m) {
|
|
@@ -653,23 +664,25 @@ function isOrthogonalMatrix(m) {
|
|
|
653
664
|
* and the general `gp_GTrsf` path for non-orthogonal transforms (shear, non-uniform scale).
|
|
654
665
|
*/
|
|
655
666
|
function applyMatrix(shape, matrix) {
|
|
656
|
-
const
|
|
667
|
+
const parsed = parseMatrixInput(matrix);
|
|
668
|
+
if (!parsed.ok) return parsed;
|
|
669
|
+
const { linear, translation } = parsed.value;
|
|
657
670
|
const d = det3x3(linear);
|
|
658
|
-
if (Math.abs(d) < 1e-12)
|
|
671
|
+
if (Math.abs(d) < 1e-12) return err(validationError(BrepErrorCode.VALIDATION_FAILED, "applyMatrix: singular matrix (determinant ≈ 0). Cannot apply a non-invertible transform."));
|
|
659
672
|
if (isOrthogonalMatrix(linear)) {
|
|
660
673
|
const inputFaceHashes = collectInputFaceHashes([shape]);
|
|
661
674
|
const { shape: resultShape, evolution } = getKernel().generalTransformWithHistory(shape.wrapped, linear, translation, true, inputFaceHashes, HASH_CODE_MAX);
|
|
662
675
|
const result = castShape(resultShape);
|
|
663
676
|
propagateAllMetadata(evolution, [shape], result);
|
|
664
|
-
return result;
|
|
677
|
+
return ok(result);
|
|
665
678
|
}
|
|
666
679
|
const result = castShape(getKernel().generalTransformNonOrthogonal(shape.wrapped, linear, translation));
|
|
667
680
|
propagateMetadataByHash([shape], result);
|
|
668
|
-
return result;
|
|
681
|
+
return ok(result);
|
|
669
682
|
/* v8 ignore stop */
|
|
670
683
|
}
|
|
671
684
|
/**
|
|
672
|
-
* Compose multiple translate/rotate operations into a single kernel
|
|
685
|
+
* Compose multiple translate/rotate operations into a single kernel transform.
|
|
673
686
|
* Operations are applied in order (first element applied first).
|
|
674
687
|
* Call `.cleanup()` on the result when done to free the kernel object.
|
|
675
688
|
*/
|
|
@@ -744,4 +757,26 @@ function simplify(shape) {
|
|
|
744
757
|
return castShape(getKernel().simplify(shape.wrapped));
|
|
745
758
|
}
|
|
746
759
|
//#endregion
|
|
747
|
-
|
|
760
|
+
//#region src/utils/arrayAccess.ts
|
|
761
|
+
/**
|
|
762
|
+
* Safe array access utilities.
|
|
763
|
+
* Replaces `arr[i]!` patterns where TypeScript's `noUncheckedIndexedAccess` requires
|
|
764
|
+
* a non-null assertion but bounds are proven by surrounding code.
|
|
765
|
+
*/
|
|
766
|
+
/** Access element by index, throwing if out of bounds. Use when bounds are logically guaranteed. */
|
|
767
|
+
function getAtOrThrow(arr, index, msg) {
|
|
768
|
+
if (index < 0 || index >= arr.length) throw new Error(msg ?? `Index ${index} out of bounds (length ${arr.length})`);
|
|
769
|
+
return arr[index];
|
|
770
|
+
}
|
|
771
|
+
/** Get the first element of a non-empty array, throwing if empty. */
|
|
772
|
+
function firstOrThrow(arr, msg) {
|
|
773
|
+
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
774
|
+
return arr[0];
|
|
775
|
+
}
|
|
776
|
+
/** Get the last element of a non-empty array, throwing if empty. */
|
|
777
|
+
function lastOrThrow(arr, msg) {
|
|
778
|
+
if (arr.length === 0) throw new Error(msg ?? "Expected non-empty array");
|
|
779
|
+
return arr[arr.length - 1];
|
|
780
|
+
}
|
|
781
|
+
//#endregion
|
|
782
|
+
export { tagFaces as A, iterEdges as B, colorShape as C, getFaceTags as D, findFacesByTag as E, getEdges as F, iterVertices as H, getFaces as I, getVertices as L, setShapeOrigin as M, describe as N, getTagMetadata as O, getBounds as P, getWires as R, colorFaces as S, getShapeColor as T, iterWires as U, iterFaces as V, vertexPosition as W, transformCopy as _, getHashCode as a, propagateAllMetadata as b, isSameShape as c, applyMatrix as d, composeTransforms as f, scale as g, rotate as h, clone as i, getFaceOrigins as j, setTagMetadata as k, simplify as l, resize as m, getAtOrThrow as n, isEmpty as o, mirror as p, lastOrThrow as r, isEqualShape as s, firstOrThrow as t, toBREP as u, translate as v, getFaceColor as w, propagateMetadataByHash as x, collectInputFaceHashes as y, invalidateShapeCache as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const require_errors = require("./errors-Czwm1_Ti.cjs");
|
|
2
|
+
const require_boolean2D = require("./boolean2D-ByJ-oeX1.cjs");
|
|
3
|
+
const require_Blueprint = require("./Blueprint-DX6dM_fB.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
|
-
import { d as validationError, k as ok, t as BrepErrorCode, y as err } from "./errors-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { d as validationError, k as ok, t as BrepErrorCode, y as err } from "./errors-BR1gOLRZ.js";
|
|
2
|
+
import { h as CompoundBlueprint } from "./boolean2D-SeTIJXii.js";
|
|
3
|
+
import { t as Blueprint } from "./Blueprint-JYd_kdC5.js";
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|