brepjs 20.5.0 → 20.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/2d.cjs +9 -11
- package/dist/2d.js +9 -11
- package/dist/{adjacencyFns-DeyXahej.js → adjacencyFns-BgJQQjdt.js} +5 -6
- package/dist/{adjacencyFns-1rxgJ6Hw.cjs → adjacencyFns-_RTYhwtD.cjs} +5 -6
- package/dist/{arrayAccess-DrUGPADn.js → arrayAccess-BpgouNir.js} +1 -2
- package/dist/{arrayAccess-e4H9cBfh.cjs → arrayAccess-DpJYARwv.cjs} +1 -2
- package/dist/{blueprint-rwJjYPzo.js → blueprint-Bth4EVaO.js} +24 -37
- package/dist/{blueprint-Yyoiz-U1.cjs → blueprint-wq2TU1XP.cjs} +24 -37
- package/dist/{blueprintFns-Q3Sq-Fse.js → blueprintFns-DQmNe1p6.js} +5 -7
- package/dist/{blueprintFns-Ce6OoPSX.cjs → blueprintFns-Dd0gm1rX.cjs} +5 -7
- package/dist/{blueprintSketcher-CzKbxeTk.cjs → blueprintSketcher-CSDqr27-.cjs} +19 -31
- package/dist/{blueprintSketcher-FywUpRiV.js → blueprintSketcher-DNp87aQZ.js} +19 -31
- package/dist/{boolean2D-D8igCYc9.js → boolean2D-BAb4SnIL.js} +13 -19
- package/dist/{boolean2D-BzZ9iBSn.cjs → boolean2D-BkgOjMRt.cjs} +13 -19
- package/dist/brepjs.cjs +113 -187
- package/dist/brepjs.js +113 -188
- package/dist/{bug-O02CsAmt.cjs → bug-CBcpIPuf.cjs} +2 -4
- package/dist/{bug-BdOHwn_e.js → bug-ClMTAJhe.js} +2 -4
- package/dist/{cameraFns-Cs6v3bWQ.js → cameraFns-9AGyuZVp.js} +8 -11
- package/dist/{cameraFns-RHCb1F1s.cjs → cameraFns-CKUN90f_.cjs} +8 -11
- package/dist/{constants-ITRzCnCp.js → constants-iraOnb2p.js} +1 -2
- package/dist/{constants-BOVyEYGH.cjs → constants-oee0S_x6.cjs} +1 -2
- package/dist/core/errors.d.ts +3 -0
- package/dist/core.cjs +8 -8
- package/dist/core.js +8 -8
- package/dist/{cornerFinder-Dlae8IX5.js → cornerFinder-Cr_04etw.js} +4 -5
- package/dist/{cornerFinder-Cji_BK-R.cjs → cornerFinder-DJWo6h1Z.cjs} +4 -5
- package/dist/{curveFns-KS1BWGhF.js → curveFns-CkA2WJP2.js} +3 -4
- package/dist/{curveFns-6-ULFrEB.cjs → curveFns-U7srQ3ZA.cjs} +3 -4
- package/dist/{drawFns-3yRVBDgI.js → drawFns-C6bmFijD.js} +32 -45
- package/dist/{drawFns-Ddlgp9gQ.cjs → drawFns-DlCxozRP.cjs} +32 -45
- package/dist/{errors-jwhfQJZK.cjs → errors-GVyCnpi0.cjs} +6 -5
- package/dist/{errors-Zb3jBa0u.js → errors-vxP5FT8B.js} +6 -5
- package/dist/{faceFns-CTlJC5IY.js → faceFns-BBk6XKJO.js} +6 -8
- package/dist/{faceFns-CZeHWke7.cjs → faceFns-DSRREV5G.cjs} +6 -8
- package/dist/{faceRoleFns-CWU1-Pm8.js → faceRoleFns-BPxzQF-n.js} +1 -2
- package/dist/{faceRoleFns-CtH_48MO.cjs → faceRoleFns-Db5bYj4Q.cjs} +1 -2
- package/dist/{healingFns-DwSpJZfg.cjs → healingFns-C9G3yjOe.cjs} +148 -51
- package/dist/{healingFns-Ct3gEMvk.js → healingFns-CEr0afli.js} +148 -51
- package/dist/{helpers-NRZVshPb.cjs → helpers-JuPoaP_b.cjs} +15 -21
- package/dist/{helpers-BN1mVMuZ.js → helpers-sDialr0f.js} +15 -21
- package/dist/{importFns-BEi-HsSw.cjs → importFns-ClqPJCFR.cjs} +12 -19
- package/dist/{importFns-0kHGg-b8.js → importFns-DSUfSQn2.js} +12 -19
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/capabilities.d.ts +8 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -2
- package/dist/{loftFns-B5mq1WDh.js → loftFns-B8DSoG-F.js} +7 -10
- package/dist/{loftFns-DL9UsQhd.cjs → loftFns-mkJeOaII.cjs} +7 -10
- package/dist/{measureFns-D_GpQw5z.cjs → measureFns-BvNkzSR6.cjs} +6 -8
- package/dist/{measureFns-CyDVZomf.js → measureFns-PRM3gOjw.js} +6 -8
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-COlno8TY.js → meshFns-CgbT3uuO.js} +6 -8
- package/dist/{meshFns-CAxkaRTm.cjs → meshFns-W7ZTKqiJ.cjs} +6 -8
- package/dist/{occtWasmAdapter-CA6PmIIj.cjs → occtWasmAdapter-BSQeA69d.cjs} +49 -57
- package/dist/{occtWasmAdapter-BX10fyla.js → occtWasmAdapter-PzZJHUAd.js} +44 -58
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-DiHy5BZC.js → originTrackingFns-D8SNCDKj.js} +4 -5
- package/dist/{originTrackingFns-CWo6NWHK.cjs → originTrackingFns-DJDTRJh3.cjs} +4 -5
- package/dist/{planeOps-DJuclNxa.cjs → planeOps-C9d2Y56B.cjs} +5 -6
- package/dist/{planeOps-Cxws4Tiu.js → planeOps-Dp0YvuFE.js} +5 -6
- package/dist/{primitiveFns-ZV3aMbqG.cjs → primitiveFns-EtHyTqhw.cjs} +8 -10
- package/dist/{primitiveFns-CGJzS4MO.js → primitiveFns-W3RYNJcm.js} +8 -10
- package/dist/{principalBoxFns-BJgGEoik.js → principalBoxFns-Cbtty-2_.js} +7 -8
- package/dist/{principalBoxFns-5FSbxAj-.cjs → principalBoxFns-CmZa7qHi.cjs} +7 -8
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -2
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-CpVZoeOT.js → refResolveFns-BkciKtNP.js} +14 -21
- package/dist/{refResolveFns-Ct52Uw7R.cjs → refResolveFns-D99Vqe7a.cjs} +14 -21
- package/dist/result.cjs +2 -2
- package/dist/result.js +2 -2
- package/dist/{rolldown-runtime-C0BPl7ul.cjs → rolldown-runtime-BW-eSwOZ.cjs} +1 -2
- package/dist/{shapeFns-C2j6oZ2u.cjs → shapeFns-B54CsPyk.cjs} +5 -6
- package/dist/{shapeFns--1wNlcc_.js → shapeFns-DB3l3ULC.js} +5 -6
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -2
- package/dist/{shapeTypes-CqNJoSam.js → shapeTypes-CgbUTASh.js} +82 -161
- package/dist/{shapeTypes-DH2ShBU_.cjs → shapeTypes-D_anqiRe.cjs} +82 -161
- package/dist/sketching.cjs +4 -5
- package/dist/sketching.js +4 -5
- package/dist/{solidBuilders-CgicU3le.cjs → solidBuilders-CUd-korS.cjs} +17 -23
- package/dist/{solidBuilders-IstbiWju.js → solidBuilders-DE_na4G3.js} +17 -23
- package/dist/{surfaceBuilders-vYgSvgI6.cjs → surfaceBuilders-DOn2jWkh.cjs} +8 -12
- package/dist/{surfaceBuilders-8nLk2PWk.js → surfaceBuilders-wdGNiImD.js} +8 -12
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-fa7VHJZz.cjs → textBlueprints-BQ60Rc96.cjs} +24 -32
- package/dist/{textBlueprints-C13NAA3C.js → textBlueprints-B_jwMuej.js} +23 -31
- package/dist/{textMetrics--cikHkGX.cjs → textMetrics-Bm0a4kh7.cjs} +4 -6
- package/dist/{textMetrics-Dcc63qRm.js → textMetrics-Dj3yfZNQ.js} +4 -6
- package/dist/{threadFns-BUQPg_vI.cjs → threadFns-BuRPVenB.cjs} +21 -33
- package/dist/{threadFns-3U9x4v_M.js → threadFns-DlL5VnMf.js} +21 -33
- package/dist/topology/modifierFns.d.ts +5 -0
- package/dist/topology/thickResultCheck.d.ts +18 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-DnfjQgP7.js → topologyQueryFns-6M_dbT1R.js} +10 -10
- package/dist/{topologyQueryFns-q2bGyuEV.cjs → topologyQueryFns-ENxs8uu2.cjs} +15 -9
- package/dist/{types-D24Y27N0.js → types-CKXsIm9-.js} +1 -2
- package/dist/{types-KjA8tY4Y.cjs → types-CjF9Rofr.cjs} +1 -2
- package/dist/{validityTypes-r0A2YdNq.cjs → validityTypes-BPamqRZ8.cjs} +3 -4
- package/dist/{validityTypes-t7JpS0Ki.js → validityTypes-BTuI0vcR.js} +3 -4
- package/dist/{vecOps-CCnJt-yH.cjs → vecOps-CrGEPPQM.cjs} +1 -2
- package/dist/{vecOps-SKPRvPH-.js → vecOps-S-m9H_fe.js} +1 -2
- package/dist/vectors.cjs +4 -4
- package/dist/vectors.js +4 -4
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -2
- package/dist/{workerPool-XcYX2UZ0.js → workerPool-Bc5hmJc4.js} +5 -10
- package/dist/{workerPool-D30NsiIW.cjs → workerPool-D5tiNXrI.cjs} +5 -10
- package/package.json +10 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { J as getKernel2D, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { i as wasmIndex, n as bug } from "./bug-
|
|
3
|
-
import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-
|
|
4
|
-
import { r as RAD2DEG, t as DEG2RAD } from "./constants-
|
|
5
|
-
import { t as firstOrThrow } from "./arrayAccess-
|
|
6
|
-
import { _ as rotate2d, d as cartesianToPolar, f as crossProduct2d, g as polarToCartesian, h as polarAngle2d, l as add2d, p as distance2d, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-
|
|
7
|
-
import { C as isPoint2D, b as normalize2d, c as make2dBezierCurve, d as make2dEllipseArc, g as approximateAsBSpline, h as make2dThreePointArc, l as make2dCircle, m as make2dTangentArc, n as asSVG, p as make2dSegmentCurve, r as viewbox, s as make2dArcFromCenter, t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-
|
|
8
|
-
|
|
1
|
+
import { J as getKernel2D, q as getKernel } from "./shapeTypes-CgbUTASh.js";
|
|
2
|
+
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
|
+
import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-vxP5FT8B.js";
|
|
4
|
+
import { r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
|
+
import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
6
|
+
import { _ as rotate2d, d as cartesianToPolar, f as crossProduct2d, g as polarToCartesian, h as polarAngle2d, l as add2d, p as distance2d, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-sDialr0f.js";
|
|
7
|
+
import { C as isPoint2D, b as normalize2d, c as make2dBezierCurve, d as make2dEllipseArc, g as approximateAsBSpline, h as make2dThreePointArc, l as make2dCircle, m as make2dTangentArc, n as asSVG, p as make2dSegmentCurve, r as viewbox, s as make2dArcFromCenter, t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-Bth4EVaO.js";
|
|
8
|
+
// node_modules/flatqueue/index.js
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
|
|
11
11
|
* Uint32ArrayConstructor | Int32ArrayConstructor | Uint16ArrayConstructor |
|
|
@@ -112,8 +112,7 @@ var FlatQueue = class {
|
|
|
112
112
|
if (Array.isArray(this.values)) this.values.length = this.length;
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
//#region node_modules/flatbush/index.js
|
|
115
|
+
// node_modules/flatbush/index.js
|
|
117
116
|
var ARRAY_TYPES = [
|
|
118
117
|
Int8Array,
|
|
119
118
|
Uint8Array,
|
|
@@ -522,8 +521,7 @@ function hilbert(x, y) {
|
|
|
522
521
|
b = (b | b << 1) & 1431655765;
|
|
523
522
|
return ((b << 1 | a) >>> 0) - 2147483648;
|
|
524
523
|
}
|
|
525
|
-
|
|
526
|
-
//#region src/2d/lib/intersections.ts
|
|
524
|
+
// src/2d/lib/intersections.ts
|
|
527
525
|
/**
|
|
528
526
|
* Compute intersection points and common segments between two 2D curves.
|
|
529
527
|
*
|
|
@@ -591,8 +589,7 @@ var selfIntersections = (curve, precision = 1e-9) => {
|
|
|
591
589
|
}
|
|
592
590
|
return ok(intersections);
|
|
593
591
|
};
|
|
594
|
-
|
|
595
|
-
//#region src/2d/lib/offset.ts
|
|
592
|
+
// src/2d/lib/offset.ts
|
|
596
593
|
var offsetEndPoints = (firstPoint, lastPoint, offset) => {
|
|
597
594
|
const tangent = normalize2d(subtract2d(lastPoint, firstPoint));
|
|
598
595
|
const normal = [tangent[1], -tangent[0]];
|
|
@@ -675,8 +672,7 @@ var make2dOffset = (curve, offset) => {
|
|
|
675
672
|
}
|
|
676
673
|
return approximation;
|
|
677
674
|
};
|
|
678
|
-
|
|
679
|
-
//#region src/2d/lib/customCorners.ts
|
|
675
|
+
// src/2d/lib/customCorners.ts
|
|
680
676
|
/** Unwrap an intersection, discarding the common-segment curves the caller does not use. */
|
|
681
677
|
function intersectionPoints(first, second) {
|
|
682
678
|
const result = unwrap(intersectCurves(first, second));
|
|
@@ -872,8 +868,7 @@ function dogboneFilletCurves(firstCurve, secondCurve, radius) {
|
|
|
872
868
|
circle?.delete();
|
|
873
869
|
}
|
|
874
870
|
}
|
|
875
|
-
|
|
876
|
-
//#region src/2d/blueprints/blueprints.ts
|
|
871
|
+
// src/2d/blueprints/blueprints.ts
|
|
877
872
|
/**
|
|
878
873
|
* Hold a collection of disjoint 2D profiles (simple or compound).
|
|
879
874
|
*
|
|
@@ -982,8 +977,7 @@ var Blueprints = class Blueprints {
|
|
|
982
977
|
return asSVG(elements.join("\n "), this.boundingBox, margin);
|
|
983
978
|
}
|
|
984
979
|
};
|
|
985
|
-
|
|
986
|
-
//#region src/2d/blueprints/compoundBlueprint.ts
|
|
980
|
+
// src/2d/blueprints/compoundBlueprint.ts
|
|
987
981
|
/**
|
|
988
982
|
* Represent a 2D profile with holes (an outer boundary minus inner cutouts).
|
|
989
983
|
*
|
|
@@ -1111,8 +1105,7 @@ var CompoundBlueprint = class CompoundBlueprint {
|
|
|
1111
1105
|
return asSVG(this.toSVGGroup(), this.boundingBox, margin);
|
|
1112
1106
|
}
|
|
1113
1107
|
};
|
|
1114
|
-
|
|
1115
|
-
//#region src/2d/blueprints/lib.ts
|
|
1108
|
+
// src/2d/blueprints/lib.ts
|
|
1116
1109
|
/**
|
|
1117
1110
|
* Groups blueprints by bounding box overlap using a spatial index.
|
|
1118
1111
|
* Uses Flatbush for O(n log n) performance instead of O(n²) pairwise comparison.
|
|
@@ -1188,8 +1181,7 @@ var organiseBlueprints = (blueprints) => {
|
|
|
1188
1181
|
return new CompoundBlueprint(compounds.map(({ blueprint }) => blueprint));
|
|
1189
1182
|
}));
|
|
1190
1183
|
};
|
|
1191
|
-
|
|
1192
|
-
//#region src/2d/blueprints/genericSketcher.ts
|
|
1184
|
+
// src/2d/blueprints/genericSketcher.ts
|
|
1193
1185
|
var isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
|
|
1194
1186
|
/** Resolve a {@link SplineOptions} into fully-expanded tangent directions and factors. */
|
|
1195
1187
|
var defaultsSplineOptions = (config) => {
|
|
@@ -1214,8 +1206,7 @@ var defaultsSplineOptions = (config) => {
|
|
|
1214
1206
|
startTangent
|
|
1215
1207
|
};
|
|
1216
1208
|
};
|
|
1217
|
-
|
|
1218
|
-
//#region src/2d/blueprints/ellipseUtils.ts
|
|
1209
|
+
// src/2d/blueprints/ellipseUtils.ts
|
|
1219
1210
|
/**
|
|
1220
1211
|
* Normalize ellipse radii so that major >= minor, adjusting the rotation
|
|
1221
1212
|
* angle by 90 degrees when the radii need to be swapped.
|
|
@@ -1335,8 +1326,7 @@ function convertSvgEllipseParams([x1, y1], [x2, y2], rx, ry, phi, fA, fS) {
|
|
|
1335
1326
|
ry
|
|
1336
1327
|
};
|
|
1337
1328
|
}
|
|
1338
|
-
|
|
1339
|
-
//#region src/2d/blueprints/baseSketcher2d.ts
|
|
1329
|
+
// src/2d/blueprints/baseSketcher2d.ts
|
|
1340
1330
|
var cornerModeFns = {
|
|
1341
1331
|
chamfer: chamferCurves,
|
|
1342
1332
|
dogbone: dogboneFilletCurves,
|
|
@@ -1629,8 +1619,7 @@ var BaseSketcher2d = class {
|
|
|
1629
1619
|
this.pointer = this.firstPoint;
|
|
1630
1620
|
}
|
|
1631
1621
|
};
|
|
1632
|
-
|
|
1633
|
-
//#region src/2d/blueprints/blueprintSketcher.ts
|
|
1622
|
+
// src/2d/blueprints/blueprintSketcher.ts
|
|
1634
1623
|
/**
|
|
1635
1624
|
* Draw 2D curves and produce a {@link Blueprint} (pure-2D shape, no kernel wire).
|
|
1636
1625
|
*
|
|
@@ -1673,5 +1662,4 @@ var BlueprintSketcher = class extends BaseSketcher2d {
|
|
|
1673
1662
|
return this.done();
|
|
1674
1663
|
}
|
|
1675
1664
|
};
|
|
1676
|
-
//#endregion
|
|
1677
1665
|
export { Blueprints as a, make2dOffset as c, CompoundBlueprint as i, intersectCurves as l, BaseSketcher2d as n, chamferCurves as o, organiseBlueprints as r, filletCurves as s, BlueprintSketcher as t, Flatbush as u };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as wasmIndex, n as bug } from "./bug-
|
|
2
|
-
import { P as unwrap, s as safeIndex } from "./errors-
|
|
3
|
-
import { r as lastOrThrow } from "./arrayAccess-
|
|
4
|
-
import { v as zip } from "./surfaceBuilders-
|
|
5
|
-
import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-
|
|
6
|
-
import { f as crossProduct2d, o as PRECISION_INTERSECTION, v as samePoint$1, x as subtract2d } from "./helpers-
|
|
7
|
-
import { S as removeDuplicatePoints, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-
|
|
8
|
-
|
|
1
|
+
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
2
|
+
import { P as unwrap, s as safeIndex } from "./errors-vxP5FT8B.js";
|
|
3
|
+
import { r as lastOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
4
|
+
import { v as zip } from "./surfaceBuilders-wdGNiImD.js";
|
|
5
|
+
import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-DNp87aQZ.js";
|
|
6
|
+
import { f as crossProduct2d, o as PRECISION_INTERSECTION, v as samePoint$1, x as subtract2d } from "./helpers-sDialr0f.js";
|
|
7
|
+
import { S as removeDuplicatePoints, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-Bth4EVaO.js";
|
|
8
|
+
// src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
11
11
|
*
|
|
@@ -81,8 +81,7 @@ var roundedRectangleBlueprint = (width, height, r = 0) => {
|
|
|
81
81
|
addFillet(rx, -ry);
|
|
82
82
|
return sk.close();
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
//#region src/2d/blueprints/booleanHelpers.ts
|
|
84
|
+
// src/2d/blueprints/booleanHelpers.ts
|
|
86
85
|
var samePoint = (x, y) => samePoint$1(x, y, PRECISION_INTERSECTION);
|
|
87
86
|
/**
|
|
88
87
|
* Hash a point for Set/Map lookup using precision rounding.
|
|
@@ -203,8 +202,7 @@ function rotateToStartAtSegment(curves, segment) {
|
|
|
203
202
|
if (flipRev !== null) return flipRev;
|
|
204
203
|
bug("rotateToStartAtSegment", "failed to rotate to segment start");
|
|
205
204
|
}
|
|
206
|
-
|
|
207
|
-
//#region src/2d/blueprints/intersectionSegments.ts
|
|
205
|
+
// src/2d/blueprints/intersectionSegments.ts
|
|
208
206
|
function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
209
207
|
const intersectionSet = new Set(allIntersections.map(hashPoint));
|
|
210
208
|
const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
|
|
@@ -360,8 +358,7 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
360
358
|
}
|
|
361
359
|
return result;
|
|
362
360
|
}
|
|
363
|
-
|
|
364
|
-
//#region src/2d/blueprints/segmentAssembly.ts
|
|
361
|
+
// src/2d/blueprints/segmentAssembly.ts
|
|
365
362
|
/**
|
|
366
363
|
* Merge adjacent collinear line segments into single segments.
|
|
367
364
|
*
|
|
@@ -524,8 +521,7 @@ function buildNoIntersectionResult(first, second) {
|
|
|
524
521
|
secondCurveInFirst: secondCurve !== void 0 && first.isInside(curveMidPoint(secondCurve))
|
|
525
522
|
};
|
|
526
523
|
}
|
|
527
|
-
|
|
528
|
-
//#region src/2d/blueprints/booleanOperations.ts
|
|
524
|
+
// src/2d/blueprints/booleanOperations.ts
|
|
529
525
|
/**
|
|
530
526
|
* Boolean operations on 2D blueprints: fuse, cut, and intersect.
|
|
531
527
|
*
|
|
@@ -606,8 +602,7 @@ function intersectBlueprints(first, second) {
|
|
|
606
602
|
if (result.secondCurveInFirst) return second.clone();
|
|
607
603
|
return null;
|
|
608
604
|
}
|
|
609
|
-
|
|
610
|
-
//#region src/2d/blueprints/boolean2D.ts
|
|
605
|
+
// src/2d/blueprints/boolean2D.ts
|
|
611
606
|
var genericIntersects = (first, second) => {
|
|
612
607
|
if (first instanceof Blueprint && second instanceof Blueprint) {
|
|
613
608
|
let allIntersections = [];
|
|
@@ -856,5 +851,4 @@ function intersect2D(first, second) {
|
|
|
856
851
|
}
|
|
857
852
|
bug("intersect2D", "Unhandled Shape2D combination");
|
|
858
853
|
}
|
|
859
|
-
//#endregion
|
|
860
854
|
export { fuseBlueprints as a, roundedRectangleBlueprint as c, cutBlueprints as i, fuse2D as n, intersectBlueprints as o, intersect2D as r, polysidesBlueprint as s, cut2D as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_bug = require("./bug-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
4
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_helpers = require("./helpers-
|
|
7
|
-
const require_blueprint = require("./blueprint-
|
|
8
|
-
|
|
1
|
+
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
2
|
+
const require_errors = require("./errors-GVyCnpi0.cjs");
|
|
3
|
+
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
4
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DOn2jWkh.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-CSDqr27-.cjs");
|
|
6
|
+
const require_helpers = require("./helpers-JuPoaP_b.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-wq2TU1XP.cjs");
|
|
8
|
+
// src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
11
11
|
*
|
|
@@ -81,8 +81,7 @@ var roundedRectangleBlueprint = (width, height, r = 0) => {
|
|
|
81
81
|
addFillet(rx, -ry);
|
|
82
82
|
return sk.close();
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
//#region src/2d/blueprints/booleanHelpers.ts
|
|
84
|
+
// src/2d/blueprints/booleanHelpers.ts
|
|
86
85
|
var samePoint = (x, y) => require_helpers.samePoint(x, y, require_helpers.PRECISION_INTERSECTION);
|
|
87
86
|
/**
|
|
88
87
|
* Hash a point for Set/Map lookup using precision rounding.
|
|
@@ -203,8 +202,7 @@ function rotateToStartAtSegment(curves, segment) {
|
|
|
203
202
|
if (flipRev !== null) return flipRev;
|
|
204
203
|
require_bug.bug("rotateToStartAtSegment", "failed to rotate to segment start");
|
|
205
204
|
}
|
|
206
|
-
|
|
207
|
-
//#region src/2d/blueprints/intersectionSegments.ts
|
|
205
|
+
// src/2d/blueprints/intersectionSegments.ts
|
|
208
206
|
function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
209
207
|
const intersectionSet = new Set(allIntersections.map(hashPoint));
|
|
210
208
|
const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
|
|
@@ -360,8 +358,7 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
360
358
|
}
|
|
361
359
|
return result;
|
|
362
360
|
}
|
|
363
|
-
|
|
364
|
-
//#region src/2d/blueprints/segmentAssembly.ts
|
|
361
|
+
// src/2d/blueprints/segmentAssembly.ts
|
|
365
362
|
/**
|
|
366
363
|
* Merge adjacent collinear line segments into single segments.
|
|
367
364
|
*
|
|
@@ -524,8 +521,7 @@ function buildNoIntersectionResult(first, second) {
|
|
|
524
521
|
secondCurveInFirst: secondCurve !== void 0 && first.isInside(curveMidPoint(secondCurve))
|
|
525
522
|
};
|
|
526
523
|
}
|
|
527
|
-
|
|
528
|
-
//#region src/2d/blueprints/booleanOperations.ts
|
|
524
|
+
// src/2d/blueprints/booleanOperations.ts
|
|
529
525
|
/**
|
|
530
526
|
* Boolean operations on 2D blueprints: fuse, cut, and intersect.
|
|
531
527
|
*
|
|
@@ -606,8 +602,7 @@ function intersectBlueprints(first, second) {
|
|
|
606
602
|
if (result.secondCurveInFirst) return second.clone();
|
|
607
603
|
return null;
|
|
608
604
|
}
|
|
609
|
-
|
|
610
|
-
//#region src/2d/blueprints/boolean2D.ts
|
|
605
|
+
// src/2d/blueprints/boolean2D.ts
|
|
611
606
|
var genericIntersects = (first, second) => {
|
|
612
607
|
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) {
|
|
613
608
|
let allIntersections = [];
|
|
@@ -856,7 +851,6 @@ function intersect2D(first, second) {
|
|
|
856
851
|
}
|
|
857
852
|
require_bug.bug("intersect2D", "Unhandled Shape2D combination");
|
|
858
853
|
}
|
|
859
|
-
//#endregion
|
|
860
854
|
Object.defineProperty(exports, "cut2D", {
|
|
861
855
|
enumerable: true,
|
|
862
856
|
get: function() {
|