brepjs 18.34.0 → 18.35.1
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/{blueprint-Ctq3YI2J.cjs → blueprint-BF0DcVwE.cjs} +7 -7
- package/dist/{blueprint-Dgn4HasF.js → blueprint-KwH2JNPU.js} +7 -7
- package/dist/{blueprintFns-BSc5kM0e.cjs → blueprintFns-CbPsMijw.cjs} +3 -3
- package/dist/{blueprintFns-CJ8_2wwd.js → blueprintFns-X7jVGGUE.js} +3 -3
- package/dist/{blueprintSketcher-DfN5LL45.js → blueprintSketcher-BwFpbp0B.js} +4 -4
- package/dist/{blueprintSketcher-DHzyZSgL.cjs → blueprintSketcher-m18T1U1T.cjs} +4 -4
- package/dist/{boolean2D-DRlzu7K9.cjs → boolean2D-BzlbvCIH.cjs} +5 -5
- package/dist/{boolean2D-BDVlp701.js → boolean2D-DAq015PP.js} +5 -5
- package/dist/{booleanFns-BZEfiLXh.cjs → booleanFns-D19tR8Gn.cjs} +6 -6
- package/dist/{booleanFns-CE3u1eIK.js → booleanFns-nHsLqZ7Y.js} +6 -6
- package/dist/brepjs.cjs +32 -26
- package/dist/brepjs.js +27 -27
- package/dist/{cameraFns-CFnPg5-H.js → cameraFns-Bhjy2SuC.js} +3 -3
- package/dist/{cameraFns-D8o9TUpN.cjs → cameraFns-D_8-JO0p.cjs} +3 -3
- package/dist/core/errors.d.ts +4 -0
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-B3DEv78h.cjs → cornerFinder-Bmp3Vm5g.cjs} +1 -1
- package/dist/{cornerFinder-B1DivYhK.js → cornerFinder-U6kzoCXY.js} +1 -1
- package/dist/{curveFns-ZXCrxKal.cjs → curveFns-p1YEnmZu.cjs} +2 -2
- package/dist/{curveFns-CwBnLSGs.js → curveFns-rUkX4tEm.js} +2 -2
- package/dist/{drawFns-B3xmKGqo.cjs → drawFns-BGIQ1IeV.cjs} +14 -14
- package/dist/{drawFns-DmDtAGJ3.js → drawFns-ZhKR7xa0.js} +14 -14
- package/dist/{errors-DxoD7zgx.cjs → errors-CXJtc4I7.cjs} +4 -0
- package/dist/{errors-BJSTLaDI.js → errors-DNWJsfVU.js} +4 -0
- package/dist/{extrudeFns-B2Jh4xdE.js → extrudeFns-Cl_azGgy.js} +2 -2
- package/dist/{extrudeFns-BCHwL5Rz.cjs → extrudeFns-DpRGUaxD.cjs} +2 -2
- package/dist/{faceFns-dIScXlyz.cjs → faceFns-C6qUr_gw.cjs} +3 -3
- package/dist/{faceFns-43zWb-uD.js → faceFns-eVWgSIzt.js} +3 -3
- package/dist/{helpers-BcvfYBlZ.js → helpers-BhJOo535.js} +7 -7
- package/dist/{helpers-WD_MY4EK.cjs → helpers-DNVILwHA.cjs} +7 -7
- package/dist/{historyFns-CesKJg-g.js → historyFns-ByJG4mBP.js} +5 -5
- package/dist/{historyFns-D0-tL5u2.cjs → historyFns-C2glA6vu.cjs} +5 -5
- package/dist/{importFns-CfXF57GK.cjs → importFns-CJc5NYJp.cjs} +3 -3
- package/dist/{importFns-nh6XUS6V.js → importFns-DuAmdf0Q.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/manifold/replay.d.ts +7 -0
- package/dist/{measureFns-CZPHU8Fq.js → measureFns-BiflqrZ_.js} +4 -4
- package/dist/{measureFns-BlNPRAt1.cjs → measureFns-D7lxkIjt.cjs} +4 -4
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-44MzVWmw.js → meshFns-Bbm7_5wS.js} +43 -7
- package/dist/{meshFns-thnWU79u.cjs → meshFns-D66okPxP.cjs} +43 -7
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-C6wxugvC.cjs → planeOps-BA4HfgQu.cjs} +1 -1
- package/dist/{planeOps-CblVcWbn.js → planeOps-DSjjtrjg.js} +1 -1
- package/dist/{primitiveFns-wcHq2Dpc.cjs → primitiveFns-CXn9Jl4q.cjs} +8 -8
- package/dist/{primitiveFns-7-BpVEfR.js → primitiveFns-vQh7Lz7B.js} +8 -8
- 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/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-DpurOSYX.cjs → shapeFns-B3v9_keQ.cjs} +3 -3
- package/dist/{shapeFns-tYJBM_yH.js → shapeFns-BbHQjI5-.js} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-DhkB2xrl.js → shapeRefFns-BOsX8Tim.js} +4 -4
- package/dist/{shapeRefFns-DNlnIVGa.cjs → shapeRefFns-CkafUjdM.cjs} +4 -4
- package/dist/{shapeTypes-C16Am1Cu.cjs → shapeTypes-Bbh2doYh.cjs} +24 -10
- package/dist/{shapeTypes-DgIDUXrS.js → shapeTypes-C-MpR5-e.js} +24 -10
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-oYCo3H_H.js → solidBuilders-C44fKbQQ.js} +3 -3
- package/dist/{solidBuilders-BRd294hA.cjs → solidBuilders-Ck6gpdQR.cjs} +3 -3
- package/dist/{surfaceBuilders-BuNn7mbE.js → surfaceBuilders-D4p1YPCz.js} +3 -3
- package/dist/{surfaceBuilders-C-MXZeRY.cjs → surfaceBuilders-DsISMCwj.cjs} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-4DfEJMBH.js → textBlueprints-BKdQqBn8.js} +9 -9
- package/dist/{textBlueprints-ihVTYQz7.cjs → textBlueprints-C93RophN.cjs} +9 -9
- package/dist/{textMetrics-KvDcXO5Z.cjs → textMetrics-2vq4PFfz.cjs} +2 -2
- package/dist/{textMetrics-CgtxG_bI.js → textMetrics-DEmVsP5C.js} +2 -2
- package/dist/topology/meshFns.d.ts +0 -5
- package/dist/topology/shapeFns.d.ts +1 -1
- package/dist/topology/topologyQueryFns.d.ts +22 -1
- package/dist/topology.cjs +7 -7
- package/dist/topology.js +7 -7
- package/dist/{topologyQueryFns-DNs19Af_.js → topologyQueryFns-B81GSST_.js} +45 -3
- package/dist/{topologyQueryFns-DTvwHQnu.cjs → topologyQueryFns-C0kAqcn5.cjs} +80 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +10 -7
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_textBlueprints = require("./textBlueprints-C93RophN.cjs");
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
3
3
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
4
|
-
const require_errors = require("./errors-
|
|
5
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
5
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.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
|
-
const require_planeOps = require("./planeOps-
|
|
10
|
-
const require_faceFns = require("./faceFns-
|
|
11
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
+
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
10
|
+
const require_faceFns = require("./faceFns-C6qUr_gw.cjs");
|
|
11
|
+
const require_curveFns = require("./curveFns-p1YEnmZu.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-DsISMCwj.cjs");
|
|
14
|
+
const require_blueprintSketcher = require("./blueprintSketcher-m18T1U1T.cjs");
|
|
15
|
+
const require_helpers = require("./helpers-DNVILwHA.cjs");
|
|
16
|
+
const require_blueprint = require("./blueprint-BF0DcVwE.cjs");
|
|
17
|
+
const require_cornerFinder = require("./cornerFinder-Bmp3Vm5g.cjs");
|
|
18
|
+
const require_boolean2D = require("./boolean2D-BzlbvCIH.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-D_8-JO0p.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-C-MpR5-e.js";
|
|
2
2
|
import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
|
|
3
|
-
import { R as unwrap, h as bug, s as safeIndex } from "./errors-
|
|
4
|
-
import {
|
|
3
|
+
import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
|
|
4
|
+
import { s as getEdges } from "./topologyQueryFns-B81GSST_.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 { _ as downcast, c as normalAt, l as outerWire, n as faceCenter, p as uvBounds, u as pointOnSurface } from "./faceFns-
|
|
10
|
-
import { c as curveStartPoint, m as offsetWire2D, r as curveIsClosed } from "./curveFns-
|
|
8
|
+
import { a as planeToWorld, o as resolvePlane } from "./planeOps-DSjjtrjg.js";
|
|
9
|
+
import { _ as downcast, c as normalAt, l as outerWire, n as faceCenter, p as uvBounds, u as pointOnSurface } from "./faceFns-eVWgSIzt.js";
|
|
10
|
+
import { c as curveStartPoint, m as offsetWire2D, r as curveIsClosed } from "./curveFns-rUkX4tEm.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-D4p1YPCz.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-BwFpbp0B.js";
|
|
14
|
+
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-BhJOo535.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-KwH2JNPU.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-U6kzoCXY.js";
|
|
17
|
+
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-DAq015PP.js";
|
|
18
|
+
import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-BKdQqBn8.js";
|
|
19
|
+
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-Bhjy2SuC.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.
|
|
@@ -354,8 +354,12 @@ var BrepErrorCode = {
|
|
|
354
354
|
STEP_EXPORT_FAILED: "STEP_EXPORT_FAILED",
|
|
355
355
|
STEP_EXPORT_CONFIGURED_FAILED: "STEP_EXPORT_CONFIGURED_FAILED",
|
|
356
356
|
STEP_FILE_READ_ERROR: "STEP_FILE_READ_ERROR",
|
|
357
|
+
STEP_EXPORT_CRASHED: "STEP_EXPORT_CRASHED",
|
|
358
|
+
STEP_EXPORT_UNSERIALIZABLE: "STEP_EXPORT_UNSERIALIZABLE",
|
|
357
359
|
STL_EXPORT_FAILED: "STL_EXPORT_FAILED",
|
|
358
360
|
STL_FILE_READ_ERROR: "STL_FILE_READ_ERROR",
|
|
361
|
+
STL_EXPORT_CRASHED: "STL_EXPORT_CRASHED",
|
|
362
|
+
STL_EXPORT_UNSERIALIZABLE: "STL_EXPORT_UNSERIALIZABLE",
|
|
359
363
|
STEP_IMPORT_FAILED: "STEP_IMPORT_FAILED",
|
|
360
364
|
STL_IMPORT_FAILED: "STL_IMPORT_FAILED",
|
|
361
365
|
IGES_EXPORT_FAILED: "IGES_EXPORT_FAILED",
|
|
@@ -354,8 +354,12 @@ var BrepErrorCode = {
|
|
|
354
354
|
STEP_EXPORT_FAILED: "STEP_EXPORT_FAILED",
|
|
355
355
|
STEP_EXPORT_CONFIGURED_FAILED: "STEP_EXPORT_CONFIGURED_FAILED",
|
|
356
356
|
STEP_FILE_READ_ERROR: "STEP_FILE_READ_ERROR",
|
|
357
|
+
STEP_EXPORT_CRASHED: "STEP_EXPORT_CRASHED",
|
|
358
|
+
STEP_EXPORT_UNSERIALIZABLE: "STEP_EXPORT_UNSERIALIZABLE",
|
|
357
359
|
STL_EXPORT_FAILED: "STL_EXPORT_FAILED",
|
|
358
360
|
STL_FILE_READ_ERROR: "STL_FILE_READ_ERROR",
|
|
361
|
+
STL_EXPORT_CRASHED: "STL_EXPORT_CRASHED",
|
|
362
|
+
STL_EXPORT_UNSERIALIZABLE: "STL_EXPORT_UNSERIALIZABLE",
|
|
359
363
|
STEP_IMPORT_FAILED: "STEP_IMPORT_FAILED",
|
|
360
364
|
STL_IMPORT_FAILED: "STL_IMPORT_FAILED",
|
|
361
365
|
IGES_EXPORT_FAILED: "IGES_EXPORT_FAILED",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-
|
|
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-
|
|
1
|
+
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-C-MpR5-e.js";
|
|
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 { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
4
4
|
//#region src/operations/extrudeUtils.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
4
4
|
//#region src/operations/extrudeUtils.ts
|
|
5
5
|
/**
|
|
@@ -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-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
2
|
-
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-C-MpR5-e.js";
|
|
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-B81GSST_.js";
|
|
4
4
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Z as getKernel, p as isFace } from "./shapeTypes-
|
|
2
|
-
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-
|
|
3
|
-
import {
|
|
1
|
+
import { Z as getKernel, p as isFace } from "./shapeTypes-C-MpR5-e.js";
|
|
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-B81GSST_.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 { c as normalAt, o as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { c as normalAt, o as getSurfaceType } from "./faceFns-eVWgSIzt.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-BbHQjI5-.js";
|
|
8
|
+
import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-rUkX4tEm.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-BiflqrZ_.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-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.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-C6qUr_gw.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-B3v9_keQ.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-p1YEnmZu.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-D7lxkIjt.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,9 +1,9 @@
|
|
|
1
|
-
import { B as createKernelHandle, Z as getKernel, t as castShape } from "./shapeTypes-
|
|
2
|
-
import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-
|
|
1
|
+
import { B as createKernelHandle, Z as getKernel, t as castShape } from "./shapeTypes-C-MpR5-e.js";
|
|
2
|
+
import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
|
|
4
|
-
import { v as fromBREP } from "./faceFns-
|
|
5
|
-
import { s as toBREP } from "./shapeFns-
|
|
6
|
-
import { a as fuseAll } from "./booleanFns-
|
|
4
|
+
import { v as fromBREP } from "./faceFns-eVWgSIzt.js";
|
|
5
|
+
import { s as toBREP } from "./shapeFns-BbHQjI5-.js";
|
|
6
|
+
import { a as fuseAll } from "./booleanFns-nHsLqZ7Y.js";
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
5
|
-
const require_shapeFns = require("./shapeFns-
|
|
6
|
-
const require_booleanFns = require("./booleanFns-
|
|
4
|
+
const require_faceFns = require("./faceFns-C6qUr_gw.cjs");
|
|
5
|
+
const require_shapeFns = require("./shapeFns-B3v9_keQ.cjs");
|
|
6
|
+
const require_booleanFns = require("./booleanFns-D19tR8Gn.cjs");
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
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-BF0DcVwE.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-C-MpR5-e.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At$1 } from "./vec3-Dpha8d5k.js";
|
|
3
|
-
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-
|
|
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-KwH2JNPU.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/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export type { Curve2DHandle } from './core/curve2dHandle.js';
|
|
|
72
72
|
export { createHandle, createKernelHandle, DisposalScope, withScope, withScopeResult, withScopeResultAsync, isLive, getDisposalStats, resetDisposalStats, } from './core/disposal.js';
|
|
73
73
|
export type { Plane, PlaneName, PlaneInput } from './core/planeTypes.js';
|
|
74
74
|
export { createPlane, createNamedPlane, resolvePlane, translatePlane, pivotPlane, } from './core/planeOps.js';
|
|
75
|
-
export { getHashCode, isSameShape, isEqualShape, getEdges, getFaces, getWires, getVertices, iterEdges, iterFaces, iterWires, iterVertices, getBounds, vertexPosition, invalidateShapeCache, setShapeOrigin, getFaceOrigins, resize, type Bounds3D, type ShapeDescription, } from './topology/shapeFns.js';
|
|
75
|
+
export { getHashCode, isSameShape, isEqualShape, getEdges, getFaces, getWires, getVertices, getSolids, getShells, getCompSolids, iterEdges, iterFaces, iterWires, iterVertices, iterSolids, iterShells, iterCompSolids, getBounds, vertexPosition, invalidateShapeCache, setShapeOrigin, getFaceOrigins, resize, type Bounds3D, type ShapeDescription, } from './topology/shapeFns.js';
|
|
76
76
|
export { tagFaces, findFacesByTag, getFaceTags, setTagMetadata, getTagMetadata, } from './topology/metadata/faceTagFns.js';
|
|
77
77
|
export { colorFaces, colorShape, getFaceColor, getShapeColor, } from './topology/metadata/colorFns.js';
|
|
78
78
|
export type { Color, ColorInput } from './topology/metadata/colorFns.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-D66okPxP.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-CJc5NYJp.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-Bbm7_5wS.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-DuAmdf0Q.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -7,5 +7,12 @@ import { OpNode } from './opGraph.js';
|
|
|
7
7
|
* Memoized post-order: each node's inputs are replayed first (deduplicated via
|
|
8
8
|
* the shared cache so a DAG with reused sub-graphs replays each node once), then
|
|
9
9
|
* the node's own handler runs. Throws on any non-replayable node or unmapped op.
|
|
10
|
+
*
|
|
11
|
+
* Every node produces an intermediate OCCT WASM-heap shape, but only the root is
|
|
12
|
+
* returned (and retained by the caller's `brepCache`). To avoid leaking the rest
|
|
13
|
+
* for the lifetime of the session, the intermediates this call allocated are
|
|
14
|
+
* disposed once the full recursion completes — they are only inputs to copying
|
|
15
|
+
* ops (booleans/modifiers), so the root holds its own geometry. Shapes the caller
|
|
16
|
+
* pre-seeded into `cache` are not in `allocated` and so are never disposed here.
|
|
10
17
|
*/
|
|
11
18
|
export declare function replay(node: OpNode, targetKernel: KernelAdapter, cache?: Map<OpNode, KernelShape>): KernelShape;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel } from "./shapeTypes-
|
|
2
|
-
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-
|
|
3
|
-
import {
|
|
4
|
-
import { p as uvBounds } from "./faceFns-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-C-MpR5-e.js";
|
|
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-B81GSST_.js";
|
|
4
|
+
import { p as uvBounds } from "./faceFns-eVWgSIzt.js";
|
|
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
|
-
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-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-C6qUr_gw.cjs");
|
|
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-D7lxkIjt.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-BiflqrZ_.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel } from "./shapeTypes-
|
|
2
|
-
import { A as ok, b as err, r as ioError } from "./errors-
|
|
3
|
-
import {
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-C-MpR5-e.js";
|
|
2
|
+
import { A as ok, b as err, r as ioError } from "./errors-DNWJsfVU.js";
|
|
3
|
+
import { n as getBounds } from "./topologyQueryFns-B81GSST_.js";
|
|
4
|
+
import { O as getFaceOrigins } from "./shapeFns-BbHQjI5-.js";
|
|
4
5
|
//#region src/topology/meshCache.ts
|
|
5
6
|
/**
|
|
6
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -181,13 +182,47 @@ function meshEdges(shape, { tolerance = .001, angularTolerance = .1, cache = tru
|
|
|
181
182
|
*
|
|
182
183
|
* @returns Ok with a Blob (MIME type `application/STEP`), or Err on failure.
|
|
183
184
|
*/
|
|
185
|
+
/**
|
|
186
|
+
* Classify a thrown export error into three distinct cases:
|
|
187
|
+
* - the kernel throws "<FMT> export failed:" when the writer reports a non-success status;
|
|
188
|
+
* - a `WebAssembly.RuntimeError` means the writer trapped on geometry it could not serialize
|
|
189
|
+
* (e.g. a degenerate sub-shape) — this can corrupt the kernel for the rest of the session,
|
|
190
|
+
* so it must not be silently relabelled as a file-read issue;
|
|
191
|
+
* - anything else is an FS read failure on the V7 file path (write succeeded, readback threw).
|
|
192
|
+
*/
|
|
193
|
+
function exportError(e, fmt) {
|
|
194
|
+
if (e instanceof Error && e.message.startsWith(`${fmt} export failed`)) return ioError(`${fmt}_EXPORT_FAILED`, `Failed to write ${fmt} file`, e);
|
|
195
|
+
if (e instanceof WebAssembly.RuntimeError) return ioError(`${fmt}_EXPORT_CRASHED`, `${fmt} export crashed the kernel (${e.message}); the shape likely contains geometry the ${fmt} writer cannot serialize`, e);
|
|
196
|
+
return ioError(`${fmt}_FILE_READ_ERROR`, `Failed to read exported ${fmt} file`, e);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Probe a shape's bounding box before handing it to the STEP/STL writer.
|
|
200
|
+
*
|
|
201
|
+
* Some sub-shapes pass `isValid`/`validSolid` yet are degenerate enough that the
|
|
202
|
+
* OCCT writer traps with a `WebAssembly.RuntimeError` (OOB) mid-transfer — which
|
|
203
|
+
* corrupts the Emscripten heap and poisons the kernel for the rest of the session
|
|
204
|
+
* (#1126). `getBounds` exercises the same geometry but fails *catchably*, so a
|
|
205
|
+
* cheap pre-export probe lets us return a clean `Err` instead of crashing.
|
|
206
|
+
* Heuristic, not universal: it only catches shapes whose bounding-box evaluation
|
|
207
|
+
* also throws.
|
|
208
|
+
*/
|
|
209
|
+
function probeSerializable(shape, fmt) {
|
|
210
|
+
try {
|
|
211
|
+
getBounds(shape);
|
|
212
|
+
return null;
|
|
213
|
+
} catch (e) {
|
|
214
|
+
if (e instanceof TypeError) throw e;
|
|
215
|
+
return ioError(`${fmt}_EXPORT_UNSERIALIZABLE`, `${fmt} export aborted: the shape contains degenerate geometry the ${fmt} writer cannot serialize (bounding-box evaluation failed); export was skipped to avoid crashing the kernel`, e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
184
218
|
function exportSTEP(shape) {
|
|
219
|
+
const unserializable = probeSerializable(shape, "STEP");
|
|
220
|
+
if (unserializable) return err(unserializable);
|
|
185
221
|
try {
|
|
186
222
|
const stepString = getKernel().exportSTEP([shape.wrapped]);
|
|
187
223
|
return ok(new Blob([stepString], { type: "application/STEP" }));
|
|
188
224
|
} catch (e) {
|
|
189
|
-
|
|
190
|
-
return err(ioError(isWriteFailure ? "STEP_EXPORT_FAILED" : "STEP_FILE_READ_ERROR", isWriteFailure ? "Failed to write STEP file" : "Failed to read exported STEP file", e));
|
|
225
|
+
return err(exportError(e, "STEP"));
|
|
191
226
|
}
|
|
192
227
|
}
|
|
193
228
|
/**
|
|
@@ -196,13 +231,14 @@ function exportSTEP(shape) {
|
|
|
196
231
|
* @returns Ok with a Blob (MIME type `application/sla`), or Err on failure.
|
|
197
232
|
*/
|
|
198
233
|
function exportSTL(shape, { tolerance = .001, angularTolerance = .1, binary = false } = {}) {
|
|
234
|
+
const unserializable = probeSerializable(shape, "STL");
|
|
235
|
+
if (unserializable) return err(unserializable);
|
|
199
236
|
try {
|
|
200
237
|
if (!getKernel().hasTriangulation(shape.wrapped)) getKernel().meshShape(shape.wrapped, tolerance, angularTolerance);
|
|
201
238
|
const stlData = getKernel().exportSTL(shape.wrapped, binary);
|
|
202
239
|
return ok(new Blob([stlData], { type: "application/sla" }));
|
|
203
240
|
} catch (e) {
|
|
204
|
-
|
|
205
|
-
return err(ioError(isWriteFailure ? "STL_EXPORT_FAILED" : "STL_FILE_READ_ERROR", isWriteFailure ? "Failed to write STL file" : "Failed to read exported STL file", e));
|
|
241
|
+
return err(exportError(e, "STL"));
|
|
206
242
|
}
|
|
207
243
|
}
|
|
208
244
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-B3v9_keQ.cjs");
|
|
4
5
|
//#region src/topology/meshCache.ts
|
|
5
6
|
/**
|
|
6
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -181,13 +182,47 @@ function meshEdges(shape, { tolerance = .001, angularTolerance = .1, cache = tru
|
|
|
181
182
|
*
|
|
182
183
|
* @returns Ok with a Blob (MIME type `application/STEP`), or Err on failure.
|
|
183
184
|
*/
|
|
185
|
+
/**
|
|
186
|
+
* Classify a thrown export error into three distinct cases:
|
|
187
|
+
* - the kernel throws "<FMT> export failed:" when the writer reports a non-success status;
|
|
188
|
+
* - a `WebAssembly.RuntimeError` means the writer trapped on geometry it could not serialize
|
|
189
|
+
* (e.g. a degenerate sub-shape) — this can corrupt the kernel for the rest of the session,
|
|
190
|
+
* so it must not be silently relabelled as a file-read issue;
|
|
191
|
+
* - anything else is an FS read failure on the V7 file path (write succeeded, readback threw).
|
|
192
|
+
*/
|
|
193
|
+
function exportError(e, fmt) {
|
|
194
|
+
if (e instanceof Error && e.message.startsWith(`${fmt} export failed`)) return require_errors.ioError(`${fmt}_EXPORT_FAILED`, `Failed to write ${fmt} file`, e);
|
|
195
|
+
if (e instanceof WebAssembly.RuntimeError) return require_errors.ioError(`${fmt}_EXPORT_CRASHED`, `${fmt} export crashed the kernel (${e.message}); the shape likely contains geometry the ${fmt} writer cannot serialize`, e);
|
|
196
|
+
return require_errors.ioError(`${fmt}_FILE_READ_ERROR`, `Failed to read exported ${fmt} file`, e);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Probe a shape's bounding box before handing it to the STEP/STL writer.
|
|
200
|
+
*
|
|
201
|
+
* Some sub-shapes pass `isValid`/`validSolid` yet are degenerate enough that the
|
|
202
|
+
* OCCT writer traps with a `WebAssembly.RuntimeError` (OOB) mid-transfer — which
|
|
203
|
+
* corrupts the Emscripten heap and poisons the kernel for the rest of the session
|
|
204
|
+
* (#1126). `getBounds` exercises the same geometry but fails *catchably*, so a
|
|
205
|
+
* cheap pre-export probe lets us return a clean `Err` instead of crashing.
|
|
206
|
+
* Heuristic, not universal: it only catches shapes whose bounding-box evaluation
|
|
207
|
+
* also throws.
|
|
208
|
+
*/
|
|
209
|
+
function probeSerializable(shape, fmt) {
|
|
210
|
+
try {
|
|
211
|
+
require_topologyQueryFns.getBounds(shape);
|
|
212
|
+
return null;
|
|
213
|
+
} catch (e) {
|
|
214
|
+
if (e instanceof TypeError) throw e;
|
|
215
|
+
return require_errors.ioError(`${fmt}_EXPORT_UNSERIALIZABLE`, `${fmt} export aborted: the shape contains degenerate geometry the ${fmt} writer cannot serialize (bounding-box evaluation failed); export was skipped to avoid crashing the kernel`, e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
184
218
|
function exportSTEP(shape) {
|
|
219
|
+
const unserializable = probeSerializable(shape, "STEP");
|
|
220
|
+
if (unserializable) return require_errors.err(unserializable);
|
|
185
221
|
try {
|
|
186
222
|
const stepString = require_shapeTypes.getKernel().exportSTEP([shape.wrapped]);
|
|
187
223
|
return require_errors.ok(new Blob([stepString], { type: "application/STEP" }));
|
|
188
224
|
} catch (e) {
|
|
189
|
-
|
|
190
|
-
return require_errors.err(require_errors.ioError(isWriteFailure ? "STEP_EXPORT_FAILED" : "STEP_FILE_READ_ERROR", isWriteFailure ? "Failed to write STEP file" : "Failed to read exported STEP file", e));
|
|
225
|
+
return require_errors.err(exportError(e, "STEP"));
|
|
191
226
|
}
|
|
192
227
|
}
|
|
193
228
|
/**
|
|
@@ -196,13 +231,14 @@ function exportSTEP(shape) {
|
|
|
196
231
|
* @returns Ok with a Blob (MIME type `application/sla`), or Err on failure.
|
|
197
232
|
*/
|
|
198
233
|
function exportSTL(shape, { tolerance = .001, angularTolerance = .1, binary = false } = {}) {
|
|
234
|
+
const unserializable = probeSerializable(shape, "STL");
|
|
235
|
+
if (unserializable) return require_errors.err(unserializable);
|
|
199
236
|
try {
|
|
200
237
|
if (!require_shapeTypes.getKernel().hasTriangulation(shape.wrapped)) require_shapeTypes.getKernel().meshShape(shape.wrapped, tolerance, angularTolerance);
|
|
201
238
|
const stlData = require_shapeTypes.getKernel().exportSTL(shape.wrapped, binary);
|
|
202
239
|
return require_errors.ok(new Blob([stlData], { type: "application/sla" }));
|
|
203
240
|
} catch (e) {
|
|
204
|
-
|
|
205
|
-
return require_errors.err(require_errors.ioError(isWriteFailure ? "STL_EXPORT_FAILED" : "STL_FILE_READ_ERROR", isWriteFailure ? "Failed to write STL file" : "Failed to read exported STL file", e));
|
|
241
|
+
return require_errors.err(exportError(e, "STL"));
|
|
206
242
|
}
|
|
207
243
|
}
|
|
208
244
|
/**
|
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_historyFns = require("./historyFns-
|
|
3
|
-
const require_extrudeFns = require("./extrudeFns-
|
|
2
|
+
const require_historyFns = require("./historyFns-C2glA6vu.cjs");
|
|
3
|
+
const require_extrudeFns = require("./extrudeFns-DpRGUaxD.cjs");
|
|
4
4
|
exports.addChild = require_historyFns.addChild;
|
|
5
5
|
exports.addStep = require_historyFns.addStep;
|
|
6
6
|
exports.circularPattern = require_historyFns.circularPattern;
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, T as gridPattern, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, g as addChild, h as undoLast, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-
|
|
2
|
-
import { c as sweep, i as complexExtrude, l as twistExtrude, s as supportExtrude } from "./extrudeFns-
|
|
1
|
+
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, T as gridPattern, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, g as addChild, h as undoLast, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-ByJG4mBP.js";
|
|
2
|
+
import { c as sweep, i as complexExtrude, l as twistExtrude, s as supportExtrude } from "./extrudeFns-Cl_azGgy.js";
|
|
3
3
|
export { addChild, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, exportAssemblySTEP, findNode, findStep, getShape as getHistoryShape, gridPattern, linearPattern, modifyStep, registerOperation, registerShape, removeChild, replayFrom, replayHistory, stepCount, stepsFrom, supportExtrude, sweep, twistExtrude, undoLast, updateNode, walkAssembly };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
2
2
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ok, R as unwrap, b as err, d as validationError } from "./errors-
|
|
1
|
+
import { A as ok, R as unwrap, b as err, d as validationError } from "./errors-DNWJsfVU.js";
|
|
2
2
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { d as vecNormalize, h as vecScale, m as vecRotate, r as vecCross, s as vecIsZero, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bbh2doYh.cjs");
|
|
2
|
+
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-C0kAqcn5.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-C6qUr_gw.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-B3v9_keQ.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
9
|
-
const require_booleanFns = require("./booleanFns-
|
|
10
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DsISMCwj.cjs");
|
|
9
|
+
const require_booleanFns = require("./booleanFns-D19tR8Gn.cjs");
|
|
10
|
+
const require_solidBuilders = require("./solidBuilders-Ck6gpdQR.cjs");
|
|
11
11
|
//#region src/topology/threeHelpers.ts
|
|
12
12
|
/**
|
|
13
13
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Z as getKernel, _ as isSolid, c as createSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, x as isClosedWire, y as isWire } from "./shapeTypes-
|
|
2
|
-
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as andThen, w as isErr } from "./errors-
|
|
3
|
-
import { c as
|
|
1
|
+
import { Z as getKernel, _ as isSolid, c as createSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, x as isClosedWire, y as isWire } from "./shapeTypes-C-MpR5-e.js";
|
|
2
|
+
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as andThen, 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-B81GSST_.js";
|
|
4
4
|
import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { _ as downcast } from "./faceFns-
|
|
6
|
-
import { _ as propagateAllMetadata, g as collectInputFaceHashes, h as translate } from "./shapeFns-
|
|
5
|
+
import { _ as downcast } from "./faceFns-eVWgSIzt.js";
|
|
6
|
+
import { _ as propagateAllMetadata, g as collectInputFaceHashes, h as translate } from "./shapeFns-BbHQjI5-.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
|
-
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-
|
|
9
|
-
import { a as fuseAll, i as fuse, n as cut, r as cutAll } from "./booleanFns-
|
|
10
|
-
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-
|
|
8
|
+
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-D4p1YPCz.js";
|
|
9
|
+
import { a as fuseAll, i as fuse, n as cut, r as cutAll } from "./booleanFns-nHsLqZ7Y.js";
|
|
10
|
+
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-C44fKbQQ.js";
|
|
11
11
|
//#region src/topology/threeHelpers.ts
|
|
12
12
|
/**
|
|
13
13
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
package/dist/projection.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_cameraFns = require("./cameraFns-
|
|
2
|
+
const require_cameraFns = require("./cameraFns-D_8-JO0p.cjs");
|
|
3
3
|
exports.PROJECTION_PLANES = require_cameraFns.PROJECTION_PLANES;
|
|
4
4
|
exports.cameraFromPlane = require_cameraFns.cameraFromPlane;
|
|
5
5
|
exports.cameraLookAt = require_cameraFns.cameraLookAt;
|
package/dist/projection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-
|
|
1
|
+
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-Bhjy2SuC.js";
|
|
2
2
|
export { PROJECTION_PLANES, cameraFromPlane, cameraLookAt, createCamera, isProjectionPlane, makeProjectedEdges, projectEdges };
|
package/dist/query.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_helpers = require("./helpers-
|
|
3
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
2
|
+
const require_helpers = require("./helpers-DNVILwHA.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-Bmp3Vm5g.cjs");
|
|
4
4
|
exports.cornerFinder = require_cornerFinder.cornerFinder;
|
|
5
5
|
exports.edgeFinder = require_helpers.edgeFinder;
|
|
6
6
|
exports.faceFinder = require_helpers.faceFinder;
|