brepjs 20.12.6 → 20.12.7
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/booleanHelpers.d.ts +0 -5
- package/dist/2d/blueprints/intersectionSegments.d.ts +6 -5
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns--KmBIKYJ.js → adjacencyFns-hMihivxC.js} +3 -3
- package/dist/{adjacencyFns-BFJfaUwX.cjs → adjacencyFns-mMmTBUBY.cjs} +3 -3
- package/dist/{blueprint-D83DDDPb.cjs → blueprint-17RUHsoP.cjs} +5 -5
- package/dist/{blueprint-BhIk9Pvm.js → blueprint-BS50D3J_.js} +5 -5
- package/dist/{blueprintFns-C4TQn-x_.cjs → blueprintFns-Dw5_4_Bk.cjs} +2 -2
- package/dist/{blueprintFns-eULVgkq9.js → blueprintFns-zy5lo2IF.js} +2 -2
- package/dist/{blueprintSketcher-Di376t-0.cjs → blueprintSketcher-BG--DxWB.cjs} +3 -3
- package/dist/{blueprintSketcher-D_Faf0GO.js → blueprintSketcher-C1WCI6E0.js} +3 -3
- package/dist/{boolean2D-CNZFI_y8.cjs → boolean2D-7SQ3B0pC.cjs} +42 -50
- package/dist/{boolean2D-DqpCF72W.js → boolean2D-CsdyfjFE.js} +42 -50
- package/dist/brepjs.cjs +30 -30
- package/dist/brepjs.js +30 -30
- package/dist/{cameraFns-RqraCXIc.cjs → cameraFns-BAtzhCYM.cjs} +3 -3
- package/dist/{cameraFns-CrClIkmV.js → cameraFns-BVWyAscu.js} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-BZuQkRp2.js → cornerFinder-Dv_2rmaY.js} +1 -1
- package/dist/{cornerFinder-CdOe1Wrb.cjs → cornerFinder-e4Wc7_yp.cjs} +1 -1
- package/dist/{curveFns-CyIvQNYT.cjs → curveFns-BAM7QHrP.cjs} +1 -1
- package/dist/{curveFns-BP3srCfK.js → curveFns-CEI-rouh.js} +1 -1
- package/dist/{drawFns-DxDwJ5zZ.js → drawFns-Cl1i8B_B.js} +12 -12
- package/dist/{drawFns-71cOhWD-.cjs → drawFns-d-RvC6u6.cjs} +12 -12
- package/dist/{faceFns-B7MiDYj1.cjs → faceFns-C-2ttg8X.cjs} +2 -2
- package/dist/{faceFns-iVPbTxki.js → faceFns-Q87HCJrp.js} +2 -2
- package/dist/{healingFns-BhP8zfp1.js → healingFns-Cm4NkKD8.js} +5 -5
- package/dist/{healingFns-DWljGTNR.cjs → healingFns-DZkO5okn.cjs} +5 -5
- package/dist/{helpers-DKEVm6Hu.cjs → helpers-BdGGaLhF.cjs} +6 -6
- package/dist/{helpers-D2hANLRu.js → helpers-DpGcM2qZ.js} +6 -6
- package/dist/{importFns-DUzIkns7.js → importFns-Bp-p0jiP.js} +2 -2
- package/dist/{importFns-KEPAgbjj.cjs → importFns-DLiP26NW.cjs} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-D5AvfCGG.cjs → loftFns-DGV1z2NJ.cjs} +1 -1
- package/dist/{loftFns-D5NJpHLZ.js → loftFns-DQ7Z29n3.js} +1 -1
- package/dist/{measureFns-CZHNWkiA.cjs → measureFns-BdSjw5fr.cjs} +3 -3
- package/dist/{measureFns-mxBdPiWa.js → measureFns-BrdCH4cH.js} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-Czlt-GBJ.cjs → meshFns-BeubBqEI.cjs} +3 -3
- package/dist/{meshFns-DmjMzNbH.js → meshFns-UE8tByyw.js} +3 -3
- package/dist/{occtWasmAdapter-DVxLkjlJ.cjs → occtWasmAdapter-D3qerQTq.cjs} +96 -35
- package/dist/{occtWasmAdapter-B9d0Q0Vl.js → occtWasmAdapter-DA7oMgcQ.js} +96 -35
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-CBnyKLm7.js → originTrackingFns-c2qgRZ_9.js} +2 -2
- package/dist/{originTrackingFns-CHymOLLm.cjs → originTrackingFns-rEKOAP65.cjs} +2 -2
- package/dist/{primitiveFns-DeNl60Rw.js → primitiveFns-3-gs-FUX.js} +4 -4
- package/dist/{primitiveFns-BVeBEaa4.cjs → primitiveFns-CLGVLwG8.cjs} +4 -4
- package/dist/{principalBoxFns-CG6kG7vT.cjs → principalBoxFns-CiXzjOkr.cjs} +3 -3
- package/dist/{principalBoxFns-3mW_hA6z.js → principalBoxFns-RMZItjfR.js} +3 -3
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-BAs4p9z7.cjs → refResolveFns-DNX0bCrP.cjs} +6 -6
- package/dist/{refResolveFns-DHx1Y3GG.js → refResolveFns-kJg2iCad.js} +6 -6
- package/dist/{shapeFns-CgqKICF_.js → shapeFns-CZ6VF1yd.js} +2 -2
- package/dist/{shapeFns-C0w8vvfb.cjs → shapeFns-SgIrOjN4.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-DwvQUp9M.js → shapeTypes-BNGu103j.js} +1 -1
- package/dist/{shapeTypes-Dc7j-MYg.cjs → shapeTypes-MUEH4XuH.cjs} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-DT1gpVWM.js → solidBuilders-Bmr59cGp.js} +5 -5
- package/dist/{solidBuilders-iS5DDwg8.cjs → solidBuilders-DdG4NPHM.cjs} +5 -5
- package/dist/{surfaceBuilders-CPLe0bbk.js → surfaceBuilders-DI376ai0.js} +3 -3
- package/dist/{surfaceBuilders-BvwSgD3C.cjs → surfaceBuilders-DOmDVuMs.cjs} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-CNPCPJix.cjs → textBlueprints-B7Vhr0xu.cjs} +7 -7
- package/dist/{textBlueprints-BU0Rhk54.js → textBlueprints-CE0oxB43.js} +7 -7
- package/dist/{textMetrics-C71g4TmO.cjs → textMetrics-C6_kSht6.cjs} +1 -1
- package/dist/{textMetrics-Df9aLYK2.js → textMetrics-_VGqdewQ.js} +1 -1
- package/dist/{threadFns-CzXEnnmo.cjs → threadFns-1H60LrFX.cjs} +7 -7
- package/dist/{threadFns-DESH7lcs.js → threadFns-CHdY-4Cz.js} +7 -7
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-5Frx8Y-0.cjs → topologyQueryFns-C_fXO6xL.cjs} +1 -1
- package/dist/{topologyQueryFns-LXV1nTaS.js → topologyQueryFns-CltEv7Pi.js} +1 -1
- package/dist/{validityTypes-C6rROGTP.cjs → validityTypes-CGX2ES81.cjs} +1 -1
- package/dist/{validityTypes-DM-Iwe8N.js → validityTypes-GanLrmvY.js} +1 -1
- package/package.json +1 -1
|
@@ -6,11 +6,6 @@ export declare const samePoint: (x: Point2D, y: Point2D) => boolean;
|
|
|
6
6
|
* nearly-equal points.
|
|
7
7
|
*/
|
|
8
8
|
export declare function hashPoint(p: Point2D): string;
|
|
9
|
-
/**
|
|
10
|
-
* Hash a segment by both orientations for bidirectional lookup.
|
|
11
|
-
* The smaller hash comes first so that (A,B) and (B,A) produce the same key.
|
|
12
|
-
*/
|
|
13
|
-
export declare function hashSegment(first: Point2D, last: Point2D): string;
|
|
14
9
|
export type Segment = Curve2D[];
|
|
15
10
|
export type IntersectionSegment = [Segment, Segment | 'same'];
|
|
16
11
|
export declare function startOfSegment(s: Segment): Point2D;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Curve2D } from '../lib/index.js';
|
|
2
2
|
import { default as Blueprint } from './blueprint.js';
|
|
3
|
-
import { IntersectionSegment } from './booleanHelpers.js';
|
|
3
|
+
import { Segment, IntersectionSegment } from './booleanHelpers.js';
|
|
4
4
|
/**
|
|
5
|
-
* Check whether a segment
|
|
6
|
-
*
|
|
5
|
+
* Check whether a segment runs along one of the common segments, in either
|
|
6
|
+
* direction. Matching endpoints are not enough: two outlines that share an
|
|
7
|
+
* edge also join its endpoints with the rest of their boundaries.
|
|
7
8
|
*/
|
|
8
|
-
export declare function isCommonSegmentMatch(
|
|
9
|
+
export declare function isCommonSegmentMatch(commonSegments: Curve2D[], segment: Segment): boolean;
|
|
9
10
|
/**
|
|
10
11
|
* Given two closed blueprints, find their intersection points, split each
|
|
11
12
|
* blueprint's curves at those points, and pair up the resulting segments.
|
package/dist/2d.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-MUEH4XuH.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_blueprint = require("./blueprint-
|
|
7
|
-
const require_boolean2D = require("./boolean2D-
|
|
8
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C_fXO6xL.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-BG--DxWB.cjs");
|
|
6
|
+
const require_blueprint = require("./blueprint-17RUHsoP.cjs");
|
|
7
|
+
const require_boolean2D = require("./boolean2D-7SQ3B0pC.cjs");
|
|
8
|
+
const require_blueprintFns = require("./blueprintFns-Dw5_4_Bk.cjs");
|
|
9
9
|
// src/core/curve2dHandle.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
package/dist/2d.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { F as createKernelHandle, J as getKernel2D, c as createEdge } from "./shapeTypes-
|
|
1
|
+
import { F as createKernelHandle, J as getKernel2D, c as createEdge } from "./shapeTypes-BNGu103j.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { E as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-
|
|
5
|
-
import { t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-
|
|
6
|
-
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
7
|
-
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-CltEv7Pi.js";
|
|
4
|
+
import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-C1WCI6E0.js";
|
|
5
|
+
import { t as Blueprint, v as Curve2D, x as BoundingBox2d } from "./blueprint-BS50D3J_.js";
|
|
6
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CsdyfjFE.js";
|
|
7
|
+
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-zy5lo2IF.js";
|
|
8
8
|
// src/core/curve2dHandle.ts
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a raw kernel 2D curve handle with brand + disposal tracking.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as GeometryCleanupError, K as getActiveKernelId, q as getKernel, r as castResultShapeWithKnownType, t as borrowShapeWithKnownType } from "./shapeTypes-
|
|
2
|
-
import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-
|
|
3
|
-
import { c as getFaces, f as getVertices, l as getOrCreateCache, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { E as GeometryCleanupError, K as getActiveKernelId, q as getKernel, r as castResultShapeWithKnownType, t as borrowShapeWithKnownType } from "./shapeTypes-BNGu103j.js";
|
|
2
|
+
import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-DA7oMgcQ.js";
|
|
3
|
+
import { c as getFaces, f as getVertices, l as getOrCreateCache, s as getEdges } from "./topologyQueryFns-CltEv7Pi.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
5
|
// src/topology/adjacencyFns.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-MUEH4XuH.cjs");
|
|
2
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-D3qerQTq.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C_fXO6xL.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
// src/topology/adjacencyFns.ts
|
|
6
6
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-MUEH4XuH.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
6
6
|
const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
|
|
7
|
-
const require_faceFns = require("./faceFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
7
|
+
const require_faceFns = require("./faceFns-C-2ttg8X.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-BAM7QHrP.cjs");
|
|
9
9
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
10
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
11
|
-
const require_helpers = require("./helpers-
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DOmDVuMs.cjs");
|
|
11
|
+
const require_helpers = require("./helpers-BdGGaLhF.cjs");
|
|
12
12
|
// src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as unregisterFromCleanup, J as getKernel2D, R as registerForCleanup, c as createEdge, p as createWire, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { B as unregisterFromCleanup, J as getKernel2D, R as registerForCleanup, c as createEdge, p as createWire, q as getKernel } from "./shapeTypes-BNGu103j.js";
|
|
2
2
|
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, P as unwrap, d as validationError, g as err, n as computationError } from "./errors-BTccWbtE.js";
|
|
4
4
|
import { r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
6
6
|
import { r as makePlane } from "./planeOps-D3yDuMux.js";
|
|
7
|
-
import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-
|
|
8
|
-
import { p as getOrientation } from "./curveFns-
|
|
7
|
+
import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-Q87HCJrp.js";
|
|
8
|
+
import { p as getOrientation } from "./curveFns-CEI-rouh.js";
|
|
9
9
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
10
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
11
|
-
import { l as add2d, m as normalize2d$1, p as distance2d, t as getSingleFace, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-
|
|
10
|
+
import { r as makeFace } from "./surfaceBuilders-DI376ai0.js";
|
|
11
|
+
import { l as add2d, m as normalize2d$1, p as distance2d, t as getSingleFace, v as samePoint, x as subtract2d, y as scalarMultiply2d } from "./helpers-DpGcM2qZ.js";
|
|
12
12
|
// src/2d/lib/definitions.ts
|
|
13
13
|
/** Type guard that checks whether a value is a `Point2D`. */
|
|
14
14
|
function isPoint2D(point) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
2
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
3
|
-
const require_blueprint = require("./blueprint-
|
|
2
|
+
const require_blueprintSketcher = require("./blueprintSketcher-BG--DxWB.cjs");
|
|
3
|
+
const require_blueprint = require("./blueprint-17RUHsoP.cjs");
|
|
4
4
|
// src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
2
|
-
import { i as CompoundBlueprint } from "./blueprintSketcher-
|
|
3
|
-
import { t as Blueprint } from "./blueprint-
|
|
2
|
+
import { i as CompoundBlueprint } from "./blueprintSketcher-C1WCI6E0.js";
|
|
3
|
+
import { t as Blueprint } from "./blueprint-BS50D3J_.js";
|
|
4
4
|
// src/2d/lib/curve2dFns.ts
|
|
5
5
|
/**
|
|
6
6
|
* Return a reversed copy of the curve (non-mutating).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-MUEH4XuH.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
6
|
-
const require_helpers = require("./helpers-
|
|
7
|
-
const require_blueprint = require("./blueprint-
|
|
6
|
+
const require_helpers = require("./helpers-BdGGaLhF.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-17RUHsoP.cjs");
|
|
8
8
|
// node_modules/flatqueue/index.js
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { J as getKernel2D, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { J as getKernel2D, q as getKernel } from "./shapeTypes-BNGu103j.js";
|
|
2
2
|
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-BTccWbtE.js";
|
|
4
4
|
import { r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
6
|
-
import { _ as rotate2d, b as squareDistance2d, 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-
|
|
6
|
+
import { _ as rotate2d, b as squareDistance2d, 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-DpGcM2qZ.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-BS50D3J_.js";
|
|
8
8
|
// node_modules/flatqueue/index.js
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
3
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
4
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
5
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
6
|
-
const require_helpers = require("./helpers-
|
|
7
|
-
const require_blueprint = require("./blueprint-
|
|
4
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DOmDVuMs.cjs");
|
|
5
|
+
const require_blueprintSketcher = require("./blueprintSketcher-BG--DxWB.cjs");
|
|
6
|
+
const require_helpers = require("./helpers-BdGGaLhF.cjs");
|
|
7
|
+
const require_blueprint = require("./blueprint-17RUHsoP.cjs");
|
|
8
8
|
// src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
@@ -91,15 +91,6 @@ var samePoint = (x, y) => require_helpers.samePoint(x, y, require_helpers.PRECIS
|
|
|
91
91
|
function hashPoint(p) {
|
|
92
92
|
return `${p[0].toFixed(9)},${p[1].toFixed(9)}`;
|
|
93
93
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Hash a segment by both orientations for bidirectional lookup.
|
|
96
|
-
* The smaller hash comes first so that (A,B) and (B,A) produce the same key.
|
|
97
|
-
*/
|
|
98
|
-
function hashSegment(first, last) {
|
|
99
|
-
const h1 = hashPoint(first);
|
|
100
|
-
const h2 = hashPoint(last);
|
|
101
|
-
return h1 < h2 ? `${h1}|${h2}` : `${h2}|${h1}`;
|
|
102
|
-
}
|
|
103
94
|
function startOfSegment(s) {
|
|
104
95
|
const first = s[0];
|
|
105
96
|
if (first === void 0) require_bug.bug("startOfSegment", "empty segment");
|
|
@@ -205,15 +196,10 @@ function rotateToStartAtSegment(curves, segment) {
|
|
|
205
196
|
// src/2d/blueprints/intersectionSegments.ts
|
|
206
197
|
function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
207
198
|
const intersectionSet = new Set(allIntersections.map(hashPoint));
|
|
208
|
-
const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
|
|
209
199
|
const matchesIntersection = (point) => {
|
|
210
200
|
if (intersectionSet.has(hashPoint(point))) return true;
|
|
211
201
|
return allIntersections.some((p) => samePoint(p, point));
|
|
212
202
|
};
|
|
213
|
-
const matchesCommonSegment = (first, last) => {
|
|
214
|
-
if (commonSegmentSet.has(hashSegment(first, last))) return true;
|
|
215
|
-
return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
|
|
216
|
-
};
|
|
217
203
|
let currentCurves = [];
|
|
218
204
|
for (const curve of curves) {
|
|
219
205
|
if (samePoint(curve.firstPoint, curve.lastPoint)) {
|
|
@@ -221,7 +207,7 @@ function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
|
221
207
|
continue;
|
|
222
208
|
}
|
|
223
209
|
const endsAtIntersection = matchesIntersection(curve.lastPoint);
|
|
224
|
-
const isCommon =
|
|
210
|
+
const isCommon = isCommonSegmentMatch(allCommonSegments, [curve]);
|
|
225
211
|
if (endsAtIntersection) {
|
|
226
212
|
currentCurves.push(curve);
|
|
227
213
|
yield currentCurves;
|
|
@@ -297,13 +283,16 @@ function splitCurvesAtIntersections(curves, curvePoints) {
|
|
|
297
283
|
});
|
|
298
284
|
}
|
|
299
285
|
/**
|
|
300
|
-
* Check whether a segment
|
|
301
|
-
*
|
|
286
|
+
* Check whether a segment runs along one of the common segments, in either
|
|
287
|
+
* direction. Matching endpoints are not enough: two outlines that share an
|
|
288
|
+
* edge also join its endpoints with the rest of their boundaries.
|
|
302
289
|
*/
|
|
303
|
-
function isCommonSegmentMatch(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
290
|
+
function isCommonSegmentMatch(commonSegments, segment) {
|
|
291
|
+
if (segment.length === 0) return false;
|
|
292
|
+
const segmentStart = startOfSegment(segment);
|
|
293
|
+
const segmentEnd = endOfSegment(segment);
|
|
294
|
+
return commonSegments.some((common) => {
|
|
295
|
+
return (samePoint(common.firstPoint, segmentStart) && samePoint(common.lastPoint, segmentEnd) || samePoint(common.firstPoint, segmentEnd) && samePoint(common.lastPoint, segmentStart)) && segment.every((curve) => common.distanceFrom(curveMidPoint(curve)) < 1e-6);
|
|
307
296
|
});
|
|
308
297
|
}
|
|
309
298
|
/**
|
|
@@ -319,7 +308,6 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
319
308
|
if (rawIntersections.length <= 1) return null;
|
|
320
309
|
let firstCurveSegments = splitCurvesAtIntersections(first.curves, firstCurvePoints);
|
|
321
310
|
let secondCurveSegments = splitCurvesAtIntersections(second.curves, secondCurvePoints);
|
|
322
|
-
const commonSegmentsPoints = allCommonSegments.map((c) => [c.firstPoint, c.lastPoint]);
|
|
323
311
|
const allIntersections = removeNonCrossingPoints(removeNonCrossingPoints(rawIntersections, firstCurveSegments, second), secondCurveSegments, first);
|
|
324
312
|
if (allIntersections.length === 0 && allCommonSegments.length === 0) return null;
|
|
325
313
|
if (allCommonSegments.length === 0) {
|
|
@@ -340,7 +328,11 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
340
328
|
if (firstSeg !== void 0 && secondSeg !== void 0) {
|
|
341
329
|
const endpointsMismatch = !samePoint(endOfSegment(secondSeg), endOfSegment(firstSeg));
|
|
342
330
|
const commonSegmentLengthMismatch = allCommonSegments.length > 0 && secondSeg.length !== 1;
|
|
343
|
-
if (endpointsMismatch || commonSegmentLengthMismatch)
|
|
331
|
+
if (endpointsMismatch || commonSegmentLengthMismatch) {
|
|
332
|
+
secondIntersectedSegments = reverseSegments(secondIntersectedSegments);
|
|
333
|
+
const last = secondIntersectedSegments[secondIntersectedSegments.length - 1];
|
|
334
|
+
if (last !== void 0 && isCommonSegmentMatch(allCommonSegments, last)) secondIntersectedSegments = [last, ...secondIntersectedSegments.slice(0, -1)];
|
|
335
|
+
}
|
|
344
336
|
}
|
|
345
337
|
const maxLen = Math.max(firstIntersectedSegments.length, secondIntersectedSegments.length);
|
|
346
338
|
const result = [];
|
|
@@ -353,7 +345,7 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
353
345
|
result.push([available, available]);
|
|
354
346
|
continue;
|
|
355
347
|
}
|
|
356
|
-
if (isCommonSegmentMatch(
|
|
348
|
+
if (isCommonSegmentMatch(allCommonSegments, firstSeg2)) result.push([firstSeg2, "same"]);
|
|
357
349
|
else result.push([firstSeg2, secondSeg2]);
|
|
358
350
|
}
|
|
359
351
|
return result;
|
|
@@ -512,13 +504,30 @@ function booleanOperation(first, second, config) {
|
|
|
512
504
|
}
|
|
513
505
|
return require_blueprintSketcher.organiseBlueprints(paths);
|
|
514
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* A point of `outline` that is not on `other`'s boundary. Outlines that only touch
|
|
509
|
+
* can meet at a curve's midpoint, where an inside test cannot tell which side is
|
|
510
|
+
* which, so several points along each curve are tried.
|
|
511
|
+
*/
|
|
512
|
+
function pointOffBoundary(outline, other) {
|
|
513
|
+
for (const curve of outline.curves) for (const fraction of [
|
|
514
|
+
.5,
|
|
515
|
+
.25,
|
|
516
|
+
.75
|
|
517
|
+
]) {
|
|
518
|
+
const point = curve.value(curve.firstParameter + fraction * (curve.lastParameter - curve.firstParameter));
|
|
519
|
+
if (!other.curves.some((c) => c.isOnCurve(point))) return point;
|
|
520
|
+
}
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
515
523
|
function buildNoIntersectionResult(first, second) {
|
|
516
|
-
const
|
|
517
|
-
const
|
|
524
|
+
const firstPoint = pointOffBoundary(first, second);
|
|
525
|
+
const secondPoint = pointOffBoundary(second, first);
|
|
526
|
+
if (firstPoint === null || secondPoint === null) return { identical: true };
|
|
518
527
|
return {
|
|
519
528
|
identical: false,
|
|
520
|
-
firstCurveInSecond:
|
|
521
|
-
secondCurveInFirst:
|
|
529
|
+
firstCurveInSecond: second.isInside(firstPoint),
|
|
530
|
+
secondCurveInFirst: first.isInside(secondPoint)
|
|
522
531
|
};
|
|
523
532
|
}
|
|
524
533
|
// src/2d/blueprints/booleanOperations.ts
|
|
@@ -603,23 +612,6 @@ function intersectBlueprints(first, second) {
|
|
|
603
612
|
return null;
|
|
604
613
|
}
|
|
605
614
|
// src/2d/blueprints/boolean2D.ts
|
|
606
|
-
var genericIntersects = (first, second) => {
|
|
607
|
-
if (first instanceof require_blueprint.Blueprint && second instanceof require_blueprint.Blueprint) {
|
|
608
|
-
let allIntersections = [];
|
|
609
|
-
first.curves.forEach((thisCurve) => {
|
|
610
|
-
second.curves.forEach((otherCurve) => {
|
|
611
|
-
const { intersections, commonSegmentsPoints } = require_errors.unwrap(require_blueprintSketcher.intersectCurves(thisCurve, otherCurve));
|
|
612
|
-
allIntersections.push(...intersections);
|
|
613
|
-
allIntersections.push(...commonSegmentsPoints);
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
allIntersections = require_blueprint.removeDuplicatePoints(allIntersections);
|
|
617
|
-
return allIntersections.length > 1;
|
|
618
|
-
}
|
|
619
|
-
if (first instanceof require_blueprintSketcher.CompoundBlueprint || first instanceof require_blueprintSketcher.Blueprints) return first.blueprints.some((bp) => genericIntersects(bp, second));
|
|
620
|
-
if (second instanceof require_blueprintSketcher.CompoundBlueprint || second instanceof require_blueprintSketcher.Blueprints) return second.blueprints.some((bp) => genericIntersects(first, bp));
|
|
621
|
-
require_bug.bug("genericIntersects", "Unhandled shape combination in genericIntersects");
|
|
622
|
-
};
|
|
623
615
|
var genericFuse = (first, second) => {
|
|
624
616
|
if (first instanceof require_blueprintSketcher.CompoundBlueprint) {
|
|
625
617
|
if (second instanceof require_blueprint.Blueprint) return fuseBlueprintWithCompound(second, first);
|
|
@@ -656,7 +648,6 @@ var fuseIntersectingBlueprints = (blueprints) => {
|
|
|
656
648
|
otherIsFused = true;
|
|
657
649
|
}
|
|
658
650
|
if (blueprint.boundingBox.isOut(otherBlueprint.boundingBox)) return;
|
|
659
|
-
if (!genericIntersects(blueprint, otherBlueprint)) return;
|
|
660
651
|
let newFused;
|
|
661
652
|
if (blueprint instanceof require_blueprintSketcher.Blueprints || otherBlueprint instanceof require_blueprintSketcher.Blueprints) {
|
|
662
653
|
const fused = fuse2D(blueprint, otherBlueprint);
|
|
@@ -785,6 +776,7 @@ var cut2D = (first, second) => {
|
|
|
785
776
|
if (first instanceof require_blueprintSketcher.CompoundBlueprint) {
|
|
786
777
|
const wrapper = require_errors.safeIndex(first.blueprints, 0, "cut2D");
|
|
787
778
|
if (second instanceof require_blueprint.Blueprint && !second.intersects(wrapper)) {
|
|
779
|
+
if (second.isInside(wrapper.firstPoint)) return null;
|
|
788
780
|
if (!wrapper.isInside(second.firstPoint)) return first.clone();
|
|
789
781
|
const cuts = fuse2D(second, new require_blueprintSketcher.Blueprints(first.blueprints.slice(1)));
|
|
790
782
|
return require_blueprintSketcher.organiseBlueprints([wrapper, ...allBlueprints(cuts)]);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
2
2
|
import { P as unwrap, s as safeIndex } from "./errors-BTccWbtE.js";
|
|
3
3
|
import { r as lastOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
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-
|
|
4
|
+
import { v as zip } from "./surfaceBuilders-DI376ai0.js";
|
|
5
|
+
import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-C1WCI6E0.js";
|
|
6
|
+
import { f as crossProduct2d, o as PRECISION_INTERSECTION, v as samePoint$1, x as subtract2d } from "./helpers-DpGcM2qZ.js";
|
|
7
|
+
import { S as removeDuplicatePoints, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-BS50D3J_.js";
|
|
8
8
|
// src/2d/blueprints/cannedBlueprints.ts
|
|
9
9
|
/**
|
|
10
10
|
* Create a regular polygon blueprint inscribed in a circle of the given radius.
|
|
@@ -91,15 +91,6 @@ var samePoint = (x, y) => samePoint$1(x, y, PRECISION_INTERSECTION);
|
|
|
91
91
|
function hashPoint(p) {
|
|
92
92
|
return `${p[0].toFixed(9)},${p[1].toFixed(9)}`;
|
|
93
93
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Hash a segment by both orientations for bidirectional lookup.
|
|
96
|
-
* The smaller hash comes first so that (A,B) and (B,A) produce the same key.
|
|
97
|
-
*/
|
|
98
|
-
function hashSegment(first, last) {
|
|
99
|
-
const h1 = hashPoint(first);
|
|
100
|
-
const h2 = hashPoint(last);
|
|
101
|
-
return h1 < h2 ? `${h1}|${h2}` : `${h2}|${h1}`;
|
|
102
|
-
}
|
|
103
94
|
function startOfSegment(s) {
|
|
104
95
|
const first = s[0];
|
|
105
96
|
if (first === void 0) bug("startOfSegment", "empty segment");
|
|
@@ -205,15 +196,10 @@ function rotateToStartAtSegment(curves, segment) {
|
|
|
205
196
|
// src/2d/blueprints/intersectionSegments.ts
|
|
206
197
|
function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
207
198
|
const intersectionSet = new Set(allIntersections.map(hashPoint));
|
|
208
|
-
const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
|
|
209
199
|
const matchesIntersection = (point) => {
|
|
210
200
|
if (intersectionSet.has(hashPoint(point))) return true;
|
|
211
201
|
return allIntersections.some((p) => samePoint(p, point));
|
|
212
202
|
};
|
|
213
|
-
const matchesCommonSegment = (first, last) => {
|
|
214
|
-
if (commonSegmentSet.has(hashSegment(first, last))) return true;
|
|
215
|
-
return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
|
|
216
|
-
};
|
|
217
203
|
let currentCurves = [];
|
|
218
204
|
for (const curve of curves) {
|
|
219
205
|
if (samePoint(curve.firstPoint, curve.lastPoint)) {
|
|
@@ -221,7 +207,7 @@ function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
|
|
|
221
207
|
continue;
|
|
222
208
|
}
|
|
223
209
|
const endsAtIntersection = matchesIntersection(curve.lastPoint);
|
|
224
|
-
const isCommon =
|
|
210
|
+
const isCommon = isCommonSegmentMatch(allCommonSegments, [curve]);
|
|
225
211
|
if (endsAtIntersection) {
|
|
226
212
|
currentCurves.push(curve);
|
|
227
213
|
yield currentCurves;
|
|
@@ -297,13 +283,16 @@ function splitCurvesAtIntersections(curves, curvePoints) {
|
|
|
297
283
|
});
|
|
298
284
|
}
|
|
299
285
|
/**
|
|
300
|
-
* Check whether a segment
|
|
301
|
-
*
|
|
286
|
+
* Check whether a segment runs along one of the common segments, in either
|
|
287
|
+
* direction. Matching endpoints are not enough: two outlines that share an
|
|
288
|
+
* edge also join its endpoints with the rest of their boundaries.
|
|
302
289
|
*/
|
|
303
|
-
function isCommonSegmentMatch(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
290
|
+
function isCommonSegmentMatch(commonSegments, segment) {
|
|
291
|
+
if (segment.length === 0) return false;
|
|
292
|
+
const segmentStart = startOfSegment(segment);
|
|
293
|
+
const segmentEnd = endOfSegment(segment);
|
|
294
|
+
return commonSegments.some((common) => {
|
|
295
|
+
return (samePoint(common.firstPoint, segmentStart) && samePoint(common.lastPoint, segmentEnd) || samePoint(common.firstPoint, segmentEnd) && samePoint(common.lastPoint, segmentStart)) && segment.every((curve) => common.distanceFrom(curveMidPoint(curve)) < 1e-6);
|
|
307
296
|
});
|
|
308
297
|
}
|
|
309
298
|
/**
|
|
@@ -319,7 +308,6 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
319
308
|
if (rawIntersections.length <= 1) return null;
|
|
320
309
|
let firstCurveSegments = splitCurvesAtIntersections(first.curves, firstCurvePoints);
|
|
321
310
|
let secondCurveSegments = splitCurvesAtIntersections(second.curves, secondCurvePoints);
|
|
322
|
-
const commonSegmentsPoints = allCommonSegments.map((c) => [c.firstPoint, c.lastPoint]);
|
|
323
311
|
const allIntersections = removeNonCrossingPoints(removeNonCrossingPoints(rawIntersections, firstCurveSegments, second), secondCurveSegments, first);
|
|
324
312
|
if (allIntersections.length === 0 && allCommonSegments.length === 0) return null;
|
|
325
313
|
if (allCommonSegments.length === 0) {
|
|
@@ -340,7 +328,11 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
340
328
|
if (firstSeg !== void 0 && secondSeg !== void 0) {
|
|
341
329
|
const endpointsMismatch = !samePoint(endOfSegment(secondSeg), endOfSegment(firstSeg));
|
|
342
330
|
const commonSegmentLengthMismatch = allCommonSegments.length > 0 && secondSeg.length !== 1;
|
|
343
|
-
if (endpointsMismatch || commonSegmentLengthMismatch)
|
|
331
|
+
if (endpointsMismatch || commonSegmentLengthMismatch) {
|
|
332
|
+
secondIntersectedSegments = reverseSegments(secondIntersectedSegments);
|
|
333
|
+
const last = secondIntersectedSegments[secondIntersectedSegments.length - 1];
|
|
334
|
+
if (last !== void 0 && isCommonSegmentMatch(allCommonSegments, last)) secondIntersectedSegments = [last, ...secondIntersectedSegments.slice(0, -1)];
|
|
335
|
+
}
|
|
344
336
|
}
|
|
345
337
|
const maxLen = Math.max(firstIntersectedSegments.length, secondIntersectedSegments.length);
|
|
346
338
|
const result = [];
|
|
@@ -353,7 +345,7 @@ function blueprintsIntersectionSegments(first, second) {
|
|
|
353
345
|
result.push([available, available]);
|
|
354
346
|
continue;
|
|
355
347
|
}
|
|
356
|
-
if (isCommonSegmentMatch(
|
|
348
|
+
if (isCommonSegmentMatch(allCommonSegments, firstSeg2)) result.push([firstSeg2, "same"]);
|
|
357
349
|
else result.push([firstSeg2, secondSeg2]);
|
|
358
350
|
}
|
|
359
351
|
return result;
|
|
@@ -512,13 +504,30 @@ function booleanOperation(first, second, config) {
|
|
|
512
504
|
}
|
|
513
505
|
return organiseBlueprints(paths);
|
|
514
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* A point of `outline` that is not on `other`'s boundary. Outlines that only touch
|
|
509
|
+
* can meet at a curve's midpoint, where an inside test cannot tell which side is
|
|
510
|
+
* which, so several points along each curve are tried.
|
|
511
|
+
*/
|
|
512
|
+
function pointOffBoundary(outline, other) {
|
|
513
|
+
for (const curve of outline.curves) for (const fraction of [
|
|
514
|
+
.5,
|
|
515
|
+
.25,
|
|
516
|
+
.75
|
|
517
|
+
]) {
|
|
518
|
+
const point = curve.value(curve.firstParameter + fraction * (curve.lastParameter - curve.firstParameter));
|
|
519
|
+
if (!other.curves.some((c) => c.isOnCurve(point))) return point;
|
|
520
|
+
}
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
515
523
|
function buildNoIntersectionResult(first, second) {
|
|
516
|
-
const
|
|
517
|
-
const
|
|
524
|
+
const firstPoint = pointOffBoundary(first, second);
|
|
525
|
+
const secondPoint = pointOffBoundary(second, first);
|
|
526
|
+
if (firstPoint === null || secondPoint === null) return { identical: true };
|
|
518
527
|
return {
|
|
519
528
|
identical: false,
|
|
520
|
-
firstCurveInSecond:
|
|
521
|
-
secondCurveInFirst:
|
|
529
|
+
firstCurveInSecond: second.isInside(firstPoint),
|
|
530
|
+
secondCurveInFirst: first.isInside(secondPoint)
|
|
522
531
|
};
|
|
523
532
|
}
|
|
524
533
|
// src/2d/blueprints/booleanOperations.ts
|
|
@@ -603,23 +612,6 @@ function intersectBlueprints(first, second) {
|
|
|
603
612
|
return null;
|
|
604
613
|
}
|
|
605
614
|
// src/2d/blueprints/boolean2D.ts
|
|
606
|
-
var genericIntersects = (first, second) => {
|
|
607
|
-
if (first instanceof Blueprint && second instanceof Blueprint) {
|
|
608
|
-
let allIntersections = [];
|
|
609
|
-
first.curves.forEach((thisCurve) => {
|
|
610
|
-
second.curves.forEach((otherCurve) => {
|
|
611
|
-
const { intersections, commonSegmentsPoints } = unwrap(intersectCurves(thisCurve, otherCurve));
|
|
612
|
-
allIntersections.push(...intersections);
|
|
613
|
-
allIntersections.push(...commonSegmentsPoints);
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
allIntersections = removeDuplicatePoints(allIntersections);
|
|
617
|
-
return allIntersections.length > 1;
|
|
618
|
-
}
|
|
619
|
-
if (first instanceof CompoundBlueprint || first instanceof Blueprints) return first.blueprints.some((bp) => genericIntersects(bp, second));
|
|
620
|
-
if (second instanceof CompoundBlueprint || second instanceof Blueprints) return second.blueprints.some((bp) => genericIntersects(first, bp));
|
|
621
|
-
bug("genericIntersects", "Unhandled shape combination in genericIntersects");
|
|
622
|
-
};
|
|
623
615
|
var genericFuse = (first, second) => {
|
|
624
616
|
if (first instanceof CompoundBlueprint) {
|
|
625
617
|
if (second instanceof Blueprint) return fuseBlueprintWithCompound(second, first);
|
|
@@ -656,7 +648,6 @@ var fuseIntersectingBlueprints = (blueprints) => {
|
|
|
656
648
|
otherIsFused = true;
|
|
657
649
|
}
|
|
658
650
|
if (blueprint.boundingBox.isOut(otherBlueprint.boundingBox)) return;
|
|
659
|
-
if (!genericIntersects(blueprint, otherBlueprint)) return;
|
|
660
651
|
let newFused;
|
|
661
652
|
if (blueprint instanceof Blueprints || otherBlueprint instanceof Blueprints) {
|
|
662
653
|
const fused = fuse2D(blueprint, otherBlueprint);
|
|
@@ -785,6 +776,7 @@ var cut2D = (first, second) => {
|
|
|
785
776
|
if (first instanceof CompoundBlueprint) {
|
|
786
777
|
const wrapper = safeIndex(first.blueprints, 0, "cut2D");
|
|
787
778
|
if (second instanceof Blueprint && !second.intersects(wrapper)) {
|
|
779
|
+
if (second.isInside(wrapper.firstPoint)) return null;
|
|
788
780
|
if (!wrapper.isInside(second.firstPoint)) return first.clone();
|
|
789
781
|
const cuts = fuse2D(second, new Blueprints(first.blueprints.slice(1)));
|
|
790
782
|
return organiseBlueprints([wrapper, ...allBlueprints(cuts)]);
|
package/dist/brepjs.cjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
|
|
3
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
4
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
3
|
+
const require_shapeTypes = require("./shapeTypes-MUEH4XuH.cjs");
|
|
4
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-D3qerQTq.cjs");
|
|
5
5
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
6
6
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
7
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
8
|
-
const require_validityTypes = require("./validityTypes-
|
|
7
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C_fXO6xL.cjs");
|
|
8
|
+
const require_validityTypes = require("./validityTypes-CGX2ES81.cjs");
|
|
9
9
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
10
10
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
11
11
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
12
12
|
const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
|
|
13
|
-
const require_faceFns = require("./faceFns-
|
|
14
|
-
const require_originTrackingFns = require("./originTrackingFns-
|
|
15
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
16
|
-
const require_primitiveFns = require("./primitiveFns-
|
|
17
|
-
const require_shapeFns = require("./shapeFns-
|
|
18
|
-
const require_curveFns = require("./curveFns-
|
|
19
|
-
const require_meshFns = require("./meshFns-
|
|
13
|
+
const require_faceFns = require("./faceFns-C-2ttg8X.cjs");
|
|
14
|
+
const require_originTrackingFns = require("./originTrackingFns-rEKOAP65.cjs");
|
|
15
|
+
const require_solidBuilders = require("./solidBuilders-DdG4NPHM.cjs");
|
|
16
|
+
const require_primitiveFns = require("./primitiveFns-CLGVLwG8.cjs");
|
|
17
|
+
const require_shapeFns = require("./shapeFns-SgIrOjN4.cjs");
|
|
18
|
+
const require_curveFns = require("./curveFns-BAM7QHrP.cjs");
|
|
19
|
+
const require_meshFns = require("./meshFns-BeubBqEI.cjs");
|
|
20
20
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
21
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
22
|
-
const require_healingFns = require("./healingFns-
|
|
23
|
-
const require_threadFns = require("./threadFns-
|
|
24
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
25
|
-
const require_helpers = require("./helpers-
|
|
26
|
-
const require_blueprint = require("./blueprint-
|
|
27
|
-
const require_drawFns = require("./drawFns-
|
|
28
|
-
const require_measureFns = require("./measureFns-
|
|
29
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
30
|
-
const require_boolean2D = require("./boolean2D-
|
|
31
|
-
const require_blueprintFns = require("./blueprintFns-
|
|
32
|
-
const require_importFns = require("./importFns-
|
|
33
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
34
|
-
const require_loftFns = require("./loftFns-
|
|
35
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
36
|
-
const require_adjacencyFns = require("./adjacencyFns-
|
|
37
|
-
const require_cameraFns = require("./cameraFns-
|
|
38
|
-
const require_textMetrics = require("./textMetrics-
|
|
39
|
-
const require_principalBoxFns = require("./principalBoxFns-
|
|
21
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DOmDVuMs.cjs");
|
|
22
|
+
const require_healingFns = require("./healingFns-DZkO5okn.cjs");
|
|
23
|
+
const require_threadFns = require("./threadFns-1H60LrFX.cjs");
|
|
24
|
+
const require_blueprintSketcher = require("./blueprintSketcher-BG--DxWB.cjs");
|
|
25
|
+
const require_helpers = require("./helpers-BdGGaLhF.cjs");
|
|
26
|
+
const require_blueprint = require("./blueprint-17RUHsoP.cjs");
|
|
27
|
+
const require_drawFns = require("./drawFns-d-RvC6u6.cjs");
|
|
28
|
+
const require_measureFns = require("./measureFns-BdSjw5fr.cjs");
|
|
29
|
+
const require_cornerFinder = require("./cornerFinder-e4Wc7_yp.cjs");
|
|
30
|
+
const require_boolean2D = require("./boolean2D-7SQ3B0pC.cjs");
|
|
31
|
+
const require_blueprintFns = require("./blueprintFns-Dw5_4_Bk.cjs");
|
|
32
|
+
const require_importFns = require("./importFns-DLiP26NW.cjs");
|
|
33
|
+
const require_textBlueprints = require("./textBlueprints-B7Vhr0xu.cjs");
|
|
34
|
+
const require_loftFns = require("./loftFns-DGV1z2NJ.cjs");
|
|
35
|
+
const require_refResolveFns = require("./refResolveFns-DNX0bCrP.cjs");
|
|
36
|
+
const require_adjacencyFns = require("./adjacencyFns-mMmTBUBY.cjs");
|
|
37
|
+
const require_cameraFns = require("./cameraFns-BAtzhCYM.cjs");
|
|
38
|
+
const require_textMetrics = require("./textMetrics-C6_kSht6.cjs");
|
|
39
|
+
const require_principalBoxFns = require("./principalBoxFns-CiXzjOkr.cjs");
|
|
40
40
|
const require_workerPool = require("./workerPool-D5tiNXrI.cjs");
|
|
41
41
|
// src/kernel/types.ts
|
|
42
42
|
/** Check if the kernel supports hidden-line-removal projection. */
|