brepjs 15.0.0 → 15.1.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.cjs +5 -5
- package/dist/2d.js +5 -5
- package/dist/{blueprint-BwRTIyAw.cjs → blueprint-BjgwjtqV.cjs} +12 -13
- package/dist/{blueprint-CdYlEXfG.js → blueprint-DZYvPFOb.js} +8 -9
- package/dist/{blueprintFns-C0Gt-QwZ.js → blueprintFns-BafXV38c.js} +2 -2
- package/dist/{blueprintFns-QcO6rMWf.cjs → blueprintFns-UOvgVzuX.cjs} +2 -2
- package/dist/{boolean2D-DFrT2rWk.cjs → boolean2D-C-hq_1gn.cjs} +18 -19
- package/dist/{boolean2D-s-HOkw92.js → boolean2D-DBwOCeX6.js} +11 -12
- package/dist/{booleanFns-Ddyxzgk3.js → booleanFns-CNHyIvDc.js} +10 -10
- package/dist/{booleanFns-DdTELRHb.cjs → booleanFns-ZM_lM6M3.cjs} +13 -13
- package/dist/brepjs.cjs +27 -28
- package/dist/brepjs.js +24 -25
- package/dist/core/shapePropertyCache.d.ts +17 -0
- package/dist/core/shapePropertyCache.d.ts.map +1 -0
- package/dist/core.cjs +7 -8
- package/dist/core.js +4 -5
- package/dist/{cornerFinder-CadmkLDu.cjs → cornerFinder-B6LRZyWV.cjs} +4 -4
- package/dist/{cornerFinder-CJBB9kPk.js → cornerFinder-aDj1xwVc.js} +3 -3
- package/dist/{curveFns-DT7CUf9U.cjs → curveFns-W_F_Xa3g.cjs} +1 -1
- package/dist/{curveFns-CPSCjYH3.js → curveFns-XeP_7sfu.js} +1 -1
- package/dist/{drawFns-DH5jLoyU.cjs → drawFns-BPu03pQs.cjs} +15 -16
- package/dist/{drawFns-vCEEAtD-.js → drawFns-wd-DUHuQ.js} +14 -15
- package/dist/{extrudeFns-jteSdJFq.js → extrudeFns-CCnX8Wnc.js} +2 -2
- package/dist/{extrudeFns-YkniZn07.cjs → extrudeFns-JKcPqDW0.cjs} +2 -2
- package/dist/{faceFns-CIH50WZl.cjs → faceFns-BatPSx4E.cjs} +40 -4
- package/dist/{faceFns-DSijGggR.js → faceFns-CwXyRBIc.js} +35 -5
- package/dist/{helpers-Cs9_5_7k.cjs → helpers-BTOfatSK.cjs} +9 -9
- package/dist/{helpers-CnNA3o2i.js → helpers-vWUe8tky.js} +7 -7
- package/dist/{historyFns-DJ7D_HBa.cjs → historyFns-BsrvsPeJ.cjs} +5 -5
- package/dist/{historyFns-BGemHNyO.js → historyFns-DCPfs9JF.js} +5 -5
- package/dist/{importFns-CXrs2hUZ.js → importFns-B-rQpr6n.js} +3 -3
- package/dist/{importFns-BIq-kGc4.cjs → importFns-CrVO7PKR.cjs} +3 -3
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/helpers.d.ts +1 -1
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -1
- package/dist/kernel/{brepkit/brepkit2d.d.ts → geometry2d.d.ts} +2 -2
- package/dist/kernel/geometry2d.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +4 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/occt/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/occt/kernel2dOps.d.ts +61 -68
- package/dist/kernel/occt/kernel2dOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +2 -2
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{measureFns-DlgliEOF.cjs → measureFns-DfgkoaSD.cjs} +2 -2
- package/dist/{measureFns-2OfU2IUx.js → measureFns-izZA1B0_.js} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-DQDOBWkh.js → meshFns-BI3QzGEX.js} +2 -2
- package/dist/{meshFns-BcsZJiab.cjs → meshFns-D_6MsFSo.cjs} +2 -2
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-6Wu7dMDN.cjs → planeOps-BXsq07La.cjs} +3 -4
- package/dist/{planeOps-gTOEarV2.js → planeOps-De5KoY28.js} +2 -3
- package/dist/{primitiveFns-C8sf6m4x.js → primitiveFns-BPLff5EG.js} +21 -21
- package/dist/{primitiveFns-DtFo8I-j.cjs → primitiveFns-Kt575VKh.cjs} +34 -34
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{shapeFns-CquegVyR.js → shapeFns-BB2q2jFa.js} +14 -14
- package/dist/{shapeFns-DT-NmO_I.cjs → shapeFns-C2XAiz3b.cjs} +20 -20
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-CAOYPDJJ.js → shapeRefFns-BDWfQuwL.js} +3 -3
- package/dist/{shapeRefFns-CfrgfNYR.cjs → shapeRefFns-Dv7ffyNc.cjs} +3 -3
- package/dist/{shapeTypes-DRUSTY2w.js → shapeTypes-C-TZVWaR.js} +5587 -5391
- package/dist/{shapeTypes-BUaUj4tR.cjs → shapeTypes-DwXVFQBp.cjs} +5587 -5391
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-D2n0c6sb.js → solidBuilders-B25s7R3T.js} +2 -2
- package/dist/{solidBuilders-DW5yg81T.cjs → solidBuilders-weOwUirU.cjs} +2 -2
- package/dist/{surfaceBuilders-C31J-3Bz.cjs → surfaceBuilders-DQ7JqzBT.cjs} +2 -2
- package/dist/{surfaceBuilders-C78Cywl6.js → surfaceBuilders-Gn_uKN9z.js} +2 -2
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/evolutionFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts +1 -1
- package/dist/topology/topologyQueryFns.d.ts.map +1 -1
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{types-BjDcsS7l.cjs → types-ETLaP595.js} +9 -18
- package/dist/types-TXQ7s56_.cjs +93 -0
- package/dist/vectors.cjs +5 -6
- package/dist/vectors.js +3 -4
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -1
- package/package.json +6 -2
- package/dist/constants-B9u763C3.js +0 -9
- package/dist/constants-unWN8k4c.cjs +0 -26
- package/dist/kernel/brepkit/brepkit2d.d.ts.map +0 -1
- package/dist/types-BWBlwp6w.js +0 -50
- /package/dist/{arrayAccess-CmulMesb.cjs → arrayAccess-DsvS2R9t.cjs} +0 -0
- /package/dist/{arrayAccess-xxcB3YNq.js → arrayAccess-E7Lh-LcJ.js} +0 -0
- /package/dist/{vecOps-D9etjPgV.js → vecOps-DaF0LUsD.js} +0 -0
- /package/dist/{vecOps-BXvBYIor.cjs → vecOps-EPq_YMgb.cjs} +0 -0
- /package/dist/{workerHandler-o2xzAfFk.js → workerHandler-DHY0IzlP.js} +0 -0
- /package/dist/{workerHandler-C-7OUJsa.cjs → workerHandler-Dl5bx8Qj.cjs} +0 -0
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-DwXVFQBp.cjs");
|
|
3
3
|
const require_errors = require("./errors-9zQcQK1H.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-BatPSx4E.cjs");
|
|
5
|
+
const require_boolean2D = require("./boolean2D-C-hq_1gn.cjs");
|
|
6
|
+
const require_blueprint = require("./blueprint-BjgwjtqV.cjs");
|
|
7
|
+
const require_blueprintFns = require("./blueprintFns-UOvgVzuX.cjs");
|
|
8
8
|
//#region src/core/curve2dHandle.ts
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
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-C-TZVWaR.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
|
|
3
|
-
import {
|
|
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-CwXyRBIc.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-DBwOCeX6.js";
|
|
5
|
+
import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-DZYvPFOb.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-BafXV38c.js";
|
|
7
7
|
//#region src/core/curve2dHandle.ts
|
|
8
8
|
/**
|
|
9
9
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DwXVFQBp.cjs");
|
|
2
2
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const require_helpers = require("./helpers-Cs9_5_7k.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-BatPSx4E.cjs");
|
|
4
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
5
|
+
const require_planeOps = require("./planeOps-BXsq07La.cjs");
|
|
6
|
+
const require_curveFns = require("./curveFns-W_F_Xa3g.cjs");
|
|
7
|
+
const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DQ7JqzBT.cjs");
|
|
9
|
+
const require_helpers = require("./helpers-BTOfatSK.cjs");
|
|
11
10
|
//#region src/2d/lib/definitions.ts
|
|
12
11
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
13
12
|
function isPoint2D(point) {
|
|
@@ -528,7 +527,7 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
|
528
527
|
if (!circleData) require_errors.bug("adaptedCurveToPathElem", "Expected circle data");
|
|
529
528
|
const { radius, isDirect } = circleData;
|
|
530
529
|
const bounds = k2d.getCurve2dBounds(curve.wrapped);
|
|
531
|
-
const paramAngle = (bounds.last - bounds.first) *
|
|
530
|
+
const paramAngle = (bounds.last - bounds.first) * require_types.RAD2DEG;
|
|
532
531
|
const end = paramAngle !== 360 ? endpoint : `${round5(endX)} ${round5(endY + 1e-4)}`;
|
|
533
532
|
return `A ${radius} ${radius} 0 ${Math.abs(paramAngle) > 180 ? "1" : "0"} ${isDirect ? "1" : "0"} ${end}`;
|
|
534
533
|
}
|
|
@@ -537,9 +536,9 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
|
|
|
537
536
|
if (!ellipseData) require_errors.bug("adaptedCurveToPathElem", "Expected ellipse data");
|
|
538
537
|
const { majorRadius: rx, minorRadius: ry, xAxisAngle, isDirect } = ellipseData;
|
|
539
538
|
const bounds = k2d.getCurve2dBounds(curve.wrapped);
|
|
540
|
-
const paramAngle = (bounds.last - bounds.first) *
|
|
539
|
+
const paramAngle = (bounds.last - bounds.first) * require_types.RAD2DEG;
|
|
541
540
|
const end = paramAngle !== 360 ? endpoint : `${round5(endX)} ${round5(endY + 1e-4)}`;
|
|
542
|
-
const angle = 180 - xAxisAngle *
|
|
541
|
+
const angle = 180 - xAxisAngle * require_types.RAD2DEG;
|
|
543
542
|
return `A ${round5(rx)} ${round5(ry)} ${round5(angle)} ${Math.abs(paramAngle) > 180 ? "1" : "0"} ${isDirect ? "1" : "0"} ${end}`;
|
|
544
543
|
}
|
|
545
544
|
require_errors.bug("adaptedCurveToPathElem", `Unsupported curve type: ${curveType}`);
|
|
@@ -807,7 +806,7 @@ var Blueprint = class Blueprint {
|
|
|
807
806
|
* @returns A new rotated Blueprint.
|
|
808
807
|
*/
|
|
809
808
|
rotate(angle, center) {
|
|
810
|
-
return new Blueprint(transformCurves(this.curves, rotateTransform2d(angle *
|
|
809
|
+
return new Blueprint(transformCurves(this.curves, rotateTransform2d(angle * require_types.DEG2RAD, center)));
|
|
811
810
|
}
|
|
812
811
|
translate(xDistOrPoint, yDist = 0) {
|
|
813
812
|
const translationVector = isPoint2D(xDistOrPoint) ? xDistOrPoint : [xDistOrPoint, yDist];
|
|
@@ -1,13 +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-C-TZVWaR.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-C-cgQA3w.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-CnNA3o2i.js";
|
|
3
|
+
import { N as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-CwXyRBIc.js";
|
|
4
|
+
import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-ETLaP595.js";
|
|
5
|
+
import { r as makePlane } from "./planeOps-De5KoY28.js";
|
|
6
|
+
import { f as getOrientation } from "./curveFns-XeP_7sfu.js";
|
|
7
|
+
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-E7Lh-LcJ.js";
|
|
8
|
+
import { r as makeFace } from "./surfaceBuilders-Gn_uKN9z.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-vWUe8tky.js";
|
|
11
10
|
//#region src/2d/lib/definitions.ts
|
|
12
11
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
13
12
|
function isPoint2D(point) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
|
|
2
|
-
import { g as CompoundBlueprint } from "./boolean2D-
|
|
3
|
-
import { t as Blueprint } from "./blueprint-
|
|
2
|
+
import { g as CompoundBlueprint } from "./boolean2D-DBwOCeX6.js";
|
|
3
|
+
import { t as Blueprint } from "./blueprint-DZYvPFOb.js";
|
|
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
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
2
|
-
const require_boolean2D = require("./boolean2D-
|
|
3
|
-
const require_blueprint = require("./blueprint-
|
|
2
|
+
const require_boolean2D = require("./boolean2D-C-hq_1gn.cjs");
|
|
3
|
+
const require_blueprint = require("./blueprint-BjgwjtqV.cjs");
|
|
4
4
|
//#region src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DwXVFQBp.cjs");
|
|
2
2
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const require_extrudeFns = require("./extrudeFns-YkniZn07.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-BatPSx4E.cjs");
|
|
4
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
5
|
+
const require_vecOps = require("./vecOps-EPq_YMgb.cjs");
|
|
6
|
+
const require_planeOps = require("./planeOps-BXsq07La.cjs");
|
|
7
|
+
const require_curveFns = require("./curveFns-W_F_Xa3g.cjs");
|
|
8
|
+
const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
|
|
9
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DQ7JqzBT.cjs");
|
|
10
|
+
const require_helpers = require("./helpers-BTOfatSK.cjs");
|
|
11
|
+
const require_blueprint = require("./blueprint-BjgwjtqV.cjs");
|
|
12
|
+
const require_extrudeFns = require("./extrudeFns-JKcPqDW0.cjs");
|
|
14
13
|
//#region node_modules/flatqueue/index.js
|
|
15
14
|
/** @template T */
|
|
16
15
|
var FlatQueue = class {
|
|
@@ -1255,10 +1254,10 @@ var defaultsSplineOptions = (config) => {
|
|
|
1255
1254
|
};
|
|
1256
1255
|
const { endTangent: endTgt, startFactor = 1, endFactor = 1, startTangent: startTgt } = conf;
|
|
1257
1256
|
let endTangent;
|
|
1258
|
-
if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt *
|
|
1257
|
+
if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt * require_types.DEG2RAD);
|
|
1259
1258
|
else endTangent = endTgt;
|
|
1260
1259
|
let startTangent;
|
|
1261
|
-
if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt *
|
|
1260
|
+
if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt * require_types.DEG2RAD);
|
|
1262
1261
|
else startTangent = startTgt;
|
|
1263
1262
|
return {
|
|
1264
1263
|
endTangent,
|
|
@@ -1377,7 +1376,7 @@ function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
|
|
|
1377
1376
|
* @param convertToUV - Coordinate conversion function from user space to UV space.
|
|
1378
1377
|
*/
|
|
1379
1378
|
function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep, convertToUV) {
|
|
1380
|
-
const radRotationAngle = rotationAngleDeg *
|
|
1379
|
+
const radRotationAngle = rotationAngleDeg * require_types.DEG2RAD;
|
|
1381
1380
|
const convertAxis = (ax) => require_helpers.distance2d(convertToUV(ax));
|
|
1382
1381
|
const r1 = convertAxis(require_helpers.polarToCartesian(majorRadius, radRotationAngle));
|
|
1383
1382
|
const r2 = convertAxis(require_helpers.polarToCartesian(minorRadius, radRotationAngle + Math.PI / 2));
|
|
@@ -1469,7 +1468,7 @@ var BaseSketcher2d = class {
|
|
|
1469
1468
|
const lastCurve = this._lastCurve();
|
|
1470
1469
|
if (!lastCurve) return 0;
|
|
1471
1470
|
const [dx, dy] = lastCurve.tangentAt(1);
|
|
1472
|
-
return Math.atan2(dy, dx) *
|
|
1471
|
+
return Math.atan2(dy, dx) * require_types.RAD2DEG;
|
|
1473
1472
|
}
|
|
1474
1473
|
/** Move the pen to an absolute 2D position before drawing any curves. */
|
|
1475
1474
|
movePointerTo(point) {
|
|
@@ -1515,11 +1514,11 @@ var BaseSketcher2d = class {
|
|
|
1515
1514
|
}
|
|
1516
1515
|
/** Draw a line to a point given in polar coordinates [r, theta] from the origin. */
|
|
1517
1516
|
polarLineTo([r, theta]) {
|
|
1518
|
-
return this.lineTo(require_helpers.polarToCartesian(r, theta *
|
|
1517
|
+
return this.lineTo(require_helpers.polarToCartesian(r, theta * require_types.DEG2RAD));
|
|
1519
1518
|
}
|
|
1520
1519
|
/** Draw a line in polar coordinates (distance and angle in degrees) from the current point. */
|
|
1521
1520
|
polarLine(distance, angle) {
|
|
1522
|
-
const [x, y] = require_helpers.polarToCartesian(distance, angle *
|
|
1521
|
+
const [x, y] = require_helpers.polarToCartesian(distance, angle * require_types.DEG2RAD);
|
|
1523
1522
|
return this.line(x, y);
|
|
1524
1523
|
}
|
|
1525
1524
|
/** Draw a line tangent to the previous curve, extending by the given distance. */
|
|
@@ -1606,7 +1605,7 @@ var BaseSketcher2d = class {
|
|
|
1606
1605
|
halfEllipseTo(end, minorRadius, sweep = false) {
|
|
1607
1606
|
const angle = require_helpers.polarAngle2d(end, this.pointer);
|
|
1608
1607
|
const dist = require_helpers.distance2d(end, this.pointer);
|
|
1609
|
-
return this.ellipseTo(end, dist / 2, minorRadius, angle *
|
|
1608
|
+
return this.ellipseTo(end, dist / 2, minorRadius, angle * require_types.RAD2DEG, true, sweep);
|
|
1610
1609
|
}
|
|
1611
1610
|
/** Draw a half-ellipse arc to a relative end point with a given minor radius. */
|
|
1612
1611
|
halfEllipse(xDist, yDist, minorRadius, sweep = false) {
|
|
@@ -1,16 +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-C-TZVWaR.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-C-cgQA3w.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { r as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
import {
|
|
13
|
-
import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-jteSdJFq.js";
|
|
3
|
+
import { P as downcast, c as normalAt, p as uvBounds, u as pointOnSurface } from "./faceFns-CwXyRBIc.js";
|
|
4
|
+
import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-ETLaP595.js";
|
|
5
|
+
import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-DaF0LUsD.js";
|
|
6
|
+
import { n as createPlane } from "./planeOps-De5KoY28.js";
|
|
7
|
+
import { c as curveStartPoint, l as curveTangentAt, r as curveIsClosed } from "./curveFns-XeP_7sfu.js";
|
|
8
|
+
import { r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-E7Lh-LcJ.js";
|
|
9
|
+
import { _ as zip, i as makeNewFaceWithinFace, r as makeFace, s as assembleWire } from "./surfaceBuilders-Gn_uKN9z.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-vWUe8tky.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-DZYvPFOb.js";
|
|
12
|
+
import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-CCnX8Wnc.js";
|
|
14
13
|
//#region node_modules/flatqueue/index.js
|
|
15
14
|
/** @template T */
|
|
16
15
|
var FlatQueue = class {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { X as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { X as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-C-TZVWaR.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-C-cgQA3w.js";
|
|
3
|
-
import { C as getVertices, b as getEdges, w as getWires } from "./faceFns-
|
|
4
|
-
import {
|
|
5
|
-
import { h as vecScale, t as vecAdd } from "./vecOps-
|
|
6
|
-
import { o as resolvePlane } from "./planeOps-
|
|
7
|
-
import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-
|
|
8
|
-
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-
|
|
9
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
3
|
+
import { C as getVertices, b as getEdges, j as getOrQueryHashCode, w as getWires } from "./faceFns-CwXyRBIc.js";
|
|
4
|
+
import { a as HASH_CODE_MAX } from "./types-ETLaP595.js";
|
|
5
|
+
import { h as vecScale, t as vecAdd } from "./vecOps-DaF0LUsD.js";
|
|
6
|
+
import { o as resolvePlane } from "./planeOps-De5KoY28.js";
|
|
7
|
+
import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-BB2q2jFa.js";
|
|
8
|
+
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-E7Lh-LcJ.js";
|
|
9
|
+
import { r as makeFace } from "./surfaceBuilders-Gn_uKN9z.js";
|
|
10
10
|
//#region src/topology/booleanFns.ts
|
|
11
11
|
/**
|
|
12
12
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -240,8 +240,8 @@ function buildEdgeAdjacency(edges) {
|
|
|
240
240
|
const edgeVertexHashes = /* @__PURE__ */ new Map();
|
|
241
241
|
for (const edge of edges) {
|
|
242
242
|
const verts = getVertices(edge);
|
|
243
|
-
const h0 = verts[0] ? kernel
|
|
244
|
-
const h1 = verts.length > 1 && verts[1] ? kernel
|
|
243
|
+
const h0 = verts[0] ? getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
|
|
244
|
+
const h1 = verts.length > 1 && verts[1] ? getOrQueryHashCode(kernel, verts[1].wrapped) : h0;
|
|
245
245
|
edgeVertexHashes.set(edge, [h0, h1]);
|
|
246
246
|
for (const h of [h0, h1]) {
|
|
247
247
|
const bucket = vertexToEdges.get(h) ?? [];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DwXVFQBp.cjs");
|
|
2
2
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
4
|
-
const
|
|
5
|
-
const require_vecOps = require("./vecOps-
|
|
6
|
-
const require_planeOps = require("./planeOps-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
9
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
3
|
+
const require_faceFns = require("./faceFns-BatPSx4E.cjs");
|
|
4
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
5
|
+
const require_vecOps = require("./vecOps-EPq_YMgb.cjs");
|
|
6
|
+
const require_planeOps = require("./planeOps-BXsq07La.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-C2XAiz3b.cjs");
|
|
8
|
+
const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
|
|
9
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DQ7JqzBT.cjs");
|
|
10
10
|
//#region src/topology/booleanFns.ts
|
|
11
11
|
/**
|
|
12
12
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -48,7 +48,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
|
|
|
48
48
|
fuzzyValue
|
|
49
49
|
}), "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
|
|
50
50
|
const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
|
|
51
|
-
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes,
|
|
51
|
+
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
|
|
52
52
|
optimisation,
|
|
53
53
|
simplify,
|
|
54
54
|
fuzzyValue
|
|
@@ -73,7 +73,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
|
|
|
73
73
|
fuzzyValue
|
|
74
74
|
}), "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
75
75
|
const inputFaceHashes = require_shapeFns.collectInputFaceHashes([base, tool]);
|
|
76
|
-
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes,
|
|
76
|
+
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
|
|
77
77
|
optimisation,
|
|
78
78
|
simplify,
|
|
79
79
|
fuzzyValue
|
|
@@ -97,7 +97,7 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
|
|
|
97
97
|
fuzzyValue
|
|
98
98
|
}), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
|
|
99
99
|
const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
|
|
100
|
-
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes,
|
|
100
|
+
const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
|
|
101
101
|
simplify,
|
|
102
102
|
fuzzyValue
|
|
103
103
|
});
|
|
@@ -240,8 +240,8 @@ function buildEdgeAdjacency(edges) {
|
|
|
240
240
|
const edgeVertexHashes = /* @__PURE__ */ new Map();
|
|
241
241
|
for (const edge of edges) {
|
|
242
242
|
const verts = require_faceFns.getVertices(edge);
|
|
243
|
-
const h0 = verts[0] ?
|
|
244
|
-
const h1 = verts.length > 1 && verts[1] ?
|
|
243
|
+
const h0 = verts[0] ? require_faceFns.getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
|
|
244
|
+
const h1 = verts.length > 1 && verts[1] ? require_faceFns.getOrQueryHashCode(kernel, verts[1].wrapped) : h0;
|
|
245
245
|
edgeVertexHashes.set(edge, [h0, h1]);
|
|
246
246
|
for (const h of [h0, h1]) {
|
|
247
247
|
const bucket = vertexToEdges.get(h) ?? [];
|
package/dist/brepjs.cjs
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_drawFns = require("./drawFns-
|
|
3
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_drawFns = require("./drawFns-BPu03pQs.cjs");
|
|
3
|
+
const require_shapeTypes = require("./shapeTypes-DwXVFQBp.cjs");
|
|
4
4
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const require_workerHandler = require("./workerHandler-C-7OUJsa.cjs");
|
|
5
|
+
const require_faceFns = require("./faceFns-BatPSx4E.cjs");
|
|
6
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
7
|
+
const require_vecOps = require("./vecOps-EPq_YMgb.cjs");
|
|
8
|
+
const require_planeOps = require("./planeOps-BXsq07La.cjs");
|
|
9
|
+
const require_shapeFns = require("./shapeFns-C2XAiz3b.cjs");
|
|
10
|
+
const require_curveFns = require("./curveFns-W_F_Xa3g.cjs");
|
|
11
|
+
const require_meshFns = require("./meshFns-D_6MsFSo.cjs");
|
|
12
|
+
const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
|
|
13
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DQ7JqzBT.cjs");
|
|
14
|
+
const require_booleanFns = require("./booleanFns-ZM_lM6M3.cjs");
|
|
15
|
+
const require_primitiveFns = require("./primitiveFns-Kt575VKh.cjs");
|
|
16
|
+
const require_historyFns = require("./historyFns-BsrvsPeJ.cjs");
|
|
17
|
+
const require_boolean2D = require("./boolean2D-C-hq_1gn.cjs");
|
|
18
|
+
const require_helpers = require("./helpers-BTOfatSK.cjs");
|
|
19
|
+
const require_solidBuilders = require("./solidBuilders-weOwUirU.cjs");
|
|
20
|
+
const require_measureFns = require("./measureFns-DfgkoaSD.cjs");
|
|
21
|
+
const require_cornerFinder = require("./cornerFinder-B6LRZyWV.cjs");
|
|
22
|
+
const require_extrudeFns = require("./extrudeFns-JKcPqDW0.cjs");
|
|
23
|
+
const require_blueprintFns = require("./blueprintFns-UOvgVzuX.cjs");
|
|
24
|
+
const require_importFns = require("./importFns-CrVO7PKR.cjs");
|
|
25
|
+
const require_shapeRefFns = require("./shapeRefFns-Dv7ffyNc.cjs");
|
|
26
|
+
const require_workerHandler = require("./workerHandler-Dl5bx8Qj.cjs");
|
|
28
27
|
//#region src/topology/shapeBooleans.ts
|
|
29
28
|
var BOPAlgo_GlueShift = 1;
|
|
30
29
|
var BOPAlgo_GlueFull = 2;
|
|
@@ -2765,11 +2764,11 @@ exports.BrepErrorCode = require_errors.BrepErrorCode;
|
|
|
2765
2764
|
exports.BrepWrapperError = BrepWrapperError;
|
|
2766
2765
|
exports.BrepkitAdapter = require_shapeTypes.BrepkitAdapter;
|
|
2767
2766
|
exports.CompoundSketch = require_drawFns.CompoundSketch;
|
|
2768
|
-
exports.DEG2RAD =
|
|
2767
|
+
exports.DEG2RAD = require_types.DEG2RAD;
|
|
2769
2768
|
exports.DisposalScope = require_shapeTypes.DisposalScope;
|
|
2770
|
-
exports.HASH_CODE_MAX =
|
|
2769
|
+
exports.HASH_CODE_MAX = require_types.HASH_CODE_MAX;
|
|
2771
2770
|
exports.OK = require_errors.OK;
|
|
2772
|
-
exports.RAD2DEG =
|
|
2771
|
+
exports.RAD2DEG = require_types.RAD2DEG;
|
|
2773
2772
|
exports.Sketch = require_boolean2D.Sketch;
|
|
2774
2773
|
exports.Sketches = require_drawFns.Sketches;
|
|
2775
2774
|
exports.addChild = require_historyFns.addChild;
|
package/dist/brepjs.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-
|
|
1
|
+
import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-C-TZVWaR.js";
|
|
2
2
|
import { A as ok, B as unwrapOr, C as fromNullable, D as mapBoth, E as map, F as tapErr, H as zip, I as tryCatch, L as tryCatchAsync, M as orElse, N as pipeline, O as mapErr, P as tap, R as unwrap, S as flatten, T as isOk, V as unwrapOrElse, _ as all, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, j as or, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, t as BrepErrorCode, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-C-cgQA3w.js";
|
|
3
|
-
import { A as vertexPosition, B as
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { a as
|
|
17
|
-
import { a as
|
|
18
|
-
import {
|
|
19
|
-
import { r as
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import { a as
|
|
23
|
-
import {
|
|
24
|
-
import { a as
|
|
25
|
-
import { a as
|
|
26
|
-
import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-o2xzAfFk.js";
|
|
3
|
+
import { A as vertexPosition, B as kernelCallRaw, C as getVertices, D as iterFaces, E as iterEdges, F as fromBREP, I as isCompSolid, L as iterTopo, M as asTopo, N as cast, O as iterVertices, P as downcast, R as shapeType, T as invalidateShapeCache, V as kernelCallScoped, a as flipFaceOrientation, b as getEdges, c as normalAt, d as projectPointOnFace, f as removeHolesFromFace, g as getBounds, h as describe$1, i as faceOrientation, k as iterWires, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, w as getWires, x as getFaces, y as getCachedSurfaceType, z as kernelCall } from "./faceFns-CwXyRBIc.js";
|
|
4
|
+
import { a as HASH_CODE_MAX, i as DEG2RAD, n as toVec2, o as RAD2DEG, r as toVec3, t as resolveDirection } from "./types-ETLaP595.js";
|
|
5
|
+
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-DaF0LUsD.js";
|
|
6
|
+
import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-De5KoY28.js";
|
|
7
|
+
import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$1, h as translate$1, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$1, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$1, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-BB2q2jFa.js";
|
|
8
|
+
import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-XeP_7sfu.js";
|
|
9
|
+
import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-BI3QzGEX.js";
|
|
10
|
+
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-E7Lh-LcJ.js";
|
|
11
|
+
import { n as fill, r as makeFace } from "./surfaceBuilders-Gn_uKN9z.js";
|
|
12
|
+
import { a as fuseAll, c as sectionToFace$1, i as fuse$1, l as slice$1, n as cut$1, o as intersect$1, r as cutAll, s as section$1, t as booleanPipeline, u as split$1 } from "./booleanFns-CNHyIvDc.js";
|
|
13
|
+
import { $ as getNurbsSurfaceData, A as fixShape, B as offset$1, C as threePointArc, D as wireLoop, E as wire, F as isValid$1, G as chamferWithEvolution, H as thicken$1, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, L as chamfer$1, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as getNurbsCurveData, R as draft$1, S as tangentArc, T as vertex, U as variableFillet, V as shell$1, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as wiresOfFace, b as sphere, c as cylinder, ct as toGroupedBufferGeometryData, d as ellipsoid, et as adjacentFaces, f as face, g as offsetFace, h as line, i as bsplineApprox, it as verticesOfEdge, j as heal$1, k as fixSelfIntersection, l as ellipse, lt as toLODGeometryData, m as helix, n as bezier, nt as facesOfEdge, o as compound, ot as chamferDistAngle, p as filledFace, q as filletWithEvolution, r as box, rt as sharedEdges, s as cone, st as toBufferGeometryData, t as addHoles, tt as edgesOfFace, u as ellipseArc, ut as toLineGeometryData, v as sewShells, w as torus, x as subFace, y as solid, z as fillet$1 } from "./primitiveFns-BPLff5EG.js";
|
|
14
|
+
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, f as serializeHistory, g as addChild, h as undoLast, i as deserializeHistory, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-DCPfs9JF.js";
|
|
15
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, f as Sketch, h as organiseBlueprints, i as cutBlueprints, m as loftAll, n as fuse2D, o as intersectBlueprints, p as loft$1, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-DBwOCeX6.js";
|
|
16
|
+
import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-vWUe8tky.js";
|
|
17
|
+
import { $ as sketchFaceOffset, B as drawSingleCircle, C as cameraFromPlane, D as makeProjectedEdges, E as projectEdges, F as drawParametricFunction, G as loadFont, H as drawText, I as drawPointsInterpolation, J as textMetrics, K as sketchText, L as drawPolysides, M as draw, N as drawCircle, O as isProjectionPlane, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, T as createCamera, U as fontMetrics, V as drawSingleEllipse, W as getFont, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, q as textBlueprints, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, w as cameraLookAt, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-wd-DUHuQ.js";
|
|
18
|
+
import { r as makeCylinder } from "./solidBuilders-B25s7R3T.js";
|
|
19
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-izZA1B0_.js";
|
|
20
|
+
import { t as cornerFinder } from "./cornerFinder-aDj1xwVc.js";
|
|
21
|
+
import { a as guidedSweep, c as sweep, i as complexExtrude, l as twistExtrude, n as extrudeAll, o as multiSectionSweep, r as revolve$1, s as supportExtrude, t as extrude$1 } from "./extrudeFns-CCnX8Wnc.js";
|
|
22
|
+
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, n as createCompoundBlueprint, 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-BafXV38c.js";
|
|
23
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-B-rQpr6n.js";
|
|
24
|
+
import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-BDWfQuwL.js";
|
|
25
|
+
import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-DHY0IzlP.js";
|
|
27
26
|
//#region \0rolldown/runtime.js
|
|
28
27
|
var __defProp = Object.defineProperty;
|
|
29
28
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KernelShape } from '../kernel/types.js';
|
|
2
|
+
import { KernelAdapter } from '../kernel/interfaces/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the vertex position from cache, or query the kernel and cache the result.
|
|
5
|
+
*
|
|
6
|
+
* Vertices are immutable — their 3D position never changes once created.
|
|
7
|
+
* This avoids WASM round-trips (~10μs each) in hot loops like vertex finders.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getOrQueryVertexPosition(kernel: KernelAdapter, vertex: KernelShape): [number, number, number];
|
|
10
|
+
/**
|
|
11
|
+
* Get the hash code from cache, or query the kernel and cache the result.
|
|
12
|
+
*
|
|
13
|
+
* Hash codes are deterministic on immutable shapes. This avoids WASM
|
|
14
|
+
* round-trips (~5μs each) in adjacency deduplication loops.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getOrQueryHashCode(kernel: KernelAdapter, shape: KernelShape): number;
|
|
17
|
+
//# sourceMappingURL=shapePropertyCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapePropertyCache.d.ts","sourceRoot":"","sources":["../../src/core/shapePropertyCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAUlE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAM1B;AASD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAMpF"}
|
package/dist/core.cjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-DwXVFQBp.cjs");
|
|
3
3
|
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const require_planeOps = require("./planeOps-6Wu7dMDN.cjs");
|
|
4
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
5
|
+
const require_vecOps = require("./vecOps-EPq_YMgb.cjs");
|
|
6
|
+
const require_planeOps = require("./planeOps-BXsq07La.cjs");
|
|
8
7
|
exports.BrepBugError = require_errors.BrepBugError;
|
|
9
|
-
exports.DEG2RAD =
|
|
8
|
+
exports.DEG2RAD = require_types.DEG2RAD;
|
|
10
9
|
exports.DisposalScope = require_shapeTypes.DisposalScope;
|
|
11
|
-
exports.HASH_CODE_MAX =
|
|
10
|
+
exports.HASH_CODE_MAX = require_types.HASH_CODE_MAX;
|
|
12
11
|
exports.OK = require_errors.OK;
|
|
13
|
-
exports.RAD2DEG =
|
|
12
|
+
exports.RAD2DEG = require_types.RAD2DEG;
|
|
14
13
|
exports.andThen = require_errors.andThen;
|
|
15
14
|
exports.bug = require_errors.bug;
|
|
16
15
|
exports.castShape = require_shapeTypes.castShape;
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-
|
|
1
|
+
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-C-TZVWaR.js";
|
|
2
2
|
import { A as ok, B as unwrapOr, E as map, I as tryCatch, L as tryCatchAsync, O as mapErr, R as unwrap, T as isOk, V as unwrapOrElse, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-C-cgQA3w.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import { i as pivotPlane, n as createPlane, o as resolvePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-gTOEarV2.js";
|
|
3
|
+
import { a as HASH_CODE_MAX, i as DEG2RAD, n as toVec2, o as RAD2DEG, r as toVec3, t as resolveDirection } from "./types-ETLaP595.js";
|
|
4
|
+
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-DaF0LUsD.js";
|
|
5
|
+
import { i as pivotPlane, n as createPlane, o as resolvePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-De5KoY28.js";
|
|
7
6
|
export { BrepBugError, DEG2RAD, DisposalScope, HASH_CODE_MAX, OK, RAD2DEG, andThen, bug, castShape, closedWire, collect, computationError, createHandle, createKernelHandle, createNamedPlane, createPlane, err, flatMap, getShapeKind, ioError, is2D, is3D, isClosedWire, isCompound, isEdge, isErr, isFace, isLive, isManifoldShell, isOk, isOrientedFace, isShape1D, isShape3D, isShell, isSolid, isValidSolid, isVertex, isWire, kernelError, manifoldShell, map, mapErr, match, moduleInitError, ok, orientedFace, pivotPlane, queryError, resolveDirection, resolvePlane, sketcherStateError, toVec2, toVec3, translatePlane, tryCatch, tryCatchAsync, typeCastError, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, validSolid, validationError, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, withScope, withScopeResult, withScopeResultAsync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
3
|
-
const require_helpers = require("./helpers-
|
|
1
|
+
const require_types = require("./types-TXQ7s56_.cjs");
|
|
2
|
+
const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
|
|
3
|
+
const require_helpers = require("./helpers-BTOfatSK.cjs");
|
|
4
4
|
//#region src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -39,7 +39,7 @@ function buildCornerFinder(filters) {
|
|
|
39
39
|
ofAngle: (angle) => withFilter((corner) => {
|
|
40
40
|
const tgt1 = corner.firstCurve.tangentAt(1);
|
|
41
41
|
const tgt2 = corner.secondCurve.tangentAt(0);
|
|
42
|
-
return Math.abs(positiveHalfAngle(require_helpers.angle2d(tgt1, tgt2)) - positiveHalfAngle(
|
|
42
|
+
return Math.abs(positiveHalfAngle(require_helpers.angle2d(tgt1, tgt2)) - positiveHalfAngle(require_types.DEG2RAD * angle)) < 1e-9;
|
|
43
43
|
}),
|
|
44
44
|
not: (fn) => {
|
|
45
45
|
const inner = fn(buildCornerFinder([]));
|