brepjs 20.2.0 → 20.4.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 +7 -7
- package/dist/2d.js +7 -7
- package/dist/{adjacencyFns-DZsPfYIq.cjs → adjacencyFns-1rxgJ6Hw.cjs} +3 -3
- package/dist/{adjacencyFns-k4GWh4n7.js → adjacencyFns-DeyXahej.js} +3 -3
- package/dist/{blueprint-CJuRunkd.cjs → blueprint-Yyoiz-U1.cjs} +7 -7
- package/dist/{blueprint-Dsp4t2ul.js → blueprint-rwJjYPzo.js} +7 -7
- package/dist/{blueprintFns-BRceCeZp.cjs → blueprintFns-Ce6OoPSX.cjs} +3 -3
- package/dist/{blueprintFns-DNyUtopT.js → blueprintFns-Q3Sq-Fse.js} +3 -3
- package/dist/{blueprintSketcher-DRXOTYuD.cjs → blueprintSketcher-CzKbxeTk.cjs} +4 -4
- package/dist/{blueprintSketcher-kV7aFwRS.js → blueprintSketcher-FywUpRiV.js} +4 -4
- package/dist/{boolean2D-DmPqFj_V.cjs → boolean2D-BzZ9iBSn.cjs} +5 -5
- package/dist/{boolean2D-TdJfMS8F.js → boolean2D-D8igCYc9.js} +5 -5
- package/dist/brepjs.cjs +35 -32
- package/dist/brepjs.js +35 -33
- package/dist/{cameraFns-u08iOn7p.js → cameraFns-Cs6v3bWQ.js} +4 -4
- package/dist/{cameraFns-B8Ai6b3Q.cjs → cameraFns-RHCb1F1s.cjs} +4 -4
- package/dist/core/errors.d.ts +3 -0
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-BVUuCBX-.cjs → cornerFinder-Cji_BK-R.cjs} +1 -1
- package/dist/{cornerFinder-DfoRecV-.js → cornerFinder-Dlae8IX5.js} +1 -1
- package/dist/{curveFns-DciWOppG.cjs → curveFns-6-ULFrEB.cjs} +2 -2
- package/dist/{curveFns-D5V4jm7S.js → curveFns-KS1BWGhF.js} +2 -2
- package/dist/{drawFns-BzuxoLHh.js → drawFns-3yRVBDgI.js} +14 -14
- package/dist/{drawFns-DeUXFpjR.cjs → drawFns-Ddlgp9gQ.cjs} +14 -14
- package/dist/{errors-CDSezF9z.js → errors-Zb3jBa0u.js} +3 -0
- package/dist/{errors-gG-7hA7k.cjs → errors-jwhfQJZK.cjs} +3 -0
- package/dist/{faceFns-DhdweJGk.js → faceFns-CTlJC5IY.js} +3 -3
- package/dist/{faceFns-DaXVpMr5.cjs → faceFns-CZeHWke7.cjs} +3 -3
- package/dist/faceRoleFns-CWU1-Pm8.js +37 -0
- package/dist/faceRoleFns-CtH_48MO.cjs +60 -0
- package/dist/{healingFns-HekFOO_s.js → healingFns-Ct3gEMvk.js} +5 -5
- package/dist/{healingFns-C_f03IV6.cjs → healingFns-DwSpJZfg.cjs} +5 -5
- package/dist/{helpers-BWNXoJz0.js → helpers-BN1mVMuZ.js} +7 -7
- package/dist/{helpers-Dh4qTGcQ.cjs → helpers-NRZVshPb.cjs} +7 -7
- package/dist/{importFns-DGnmgb9G.js → importFns-0kHGg-b8.js} +3 -3
- package/dist/{importFns-CKfKRdiq.cjs → importFns-BEi-HsSw.cjs} +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/interfaces/measureOps.d.ts +19 -0
- package/dist/kernel/occtWasm/measureOps.d.ts +2 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +2 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
- package/dist/{loftFns-DE1GYW9g.js → loftFns-B5mq1WDh.js} +2 -2
- package/dist/{loftFns-CI8uJc1D.cjs → loftFns-DL9UsQhd.cjs} +2 -2
- package/dist/{measureFns-BoA-Fmwy.js → measureFns-CyDVZomf.js} +5 -5
- package/dist/{measureFns-B8Yj_BMz.cjs → measureFns-D_GpQw5z.cjs} +16 -4
- package/dist/measurement/measureCache.d.ts +2 -1
- package/dist/measurement/measureTypes.d.ts +9 -0
- package/dist/measurement/principalBoxFns.d.ts +33 -0
- package/dist/measurement.cjs +3 -1
- package/dist/measurement.d.ts +1 -0
- package/dist/measurement.js +3 -2
- package/dist/{meshFns-BT7W4b1c.cjs → meshFns-CAxkaRTm.cjs} +4 -4
- package/dist/{meshFns-o9MnZeir.js → meshFns-COlno8TY.js} +4 -4
- package/dist/ns/measurement.d.ts +1 -0
- package/dist/{occtWasmAdapter-D4I0n537.js → occtWasmAdapter-BX10fyla.js} +21 -0
- package/dist/{occtWasmAdapter-wCKnmevS.cjs → occtWasmAdapter-CA6PmIIj.cjs} +21 -0
- package/dist/operations/extrudeFns.d.ts +4 -0
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-B3-1bBED.cjs → originTrackingFns-CWo6NWHK.cjs} +2 -2
- package/dist/{originTrackingFns-BFmhk_Up.js → originTrackingFns-DiHy5BZC.js} +2 -2
- package/dist/{planeOps-BO6nvRja.js → planeOps-Cxws4Tiu.js} +1 -1
- package/dist/{planeOps-DqGSxcMr.cjs → planeOps-DJuclNxa.cjs} +1 -1
- package/dist/{primitiveFns-DfhjU_X9.js → primitiveFns-CGJzS4MO.js} +5 -5
- package/dist/{primitiveFns-Ke-n8Bib.cjs → primitiveFns-ZV3aMbqG.cjs} +5 -5
- package/dist/principalBoxFns-5FSbxAj-.cjs +212 -0
- package/dist/principalBoxFns-BJgGEoik.js +207 -0
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-C-6Xa_8k.js → refResolveFns-CpVZoeOT.js} +30 -12
- package/dist/{refResolveFns-BPqbBoxy.cjs → refResolveFns-Ct52Uw7R.cjs} +30 -12
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-CUTM2ZDR.js → shapeFns--1wNlcc_.js} +3 -3
- package/dist/{shapeFns-CmJNoPsh.cjs → shapeFns-C2j6oZ2u.cjs} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-DVpJHhgk.js → shapeTypes-CqNJoSam.js} +1 -1
- package/dist/{shapeTypes-BWsKDxzf.cjs → shapeTypes-DH2ShBU_.cjs} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-B8t5h68e.cjs → solidBuilders-CgicU3le.cjs} +12 -10
- package/dist/{solidBuilders-p_ppeTkc.js → solidBuilders-IstbiWju.js} +12 -10
- package/dist/{surfaceBuilders-Dccm2kQX.js → surfaceBuilders-8nLk2PWk.js} +4 -4
- package/dist/{surfaceBuilders-Bn-c9xVR.cjs → surfaceBuilders-vYgSvgI6.cjs} +4 -4
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-bFsyNLkO.js → textBlueprints-C13NAA3C.js} +169 -10
- package/dist/{textBlueprints-DQi920gG.cjs → textBlueprints-fa7VHJZz.cjs} +168 -9
- package/dist/{textMetrics-DhysRMr7.cjs → textMetrics--cikHkGX.cjs} +2 -2
- package/dist/{textMetrics-CvTwh4tR.js → textMetrics-Dcc63qRm.js} +2 -2
- package/dist/{threadFns-DlGXBSK7.js → threadFns-3U9x4v_M.js} +8 -8
- package/dist/{threadFns-DAKMitvE.cjs → threadFns-BUQPg_vI.cjs} +8 -8
- package/dist/topology/metadata/faceRoleFns.d.ts +15 -0
- package/dist/topology/metadata/metadataPropagation.d.ts +2 -2
- package/dist/topology/shapeRef/extrudeRoleFns.d.ts +9 -0
- package/dist/topology/shapeRef/refResolveFns.d.ts +2 -1
- package/dist/topology/shapeRef/shapeRefFns.d.ts +8 -2
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-fNWsM4Lr.js → topologyQueryFns-DnfjQgP7.js} +3 -3
- package/dist/{topologyQueryFns-CI4j3NTE.cjs → topologyQueryFns-q2bGyuEV.cjs} +8 -2
- package/dist/{validityTypes-D9oxhu4U.cjs → validityTypes-r0A2YdNq.cjs} +2 -2
- package/dist/{validityTypes-2DNKAPEw.js → validityTypes-t7JpS0Ki.js} +2 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-CqNJoSam.js";
|
|
2
2
|
import { i as wasmIndex, n as bug } from "./bug-BdOHwn_e.js";
|
|
3
|
-
import { P as unwrap, s as safeIndex } from "./errors-
|
|
4
|
-
import { s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { P as unwrap, s as safeIndex } from "./errors-Zb3jBa0u.js";
|
|
4
|
+
import { s as getEdges } from "./topologyQueryFns-DnfjQgP7.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
|
-
import { a as planeToWorld, o as resolvePlane } from "./planeOps-
|
|
9
|
-
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-
|
|
10
|
-
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-
|
|
8
|
+
import { a as planeToWorld, o as resolvePlane } from "./planeOps-Cxws4Tiu.js";
|
|
9
|
+
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-CTlJC5IY.js";
|
|
10
|
+
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-KS1BWGhF.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 { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-
|
|
15
|
-
import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } 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-8nLk2PWk.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-FywUpRiV.js";
|
|
14
|
+
import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-BN1mVMuZ.js";
|
|
15
|
+
import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-rwJjYPzo.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-Dlae8IX5.js";
|
|
17
|
+
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-D8igCYc9.js";
|
|
18
|
+
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-C13NAA3C.js";
|
|
19
|
+
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-Cs6v3bWQ.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,22 +1,22 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
2
|
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-q2bGyuEV.cjs");
|
|
5
5
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
6
6
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
7
7
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
8
|
-
const require_planeOps = require("./planeOps-
|
|
9
|
-
const require_faceFns = require("./faceFns-
|
|
10
|
-
const require_curveFns = require("./curveFns-
|
|
8
|
+
const require_planeOps = require("./planeOps-DJuclNxa.cjs");
|
|
9
|
+
const require_faceFns = require("./faceFns-CZeHWke7.cjs");
|
|
10
|
+
const require_curveFns = require("./curveFns-6-ULFrEB.cjs");
|
|
11
11
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
12
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
13
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
14
|
-
const require_helpers = require("./helpers-
|
|
15
|
-
const require_blueprint = require("./blueprint-
|
|
16
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
17
|
-
const require_boolean2D = require("./boolean2D-
|
|
18
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
19
|
-
const require_cameraFns = require("./cameraFns-
|
|
12
|
+
const require_surfaceBuilders = require("./surfaceBuilders-vYgSvgI6.cjs");
|
|
13
|
+
const require_blueprintSketcher = require("./blueprintSketcher-CzKbxeTk.cjs");
|
|
14
|
+
const require_helpers = require("./helpers-NRZVshPb.cjs");
|
|
15
|
+
const require_blueprint = require("./blueprint-Yyoiz-U1.cjs");
|
|
16
|
+
const require_cornerFinder = require("./cornerFinder-Cji_BK-R.cjs");
|
|
17
|
+
const require_boolean2D = require("./boolean2D-BzZ9iBSn.cjs");
|
|
18
|
+
const require_textBlueprints = require("./textBlueprints-fa7VHJZz.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-RHCb1F1s.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.
|
|
@@ -190,6 +190,7 @@ var BrepErrorCode = {
|
|
|
190
190
|
SOLID_FROM_SHELL_FAILED: "SOLID_FROM_SHELL_FAILED",
|
|
191
191
|
FIX_SELF_INTERSECTION_FAILED: "FIX_SELF_INTERSECTION_FAILED",
|
|
192
192
|
MESH_FAILED: "MESH_FAILED",
|
|
193
|
+
PRINCIPAL_BOX_FAILED: "PRINCIPAL_BOX_FAILED",
|
|
193
194
|
ELLIPSE_RADII: "ELLIPSE_RADII",
|
|
194
195
|
FUSE_ALL_EMPTY: "FUSE_ALL_EMPTY",
|
|
195
196
|
FILLET_NO_EDGES: "FILLET_NO_EDGES",
|
|
@@ -216,6 +217,8 @@ var BrepErrorCode = {
|
|
|
216
217
|
DRAFT_NOT_3D: "DRAFT_NOT_3D",
|
|
217
218
|
DRAFT_FAILED: "DRAFT_FAILED",
|
|
218
219
|
CSG_EXTENSION_UNKNOWN: "CSG_EXTENSION_UNKNOWN",
|
|
220
|
+
NOT_A_SOLID: "NOT_A_SOLID",
|
|
221
|
+
ZERO_VOLUME: "ZERO_VOLUME",
|
|
219
222
|
FUSE_NOT_3D: "FUSE_NOT_3D",
|
|
220
223
|
CUT_NOT_3D: "CUT_NOT_3D",
|
|
221
224
|
INTERSECT_NOT_3D: "INTERSECT_NOT_3D",
|
|
@@ -190,6 +190,7 @@ var BrepErrorCode = {
|
|
|
190
190
|
SOLID_FROM_SHELL_FAILED: "SOLID_FROM_SHELL_FAILED",
|
|
191
191
|
FIX_SELF_INTERSECTION_FAILED: "FIX_SELF_INTERSECTION_FAILED",
|
|
192
192
|
MESH_FAILED: "MESH_FAILED",
|
|
193
|
+
PRINCIPAL_BOX_FAILED: "PRINCIPAL_BOX_FAILED",
|
|
193
194
|
ELLIPSE_RADII: "ELLIPSE_RADII",
|
|
194
195
|
FUSE_ALL_EMPTY: "FUSE_ALL_EMPTY",
|
|
195
196
|
FILLET_NO_EDGES: "FILLET_NO_EDGES",
|
|
@@ -216,6 +217,8 @@ var BrepErrorCode = {
|
|
|
216
217
|
DRAFT_NOT_3D: "DRAFT_NOT_3D",
|
|
217
218
|
DRAFT_FAILED: "DRAFT_FAILED",
|
|
218
219
|
CSG_EXTENSION_UNKNOWN: "CSG_EXTENSION_UNKNOWN",
|
|
220
|
+
NOT_A_SOLID: "NOT_A_SOLID",
|
|
221
|
+
ZERO_VOLUME: "ZERO_VOLUME",
|
|
219
222
|
FUSE_NOT_3D: "FUSE_NOT_3D",
|
|
220
223
|
CUT_NOT_3D: "CUT_NOT_3D",
|
|
221
224
|
INTERSECT_NOT_3D: "INTERSECT_NOT_3D",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as castShape, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
1
|
+
import { i as castShape, q as getKernel } from "./shapeTypes-CqNJoSam.js";
|
|
2
|
+
import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-Zb3jBa0u.js";
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-DnfjQgP7.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-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-q2bGyuEV.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/topology/metadata/faceRoleFns.ts
|
|
2
|
+
var faceRoleStore = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
/** O(1) check whether a shape carries recorded face roles. */
|
|
4
|
+
function hasFaceRoles(shape) {
|
|
5
|
+
return faceRoleStore.has(shape.wrapped);
|
|
6
|
+
}
|
|
7
|
+
/** Record face roles (face hash → role name) on a shape, replacing any it had. */
|
|
8
|
+
function setFaceRoles(shape, roles) {
|
|
9
|
+
if (roles.size === 0) return;
|
|
10
|
+
faceRoleStore.set(shape.wrapped, new Map(roles));
|
|
11
|
+
}
|
|
12
|
+
/** The face roles recorded on a shape (face hash → role name), if any. */
|
|
13
|
+
function getFaceRoles(shape) {
|
|
14
|
+
return faceRoleStore.get(shape.wrapped);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Carry recorded face roles from inputs to a result through a ShapeEvolution:
|
|
18
|
+
* deleted faces drop their role, a modified face passes it to every successor,
|
|
19
|
+
* and an untouched face keeps it. When two inputs' faces land on one result
|
|
20
|
+
* face, the first input's role wins.
|
|
21
|
+
*/
|
|
22
|
+
function propagateFaceRolesFromEvolution(evolution, inputs, result) {
|
|
23
|
+
const resultRoles = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const input of inputs) {
|
|
25
|
+
const inputRoles = faceRoleStore.get(input.wrapped);
|
|
26
|
+
if (!inputRoles) continue;
|
|
27
|
+
for (const [hash, role] of inputRoles) {
|
|
28
|
+
if (evolution.deleted.has(hash)) continue;
|
|
29
|
+
const modified = evolution.modified.get(hash);
|
|
30
|
+
const targets = modified && modified.length > 0 ? modified : [hash];
|
|
31
|
+
for (const target of targets) if (!resultRoles.has(target)) resultRoles.set(target, role);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
setFaceRoles(result, resultRoles);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { setFaceRoles as i, hasFaceRoles as n, propagateFaceRolesFromEvolution as r, getFaceRoles as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/topology/metadata/faceRoleFns.ts
|
|
2
|
+
var faceRoleStore = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
/** O(1) check whether a shape carries recorded face roles. */
|
|
4
|
+
function hasFaceRoles(shape) {
|
|
5
|
+
return faceRoleStore.has(shape.wrapped);
|
|
6
|
+
}
|
|
7
|
+
/** Record face roles (face hash → role name) on a shape, replacing any it had. */
|
|
8
|
+
function setFaceRoles(shape, roles) {
|
|
9
|
+
if (roles.size === 0) return;
|
|
10
|
+
faceRoleStore.set(shape.wrapped, new Map(roles));
|
|
11
|
+
}
|
|
12
|
+
/** The face roles recorded on a shape (face hash → role name), if any. */
|
|
13
|
+
function getFaceRoles(shape) {
|
|
14
|
+
return faceRoleStore.get(shape.wrapped);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Carry recorded face roles from inputs to a result through a ShapeEvolution:
|
|
18
|
+
* deleted faces drop their role, a modified face passes it to every successor,
|
|
19
|
+
* and an untouched face keeps it. When two inputs' faces land on one result
|
|
20
|
+
* face, the first input's role wins.
|
|
21
|
+
*/
|
|
22
|
+
function propagateFaceRolesFromEvolution(evolution, inputs, result) {
|
|
23
|
+
const resultRoles = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const input of inputs) {
|
|
25
|
+
const inputRoles = faceRoleStore.get(input.wrapped);
|
|
26
|
+
if (!inputRoles) continue;
|
|
27
|
+
for (const [hash, role] of inputRoles) {
|
|
28
|
+
if (evolution.deleted.has(hash)) continue;
|
|
29
|
+
const modified = evolution.modified.get(hash);
|
|
30
|
+
const targets = modified && modified.length > 0 ? modified : [hash];
|
|
31
|
+
for (const target of targets) if (!resultRoles.has(target)) resultRoles.set(target, role);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
setFaceRoles(result, resultRoles);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
Object.defineProperty(exports, "getFaceRoles", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function() {
|
|
40
|
+
return getFaceRoles;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "hasFaceRoles", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return hasFaceRoles;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "propagateFaceRolesFromEvolution", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return propagateFaceRolesFromEvolution;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "setFaceRoles", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
return setFaceRoles;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as isSolid, D as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
2
|
-
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { C as isSolid, D as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-CqNJoSam.js";
|
|
2
|
+
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-Zb3jBa0u.js";
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-DnfjQgP7.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { y as downcast } from "./faceFns-
|
|
6
|
-
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-
|
|
5
|
+
import { y as downcast } from "./faceFns-CTlJC5IY.js";
|
|
6
|
+
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-IstbiWju.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-q2bGyuEV.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
5
|
+
const require_faceFns = require("./faceFns-CZeHWke7.cjs");
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-CgicU3le.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { q as getKernel, y as isFace } from "./shapeTypes-
|
|
2
|
-
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { q as getKernel, y as isFace } from "./shapeTypes-CqNJoSam.js";
|
|
2
|
+
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-Zb3jBa0u.js";
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-DnfjQgP7.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-CTlJC5IY.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns--1wNlcc_.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-KS1BWGhF.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-CyDVZomf.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,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-q2bGyuEV.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-CZeHWke7.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-C2j6oZ2u.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-6-ULFrEB.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-D_GpQw5z.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,8 +1,8 @@
|
|
|
1
|
-
import { n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { n as castResultShape, q as getKernel } from "./shapeTypes-CqNJoSam.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At$1 } from "./bug-BdOHwn_e.js";
|
|
3
|
-
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-
|
|
3
|
+
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-Zb3jBa0u.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-rwJjYPzo.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) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
2
|
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
3
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-Yyoiz-U1.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) {
|
package/dist/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export { exportURDF, importURDF, type UrdfExportOptions, type UrdfDocument, } fr
|
|
|
131
131
|
export { createHistory, addStep, undoLast, findStep, getShape as getHistoryShape, stepCount, stepsFrom, registerShape, createRegistry, registerOperation, replayHistory, replayFrom, modifyStep, serializeHistory, deserializeHistory, type OperationStep, type ModelHistory, type SerializedHistory, type OperationFn, type OperationRegistry as HistoryOperationRegistry, } from './operations/historyFns.js';
|
|
132
132
|
export { measureVolume, measureArea, measureLength, measureDistance, measureDistanceProps, createDistanceQuery, measureVolumeProps, measureSurfaceProps, measureLinearProps, type PhysicalProps, type VolumeProps, type SurfaceProps, type LinearProps, type DistanceProps, measureCurvatureAt, measureCurvatureAtMid, type CurvatureResult, } from './measurement/measureFns.js';
|
|
133
133
|
export { checkInterference, checkAllInterferences, type InterferenceResult, type InterferencePair, } from './measurement/interferenceFns.js';
|
|
134
|
+
export { principalBoundingBox, type PrincipalBoundingBox } from './measurement/principalBoxFns.js';
|
|
134
135
|
export { importSTEP, importSTL, importIGES } from './io/importFns.js';
|
|
135
136
|
export { importDXF } from './io/dxfImportFns.js';
|
|
136
137
|
export { importOBJ } from './io/objImportFns.js';
|
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-CAxkaRTm.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-BEi-HsSw.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-COlno8TY.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-0kHGg-b8.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { DistanceResult, KernelShape } from '../types.js';
|
|
2
|
+
/** A 3x3 matrix as nine row-major entries. */
|
|
3
|
+
export type Matrix3 = readonly [
|
|
4
|
+
number,
|
|
5
|
+
number,
|
|
6
|
+
number,
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number
|
|
13
|
+
];
|
|
2
14
|
/** All scalar measurements for a shape, computed in bulk. */
|
|
3
15
|
export interface BulkMeasurement {
|
|
4
16
|
volume: number;
|
|
@@ -20,6 +32,13 @@ export interface KernelMeasureOps {
|
|
|
20
32
|
min: [number, number, number];
|
|
21
33
|
max: [number, number, number];
|
|
22
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Volume matrix of inertia about the center of mass (unit density), in axes
|
|
37
|
+
* parallel to world X/Y/Z. Products of inertia carry the tensor's negative
|
|
38
|
+
* sign, so the matrix is symmetric with `[1]==[3]`, `[2]==[6]`, `[5]==[7]`.
|
|
39
|
+
* Optional: kernels without it cannot answer principal-axes queries.
|
|
40
|
+
*/
|
|
41
|
+
inertia?(shape: KernelShape): Matrix3;
|
|
23
42
|
/** Minimum distance between two shapes with witness points. */
|
|
24
43
|
distance(shape1: KernelShape, shape2: KernelShape): DistanceResult;
|
|
25
44
|
/** Compute surface curvature at a UV point on a face. */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DistanceResult, KernelShape } from '../types.js';
|
|
2
|
-
import { BulkMeasurement } from '../interfaces/measureOps.js';
|
|
2
|
+
import { BulkMeasurement, Matrix3 } from '../interfaces/measureOps.js';
|
|
3
3
|
import { OcctKernelWasm, OcctWasmModule } from './occtWasmTypes.js';
|
|
4
4
|
export declare function volume(k: OcctKernelWasm, shape: KernelShape): number;
|
|
5
5
|
export declare function area(k: OcctKernelWasm, shape: KernelShape): number;
|
|
6
6
|
export declare function length(k: OcctKernelWasm, shape: KernelShape): number;
|
|
7
7
|
export declare function centerOfMass(k: OcctKernelWasm, shape: KernelShape): [number, number, number];
|
|
8
8
|
export declare function linearCenterOfMass(k: OcctKernelWasm, shape: KernelShape): [number, number, number];
|
|
9
|
+
export declare function inertia(k: OcctKernelWasm, shape: KernelShape): Matrix3;
|
|
9
10
|
export declare function boundingBox(k: OcctKernelWasm, shape: KernelShape): {
|
|
10
11
|
min: [number, number, number];
|
|
11
12
|
max: [number, number, number];
|
|
@@ -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-CA6PmIIj.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KernelCapabilities } from '../capabilities.js';
|
|
2
2
|
import { BooleanOpType, BooleanOptions, CheckBooleanResult, DiagnosticOperationResult, DistanceResult, KernelAdapter, KernelEdgeMeshResult, KernelInstance, KernelMeshResult, KernelShape, KernelType, MeshOptions, NurbsCurveData, OperationResult, ShapeOrientation, ShapeType, StepAssemblyPart, SurfaceType } from '../types.js';
|
|
3
|
-
import { BulkMeasurement } from '../interfaces/measureOps.js';
|
|
3
|
+
import { BulkMeasurement, Matrix3 } from '../interfaces/measureOps.js';
|
|
4
4
|
import { TransformEntry } from '../interfaces/transformOps.js';
|
|
5
5
|
import { Curve2dHandle, BBox2dHandle } from '../kernel2dTypes.js';
|
|
6
6
|
import { OcctWasmModule, OcctKernelWasm } from './occtWasmTypes.js';
|
|
@@ -249,6 +249,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
249
249
|
min: [number, number, number];
|
|
250
250
|
max: [number, number, number];
|
|
251
251
|
};
|
|
252
|
+
inertia(shape: KernelShape): Matrix3;
|
|
252
253
|
distance(shape1: KernelShape, shape2: KernelShape): DistanceResult;
|
|
253
254
|
surfaceCurvature(face: KernelShape, u: number, v: number): {
|
|
254
255
|
gaussian: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-BX10fyla.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -229,6 +229,8 @@ export interface OcctKernelWasm {
|
|
|
229
229
|
getSurfaceArea(id: number): number;
|
|
230
230
|
getLength(id: number): number;
|
|
231
231
|
getCenterOfMass(id: number): EmVectorDouble;
|
|
232
|
+
/** Row-major 3x3 volume matrix of inertia about the center of mass (occt-wasm >= 3.3.0). */
|
|
233
|
+
getInertia(id: number): EmVectorDouble;
|
|
232
234
|
getSurfaceCenterOfMass(faceId: number): EmVectorDouble;
|
|
233
235
|
getLinearCenterOfMass(id: number): EmVectorDouble;
|
|
234
236
|
surfaceCurvature(faceId: number, u: number, v: number): EmVectorDouble;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-
|
|
2
|
-
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-
|
|
1
|
+
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-CqNJoSam.js";
|
|
2
|
+
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-Zb3jBa0u.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-
|
|
3
|
-
import {
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-CqNJoSam.js";
|
|
2
|
+
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-Zb3jBa0u.js";
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-DnfjQgP7.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-CTlJC5IY.js";
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -224,4 +224,4 @@ function measureCurvatureAtMid(face) {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
|
-
export { measureDistance as a, measureLinearProps as c, measureVolumeProps as d, measureCurvatureAtMid as i, measureSurfaceProps as l, measureArea as n, measureDistanceProps as o, measureCurvatureAt as r, measureLength as s, createDistanceQuery as t, measureVolume as u };
|
|
227
|
+
export { measureDistance as a, measureLinearProps as c, measureVolumeProps as d, getCachedMeasurement as f, measureCurvatureAtMid as i, measureSurfaceProps as l, measureArea as n, measureDistanceProps as o, setCachedMeasurement as p, measureCurvatureAt as r, measureLength as s, createDistanceQuery as t, measureVolume as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DH2ShBU_.cjs");
|
|
2
|
+
const require_errors = require("./errors-jwhfQJZK.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-q2bGyuEV.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-CZeHWke7.cjs");
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -230,6 +230,12 @@ Object.defineProperty(exports, "createDistanceQuery", {
|
|
|
230
230
|
return createDistanceQuery;
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
+
Object.defineProperty(exports, "getCachedMeasurement", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function() {
|
|
236
|
+
return getCachedMeasurement;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
233
239
|
Object.defineProperty(exports, "measureArea", {
|
|
234
240
|
enumerable: true,
|
|
235
241
|
get: function() {
|
|
@@ -290,3 +296,9 @@ Object.defineProperty(exports, "measureVolumeProps", {
|
|
|
290
296
|
return measureVolumeProps;
|
|
291
297
|
}
|
|
292
298
|
});
|
|
299
|
+
Object.defineProperty(exports, "setCachedMeasurement", {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get: function() {
|
|
302
|
+
return setCachedMeasurement;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { VolumeProps, SurfaceProps, LinearProps } from './measureTypes.js';
|
|
1
|
+
import { VolumeProps, SurfaceProps, LinearProps, PrincipalBoundingBox } from './measureTypes.js';
|
|
2
2
|
/** Maps measurement keys to their corresponding result types. */
|
|
3
3
|
export interface MeasurementValueMap {
|
|
4
4
|
volume: VolumeProps;
|
|
5
5
|
surface: SurfaceProps;
|
|
6
6
|
linear: LinearProps;
|
|
7
|
+
principal: PrincipalBoundingBox;
|
|
7
8
|
}
|
|
8
9
|
/** Valid measurement cache keys. */
|
|
9
10
|
export type MeasurementKey = keyof MeasurementValueMap;
|
|
@@ -18,6 +18,15 @@ export interface SurfaceProps extends PhysicalProps {
|
|
|
18
18
|
export interface LinearProps extends PhysicalProps {
|
|
19
19
|
readonly length: number;
|
|
20
20
|
}
|
|
21
|
+
/** A box aligned to a solid's principal axes of inertia. */
|
|
22
|
+
export interface PrincipalBoundingBox {
|
|
23
|
+
/** Box center in world coordinates. */
|
|
24
|
+
readonly center: Vec3;
|
|
25
|
+
/** Box axes: orthonormal, right-handed, ordered by decreasing extent. */
|
|
26
|
+
readonly axes: readonly [Vec3, Vec3, Vec3];
|
|
27
|
+
/** Full edge lengths along `axes`, largest first. */
|
|
28
|
+
readonly size: Vec3;
|
|
29
|
+
}
|
|
21
30
|
/** Distance measurement result including witness points. */
|
|
22
31
|
export interface DistanceProps {
|
|
23
32
|
/** The minimum distance between the two shapes. */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AnyShape, Dimension } from '../core/shapeTypes.js';
|
|
2
|
+
import { Result } from '../core/result.js';
|
|
3
|
+
import { PrincipalBoundingBox } from './measureTypes.js';
|
|
4
|
+
export type { PrincipalBoundingBox };
|
|
5
|
+
/**
|
|
6
|
+
* Measure a solid's bounding box on its principal axes of inertia.
|
|
7
|
+
*
|
|
8
|
+
* `getBounds` answers in world axes, so a board turned 30 degrees reports an
|
|
9
|
+
* inflated box with no frame. This box follows the part's own frame instead:
|
|
10
|
+
* it is the axis-aligned box in the frame of the principal axes of the volume
|
|
11
|
+
* inertia tensor about the center of mass.
|
|
12
|
+
*
|
|
13
|
+
* This is NOT a minimum-volume oriented bounding box. When principal moments
|
|
14
|
+
* coincide, the principal axes in that plane are not unique and the box can be
|
|
15
|
+
* larger than the tightest one: a 100 x 100 x 2 plate rotated 30 degrees about
|
|
16
|
+
* Z reports 136.6 x 136.6 x 2, because any in-plane pair of axes is principal
|
|
17
|
+
* for a square plate.
|
|
18
|
+
*
|
|
19
|
+
* @param shape - A solid, compsolid, or compound containing solids.
|
|
20
|
+
* @returns `Result` with the box center in world coordinates, orthonormal
|
|
21
|
+
* right-handed axes ordered by decreasing extent, and the full edge lengths
|
|
22
|
+
* along those axes. Fails with `NOT_A_SOLID` for any other shape type
|
|
23
|
+
* (face, wire, shell, ...), `ZERO_VOLUME` when the shape encloses no volume
|
|
24
|
+
* (e.g. a compound of faces), and an `UNSUPPORTED` error on kernels without
|
|
25
|
+
* an inertia query.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const { size, axes, center } = unwrap(principalBoundingBox(board));
|
|
30
|
+
* // size: [length, width, thickness]; axes[2] is the board's normal
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function principalBoundingBox(shape: AnyShape<Dimension>): Result<PrincipalBoundingBox>;
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-D_GpQw5z.cjs");
|
|
3
|
+
const require_principalBoxFns = require("./principalBoxFns-5FSbxAj-.cjs");
|
|
3
4
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
4
5
|
exports.measureArea = require_measureFns.measureArea;
|
|
5
6
|
exports.measureDistance = require_measureFns.measureDistance;
|
|
@@ -9,3 +10,4 @@ exports.measureLinearProps = require_measureFns.measureLinearProps;
|
|
|
9
10
|
exports.measureSurfaceProps = require_measureFns.measureSurfaceProps;
|
|
10
11
|
exports.measureVolume = require_measureFns.measureVolume;
|
|
11
12
|
exports.measureVolumeProps = require_measureFns.measureVolumeProps;
|
|
13
|
+
exports.principalBoundingBox = require_principalBoxFns.principalBoundingBox;
|
package/dist/measurement.d.ts
CHANGED
|
@@ -2,3 +2,4 @@
|
|
|
2
2
|
* brepjs/measurement — Shape measurement functions.
|
|
3
3
|
*/
|
|
4
4
|
export { measureVolume, measureArea, measureLength, measureDistance, measureDistanceProps, createDistanceQuery, measureVolumeProps, measureSurfaceProps, measureLinearProps, type PhysicalProps, type DistanceProps, } from './measurement/measureFns.js';
|
|
5
|
+
export { principalBoundingBox, type PrincipalBoundingBox } from './measurement/principalBoxFns.js';
|
package/dist/measurement.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
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-
|
|
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-CyDVZomf.js";
|
|
2
|
+
import { t as principalBoundingBox } from "./principalBoxFns-BJgGEoik.js";
|
|
3
|
+
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
|