brepjs 8.8.2 → 8.8.4
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/curves.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/approximations.d.ts.map +1 -1
- package/dist/2d/lib/makeCurves.d.ts.map +1 -1
- package/dist/2d/lib/ocWrapper.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/Blueprint-C4Rx89oe.js +1440 -0
- package/dist/Blueprint-D1Dik12C.cjs +1439 -0
- package/dist/{boolean2D-q5FOdOQW.cjs → boolean2D-BZnkU_aH.cjs} +215 -130
- package/dist/{boolean2D-Dgnuy63w.js → boolean2D-D4j89vF_.js} +215 -130
- package/dist/{booleanFns-CFit7JYt.cjs → booleanFns-Cf_0aWNe.cjs} +214 -133
- package/dist/{booleanFns--Orezl-b.js → booleanFns-D6SeHoCv.js} +214 -133
- package/dist/brepjs.cjs +478 -314
- package/dist/brepjs.js +574 -410
- package/dist/core/disposal.d.ts +44 -3
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +2 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/geometryHelpers.d.ts.map +1 -1
- package/dist/core/kernelCall.d.ts +20 -0
- package/dist/core/kernelCall.d.ts.map +1 -1
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core.cjs +7 -4
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +14 -11
- package/dist/{cornerFinder-KNTFoGrm.js → cornerFinder-CypY3T_w.js} +1 -1
- package/dist/{cornerFinder-v4un1Fr9.cjs → cornerFinder-DbRL42YI.cjs} +1 -1
- package/dist/{curveFns-6ovDM_sR.cjs → curveFns-KDpL9iyo.cjs} +139 -38
- package/dist/curveFns-VDZEhY97.js +281 -0
- package/dist/{drawFns-WgXeXHH1.cjs → drawFns-B52K-9DJ.cjs} +184 -104
- package/dist/{drawFns-XwroLxdb.js → drawFns-CVPwl2No.js} +184 -104
- package/dist/{errors-NNmTtM5u.cjs → errors-BYb4tL5h.cjs} +3 -0
- package/dist/{errors-DJ92ermb.js → errors-CHfaHQSt.js} +3 -0
- package/dist/faceFns-B8xnZw-f.cjs +358 -0
- package/dist/faceFns-DG4bu-QB.js +359 -0
- package/dist/{helpers-CRfqaW0Y.cjs → helpers-Cfibxk7U.cjs} +15 -12
- package/dist/{helpers-CtBCzEqs.js → helpers-zsENdJlc.js} +15 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/io/importFns.d.ts.map +1 -1
- package/dist/io.cjs +133 -65
- package/dist/io.js +133 -65
- package/dist/kernel/booleanOps.d.ts.map +1 -1
- package/dist/loft-Bhnw5Rfr.cjs +530 -0
- package/dist/loft-fSnlFn-j.js +531 -0
- package/dist/measurement-C4Ofuy_y.cjs +200 -0
- package/dist/measurement-DzRb6oYN.js +201 -0
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CPNNlpbw.cjs → meshFns-C-6Cq3V-.cjs} +3 -3
- package/dist/{meshFns-DAmWVyEp.js → meshFns-Cw3IFJjg.js} +3 -3
- package/dist/{occtBoundary-Cqfsau2c.cjs → occtBoundary-CN_uQJtA.cjs} +4 -3
- package/dist/{occtBoundary-DvBywHyU.js → occtBoundary-Ct0tN8cs.js} +4 -3
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/exporterUtils.d.ts +3 -3
- package/dist/operations/exporterUtils.d.ts.map +1 -1
- package/dist/operations/exporters.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/loft.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/{operations-BQ25CPI8.cjs → operations-DvwWDqIp.cjs} +263 -168
- package/dist/{operations-vN0tcoaU.js → operations-PYuj8GLd.js} +263 -168
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query/shapeDistanceFilter.d.ts.map +1 -1
- package/dist/query.cjs +67 -15
- package/dist/query.js +68 -16
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-C785aeVn.cjs → shapeFns-ByLUl6KE.cjs} +63 -9
- package/dist/{shapeFns-ClpALED4.js → shapeFns-QL3zx6uW.js} +63 -9
- package/dist/{shapeTypes-DnwCo942.js → shapeTypes-D34s68Xi.js} +51 -20
- package/dist/{shapeTypes-CIijJxCz.cjs → shapeTypes-sXITvFkF.cjs} +33 -2
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketcher2d.d.ts.map +1 -1
- package/dist/sketching/cannedSketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/surfaceBuilders-DYX6h68y.js +436 -0
- package/dist/surfaceBuilders-hupjYn0W.cjs +435 -0
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/curveBuilders.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/solidBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/{topology-zG8maSDK.cjs → topology-DWe9SYAy.cjs} +8 -8
- package/dist/{topology-CqyxpmEh.js → topology-psR8Hqiz.js} +8 -8
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{vectors-CGLqemPY.cjs → vectors-9rrStq8t.cjs} +2 -2
- package/dist/{vectors-2lOjaa8N.js → vectors-Dp5Iu1KH.js} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +4 -1
- package/dist/Blueprint-BmbNUnGI.cjs +0 -1185
- package/dist/Blueprint-C-JJkkwL.js +0 -1186
- package/dist/curveFns-BhQECv8e.js +0 -180
- package/dist/faceFns-3PDjBeW7.js +0 -272
- package/dist/faceFns-CxaLWOjc.cjs +0 -271
- package/dist/loft-CVb-IjEI.cjs +0 -372
- package/dist/loft-DMFjK6lk.js +0 -373
- package/dist/measurement-CecYIt3s.cjs +0 -134
- package/dist/measurement-DHDLAH7-.js +0 -135
- package/dist/surfaceBuilders-CC0ZQGix.cjs +0 -289
- package/dist/surfaceBuilders-CrJtFu2a.js +0 -290
package/dist/core/disposal.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { OcShape } from '../kernel/types.js';
|
|
2
|
+
import { BrepError } from './errors.js';
|
|
3
|
+
import { Result } from './result.js';
|
|
2
4
|
/** Any object that can be cleaned up by calling `delete()` (OCCT WASM objects). */
|
|
3
5
|
export interface Deletable {
|
|
4
6
|
delete: () => void;
|
|
@@ -40,10 +42,49 @@ export declare function withScope<T>(fn: (scope: DisposalScope) => T): T;
|
|
|
40
42
|
export declare function registerForCleanup(owner: object, deletable: Deletable): void;
|
|
41
43
|
/** Unregister a previously-registered deletable (call before manual delete). */
|
|
42
44
|
export declare function unregisterFromCleanup(deletable: Deletable): void;
|
|
43
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use `using scope = new DisposalScope()` + `scope.register()` instead.
|
|
47
|
+
* DisposalScope provides deterministic cleanup on all exit paths including throws.
|
|
48
|
+
* @see DisposalScope
|
|
49
|
+
*/
|
|
44
50
|
export declare function gcWithScope(): <T extends Deletable>(value: T) => T;
|
|
45
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use `using scope = new DisposalScope()` + `scope.register()` instead.
|
|
53
|
+
* DisposalScope provides deterministic cleanup on all exit paths including throws.
|
|
54
|
+
* @see DisposalScope
|
|
55
|
+
*/
|
|
46
56
|
export declare function gcWithObject(obj: object): <T extends Deletable>(value: T) => T;
|
|
47
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Use `using scope = new DisposalScope()` + `scope.register()` instead.
|
|
59
|
+
* DisposalScope provides deterministic cleanup on all exit paths including throws.
|
|
60
|
+
* @see DisposalScope
|
|
61
|
+
*/
|
|
48
62
|
export declare function localGC(debug?: boolean): [<T extends Deletable>(v: T) => T, () => void, Set<Deletable> | undefined];
|
|
63
|
+
/**
|
|
64
|
+
* Run fn inside a DisposalScope. The scope is disposed on all exit paths:
|
|
65
|
+
* Ok return, Err return, and throw. Use in any function that allocates
|
|
66
|
+
* OCCT objects and returns Result<T>.
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* return withScopeResult((scope) => {
|
|
70
|
+
* const axis = scope.register(makeOcAx1(origin, dir));
|
|
71
|
+
* return ok(castShape(getKernel().makeSomething(axis)) as Solid);
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function withScopeResult<T, E = BrepError>(fn: (scope: DisposalScope) => Result<T, E>): Result<T, E>;
|
|
76
|
+
/**
|
|
77
|
+
* Async variant of withScopeResult. The scope is disposed after the
|
|
78
|
+
* returned promise settles (resolved or rejected).
|
|
79
|
+
*/
|
|
80
|
+
export declare function withScopeResultAsync<T, E = BrepError>(fn: (scope: DisposalScope) => Promise<Result<T, E>>): Promise<Result<T, E>>;
|
|
81
|
+
/**
|
|
82
|
+
* Returns true if the handle has not been disposed.
|
|
83
|
+
* Provides a named alternative to checking `.disposed` directly.
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* if (!isLive(handle)) return err(validationError('DISPOSED_HANDLE', '...'));
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function isLive(handle: ShapeHandle | OcHandle<Deletable>): boolean;
|
|
49
90
|
//# sourceMappingURL=disposal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposal.d.ts","sourceRoot":"","sources":["../../src/core/disposal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"disposal.d.ts","sourceRoot":"","sources":["../../src/core/disposal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,mFAAmF;AACnF,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAqCD,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,uCAAuC;IACvC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IAEzB,iFAAiF;IACjF,MAAM,IAAI,IAAI,CAAC;IAEf,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAoC1D;AAMD,gDAAgD;AAChD,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,SAAS;IAC3C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CA4BzE;AAMD,wDAAw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,GACzC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAGd;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,EACzD,EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAGvB;AAMD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,CAEzE"}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export declare const BrepErrorCode: {
|
|
|
76
76
|
readonly PARAMETER_NOT_FOUND: "PARAMETER_NOT_FOUND";
|
|
77
77
|
readonly INTERSECTION_FAILED: "INTERSECTION_FAILED";
|
|
78
78
|
readonly SELF_INTERSECTION_FAILED: "SELF_INTERSECTION_FAILED";
|
|
79
|
+
readonly COMPOUND_NO_FACES: "COMPOUND_NO_FACES";
|
|
80
|
+
readonly COMPOUND_FACE_NOT_FOUND: "COMPOUND_FACE_NOT_FOUND";
|
|
79
81
|
readonly FINDER_NOT_UNIQUE: "FINDER_NOT_UNIQUE";
|
|
80
82
|
readonly HULL_EMPTY_INPUT: "HULL_EMPTY_INPUT";
|
|
81
83
|
readonly HULL_FAILED: "HULL_FAILED";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,IAAI,GACJ,OAAO,CAAC;AA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M,EAAE,OAAO,CAAC,EAClC,UAAU,CAAC,EAAE,MAAM,GAClB,SAAS,CAEX;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,UAAU,CAAC,EAAE,MAAM,GAClB,SAAS,CAEX;AAyED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQ9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometryHelpers.d.ts","sourceRoot":"","sources":["../../src/core/geometryHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;;;;;;;;;GAUG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;AACxC,iBAAS,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,EACpC,MAAM,CAAC,EAAE,UAAU,GAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"geometryHelpers.d.ts","sourceRoot":"","sources":["../../src/core/geometryHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;;;;;;;;;GAUG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;AACxC,iBAAS,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,EACpC,MAAM,CAAC,EAAE,UAAU,GAClB,MAAM,CAyCR"}
|
|
@@ -2,6 +2,7 @@ import { OcShape } from '../kernel/types.js';
|
|
|
2
2
|
import { AnyShape } from './shapeTypes.js';
|
|
3
3
|
import { Result } from './result.js';
|
|
4
4
|
import { BrepErrorKind } from './errors.js';
|
|
5
|
+
import { DisposalScope } from './disposal.js';
|
|
5
6
|
/**
|
|
6
7
|
* Wrap a kernel call that returns an OcShape, automatically casting
|
|
7
8
|
* the result into a branded AnyShape. On exception, returns an Err
|
|
@@ -19,4 +20,23 @@ export declare function kernelCall(fn: () => OcShape, code: string, message: str
|
|
|
19
20
|
* explanations when the error kind is OCCT_OPERATION.
|
|
20
21
|
*/
|
|
21
22
|
export declare function kernelCallRaw<T>(fn: () => T, code: string, message: string, kind?: BrepErrorKind): Result<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Wrap a kernel call that needs intermediate OCCT allocations.
|
|
25
|
+
*
|
|
26
|
+
* A DisposalScope is created and passed to fn. The scope is disposed
|
|
27
|
+
* deterministically after fn returns or throws — ensuring no intermediate
|
|
28
|
+
* handles are leaked even on error paths.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* return kernelCallScoped(
|
|
32
|
+
* (scope) => {
|
|
33
|
+
* const axis = scope.register(makeOcAx1(origin, dir));
|
|
34
|
+
* return getKernel().oc.BRepBuilderAPI_MakeRevol_1(shape.wrapped, axis).Shape();
|
|
35
|
+
* },
|
|
36
|
+
* BrepErrorCode.REVOLUTION_NOT_3D,
|
|
37
|
+
* 'Revolution failed'
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function kernelCallScoped(fn: (scope: DisposalScope) => OcShape, code: string, message: string, kind?: BrepErrorKind): Result<AnyShape>;
|
|
22
42
|
//# sourceMappingURL=kernelCall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelCall.d.ts","sourceRoot":"","sources":["../../src/core/kernelCall.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kernelCall.d.ts","sourceRoot":"","sources":["../../src/core/kernelCall.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAe9C;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,OAAO,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,aAAgC,GACrC,MAAM,CAAC,QAAQ,CAAC,CASlB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,EAAE,EAAE,MAAM,CAAC,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,aAAgC,GACrC,MAAM,CAAC,CAAC,CAAC,CASX;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,EACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,aAAgC,GACrC,MAAM,CAAC,QAAQ,CAAC,CAGlB"}
|
package/dist/core/memory.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Memory management utilities — re-export hub for disposal.ts.
|
|
3
3
|
*/
|
|
4
4
|
export type { Deletable } from './disposal.js';
|
|
5
|
-
export { createHandle, createOcHandle, DisposalScope, withScope, gcWithScope, gcWithObject, localGC, registerForCleanup, unregisterFromCleanup, type ShapeHandle, type OcHandle, } from './disposal.js';
|
|
5
|
+
export { createHandle, createOcHandle, DisposalScope, withScope, withScopeResult, withScopeResultAsync, isLive, gcWithScope, gcWithObject, localGC, registerForCleanup, unregisterFromCleanup, type ShapeHandle, type OcHandle, } from './disposal.js';
|
|
6
6
|
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/core/memory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,WAAW,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/core/memory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,MAAM,EAEN,WAAW,EAEX,YAAY,EAEZ,OAAO,EACP,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,GACd,MAAM,eAAe,CAAC"}
|
package/dist/core.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const errors = require("./errors-
|
|
6
|
-
const vectors = require("./vectors-
|
|
7
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
6
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
7
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
8
8
|
const result = require("./result.cjs");
|
|
9
9
|
exports.resolveDirection = occtBoundary.resolveDirection;
|
|
10
10
|
exports.toVec2 = occtBoundary.toVec2;
|
|
@@ -66,6 +66,7 @@ exports.getShapeKind = shapeTypes.getShapeKind;
|
|
|
66
66
|
exports.isCompound = shapeTypes.isCompound;
|
|
67
67
|
exports.isEdge = shapeTypes.isEdge;
|
|
68
68
|
exports.isFace = shapeTypes.isFace;
|
|
69
|
+
exports.isLive = shapeTypes.isLive;
|
|
69
70
|
exports.isShape1D = shapeTypes.isShape1D;
|
|
70
71
|
exports.isShape3D = shapeTypes.isShape3D;
|
|
71
72
|
exports.isShell = shapeTypes.isShell;
|
|
@@ -73,5 +74,7 @@ exports.isSolid = shapeTypes.isSolid;
|
|
|
73
74
|
exports.isVertex = shapeTypes.isVertex;
|
|
74
75
|
exports.isWire = shapeTypes.isWire;
|
|
75
76
|
exports.withScope = shapeTypes.withScope;
|
|
77
|
+
exports.withScopeResult = shapeTypes.withScopeResult;
|
|
78
|
+
exports.withScopeResultAsync = shapeTypes.withScopeResultAsync;
|
|
76
79
|
exports.BrepBugError = result.BrepBugError;
|
|
77
80
|
exports.bug = result.bug;
|
package/dist/core.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export { createPlane, createNamedPlane, resolvePlane, translatePlane, pivotPlane
|
|
|
13
13
|
export type { ShapeKind, Vertex, Edge, Wire, Face, Shell, Solid, CompSolid, Compound, AnyShape, Shape1D, Shape3D, } from './core/shapeTypes.js';
|
|
14
14
|
export { castShape, getShapeKind, isVertex, isEdge, isWire, isFace, isShell, isSolid, isCompound, isShape3D, isShape1D, } from './core/shapeTypes.js';
|
|
15
15
|
export type { ShapeHandle, OcHandle } from './core/disposal.js';
|
|
16
|
-
export { createHandle, createOcHandle, DisposalScope, withScope } from './core/disposal.js';
|
|
16
|
+
export { createHandle, createOcHandle, DisposalScope, withScope, withScopeResult, withScopeResultAsync, isLive, } from './core/disposal.js';
|
|
17
17
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,SA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ACV,SAAS,EACT,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,GACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,MAAM,GACP,MAAM,oBAAoB,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r, t, a } from "./occtBoundary-
|
|
1
|
+
import { r, t, a } from "./occtBoundary-Ct0tN8cs.js";
|
|
2
2
|
import { D, H, R, v, a as a2, b, c, d, e, f, g, h, i, j, k, l, m, n, o } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { O, a as a3, c as c2, b as b2, e as e2, f as f2, i as i2, d as d2, g as g2, m as m2, h as h2, j as j2, k as k2, o as o2, l as l2, q, s, t as t2, n as n2, p, u, r as r2, v as v2, w, x } from "./errors-
|
|
4
|
-
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-
|
|
5
|
-
import { D as D2, c as c4, a as a5, b as b3, g as g3, i as i3, d as d3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, w as w2 } from "./shapeTypes-
|
|
3
|
+
import { O, a as a3, c as c2, b as b2, e as e2, f as f2, i as i2, d as d2, g as g2, m as m2, h as h2, j as j2, k as k2, o as o2, l as l2, q, s, t as t2, n as n2, p, u, r as r2, v as v2, w, x } from "./errors-CHfaHQSt.js";
|
|
4
|
+
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-Dp5Iu1KH.js";
|
|
5
|
+
import { D as D2, c as c4, a as a5, b as b3, g as g3, i as i3, d as d3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, n as n3, w as w2, o as o3, p as p3 } from "./shapeTypes-D34s68Xi.js";
|
|
6
6
|
import { BrepBugError, bug } from "./result.js";
|
|
7
7
|
export {
|
|
8
8
|
BrepBugError,
|
|
@@ -28,13 +28,14 @@ export {
|
|
|
28
28
|
d3 as isEdge,
|
|
29
29
|
d2 as isErr,
|
|
30
30
|
e3 as isFace,
|
|
31
|
+
f3 as isLive,
|
|
31
32
|
g2 as isOk,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
h3 as isShape1D,
|
|
34
|
+
j3 as isShape3D,
|
|
35
|
+
k3 as isShell,
|
|
36
|
+
l3 as isSolid,
|
|
37
|
+
m3 as isVertex,
|
|
38
|
+
n3 as isWire,
|
|
38
39
|
m2 as map,
|
|
39
40
|
h2 as mapErr,
|
|
40
41
|
j2 as match,
|
|
@@ -73,5 +74,7 @@ export {
|
|
|
73
74
|
m as vecRotate,
|
|
74
75
|
n as vecScale,
|
|
75
76
|
o as vecSub,
|
|
76
|
-
w2 as withScope
|
|
77
|
+
w2 as withScope,
|
|
78
|
+
o3 as withScopeResult,
|
|
79
|
+
p3 as withScopeResultAsync
|
|
77
80
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-
|
|
1
|
+
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-zsENdJlc.js";
|
|
2
2
|
import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
3
3
|
const PI_2 = 2 * Math.PI;
|
|
4
4
|
function positiveHalfAngle(angle) {
|
|
@@ -1,7 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
3
|
+
var __typeError = (msg) => {
|
|
4
|
+
throw TypeError(msg);
|
|
5
|
+
};
|
|
6
|
+
var __using = (stack, value, async) => {
|
|
7
|
+
if (value != null) {
|
|
8
|
+
if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected");
|
|
9
|
+
var dispose, inner;
|
|
10
|
+
if (async) dispose = value[__knownSymbol("asyncDispose")];
|
|
11
|
+
if (dispose === void 0) {
|
|
12
|
+
dispose = value[__knownSymbol("dispose")];
|
|
13
|
+
if (async) inner = dispose;
|
|
14
|
+
}
|
|
15
|
+
if (typeof dispose !== "function") __typeError("Object not disposable");
|
|
16
|
+
if (inner) dispose = function() {
|
|
17
|
+
try {
|
|
18
|
+
inner.call(this);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return Promise.reject(e);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
stack.push([async, dispose, value]);
|
|
24
|
+
} else if (async) {
|
|
25
|
+
stack.push([async]);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
};
|
|
29
|
+
var __callDispose = (stack, error, hasError) => {
|
|
30
|
+
var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
31
|
+
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
32
|
+
};
|
|
33
|
+
var fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e);
|
|
34
|
+
var next = (it) => {
|
|
35
|
+
while (it = stack.pop()) {
|
|
36
|
+
try {
|
|
37
|
+
var result = it[1] && it[1].call(it[2]);
|
|
38
|
+
if (it[0]) return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
fail(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (hasError) throw error;
|
|
44
|
+
};
|
|
45
|
+
return next();
|
|
46
|
+
};
|
|
47
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
48
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
49
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
5
50
|
let CURVE_TYPES_MAP = null;
|
|
6
51
|
const getCurveTypesMap = (refresh) => {
|
|
7
52
|
if (CURVE_TYPES_MAP && !refresh) return CURVE_TYPES_MAP;
|
|
@@ -41,55 +86,111 @@ function mapParam(adaptor, t) {
|
|
|
41
86
|
return first + (last - first) * t;
|
|
42
87
|
}
|
|
43
88
|
function getCurveType(shape) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
89
|
+
var _stack = [];
|
|
90
|
+
try {
|
|
91
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
92
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
93
|
+
const technicalType = adaptor.GetType && adaptor.GetType();
|
|
94
|
+
return errors.unwrap(findCurveType(technicalType));
|
|
95
|
+
} catch (_) {
|
|
96
|
+
var _error = _, _hasError = true;
|
|
97
|
+
} finally {
|
|
98
|
+
__callDispose(_stack, _error, _hasError);
|
|
99
|
+
}
|
|
48
100
|
}
|
|
49
101
|
function curveStartPoint(shape) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
102
|
+
var _stack = [];
|
|
103
|
+
try {
|
|
104
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
105
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
106
|
+
const pnt = scope.register(adaptor.Value(adaptor.FirstParameter()));
|
|
107
|
+
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
108
|
+
} catch (_) {
|
|
109
|
+
var _error = _, _hasError = true;
|
|
110
|
+
} finally {
|
|
111
|
+
__callDispose(_stack, _error, _hasError);
|
|
112
|
+
}
|
|
54
113
|
}
|
|
55
114
|
function curveEndPoint(shape) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
115
|
+
var _stack = [];
|
|
116
|
+
try {
|
|
117
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
118
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
119
|
+
const pnt = scope.register(adaptor.Value(adaptor.LastParameter()));
|
|
120
|
+
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
121
|
+
} catch (_) {
|
|
122
|
+
var _error = _, _hasError = true;
|
|
123
|
+
} finally {
|
|
124
|
+
__callDispose(_stack, _error, _hasError);
|
|
125
|
+
}
|
|
60
126
|
}
|
|
61
127
|
function curvePointAt(shape, position = 0.5) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
128
|
+
var _stack = [];
|
|
129
|
+
try {
|
|
130
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
131
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
132
|
+
const pnt = scope.register(adaptor.Value(mapParam(adaptor, position)));
|
|
133
|
+
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
134
|
+
} catch (_) {
|
|
135
|
+
var _error = _, _hasError = true;
|
|
136
|
+
} finally {
|
|
137
|
+
__callDispose(_stack, _error, _hasError);
|
|
138
|
+
}
|
|
66
139
|
}
|
|
67
140
|
function curveTangentAt(shape, position = 0.5) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
141
|
+
var _stack = [];
|
|
142
|
+
try {
|
|
143
|
+
const oc = occtBoundary.getKernel().oc;
|
|
144
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
145
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
146
|
+
const param = mapParam(adaptor, position);
|
|
147
|
+
const tmpPnt = scope.register(new oc.gp_Pnt_1());
|
|
148
|
+
const tmpVec = scope.register(new oc.gp_Vec_1());
|
|
149
|
+
adaptor.D1(param, tmpPnt, tmpVec);
|
|
150
|
+
return [tmpVec.X(), tmpVec.Y(), tmpVec.Z()];
|
|
151
|
+
} catch (_) {
|
|
152
|
+
var _error = _, _hasError = true;
|
|
153
|
+
} finally {
|
|
154
|
+
__callDispose(_stack, _error, _hasError);
|
|
155
|
+
}
|
|
76
156
|
}
|
|
77
157
|
function curveLength(shape) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
158
|
+
var _stack = [];
|
|
159
|
+
try {
|
|
160
|
+
const oc = occtBoundary.getKernel().oc;
|
|
161
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
162
|
+
const props = scope.register(new oc.GProp_GProps_1());
|
|
163
|
+
oc.BRepGProp.LinearProperties(shape.wrapped, props, true, false);
|
|
164
|
+
return props.Mass();
|
|
165
|
+
} catch (_) {
|
|
166
|
+
var _error = _, _hasError = true;
|
|
167
|
+
} finally {
|
|
168
|
+
__callDispose(_stack, _error, _hasError);
|
|
169
|
+
}
|
|
83
170
|
}
|
|
84
171
|
function curveIsClosed(shape) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
172
|
+
var _stack = [];
|
|
173
|
+
try {
|
|
174
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
175
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
176
|
+
return adaptor.IsClosed();
|
|
177
|
+
} catch (_) {
|
|
178
|
+
var _error = _, _hasError = true;
|
|
179
|
+
} finally {
|
|
180
|
+
__callDispose(_stack, _error, _hasError);
|
|
181
|
+
}
|
|
88
182
|
}
|
|
89
183
|
function curveIsPeriodic(shape) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
184
|
+
var _stack = [];
|
|
185
|
+
try {
|
|
186
|
+
const scope = __using(_stack, new shapeTypes.DisposalScope());
|
|
187
|
+
const adaptor = scope.register(getAdaptor(shape));
|
|
188
|
+
return adaptor.IsPeriodic();
|
|
189
|
+
} catch (_) {
|
|
190
|
+
var _error = _, _hasError = true;
|
|
191
|
+
} finally {
|
|
192
|
+
__callDispose(_stack, _error, _hasError);
|
|
193
|
+
}
|
|
93
194
|
}
|
|
94
195
|
function curvePeriod(shape) {
|
|
95
196
|
const adaptor = getAdaptor(shape);
|