brepjs 8.0.1 → 8.0.2
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 +32 -0
- package/dist/2d/blueprints/booleanHelpers.d.ts.map +1 -0
- package/dist/2d/blueprints/booleanOperations.d.ts +5 -3
- package/dist/2d/blueprints/booleanOperations.d.ts.map +1 -1
- package/dist/2d/blueprints/intersectionSegments.d.ts +12 -0
- package/dist/2d/blueprints/intersectionSegments.d.ts.map +1 -0
- package/dist/2d/blueprints/segmentAssembly.d.ts +31 -0
- package/dist/2d/blueprints/segmentAssembly.d.ts.map +1 -0
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +8 -8
- package/dist/{Blueprint-D3JfGJTz.js → Blueprint-B9fhnpFp.js} +117 -30
- package/dist/{Blueprint-CVctc41Z.cjs → Blueprint-VGbo3izk.cjs} +111 -24
- package/dist/{boolean2D-BdZATaHs.cjs → boolean2D-B1XrGVgx.cjs} +426 -345
- package/dist/{boolean2D-hOw5Qay5.js → boolean2D-_WiqPxWZ.js} +391 -310
- package/dist/{booleanFns-BBSVKhL2.cjs → booleanFns-BxW-N3rP.cjs} +12 -16
- package/dist/{booleanFns-CqehfzcK.js → booleanFns-CkccZ7UL.js} +14 -18
- package/dist/brepjs.cjs +133 -62
- package/dist/brepjs.js +290 -217
- package/dist/{cast-DQaUibmm.js → cast-C4Ff_1Qe.js} +2 -2
- package/dist/{cast-DkB0GKmQ.cjs → cast-DIiyxDLo.cjs} +2 -2
- package/dist/core/disposal.d.ts +1 -1
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/cornerFinder-BndBNtJE.cjs +58 -0
- package/dist/cornerFinder-DzGzfiqb.js +59 -0
- package/dist/curveBuilders-BUoFO1UG.cjs +196 -0
- package/dist/curveBuilders-CBlIWlbU.js +197 -0
- package/dist/{curveFns-BilyYL_s.cjs → curveFns-BrJDkaWi.cjs} +31 -44
- package/dist/{curveFns-CdVE4da7.js → curveFns-BshHA9Ys.js} +31 -44
- package/dist/{drawFns-921SkhDL.js → drawFns-Btmlh_Oz.js} +13 -14
- package/dist/{drawFns-CUyx50gi.cjs → drawFns-D2eDcf4k.cjs} +58 -59
- package/dist/{faceFns-DHu-2JpA.js → faceFns-DDzCECn3.js} +3 -3
- package/dist/{faceFns-BwK7FP7N.cjs → faceFns-NDRFeekj.cjs} +3 -3
- package/dist/helpers-Ck8GJ58k.cjs +203 -0
- package/dist/helpers-jku2V1DY.js +204 -0
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/occtAdapter.d.ts +1 -0
- package/dist/kernel/occtAdapter.d.ts.map +1 -1
- package/dist/kernel/sweepOps.d.ts +8 -0
- package/dist/kernel/sweepOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +1 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/loft-Bk9EM0gZ.js +373 -0
- package/dist/loft-DJXwxV_L.cjs +372 -0
- package/dist/{measurement-C5JGCuUP.js → measurement-DlXaTzKc.js} +3 -3
- package/dist/{measurement-fxm_pW7x.cjs → measurement-LcGh4wV0.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-AqAjTTVl.js → meshFns-Djzdn-CS.js} +1 -1
- package/dist/{meshFns-BhrZGi6w.cjs → meshFns-c8lDKfYy.cjs} +1 -1
- package/dist/{occtBoundary-du8_ex-p.cjs → occtBoundary-6kQSl3cF.cjs} +21 -0
- package/dist/{occtBoundary-CwegMzqc.js → occtBoundary-CqXvDhZY.js} +26 -5
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/extrudeUtils.d.ts +17 -0
- package/dist/operations/extrudeUtils.d.ts.map +1 -1
- package/dist/{operations-C1rWoba2.js → operations-CrQlFDHc.js} +30 -7
- package/dist/{operations-BP1wVDw0.cjs → operations-Do-WZGXc.cjs} +30 -7
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +4 -4
- package/dist/query/cornerFinder.d.ts +48 -0
- package/dist/query/cornerFinder.d.ts.map +1 -0
- package/dist/query/directionUtils.d.ts +6 -0
- package/dist/query/directionUtils.d.ts.map +1 -0
- package/dist/query/edgeFinder.d.ts +15 -0
- package/dist/query/edgeFinder.d.ts.map +1 -0
- package/dist/query/faceFinder.d.ts +15 -0
- package/dist/query/faceFinder.d.ts.map +1 -0
- package/dist/query/finderCore.d.ts +35 -0
- package/dist/query/finderCore.d.ts.map +1 -0
- package/dist/query/finderFns.d.ts +21 -106
- package/dist/query/finderFns.d.ts.map +1 -1
- package/dist/query/shapeDistanceFilter.d.ts +11 -0
- package/dist/query/shapeDistanceFilter.d.ts.map +1 -0
- package/dist/query/vertexFinder.d.ts +16 -0
- package/dist/query/vertexFinder.d.ts.map +1 -0
- package/dist/query/wireFinder.d.ts +10 -0
- package/dist/query/wireFinder.d.ts.map +1 -0
- package/dist/query.cjs +42 -5
- package/dist/query.js +40 -2
- package/dist/{shapeFns-BrF97sKt.js → shapeFns-DQtpzndX.js} +17 -18
- package/dist/{shapeFns-BvOndshS.cjs → shapeFns-cN4qGpbO.cjs} +6 -7
- package/dist/{shapeTypes-DKhwEnUM.cjs → shapeTypes-BJ3Hmskg.cjs} +24 -20
- package/dist/{shapeTypes-BlSElW8z.js → shapeTypes-C9sUsmEW.js} +32 -28
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketcher2d.d.ts +12 -4
- package/dist/sketching/Sketcher2d.d.ts.map +1 -1
- package/dist/sketching/ellipseUtils.d.ts +29 -0
- package/dist/sketching/ellipseUtils.d.ts.map +1 -0
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/curveBuilders.d.ts +75 -0
- package/dist/topology/curveBuilders.d.ts.map +1 -0
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeHelpers.d.ts +6 -173
- package/dist/topology/shapeHelpers.d.ts.map +1 -1
- package/dist/topology/shapeUtils.d.ts +13 -0
- package/dist/topology/shapeUtils.d.ts.map +1 -0
- package/dist/topology/solidBuilders.d.ts +70 -0
- package/dist/topology/solidBuilders.d.ts.map +1 -0
- package/dist/topology/surfaceBuilders.d.ts +35 -0
- package/dist/topology/surfaceBuilders.d.ts.map +1 -0
- package/dist/topology/wrapperFns.d.ts +1 -0
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-tFzqSrGH.js → topology-CtfUZwLR.js} +8 -8
- package/dist/{topology-CIooytHH.cjs → topology-DXq8dLsi.cjs} +8 -8
- package/dist/topology.cjs +7 -7
- package/dist/topology.js +31 -31
- package/dist/{vectors-CBuaMeZv.js → vectors-BVgXsYWl.js} +1 -1
- package/dist/{vectors-ChWEZPwy.cjs → vectors-DK2hEKcI.cjs} +1 -1
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +1 -1
- package/dist/loft-BzWFokmC.cjs +0 -178
- package/dist/loft-CtG5nMq5.js +0 -179
- package/dist/query-V6nV-VfL.js +0 -396
- package/dist/query-hMSmOWJP.cjs +0 -395
- package/dist/shapeHelpers-B2SXz1p4.cjs +0 -488
- package/dist/shapeHelpers-BcoZf2N9.js +0 -489
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Point2D, Curve2D } from '../lib/index.js';
|
|
2
|
+
export declare const samePoint: (x: Point2D, y: Point2D) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Hash a point for Set/Map lookup using precision rounding.
|
|
5
|
+
* Must match PRECISION_INTERSECTION (1e-9) to avoid hash collisions for
|
|
6
|
+
* nearly-equal points.
|
|
7
|
+
*/
|
|
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
|
+
export type Segment = Curve2D[];
|
|
15
|
+
export type IntersectionSegment = [Segment, Segment | 'same'];
|
|
16
|
+
export declare function startOfSegment(s: Segment): Point2D;
|
|
17
|
+
export declare function endOfSegment(s: Segment): Point2D;
|
|
18
|
+
export declare function reverseSegment(segment: Segment): Segment;
|
|
19
|
+
export declare function reverseSegments(segments: Segment[]): Segment[];
|
|
20
|
+
export declare function curveMidPoint(curve: Curve2D): Point2D;
|
|
21
|
+
/**
|
|
22
|
+
* Rotate the curves array so that it starts at the curve whose firstPoint
|
|
23
|
+
* matches the given point.
|
|
24
|
+
*/
|
|
25
|
+
export declare function rotateToStartAt(curves: Curve2D[], point: Point2D): Curve2D[];
|
|
26
|
+
/**
|
|
27
|
+
* Rotate the curves array so that it starts at the curve matching the given
|
|
28
|
+
* segment. If the segment is oriented the other way, the curves are reversed
|
|
29
|
+
* first.
|
|
30
|
+
*/
|
|
31
|
+
export declare function rotateToStartAtSegment(curves: Curve2D[], segment: Curve2D): Curve2D[];
|
|
32
|
+
//# sourceMappingURL=booleanHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanHelpers.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/booleanHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQxD,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OACH,CAAC;AAMjD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAIjE;AAMD,MAAM,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC;AAChC,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAE9D,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMhD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAMxD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAE9D;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGrD;AAsDD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAwBrF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { default as Blueprint } from './Blueprint.js';
|
|
2
2
|
import { default as Blueprints } from './Blueprints.js';
|
|
3
|
+
export type { Segment, IntersectionSegment } from './booleanHelpers.js';
|
|
4
|
+
export { blueprintsIntersectionSegments } from './intersectionSegments.js';
|
|
3
5
|
/**
|
|
4
6
|
* Compute the boolean union of two simple blueprints.
|
|
5
7
|
*
|
|
@@ -14,7 +16,7 @@ import { default as Blueprints } from './Blueprints.js';
|
|
|
14
16
|
* @remarks Both blueprints must be closed. For compound or multi-blueprint
|
|
15
17
|
* inputs, use {@link fuse2D} instead.
|
|
16
18
|
*/
|
|
17
|
-
export declare
|
|
19
|
+
export declare function fuseBlueprints(first: Blueprint, second: Blueprint): null | Blueprint | Blueprints;
|
|
18
20
|
/**
|
|
19
21
|
* Compute the boolean difference of two simple blueprints (first minus second).
|
|
20
22
|
*
|
|
@@ -28,7 +30,7 @@ export declare const fuseBlueprints: (first: Blueprint, second: Blueprint) => nu
|
|
|
28
30
|
*
|
|
29
31
|
* @remarks Both blueprints must be closed. For compound inputs use {@link cut2D}.
|
|
30
32
|
*/
|
|
31
|
-
export declare
|
|
33
|
+
export declare function cutBlueprints(first: Blueprint, second: Blueprint): null | Blueprint | Blueprints;
|
|
32
34
|
/**
|
|
33
35
|
* Compute the boolean intersection of two simple blueprints.
|
|
34
36
|
*
|
|
@@ -41,5 +43,5 @@ export declare const cutBlueprints: (first: Blueprint, second: Blueprint) => nul
|
|
|
41
43
|
*
|
|
42
44
|
* @remarks Both blueprints must be closed. For compound inputs use {@link intersect2D}.
|
|
43
45
|
*/
|
|
44
|
-
export declare
|
|
46
|
+
export declare function intersectBlueprints(first: Blueprint, second: Blueprint): null | Blueprint | Blueprints;
|
|
45
47
|
//# sourceMappingURL=booleanOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booleanOperations.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/booleanOperations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"booleanOperations.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/booleanOperations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAKzC,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAM3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAqBjG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAqBhG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,IAAI,GAAG,SAAS,GAAG,UAAU,CAqB/B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as Blueprint } from './Blueprint.js';
|
|
2
|
+
import { IntersectionSegment } from './booleanHelpers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Given two closed blueprints, find their intersection points, split each
|
|
5
|
+
* blueprint's curves at those points, and pair up the resulting segments.
|
|
6
|
+
*
|
|
7
|
+
* Returns an array of paired segments (one from each blueprint) that share
|
|
8
|
+
* the same start/end intersection points, or `null` if the blueprints do not
|
|
9
|
+
* intersect.
|
|
10
|
+
*/
|
|
11
|
+
export declare function blueprintsIntersectionSegments(first: Blueprint, second: Blueprint): IntersectionSegment[] | null;
|
|
12
|
+
//# sourceMappingURL=intersectionSegments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAgKxE;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,mBAAmB,EAAE,GAAG,IAAI,CAwE9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Curve2D } from '../lib/index.js';
|
|
2
|
+
import { default as Blueprint } from './Blueprint.js';
|
|
3
|
+
import { default as Blueprints } from './Blueprints.js';
|
|
4
|
+
/**
|
|
5
|
+
* Split an array of curves into separate continuous paths. A discontinuity
|
|
6
|
+
* occurs where one curve's lastPoint does not match the next curve's
|
|
7
|
+
* firstPoint.
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitPaths(curves: Curve2D[]): Curve2D[][];
|
|
10
|
+
interface NoIntersectionResult {
|
|
11
|
+
readonly identical: false;
|
|
12
|
+
readonly firstCurveInSecond: boolean;
|
|
13
|
+
readonly secondCurveInFirst: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface IdenticalResult {
|
|
16
|
+
readonly identical: true;
|
|
17
|
+
}
|
|
18
|
+
export type BooleanOperationResult = Blueprint | Blueprints | null | IdenticalResult | NoIntersectionResult;
|
|
19
|
+
interface BooleanOperationConfig {
|
|
20
|
+
readonly firstInside: 'keep' | 'remove';
|
|
21
|
+
readonly secondInside: 'keep' | 'remove';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Core boolean operation between two simple (non-compound) blueprints.
|
|
25
|
+
*
|
|
26
|
+
* Segments both blueprints at their intersection points, then selects which
|
|
27
|
+
* segments to keep based on the `firstInside`/`secondInside` configuration.
|
|
28
|
+
*/
|
|
29
|
+
export declare function booleanOperation(first: Blueprint, second: Blueprint, config: BooleanOperationConfig): BooleanOperationResult;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=segmentAssembly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentAssembly.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/segmentAssembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAU9C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CA6BzD;AAMD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,UAAU,GACV,IAAI,GACJ,eAAe,GACf,oBAAoB,CAAC;AAMzB,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1C;AAmGD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAoDxB"}
|
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-VGbo3izk.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-B1XrGVgx.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
package/dist/2d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import {
|
|
3
|
-
import { b
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-B9fhnpFp.js";
|
|
2
|
+
import { e, C, f } from "./Blueprint-B9fhnpFp.js";
|
|
3
|
+
import { b, C as C2, c, d, f as f2, e as e2, i, g, o, p, r } from "./boolean2D-_WiqPxWZ.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -68,11 +68,11 @@ function sketch2DOnFace(bp, face, scaleMode) {
|
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
70
70
|
Blueprint,
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
b as Blueprints,
|
|
72
|
+
e as BoundingBox2d,
|
|
73
73
|
C2 as CompoundBlueprint,
|
|
74
74
|
C as Curve2D,
|
|
75
|
-
|
|
75
|
+
f as axis2d,
|
|
76
76
|
createBlueprint,
|
|
77
77
|
curve2dBoundingBox,
|
|
78
78
|
curve2dDistanceFrom,
|
|
@@ -84,8 +84,8 @@ export {
|
|
|
84
84
|
curve2dTangentAt,
|
|
85
85
|
c as cut2D,
|
|
86
86
|
d as cutBlueprints,
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
f2 as fuse2D,
|
|
88
|
+
e2 as fuseBlueprints,
|
|
89
89
|
getBounds2D,
|
|
90
90
|
getOrientation2D,
|
|
91
91
|
i as intersect2D,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { r as resolvePlane } from "./vectors-
|
|
2
|
-
import { g as getKernel, a as toVec3,
|
|
3
|
-
import {
|
|
4
|
-
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-
|
|
5
|
-
import { j as findCurveType, m as getOrientation } from "./curveFns-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { c as cast } from "./cast-DQaUibmm.js";
|
|
1
|
+
import { r as resolvePlane } from "./vectors-BVgXsYWl.js";
|
|
2
|
+
import { g as getKernel, a as toVec3, m as makeOcAx2 } from "./occtBoundary-CqXvDhZY.js";
|
|
3
|
+
import { t as localGC, u as createFace, e as isFace, y as registerForCleanup, z as unregisterFromCleanup, p as gcWithScope, o as createEdge, n as createWire } from "./shapeTypes-C9sUsmEW.js";
|
|
4
|
+
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-DDzCECn3.js";
|
|
5
|
+
import { j as findCurveType, m as getOrientation } from "./curveFns-BshHA9Ys.js";
|
|
6
|
+
import { e as err, o as occtError, l as ok, a as andThen, x as validationError, u as unwrap, b as computationError } from "./errors-wGhcJMpB.js";
|
|
7
|
+
import { d as distance2d, s as samePoint, k as scalarMultiply2d, i as add2d, n as normalize2d, h as subtract2d, g as getSingleFace } from "./helpers-jku2V1DY.js";
|
|
8
|
+
import { c as cast } from "./cast-C4Ff_1Qe.js";
|
|
10
9
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
10
|
+
import { a as getEdges } from "./shapeFns-DQtpzndX.js";
|
|
11
|
+
import { m as makeLine, a as assembleWire$1 } from "./curveBuilders-CBlIWlbU.js";
|
|
11
12
|
import { bug } from "./result.js";
|
|
12
13
|
function makePlane(plane, origin) {
|
|
13
14
|
if (plane && typeof plane !== "string") {
|
|
@@ -44,6 +45,86 @@ function mirror(shape, inputPlane, origin) {
|
|
|
44
45
|
gc();
|
|
45
46
|
return newShape;
|
|
46
47
|
}
|
|
48
|
+
function range(len) {
|
|
49
|
+
return Array.from(Array(len).keys());
|
|
50
|
+
}
|
|
51
|
+
function zip(arrays) {
|
|
52
|
+
const minLength = Math.min(...arrays.map((arr) => arr.length));
|
|
53
|
+
return range(minLength).map((i) => arrays.map((arr) => arr[i]));
|
|
54
|
+
}
|
|
55
|
+
function makeFace(wire, holes) {
|
|
56
|
+
const oc = getKernel().oc;
|
|
57
|
+
const faceBuilder = new oc.BRepBuilderAPI_MakeFace_15(wire.wrapped, false);
|
|
58
|
+
holes?.forEach((hole) => {
|
|
59
|
+
faceBuilder.Add(hole.wrapped);
|
|
60
|
+
});
|
|
61
|
+
if (!faceBuilder.IsDone()) {
|
|
62
|
+
faceBuilder.delete();
|
|
63
|
+
return err(
|
|
64
|
+
occtError("FACE_BUILD_FAILED", "Failed to build the face. Your wire might be non planar.")
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const face = faceBuilder.Face();
|
|
68
|
+
faceBuilder.delete();
|
|
69
|
+
return ok(createFace(face));
|
|
70
|
+
}
|
|
71
|
+
function makeNewFaceWithinFace(originFace, wire) {
|
|
72
|
+
const oc = getKernel().oc;
|
|
73
|
+
const [r, gc] = localGC();
|
|
74
|
+
const surface = r(oc.BRep_Tool.Surface_2(originFace.wrapped));
|
|
75
|
+
const faceBuilder = r(new oc.BRepBuilderAPI_MakeFace_21(surface, wire.wrapped, true));
|
|
76
|
+
const face = faceBuilder.Face();
|
|
77
|
+
gc();
|
|
78
|
+
return createFace(face);
|
|
79
|
+
}
|
|
80
|
+
function makeNonPlanarFace(wire) {
|
|
81
|
+
const oc = getKernel().oc;
|
|
82
|
+
const [r, gc] = localGC();
|
|
83
|
+
const faceBuilder = r(
|
|
84
|
+
new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, 0.01, 0.1, 8, 9)
|
|
85
|
+
);
|
|
86
|
+
getEdges(wire).forEach((edge) => {
|
|
87
|
+
faceBuilder.Add_1(
|
|
88
|
+
edge.wrapped,
|
|
89
|
+
oc.GeomAbs_Shape.GeomAbs_C0,
|
|
90
|
+
true
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
const progress = r(new oc.Message_ProgressRange_1());
|
|
94
|
+
faceBuilder.Build(progress);
|
|
95
|
+
return andThen(cast(faceBuilder.Shape()), (newFace) => {
|
|
96
|
+
gc();
|
|
97
|
+
if (!isFace(newFace)) {
|
|
98
|
+
return err(occtError("FACE_BUILD_FAILED", "Failed to create a face"));
|
|
99
|
+
}
|
|
100
|
+
return ok(newFace);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function addHolesInFace(face, holes) {
|
|
104
|
+
const oc = getKernel().oc;
|
|
105
|
+
const [r, gc] = localGC();
|
|
106
|
+
const faceMaker = r(new oc.BRepBuilderAPI_MakeFace_2(face.wrapped));
|
|
107
|
+
holes.forEach((wire) => {
|
|
108
|
+
faceMaker.Add(wire.wrapped);
|
|
109
|
+
});
|
|
110
|
+
const builtFace = r(faceMaker.Face());
|
|
111
|
+
const fixer = r(new oc.ShapeFix_Face_2(builtFace));
|
|
112
|
+
fixer.FixOrientation_1();
|
|
113
|
+
const newFace = fixer.Face();
|
|
114
|
+
gc();
|
|
115
|
+
return createFace(newFace);
|
|
116
|
+
}
|
|
117
|
+
function makePolygon(points) {
|
|
118
|
+
if (points.length < 3)
|
|
119
|
+
return err(
|
|
120
|
+
validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon")
|
|
121
|
+
);
|
|
122
|
+
const edges = zip([points, [...points.slice(1), points[0]]]).map(
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- zip returns untyped pairs
|
|
124
|
+
([p1, p2]) => makeLine(p1, p2)
|
|
125
|
+
);
|
|
126
|
+
return andThen(assembleWire$1(edges), (wire) => makeFace(wire));
|
|
127
|
+
}
|
|
47
128
|
function isPoint2D(point) {
|
|
48
129
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
49
130
|
}
|
|
@@ -1158,27 +1239,33 @@ class Blueprint {
|
|
|
1158
1239
|
}
|
|
1159
1240
|
}
|
|
1160
1241
|
export {
|
|
1242
|
+
removeDuplicatePoints as A,
|
|
1161
1243
|
Blueprint as B,
|
|
1162
1244
|
Curve2D as C,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1245
|
+
addHolesInFace as a,
|
|
1246
|
+
makeNonPlanarFace as b,
|
|
1247
|
+
makePolygon as c,
|
|
1248
|
+
makeNewFaceWithinFace as d,
|
|
1249
|
+
BoundingBox2d as e,
|
|
1250
|
+
axis2d as f,
|
|
1251
|
+
makePlane as g,
|
|
1252
|
+
mirror as h,
|
|
1253
|
+
make2dSegmentCurve as i,
|
|
1254
|
+
make2dArcFromCenter as j,
|
|
1255
|
+
approximateAsSvgCompatibleCurve as k,
|
|
1256
|
+
edgeToCurve as l,
|
|
1257
|
+
makeFace as m,
|
|
1258
|
+
make2dInerpolatedBSplineCurve as n,
|
|
1259
|
+
make2dCircle as o,
|
|
1260
|
+
make2dEllipse as p,
|
|
1261
|
+
deserializeCurve2D as q,
|
|
1262
|
+
approximateAsBSpline as r,
|
|
1263
|
+
isPoint2D as s,
|
|
1264
|
+
make2dThreePointArc as t,
|
|
1265
|
+
asSVG as u,
|
|
1266
|
+
viewbox as v,
|
|
1267
|
+
make2dEllipseArc as w,
|
|
1268
|
+
make2dTangentArc as x,
|
|
1269
|
+
make2dBezierCurve as y,
|
|
1270
|
+
zip as z
|
|
1184
1271
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
4
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
2
|
+
const vectors = require("./vectors-DK2hEKcI.cjs");
|
|
3
|
+
const occtBoundary = require("./occtBoundary-6kQSl3cF.cjs");
|
|
4
|
+
const shapeTypes = require("./shapeTypes-BJ3Hmskg.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-NDRFeekj.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-BrJDkaWi.cjs");
|
|
7
7
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
8
|
+
const helpers = require("./helpers-Ck8GJ58k.cjs");
|
|
9
|
+
const cast = require("./cast-DIiyxDLo.cjs");
|
|
11
10
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
11
|
+
const shapeFns = require("./shapeFns-cN4qGpbO.cjs");
|
|
12
|
+
const curveBuilders = require("./curveBuilders-BUoFO1UG.cjs");
|
|
12
13
|
const result = require("./result.cjs");
|
|
13
14
|
function makePlane(plane, origin) {
|
|
14
15
|
if (plane && typeof plane !== "string") {
|
|
@@ -45,6 +46,86 @@ function mirror(shape, inputPlane, origin) {
|
|
|
45
46
|
gc();
|
|
46
47
|
return newShape;
|
|
47
48
|
}
|
|
49
|
+
function range(len) {
|
|
50
|
+
return Array.from(Array(len).keys());
|
|
51
|
+
}
|
|
52
|
+
function zip(arrays) {
|
|
53
|
+
const minLength = Math.min(...arrays.map((arr) => arr.length));
|
|
54
|
+
return range(minLength).map((i) => arrays.map((arr) => arr[i]));
|
|
55
|
+
}
|
|
56
|
+
function makeFace(wire, holes) {
|
|
57
|
+
const oc = occtBoundary.getKernel().oc;
|
|
58
|
+
const faceBuilder = new oc.BRepBuilderAPI_MakeFace_15(wire.wrapped, false);
|
|
59
|
+
holes?.forEach((hole) => {
|
|
60
|
+
faceBuilder.Add(hole.wrapped);
|
|
61
|
+
});
|
|
62
|
+
if (!faceBuilder.IsDone()) {
|
|
63
|
+
faceBuilder.delete();
|
|
64
|
+
return errors.err(
|
|
65
|
+
errors.occtError("FACE_BUILD_FAILED", "Failed to build the face. Your wire might be non planar.")
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
const face = faceBuilder.Face();
|
|
69
|
+
faceBuilder.delete();
|
|
70
|
+
return errors.ok(shapeTypes.createFace(face));
|
|
71
|
+
}
|
|
72
|
+
function makeNewFaceWithinFace(originFace, wire) {
|
|
73
|
+
const oc = occtBoundary.getKernel().oc;
|
|
74
|
+
const [r, gc] = shapeTypes.localGC();
|
|
75
|
+
const surface = r(oc.BRep_Tool.Surface_2(originFace.wrapped));
|
|
76
|
+
const faceBuilder = r(new oc.BRepBuilderAPI_MakeFace_21(surface, wire.wrapped, true));
|
|
77
|
+
const face = faceBuilder.Face();
|
|
78
|
+
gc();
|
|
79
|
+
return shapeTypes.createFace(face);
|
|
80
|
+
}
|
|
81
|
+
function makeNonPlanarFace(wire) {
|
|
82
|
+
const oc = occtBoundary.getKernel().oc;
|
|
83
|
+
const [r, gc] = shapeTypes.localGC();
|
|
84
|
+
const faceBuilder = r(
|
|
85
|
+
new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, 0.01, 0.1, 8, 9)
|
|
86
|
+
);
|
|
87
|
+
shapeFns.getEdges(wire).forEach((edge) => {
|
|
88
|
+
faceBuilder.Add_1(
|
|
89
|
+
edge.wrapped,
|
|
90
|
+
oc.GeomAbs_Shape.GeomAbs_C0,
|
|
91
|
+
true
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
const progress = r(new oc.Message_ProgressRange_1());
|
|
95
|
+
faceBuilder.Build(progress);
|
|
96
|
+
return errors.andThen(cast.cast(faceBuilder.Shape()), (newFace) => {
|
|
97
|
+
gc();
|
|
98
|
+
if (!shapeTypes.isFace(newFace)) {
|
|
99
|
+
return errors.err(errors.occtError("FACE_BUILD_FAILED", "Failed to create a face"));
|
|
100
|
+
}
|
|
101
|
+
return errors.ok(newFace);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function addHolesInFace(face, holes) {
|
|
105
|
+
const oc = occtBoundary.getKernel().oc;
|
|
106
|
+
const [r, gc] = shapeTypes.localGC();
|
|
107
|
+
const faceMaker = r(new oc.BRepBuilderAPI_MakeFace_2(face.wrapped));
|
|
108
|
+
holes.forEach((wire) => {
|
|
109
|
+
faceMaker.Add(wire.wrapped);
|
|
110
|
+
});
|
|
111
|
+
const builtFace = r(faceMaker.Face());
|
|
112
|
+
const fixer = r(new oc.ShapeFix_Face_2(builtFace));
|
|
113
|
+
fixer.FixOrientation_1();
|
|
114
|
+
const newFace = fixer.Face();
|
|
115
|
+
gc();
|
|
116
|
+
return shapeTypes.createFace(newFace);
|
|
117
|
+
}
|
|
118
|
+
function makePolygon(points) {
|
|
119
|
+
if (points.length < 3)
|
|
120
|
+
return errors.err(
|
|
121
|
+
errors.validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon")
|
|
122
|
+
);
|
|
123
|
+
const edges = zip([points, [...points.slice(1), points[0]]]).map(
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- zip returns untyped pairs
|
|
125
|
+
([p1, p2]) => curveBuilders.makeLine(p1, p2)
|
|
126
|
+
);
|
|
127
|
+
return errors.andThen(curveBuilders.assembleWire(edges), (wire) => makeFace(wire));
|
|
128
|
+
}
|
|
48
129
|
function isPoint2D(point) {
|
|
49
130
|
return Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number";
|
|
50
131
|
}
|
|
@@ -291,8 +372,8 @@ class Curve2D {
|
|
|
291
372
|
}
|
|
292
373
|
return Math.min(
|
|
293
374
|
curveToPoint,
|
|
294
|
-
|
|
295
|
-
|
|
375
|
+
helpers.distance2d(point, this.firstPoint),
|
|
376
|
+
helpers.distance2d(point, this.lastPoint)
|
|
296
377
|
);
|
|
297
378
|
}
|
|
298
379
|
distanceFromCurve(curve) {
|
|
@@ -348,8 +429,8 @@ class Curve2D {
|
|
|
348
429
|
lowerDistance = projector.LowerDistance();
|
|
349
430
|
lowerDistanceParameter = projector.LowerDistanceParameter();
|
|
350
431
|
} catch {
|
|
351
|
-
if (
|
|
352
|
-
if (
|
|
432
|
+
if (helpers.samePoint(point, this.firstPoint, precision)) return errors.ok(this.firstParameter);
|
|
433
|
+
if (helpers.samePoint(point, this.lastPoint, precision)) return errors.ok(this.lastParameter);
|
|
353
434
|
return errors.err(errors.computationError("PARAMETER_NOT_FOUND", "Failed to find parameter"));
|
|
354
435
|
}
|
|
355
436
|
if (lowerDistance > precision) {
|
|
@@ -412,7 +493,7 @@ class Curve2D {
|
|
|
412
493
|
)
|
|
413
494
|
parameters = parameters.slice(0, -1);
|
|
414
495
|
if (!parameters.length) return [this];
|
|
415
|
-
return
|
|
496
|
+
return zip([
|
|
416
497
|
[firstParam, ...parameters],
|
|
417
498
|
[...parameters, lastParam]
|
|
418
499
|
]).map(([first, last]) => {
|
|
@@ -489,7 +570,7 @@ function approximateAsSvgCompatibleCurve(curves, options = {
|
|
|
489
570
|
return curves.flatMap((curve) => {
|
|
490
571
|
const adaptor = r(curve.adaptor());
|
|
491
572
|
const curveType = errors.unwrap(curveFns.findCurveType(adaptor.GetType()));
|
|
492
|
-
if (curveType === "ELLIPSE" || curveType === "CIRCLE" &&
|
|
573
|
+
if (curveType === "ELLIPSE" || curveType === "CIRCLE" && helpers.samePoint(curve.firstPoint, curve.lastPoint)) {
|
|
493
574
|
return curve.splitAt([0.5]);
|
|
494
575
|
}
|
|
495
576
|
if (["LINE", "ELLIPSE", "CIRCLE"].includes(curveType)) {
|
|
@@ -520,7 +601,7 @@ const make2dSegmentCurve = (startPoint, endPoint) => {
|
|
|
520
601
|
const [r, gc] = shapeTypes.localGC();
|
|
521
602
|
const segment = r(new oc.GCE2d_MakeSegment_1(r(pnt(startPoint)), r(pnt(endPoint)))).Value();
|
|
522
603
|
const curve = new Curve2D(segment);
|
|
523
|
-
if (!
|
|
604
|
+
if (!helpers.samePoint(curve.firstPoint, startPoint)) {
|
|
524
605
|
curve.reverse();
|
|
525
606
|
}
|
|
526
607
|
gc();
|
|
@@ -534,7 +615,7 @@ const make2dThreePointArc = (startPoint, midPoint, endPoint) => {
|
|
|
534
615
|
).Value();
|
|
535
616
|
gc();
|
|
536
617
|
const curve = new Curve2D(segment);
|
|
537
|
-
if (!
|
|
618
|
+
if (!helpers.samePoint(curve.firstPoint, startPoint)) {
|
|
538
619
|
curve.wrapped.get().SetTrim(curve.lastParameter, curve.firstParameter, true, true);
|
|
539
620
|
}
|
|
540
621
|
return curve;
|
|
@@ -547,7 +628,7 @@ const make2dTangentArc = (startPoint, tangent, endPoint) => {
|
|
|
547
628
|
).Value();
|
|
548
629
|
gc();
|
|
549
630
|
const curve = new Curve2D(segment);
|
|
550
|
-
if (!
|
|
631
|
+
if (!helpers.samePoint(curve.firstPoint, startPoint)) {
|
|
551
632
|
curve.wrapped.get().SetTrim(curve.lastParameter, curve.firstParameter, true, true);
|
|
552
633
|
}
|
|
553
634
|
return curve;
|
|
@@ -630,12 +711,12 @@ function make2dInerpolatedBSplineCurve(points, {
|
|
|
630
711
|
return errors.ok(new Curve2D(splineBuilder.Curve()));
|
|
631
712
|
}
|
|
632
713
|
const make2dArcFromCenter = (startPoint, endPoint, center, longArc = false) => {
|
|
633
|
-
const midChord =
|
|
634
|
-
const orientedRadius =
|
|
635
|
-
const midChordDir =
|
|
714
|
+
const midChord = helpers.scalarMultiply2d(helpers.add2d(startPoint, endPoint), 0.5);
|
|
715
|
+
const orientedRadius = helpers.distance2d(center, startPoint) * (longArc ? -1 : 1);
|
|
716
|
+
const midChordDir = helpers.normalize2d(helpers.subtract2d(midChord, center));
|
|
636
717
|
return make2dThreePointArc(
|
|
637
718
|
startPoint,
|
|
638
|
-
|
|
719
|
+
helpers.add2d(helpers.scalarMultiply2d(midChordDir, orientedRadius), center),
|
|
639
720
|
endPoint
|
|
640
721
|
);
|
|
641
722
|
};
|
|
@@ -1021,7 +1102,7 @@ class Blueprint {
|
|
|
1021
1102
|
const originPoint = origin || [...faceFns.faceCenter(face)];
|
|
1022
1103
|
const originVec3 = occtBoundary.toVec3(originPoint);
|
|
1023
1104
|
const sketch = this.translate(faceFns.uvCoordinates(face, originVec3)).sketchOnFace(face, "original");
|
|
1024
|
-
return errors.unwrap(
|
|
1105
|
+
return errors.unwrap(makeFace(sketch.wire));
|
|
1025
1106
|
}
|
|
1026
1107
|
/**
|
|
1027
1108
|
* Cut a prism-shaped hole through a solid along a face using this blueprint.
|
|
@@ -1041,7 +1122,7 @@ class Blueprint {
|
|
|
1041
1122
|
} = {}) {
|
|
1042
1123
|
const oc = occtBoundary.getKernel().oc;
|
|
1043
1124
|
const gc = shapeTypes.gcWithScope();
|
|
1044
|
-
const foundFace = errors.unwrap(
|
|
1125
|
+
const foundFace = errors.unwrap(helpers.getSingleFace(face, shape));
|
|
1045
1126
|
const hole = this.subFace(foundFace, origin);
|
|
1046
1127
|
const maker = gc(
|
|
1047
1128
|
new oc.BRepFeat_MakeDPrism_1(
|
|
@@ -1133,7 +1214,7 @@ class Blueprint {
|
|
|
1133
1214
|
}
|
|
1134
1215
|
/** Check whether the first and last points coincide (the profile is closed). */
|
|
1135
1216
|
isClosed() {
|
|
1136
|
-
return
|
|
1217
|
+
return helpers.samePoint(this.firstPoint, this.lastPoint);
|
|
1137
1218
|
}
|
|
1138
1219
|
/**
|
|
1139
1220
|
* Test whether this blueprint's curves intersect with another blueprint's curves.
|
|
@@ -1161,6 +1242,7 @@ class Blueprint {
|
|
|
1161
1242
|
exports.Blueprint = Blueprint;
|
|
1162
1243
|
exports.BoundingBox2d = BoundingBox2d;
|
|
1163
1244
|
exports.Curve2D = Curve2D;
|
|
1245
|
+
exports.addHolesInFace = addHolesInFace;
|
|
1164
1246
|
exports.approximateAsBSpline = approximateAsBSpline;
|
|
1165
1247
|
exports.approximateAsSvgCompatibleCurve = approximateAsSvgCompatibleCurve;
|
|
1166
1248
|
exports.asSVG = asSVG;
|
|
@@ -1177,7 +1259,12 @@ exports.make2dInerpolatedBSplineCurve = make2dInerpolatedBSplineCurve;
|
|
|
1177
1259
|
exports.make2dSegmentCurve = make2dSegmentCurve;
|
|
1178
1260
|
exports.make2dTangentArc = make2dTangentArc;
|
|
1179
1261
|
exports.make2dThreePointArc = make2dThreePointArc;
|
|
1262
|
+
exports.makeFace = makeFace;
|
|
1263
|
+
exports.makeNewFaceWithinFace = makeNewFaceWithinFace;
|
|
1264
|
+
exports.makeNonPlanarFace = makeNonPlanarFace;
|
|
1180
1265
|
exports.makePlane = makePlane;
|
|
1266
|
+
exports.makePolygon = makePolygon;
|
|
1181
1267
|
exports.mirror = mirror;
|
|
1182
1268
|
exports.removeDuplicatePoints = removeDuplicatePoints;
|
|
1183
1269
|
exports.viewbox = viewbox;
|
|
1270
|
+
exports.zip = zip;
|