brepjs 18.107.0 → 18.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{blueprint-D5ArjKiA.cjs → blueprint-BwkD2qeC.cjs} +5 -5
- package/dist/{blueprint-CF12Nceg.js → blueprint-Dw0QqImu.js} +5 -5
- package/dist/{blueprintFns-CcCfkbyd.cjs → blueprintFns-B-aybpEo.cjs} +2 -2
- package/dist/{blueprintFns-BuPAK4OB.js → blueprintFns-BowWsZgJ.js} +2 -2
- package/dist/{blueprintSketcher-CEQ8s7TD.js → blueprintSketcher-7rtwqUHZ.js} +3 -3
- package/dist/{blueprintSketcher-DCttG3KS.cjs → blueprintSketcher-RK-cH6ps.cjs} +3 -3
- package/dist/{boolean2D-BCqDjg0y.cjs → boolean2D-CZUEOoAh.cjs} +4 -4
- package/dist/{boolean2D-8rB2sUzj.js → boolean2D-y0SSZfe2.js} +4 -4
- package/dist/brepjs.cjs +111 -27
- package/dist/brepjs.js +111 -27
- package/dist/{cameraFns-Bu6jgTKc.js → cameraFns-bk9e0F-T.js} +2 -2
- package/dist/{cameraFns-S7YbAxfg.cjs → cameraFns-uo1sZbBT.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-Ci2NbbAW.cjs → cornerFinder-B4q88TRb.cjs} +1 -1
- package/dist/{cornerFinder-COqoeY--.js → cornerFinder-DUGeBIvD.js} +1 -1
- package/dist/csg/evaluate.d.ts +25 -0
- package/dist/{curveFns-CG05Jygr.js → curveFns-CcSn4-Rf.js} +1 -1
- package/dist/{curveFns-Dx7_wMut.cjs → curveFns-DgUJpH4z.cjs} +1 -1
- package/dist/{drawFns-DYkjT_hx.cjs → drawFns-DNxs7PAT.cjs} +12 -12
- package/dist/{drawFns-CsXPFyDe.js → drawFns-SQIBls6p.js} +12 -12
- package/dist/{faceFns-mo4ThIHz.js → faceFns-B86WGqDg.js} +2 -2
- package/dist/{faceFns-DKg2St8b.cjs → faceFns-BV0GnTlt.cjs} +2 -2
- package/dist/{healingFns-OL0bBSSY.cjs → healingFns-C4UE1ZyM.cjs} +5 -5
- package/dist/{healingFns-C5AomW4j.js → healingFns-CPm_VFck.js} +5 -5
- package/dist/{helpers-8zxf2gkc.cjs → helpers-BSLPCflF.cjs} +6 -6
- package/dist/{helpers-DT44wBAD.js → helpers-DhJwFrkC.js} +6 -6
- package/dist/{importFns-B6hw9Nhx.cjs → importFns-CgMQIi0z.cjs} +2 -2
- package/dist/{importFns-CEczwPdN.js → importFns-nR9lEx22.js} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/transformOps.d.ts +1 -0
- package/dist/kernel/interfaces/transformOps.d.ts +10 -0
- package/dist/kernel/occt/transformOps.d.ts +8 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +1 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +7 -0
- package/dist/kernel/occtWasm/transformOps.d.ts +7 -0
- package/dist/{loftFns-DyNuD9XL.js → loftFns-CmShFQlv.js} +1 -1
- package/dist/{loftFns-DaRDYpfB.cjs → loftFns-fpTmrIdd.cjs} +1 -1
- package/dist/{measureFns-Q2dnokUU.cjs → measureFns-DblG0Yaz.cjs} +3 -3
- package/dist/{measureFns-Dkh_DmrE.js → measureFns-a5Vx25or.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BgF4Xesg.cjs → meshFns-1hQSn1p2.cjs} +9 -3
- package/dist/{meshFns-BvP9Tm5Q.js → meshFns-DbmidUzH.js} +4 -4
- package/dist/{occtWasmAdapter-DDZELjlB.cjs → occtWasmAdapter-B2TEQOjs.cjs} +38 -10
- package/dist/{occtWasmAdapter-BDEPveZs.js → occtWasmAdapter-CKwtxwNH.js} +38 -10
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-62SO4ti5.js → primitiveFns-CBrOyk5S.js} +4 -4
- package/dist/{primitiveFns-BAWtMd9H.cjs → primitiveFns-DLIWtQWA.cjs} +4 -4
- 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/{shapeFns-DyBbhU30.js → shapeFns-DrZOVwHX.js} +44 -4
- package/dist/{shapeFns-L4a8kH_A.cjs → shapeFns-ybo0INGL.cjs} +55 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-Dij41NuC.cjs → shapeRefFns--2FPCL7P.cjs} +4 -4
- package/dist/{shapeRefFns-Cn4WNb3q.js → shapeRefFns-C1DefNzr.js} +4 -4
- package/dist/{shapeTypes-Bwgm5N6R.cjs → shapeTypes-BTTwjHy5.cjs} +18 -1
- package/dist/{shapeTypes-C4lPfrc2.js → shapeTypes-Dpu6mD3m.js} +18 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-Biwv2cW3.js → solidBuilders-C32wXQWG.js} +5 -5
- package/dist/{solidBuilders-CgRmJEdn.cjs → solidBuilders-DiUv_mD0.cjs} +5 -5
- package/dist/{surfaceBuilders-FLnYYA70.cjs → surfaceBuilders-UyyfZy8w.cjs} +2 -2
- package/dist/{surfaceBuilders-Bww4jhBo.js → surfaceBuilders-rkE-jE90.js} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-CEzTC9vX.js → textBlueprints-BnkWAqwS.js} +7 -7
- package/dist/{textBlueprints-08NcMO9T.cjs → textBlueprints-D5lsZswr.cjs} +7 -7
- package/dist/{textMetrics-CBbDQ5QW.js → textMetrics-COGYk0LE.js} +1 -1
- package/dist/{textMetrics-W-H6jUDj.cjs → textMetrics-IC_IoI7l.cjs} +1 -1
- package/dist/{threadFns-DGYdomjN.cjs → threadFns-C8bErjVC.cjs} +6 -6
- package/dist/{threadFns-8rKpQXiR.js → threadFns-bCOhVQLb.js} +6 -6
- package/dist/topology/metadata/metadataPropagation.d.ts +21 -0
- package/dist/topology.cjs +8 -8
- package/dist/topology.js +8 -8
- package/dist/{topologyQueryFns-Do8E4EXj.js → topologyQueryFns-BeKaWpNm.js} +1 -1
- package/dist/{topologyQueryFns-ygBBXxnP.cjs → topologyQueryFns-CoXVHuN7.cjs} +1 -1
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-
|
|
1
|
+
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, B as unwrapOr, E as map, I as tryCatch, L as tryCatchAsync, O as mapErr, R as unwrap, T as isOk, V as unwrapOrElse, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
4
4
|
import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-D24Y27N0.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
2
2
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
3
|
-
const require_helpers = require("./helpers-
|
|
3
|
+
const require_helpers = require("./helpers-BSLPCflF.cjs");
|
|
4
4
|
//#region src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
2
2
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
3
|
-
import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-
|
|
3
|
+
import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-DhJwFrkC.js";
|
|
4
4
|
//#region src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
package/dist/csg/evaluate.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Result } from '../core/result.js';
|
|
2
2
|
import { AnyShape, Dimension } from '../core/shapeTypes.js';
|
|
3
|
+
import { ShapeMesh, MeshOptions } from '../topology/meshFns.js';
|
|
3
4
|
import { Env } from './expressions.js';
|
|
4
5
|
import { IRNode } from './types.js';
|
|
5
6
|
export interface EvaluatorOptions {
|
|
@@ -21,6 +22,14 @@ export interface EvaluatorOptions {
|
|
|
21
22
|
* (calling it from an onStep callback throws). Must be a positive integer.
|
|
22
23
|
*/
|
|
23
24
|
readonly maxCacheEntries?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Upper bound on entries in the {@link Evaluator.evaluateMesh} content cache,
|
|
27
|
+
* which is independent of the shape cache. Defaults to unbounded. Bounding it
|
|
28
|
+
* separately is what lets a mesh outlive its (evicted) kernel shape, so a
|
|
29
|
+
* re-`evaluateMesh` is a pure data hit with no re-materialization. Must be a
|
|
30
|
+
* positive integer.
|
|
31
|
+
*/
|
|
32
|
+
readonly maxMeshCacheEntries?: number | undefined;
|
|
24
33
|
}
|
|
25
34
|
export interface StepInfo {
|
|
26
35
|
readonly node: IRNode;
|
|
@@ -42,6 +51,8 @@ export declare class Evaluator implements Disposable {
|
|
|
42
51
|
private readonly kernelId;
|
|
43
52
|
private readonly defaultTolerance;
|
|
44
53
|
private readonly maxCacheEntries;
|
|
54
|
+
private readonly maxMeshCacheEntries;
|
|
55
|
+
private readonly meshCache;
|
|
45
56
|
private readonly onStep?;
|
|
46
57
|
private hits;
|
|
47
58
|
private misses;
|
|
@@ -58,9 +69,23 @@ export declare class Evaluator implements Disposable {
|
|
|
58
69
|
* throws.
|
|
59
70
|
*/
|
|
60
71
|
evaluate(node: IRNode, env?: Env): Result<AnyShape<Dimension>>;
|
|
72
|
+
/**
|
|
73
|
+
* Materialize a node and mesh it, caching the mesh by the shape's content key
|
|
74
|
+
* plus the mesh parameters. The mesh cache is independent of the shape cache:
|
|
75
|
+
* a hit returns the cached mesh without evaluating or meshing — even after the
|
|
76
|
+
* shape was LRU-evicted (a mesh is plain data, not a kernel handle). The
|
|
77
|
+
* returned mesh is borrowed (do not mutate it); it stays valid for the
|
|
78
|
+
* Evaluator's lifetime, or until `maxMeshCacheEntries` evicts it.
|
|
79
|
+
*/
|
|
80
|
+
evaluateMesh(node: IRNode, env?: Env, meshOpts?: MeshOptions & {
|
|
81
|
+
skipNormals?: boolean;
|
|
82
|
+
includeUVs?: boolean;
|
|
83
|
+
cache?: boolean;
|
|
84
|
+
}): Result<ShapeMesh>;
|
|
61
85
|
private evaluateInner;
|
|
62
86
|
private releaseShape;
|
|
63
87
|
private trimCache;
|
|
88
|
+
private trimMeshCache;
|
|
64
89
|
private rollbackPending;
|
|
65
90
|
cacheStats(): CacheStats;
|
|
66
91
|
resetStats(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
|
|
3
3
|
//#region src/topology/curveFns.ts
|
|
4
4
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_textBlueprints = require("./textBlueprints-D5lsZswr.cjs");
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
3
3
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
4
4
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
5
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
5
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
6
6
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
7
7
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
8
8
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
9
9
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
10
|
-
const require_faceFns = require("./faceFns-
|
|
11
|
-
const require_curveFns = require("./curveFns-
|
|
10
|
+
const require_faceFns = require("./faceFns-BV0GnTlt.cjs");
|
|
11
|
+
const require_curveFns = require("./curveFns-DgUJpH4z.cjs");
|
|
12
12
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
13
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
14
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
15
|
-
const require_helpers = require("./helpers-
|
|
16
|
-
const require_blueprint = require("./blueprint-
|
|
17
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
18
|
-
const require_boolean2D = require("./boolean2D-
|
|
19
|
-
const require_cameraFns = require("./cameraFns-
|
|
13
|
+
const require_surfaceBuilders = require("./surfaceBuilders-UyyfZy8w.cjs");
|
|
14
|
+
const require_blueprintSketcher = require("./blueprintSketcher-RK-cH6ps.cjs");
|
|
15
|
+
const require_helpers = require("./helpers-BSLPCflF.cjs");
|
|
16
|
+
const require_blueprint = require("./blueprint-BwkD2qeC.cjs");
|
|
17
|
+
const require_cornerFinder = require("./cornerFinder-B4q88TRb.cjs");
|
|
18
|
+
const require_boolean2D = require("./boolean2D-CZUEOoAh.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-uo1sZbBT.cjs");
|
|
20
20
|
//#region src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-
|
|
1
|
+
import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
|
|
4
|
-
import { s as getEdges } from "./topologyQueryFns-
|
|
4
|
+
import { s as getEdges } from "./topologyQueryFns-BeKaWpNm.js";
|
|
5
5
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
6
6
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
7
7
|
import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-SKPRvPH-.js";
|
|
8
8
|
import { a as planeToWorld, o as resolvePlane } from "./planeOps-DSjjtrjg.js";
|
|
9
|
-
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as downcast } from "./faceFns-
|
|
10
|
-
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-
|
|
9
|
+
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as downcast } from "./faceFns-B86WGqDg.js";
|
|
10
|
+
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-CcSn4-Rf.js";
|
|
11
11
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
12
|
-
import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-
|
|
13
|
-
import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-
|
|
14
|
-
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-
|
|
15
|
-
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-
|
|
16
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
17
|
-
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-
|
|
18
|
-
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-
|
|
19
|
-
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-
|
|
12
|
+
import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-rkE-jE90.js";
|
|
13
|
+
import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-7rtwqUHZ.js";
|
|
14
|
+
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-DhJwFrkC.js";
|
|
15
|
+
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-Dw0QqImu.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-DUGeBIvD.js";
|
|
17
|
+
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-y0SSZfe2.js";
|
|
18
|
+
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-BnkWAqwS.js";
|
|
19
|
+
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-bk9e0F-T.js";
|
|
20
20
|
//#region src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-BeKaWpNm.js";
|
|
4
4
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_shapeFns = require("./shapeFns-
|
|
5
|
+
const require_faceFns = require("./faceFns-BV0GnTlt.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-ybo0INGL.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
8
|
+
const require_solidBuilders = require("./solidBuilders-DiUv_mD0.cjs");
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BeKaWpNm.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { v as downcast } from "./faceFns-
|
|
6
|
-
import {
|
|
5
|
+
import { v as downcast } from "./faceFns-B86WGqDg.js";
|
|
6
|
+
import { g as collectInputFaceHashes, v as propagateAllMetadata } from "./shapeFns-DrZOVwHX.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
|
-
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-
|
|
8
|
+
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-C32wXQWG.js";
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_faceFns = require("./faceFns-BV0GnTlt.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-ybo0INGL.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-DgUJpH4z.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-DblG0Yaz.cjs");
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Z as getKernel, p as isFace } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, p as isFace } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-BeKaWpNm.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
|
|
6
|
-
import { l as normalAt, s as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { l as normalAt, s as getSurfaceType } from "./faceFns-B86WGqDg.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-DrZOVwHX.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CcSn4-Rf.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-a5Vx25or.js";
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-BwkD2qeC.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At$1 } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-Dw0QqImu.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-1hQSn1p2.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-CgMQIi0z.cjs");
|
|
4
4
|
exports.blueprintToDXF = require_importFns.blueprintToDXF;
|
|
5
5
|
exports.exportDXF = require_importFns.exportDXF;
|
|
6
6
|
exports.exportGlb = require_importFns.exportGlb;
|
package/dist/io.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-
|
|
2
|
-
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-DbmidUzH.js";
|
|
2
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-nR9lEx22.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -17,6 +17,7 @@ export declare function transformBatch(bk: BrepkitKernel, entries: TransformEntr
|
|
|
17
17
|
/** Co-located factory: returns the transform slice of {@link KernelAdapter} bound to `bk`. */
|
|
18
18
|
export declare function makeTransformOps(bk: BrepkitKernel): {
|
|
19
19
|
transform: (shape: any, trsf: any) => any;
|
|
20
|
+
locate: (shape: any, trsf: any) => any;
|
|
20
21
|
translate: (shape: any, x: number, y: number, z: number) => any;
|
|
21
22
|
rotate: (shape: any, angle: number, axis: readonly [number, number, number] | undefined, center: readonly [number, number, number] | undefined) => any;
|
|
22
23
|
mirror: (shape: any, origin: readonly [number, number, number], normal: readonly [number, number, number]) => any;
|
|
@@ -40,6 +40,16 @@ export interface KernelTransformOps {
|
|
|
40
40
|
dispose: () => void;
|
|
41
41
|
};
|
|
42
42
|
transform(shape: KernelShape, trsf: KernelType): KernelShape;
|
|
43
|
+
/**
|
|
44
|
+
* Apply a rigid transform as a *location re-tag* that shares the source's
|
|
45
|
+
* underlying geometry instead of deep-copying its topology — O(1) vs
|
|
46
|
+
* O(topology size). `trsf` MUST be a rigid motion (rotation + translation,
|
|
47
|
+
* e.g. built from translate/rotate via {@link composeTransform}); non-rigid
|
|
48
|
+
* input (scale/shear) is unsupported. Kernels with no cheap-location concept
|
|
49
|
+
* fall back to a copying {@link transform}: the result is geometrically
|
|
50
|
+
* identical, only the cost differs.
|
|
51
|
+
*/
|
|
52
|
+
locate(shape: KernelShape, trsf: KernelType): KernelShape;
|
|
43
53
|
translate(shape: KernelShape, x: number, y: number, z: number): KernelShape;
|
|
44
54
|
rotate(shape: KernelShape, angle: number, axis?: readonly [number, number, number], center?: readonly [number, number, number]): KernelShape;
|
|
45
55
|
mirror(shape: KernelShape, origin: readonly [number, number, number], normal: readonly [number, number, number]): KernelShape;
|
|
@@ -12,6 +12,13 @@ export declare function transformBatch(oc: KernelInstance, entries: TransformEnt
|
|
|
12
12
|
* Applies a transformation matrix to a shape.
|
|
13
13
|
*/
|
|
14
14
|
export declare function transform(oc: KernelInstance, shape: KernelShape, trsf: KernelType): KernelShape;
|
|
15
|
+
/**
|
|
16
|
+
* Apply a rigid transform as a location re-tag. Passing copy=false makes
|
|
17
|
+
* BRepBuilderAPI_Transform share the source TShape under a new location for a
|
|
18
|
+
* rigid motion, instead of the deep topology copy {@link transform} (copy=true)
|
|
19
|
+
* performs. Use only for rigid `trsf` (rotation + translation).
|
|
20
|
+
*/
|
|
21
|
+
export declare function locate(oc: KernelInstance, shape: KernelShape, trsf: KernelType): KernelShape;
|
|
15
22
|
/**
|
|
16
23
|
* Translates a shape by the given offset.
|
|
17
24
|
*/
|
|
@@ -43,6 +50,7 @@ export declare function simplify(oc: KernelInstance, shape: KernelShape): Kernel
|
|
|
43
50
|
/** Co-located factory: returns the transform slice of {@link KernelAdapter} bound to `oc`. */
|
|
44
51
|
export declare function makeTransformOps(oc: KernelInstance): {
|
|
45
52
|
transform: (shape: any, trsf: any) => any;
|
|
53
|
+
locate: (shape: any, trsf: any) => any;
|
|
46
54
|
translate: (shape: any, x: number, y: number, z: number) => any;
|
|
47
55
|
rotate: (shape: any, angle: number, axis: readonly [number, number, number] | undefined, center: readonly [number, number, number] | undefined) => any;
|
|
48
56
|
mirror: (shape: any, origin: readonly [number, number, number], normal: readonly [number, number, number]) => any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-B2TEQOjs.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -167,6 +167,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
167
167
|
dispose: () => void;
|
|
168
168
|
};
|
|
169
169
|
transform(shape: KernelShape, trsf: KernelType): KernelShape;
|
|
170
|
+
locate(shape: KernelShape, trsf: KernelType): KernelShape;
|
|
170
171
|
translate(shape: KernelShape, x: number, y: number, z: number): KernelShape;
|
|
171
172
|
rotate(shape: KernelShape, angle: number, axis?: readonly [number, number, number], center?: readonly [number, number, number]): KernelShape;
|
|
172
173
|
mirror(shape: KernelShape, origin: readonly [number, number, number], normal: readonly [number, number, number]): KernelShape;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-CKwtxwNH.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -174,6 +174,13 @@ export interface OcctKernelWasm {
|
|
|
174
174
|
mirror(id: number, px: number, py: number, pz: number, nx: number, ny: number, nz: number): number;
|
|
175
175
|
copy(id: number): number;
|
|
176
176
|
transform(id: number, matrix: EmVectorDouble): number;
|
|
177
|
+
/**
|
|
178
|
+
* Cheap location-only move (a `TopLoc_Location` re-tag sharing the source
|
|
179
|
+
* `TShape`). Optional: absent on WASM builds published before this method
|
|
180
|
+
* landed, so callers must feature-detect (`typeof k.located === 'function'`)
|
|
181
|
+
* and fall back to {@link transform}.
|
|
182
|
+
*/
|
|
183
|
+
located?(id: number, matrix: EmVectorDouble): number;
|
|
177
184
|
generalTransform(id: number, matrix: EmVectorDouble): number;
|
|
178
185
|
linearPattern(id: number, dx: number, dy: number, dz: number, spacing: number, count: number): number;
|
|
179
186
|
circularPattern(id: number, cx: number, cy: number, cz: number, ax: number, ay: number, az: number, angle: number, count: number): number;
|
|
@@ -16,6 +16,13 @@ export declare function composeTransform(ops: Array<{
|
|
|
16
16
|
dispose: () => void;
|
|
17
17
|
};
|
|
18
18
|
export declare function transform(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, trsf: KernelType): KernelShape;
|
|
19
|
+
/**
|
|
20
|
+
* Cheap location-only move. Uses the occt-wasm `located` facade method (a
|
|
21
|
+
* `TopLoc_Location` re-tag that shares the source `TShape`) when the loaded
|
|
22
|
+
* WASM build exposes it; builds without `located` fall back to the copying
|
|
23
|
+
* `transform` — same geometry, only the cost differs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function locate(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, trsf: KernelType): KernelShape;
|
|
19
26
|
export declare function translate(k: OcctKernelWasm, shape: KernelShape, x: number, y: number, z: number): KernelShape;
|
|
20
27
|
export declare function rotate(k: OcctKernelWasm, shape: KernelShape, angle: number, axis?: readonly [number, number, number], center?: readonly [number, number, number]): KernelShape;
|
|
21
28
|
export declare function mirror(k: OcctKernelWasm, shape: KernelShape, origin: readonly [number, number, number], normal: readonly [number, number, number]): KernelShape;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-BV0GnTlt.cjs");
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { w as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { w as kernelCallRaw } from "./topologyQueryFns-BeKaWpNm.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-B86WGqDg.js";
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-DblG0Yaz.cjs");
|
|
3
3
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
4
4
|
exports.measureArea = require_measureFns.measureArea;
|
|
5
5
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-a5Vx25or.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BTTwjHy5.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_shapeFns = require("./shapeFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CoXVHuN7.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-ybo0INGL.cjs");
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -424,6 +424,12 @@ async function meshLODsProgressive(shape, options = {}) {
|
|
|
424
424
|
return results;
|
|
425
425
|
}
|
|
426
426
|
//#endregion
|
|
427
|
+
Object.defineProperty(exports, "buildMeshCacheKey", {
|
|
428
|
+
enumerable: true,
|
|
429
|
+
get: function() {
|
|
430
|
+
return buildMeshCacheKey;
|
|
431
|
+
}
|
|
432
|
+
});
|
|
427
433
|
Object.defineProperty(exports, "clearMeshCache", {
|
|
428
434
|
enumerable: true,
|
|
429
435
|
get: function() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, b as err, r as ioError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
4
|
-
import {
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-BeKaWpNm.js";
|
|
4
|
+
import { A as getFaceOrigins } from "./shapeFns-DrZOVwHX.js";
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -424,4 +424,4 @@ async function meshLODsProgressive(shape, options = {}) {
|
|
|
424
424
|
return results;
|
|
425
425
|
}
|
|
426
426
|
//#endregion
|
|
427
|
-
export { meshEdges as a, meshMultiLOD as c, mesh as i,
|
|
427
|
+
export { meshEdges as a, meshMultiLOD as c, createMeshCache as d, mesh as i, buildMeshCacheKey as l, exportSTEP as n, meshLODs as o, exportSTL as r, meshLODsProgressive as s, exportIGES as t, clearMeshCache as u };
|
|
@@ -2741,28 +2741,53 @@ function composeTransform(ops) {
|
|
|
2741
2741
|
dispose: noop
|
|
2742
2742
|
};
|
|
2743
2743
|
}
|
|
2744
|
-
|
|
2744
|
+
/**
|
|
2745
|
+
* Extract a 12-element row-major 3x4 matrix from the trsf representations the
|
|
2746
|
+
* occt-wasm adapter accepts (raw array, `{ matrix }`, `{ elements }`). Returns
|
|
2747
|
+
* undefined when no usable matrix is present.
|
|
2748
|
+
*/
|
|
2749
|
+
function toMatrix12(trsf) {
|
|
2745
2750
|
const t = trsf;
|
|
2746
2751
|
let matrix;
|
|
2747
2752
|
if (Array.isArray(t)) matrix = t;
|
|
2748
|
-
else if (typeof t === "object") {
|
|
2749
|
-
if (Array.isArray(t["matrix"]))
|
|
2750
|
-
|
|
2751
|
-
if (matrix.length === 16) matrix = matrix.slice(0, 12);
|
|
2752
|
-
} else if (Array.isArray(t["elements"])) matrix = t["elements"];
|
|
2753
|
+
else if (t !== null && typeof t === "object") {
|
|
2754
|
+
if (Array.isArray(t["matrix"])) matrix = t["matrix"];
|
|
2755
|
+
else if (Array.isArray(t["elements"])) matrix = t["elements"];
|
|
2753
2756
|
}
|
|
2757
|
+
if (matrix && matrix.length === 16) matrix = matrix.slice(0, 12);
|
|
2758
|
+
return matrix && matrix.length >= 12 ? matrix : void 0;
|
|
2759
|
+
}
|
|
2760
|
+
function transform(k, Module, shape, trsf) {
|
|
2761
|
+
const matrix = toMatrix12(trsf);
|
|
2754
2762
|
if (matrix) {
|
|
2755
|
-
|
|
2756
|
-
|
|
2763
|
+
const vec = makeVecDouble(Module, matrix);
|
|
2764
|
+
try {
|
|
2765
|
+
return wrapResult(k, k.transform(unwrap(shape), vec));
|
|
2766
|
+
} finally {
|
|
2767
|
+
vec.delete();
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
return handle(k.getShapeType(unwrap(shape)), k.copy(unwrap(shape)));
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Cheap location-only move. Uses the occt-wasm `located` facade method (a
|
|
2774
|
+
* `TopLoc_Location` re-tag that shares the source `TShape`) when the loaded
|
|
2775
|
+
* WASM build exposes it; builds without `located` fall back to the copying
|
|
2776
|
+
* `transform` — same geometry, only the cost differs.
|
|
2777
|
+
*/
|
|
2778
|
+
function locate(k, Module, shape, trsf) {
|
|
2779
|
+
if (typeof k.located === "function") {
|
|
2780
|
+
const matrix = toMatrix12(trsf);
|
|
2781
|
+
if (matrix) {
|
|
2757
2782
|
const vec = makeVecDouble(Module, matrix);
|
|
2758
2783
|
try {
|
|
2759
|
-
return wrapResult(k, k.
|
|
2784
|
+
return wrapResult(k, k.located(unwrap(shape), vec));
|
|
2760
2785
|
} finally {
|
|
2761
2786
|
vec.delete();
|
|
2762
2787
|
}
|
|
2763
2788
|
}
|
|
2764
2789
|
}
|
|
2765
|
-
return
|
|
2790
|
+
return transform(k, Module, shape, trsf);
|
|
2766
2791
|
}
|
|
2767
2792
|
function translate(k, shape, x, y, z) {
|
|
2768
2793
|
return wrapResult(k, k.translate(unwrap(shape), x, y, z));
|
|
@@ -4758,6 +4783,9 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
4758
4783
|
transform(shape, trsf) {
|
|
4759
4784
|
return transform(this.k, this.Module, shape, trsf);
|
|
4760
4785
|
}
|
|
4786
|
+
locate(shape, trsf) {
|
|
4787
|
+
return locate(this.k, this.Module, shape, trsf);
|
|
4788
|
+
}
|
|
4761
4789
|
translate(shape, x, y, z) {
|
|
4762
4790
|
return translate(this.k, shape, x, y, z);
|
|
4763
4791
|
}
|