brepjs 20.12.5 → 20.12.6
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/lib/offset.d.ts +1 -1
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-B2Po1gPs.js → adjacencyFns--KmBIKYJ.js} +3 -3
- package/dist/{adjacencyFns-Cho9v3Q3.cjs → adjacencyFns-BFJfaUwX.cjs} +3 -3
- package/dist/{blueprint-Zmt5-07y.js → blueprint-BhIk9Pvm.js} +7 -8
- package/dist/{blueprint-ERmwk6zG.cjs → blueprint-D83DDDPb.cjs} +7 -8
- package/dist/{blueprintFns-B_sxtIo7.cjs → blueprintFns-C4TQn-x_.cjs} +2 -2
- package/dist/{blueprintFns-Dtm-XukP.js → blueprintFns-eULVgkq9.js} +2 -2
- package/dist/{blueprintSketcher-CwTAtrkY.js → blueprintSketcher-D_Faf0GO.js} +32 -14
- package/dist/{blueprintSketcher-CZyokLGJ.cjs → blueprintSketcher-Di376t-0.cjs} +32 -14
- package/dist/{boolean2D-CRuNKgXs.cjs → boolean2D-CNZFI_y8.cjs} +4 -4
- package/dist/{boolean2D-yUpS8onH.js → boolean2D-DqpCF72W.js} +4 -4
- package/dist/brepjs.cjs +30 -30
- package/dist/brepjs.js +30 -30
- package/dist/{cameraFns-DRok4UxZ.js → cameraFns-CrClIkmV.js} +3 -3
- package/dist/{cameraFns-DB1IyMmS.cjs → cameraFns-RqraCXIc.cjs} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-D5qnDbtZ.js → cornerFinder-BZuQkRp2.js} +1 -1
- package/dist/{cornerFinder-DfYBHHZG.cjs → cornerFinder-CdOe1Wrb.cjs} +1 -1
- package/dist/{curveFns-BGPSFUWB.js → curveFns-BP3srCfK.js} +1 -1
- package/dist/{curveFns-BKT4Sg8q.cjs → curveFns-CyIvQNYT.cjs} +1 -1
- package/dist/{drawFns-D8e5RiRe.cjs → drawFns-71cOhWD-.cjs} +18 -13
- package/dist/{drawFns-aGufr-pr.js → drawFns-DxDwJ5zZ.js} +18 -13
- package/dist/{faceFns-Cx7cwUMx.cjs → faceFns-B7MiDYj1.cjs} +2 -2
- package/dist/{faceFns-lE2OvBfq.js → faceFns-iVPbTxki.js} +2 -2
- package/dist/{healingFns-B94zSk1-.js → healingFns-BhP8zfp1.js} +5 -5
- package/dist/{healingFns-CcgyrL6h.cjs → healingFns-DWljGTNR.cjs} +5 -5
- package/dist/{helpers-CNgipe6l.js → helpers-D2hANLRu.js} +6 -6
- package/dist/{helpers-C4f2MV-r.cjs → helpers-DKEVm6Hu.cjs} +6 -6
- package/dist/{importFns-gB1X3ti2.js → importFns-DUzIkns7.js} +2 -2
- package/dist/{importFns-fIdcaMqt.cjs → importFns-KEPAgbjj.cjs} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/bspline2dFit.d.ts +42 -0
- package/dist/kernel/geometry2d.d.ts +45 -0
- package/dist/kernel/occt/kernel2dOps.d.ts +1 -1
- package/dist/kernel/occtWasm/kernel2dOps.d.ts +7 -4
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
- package/dist/{loftFns-AHaYxJyS.cjs → loftFns-D5AvfCGG.cjs} +1 -1
- package/dist/{loftFns-mbyBvJ8Y.js → loftFns-D5NJpHLZ.js} +1 -1
- package/dist/{measureFns-CuabRDRL.cjs → measureFns-CZHNWkiA.cjs} +3 -3
- package/dist/{measureFns-C94G0fH8.js → measureFns-mxBdPiWa.js} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-GXF5gPZL.cjs → meshFns-Czlt-GBJ.cjs} +3 -3
- package/dist/{meshFns-jarDZKw1.js → meshFns-DmjMzNbH.js} +3 -3
- package/dist/{occtWasmAdapter-DlNmVNUn.js → occtWasmAdapter-B9d0Q0Vl.js} +1153 -257
- package/dist/{occtWasmAdapter-DeoeK2iJ.cjs → occtWasmAdapter-DVxLkjlJ.cjs} +1164 -256
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-BxeUD2NM.js → originTrackingFns-CBnyKLm7.js} +2 -2
- package/dist/{originTrackingFns-C-yuMV3m.cjs → originTrackingFns-CHymOLLm.cjs} +2 -2
- package/dist/{primitiveFns-BVAkYHVf.cjs → primitiveFns-BVeBEaa4.cjs} +4 -4
- package/dist/{primitiveFns-CualoFAk.js → primitiveFns-DeNl60Rw.js} +4 -4
- package/dist/{principalBoxFns-DtI7tVuS.js → principalBoxFns-3mW_hA6z.js} +3 -3
- package/dist/{principalBoxFns-DHh5_HCw.cjs → principalBoxFns-CG6kG7vT.cjs} +3 -3
- 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-CaAw-ya3.cjs → refResolveFns-BAs4p9z7.cjs} +6 -6
- package/dist/{refResolveFns--SRyN2qa.js → refResolveFns-DHx1Y3GG.js} +6 -6
- package/dist/{shapeFns-CwjjUOr0.cjs → shapeFns-C0w8vvfb.cjs} +2 -2
- package/dist/{shapeFns-CdrDroOM.js → shapeFns-CgqKICF_.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-D938X2mg.cjs → shapeTypes-Dc7j-MYg.cjs} +10 -16
- package/dist/{shapeTypes-PNVEv6ga.js → shapeTypes-DwvQUp9M.js} +10 -16
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-Hft8Cr6a.js → solidBuilders-DT1gpVWM.js} +5 -5
- package/dist/{solidBuilders-CAkBQKWb.cjs → solidBuilders-iS5DDwg8.cjs} +5 -5
- package/dist/{surfaceBuilders-BKCiVf7T.cjs → surfaceBuilders-BvwSgD3C.cjs} +3 -3
- package/dist/{surfaceBuilders-CrO_BBKM.js → surfaceBuilders-CPLe0bbk.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-B8q2a-nN.js → textBlueprints-BU0Rhk54.js} +7 -7
- package/dist/{textBlueprints-C9HeYc5a.cjs → textBlueprints-CNPCPJix.cjs} +7 -7
- package/dist/{textMetrics-1fhCSAGF.cjs → textMetrics-C71g4TmO.cjs} +1 -1
- package/dist/{textMetrics-DJfTSy6w.js → textMetrics-Df9aLYK2.js} +1 -1
- package/dist/{threadFns-CVIEbOW3.cjs → threadFns-CzXEnnmo.cjs} +7 -7
- package/dist/{threadFns-f2KwibLR.js → threadFns-DESH7lcs.js} +7 -7
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-4WYqtSFF.cjs → topologyQueryFns-5Frx8Y-0.cjs} +1 -1
- package/dist/{topologyQueryFns-BZUY10TD.js → topologyQueryFns-LXV1nTaS.js} +1 -1
- package/dist/{validityTypes-tWSx_zAH.cjs → validityTypes-C6rROGTP.cjs} +1 -1
- package/dist/{validityTypes-DAXIqwZM.js → validityTypes-DM-Iwe8N.js} +1 -1
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
3
3
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
4
4
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
5
|
-
const require_validityTypes = require("./validityTypes-
|
|
5
|
+
const require_validityTypes = require("./validityTypes-C6rROGTP.cjs");
|
|
6
6
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
7
7
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
8
8
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, H as withScope, L as isLive, M as is3D, N as DisposalScope, P as createHandle, S as isShell, T as isWire, U as withScopeResult, W as withScopeResultAsync, _ as isCompound, b as isShape1D, i as castShape, j as is2D, v as isEdge, w as isVertex, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
1
|
+
import { C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, H as withScope, L as isLive, M as is3D, N as DisposalScope, P as createHandle, S as isShell, T as isWire, U as withScopeResult, W as withScopeResultAsync, _ as isCompound, b as isShape1D, i as castShape, j as is2D, v as isEdge, w as isVertex, x as isShape3D, y as isFace } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { n as bug, t as BrepBugError } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, F as unwrapErr, I as unwrapOr, L as unwrapOrElse, M as tryCatch, N as tryCatchAsync, P as unwrap, S as map, T as match, _ as flatMap, a as moduleInitError, b as isErr, c as sketcherStateError, d as validationError, f as OK, g as err, h as collect, i as kernelError, l as typeCastError, m as andThen, n as computationError, o as queryError, r as ioError, u as unsupportedError, w as mapErr, x as isOk } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { c as manifoldShell, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, r as isManifoldShell, s as isValidSolid, t as closedWire } from "./validityTypes-
|
|
4
|
+
import { c as manifoldShell, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, r as isManifoldShell, s as isValidSolid, t as closedWire } from "./validityTypes-DM-Iwe8N.js";
|
|
5
5
|
import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
6
6
|
import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-CKXsIm9-.js";
|
|
7
7
|
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-S-m9H_fe.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
2
2
|
import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
3
|
-
import { p as distance2d, u as angle2d, v as samePoint } from "./helpers-
|
|
3
|
+
import { p as distance2d, u as angle2d, v as samePoint } from "./helpers-D2hANLRu.js";
|
|
4
4
|
// src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
2
2
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
3
|
-
const require_helpers = require("./helpers-
|
|
3
|
+
const require_helpers = require("./helpers-DKEVm6Hu.cjs");
|
|
4
4
|
// src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-
|
|
1
|
+
import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { E as ok, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
|
|
3
3
|
// src/topology/curveFns.ts
|
|
4
4
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
5
5
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
6
6
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
7
7
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
8
8
|
const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
|
|
9
|
-
const require_faceFns = require("./faceFns-
|
|
10
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
+
const require_faceFns = require("./faceFns-B7MiDYj1.cjs");
|
|
10
|
+
const require_curveFns = require("./curveFns-CyIvQNYT.cjs");
|
|
11
11
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.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-BvwSgD3C.cjs");
|
|
13
|
+
const require_blueprintSketcher = require("./blueprintSketcher-Di376t-0.cjs");
|
|
14
|
+
const require_helpers = require("./helpers-DKEVm6Hu.cjs");
|
|
15
|
+
const require_blueprint = require("./blueprint-D83DDDPb.cjs");
|
|
16
|
+
const require_cornerFinder = require("./cornerFinder-CdOe1Wrb.cjs");
|
|
17
|
+
const require_boolean2D = require("./boolean2D-CNZFI_y8.cjs");
|
|
18
|
+
const require_textBlueprints = require("./textBlueprints-CNPCPJix.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-RqraCXIc.cjs");
|
|
20
20
|
// src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -699,6 +699,10 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
699
699
|
else if (!samePoint(curve.offset.firstPoint, curve.offset.lastPoint)) offsettedArray.push(require_blueprint.make2dSegmentCurve(curve.offset.firstPoint, curve.offset.lastPoint));
|
|
700
700
|
}
|
|
701
701
|
const iterateOffsetCurves = function* () {
|
|
702
|
+
if (offsetCurves.length === 1) {
|
|
703
|
+
yield require_errors.safeIndex(offsetCurves, 0, "rawOffsets");
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
702
706
|
for (const curve of offsetCurves.slice(0, -1)) yield curve;
|
|
703
707
|
if (!savedLastCurve) require_bug.bug("offset.rawOffsets", "No saved curve after iterating offset segments");
|
|
704
708
|
yield savedLastCurve;
|
|
@@ -746,7 +750,8 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
746
750
|
*/
|
|
747
751
|
function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
748
752
|
const offsettedArray = rawOffsets(blueprint, offset, offsetConfig);
|
|
749
|
-
|
|
753
|
+
const [onlyCurve] = offsettedArray;
|
|
754
|
+
if (!onlyCurve || offsettedArray.length === 1 && !samePoint(onlyCurve.firstPoint, onlyCurve.lastPoint)) return null;
|
|
750
755
|
const allIntersections = findSelfIntersections(offsettedArray);
|
|
751
756
|
if (!allIntersections.size) {
|
|
752
757
|
const offsettedBlueprint = new require_blueprint.Blueprint(offsettedArray);
|
|
@@ -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-DwvQUp9M.js";
|
|
2
2
|
import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { P as unwrap, s as safeIndex } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { s as getEdges } from "./topologyQueryFns-
|
|
4
|
+
import { s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
|
|
5
5
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
6
6
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
7
7
|
import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-S-m9H_fe.js";
|
|
8
8
|
import { a as planeToWorld, o as resolvePlane } from "./planeOps-D3yDuMux.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-
|
|
10
|
-
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-
|
|
9
|
+
import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-iVPbTxki.js";
|
|
10
|
+
import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-BP3srCfK.js";
|
|
11
11
|
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.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 wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } 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-CPLe0bbk.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-D_Faf0GO.js";
|
|
14
|
+
import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-D2hANLRu.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-BhIk9Pvm.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-BZuQkRp2.js";
|
|
17
|
+
import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-DqpCF72W.js";
|
|
18
|
+
import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-BU0Rhk54.js";
|
|
19
|
+
import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-CrClIkmV.js";
|
|
20
20
|
// src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -699,6 +699,10 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
699
699
|
else if (!samePoint(curve.offset.firstPoint, curve.offset.lastPoint)) offsettedArray.push(make2dSegmentCurve(curve.offset.firstPoint, curve.offset.lastPoint));
|
|
700
700
|
}
|
|
701
701
|
const iterateOffsetCurves = function* () {
|
|
702
|
+
if (offsetCurves.length === 1) {
|
|
703
|
+
yield safeIndex(offsetCurves, 0, "rawOffsets");
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
702
706
|
for (const curve of offsetCurves.slice(0, -1)) yield curve;
|
|
703
707
|
if (!savedLastCurve) bug("offset.rawOffsets", "No saved curve after iterating offset segments");
|
|
704
708
|
yield savedLastCurve;
|
|
@@ -746,7 +750,8 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
746
750
|
*/
|
|
747
751
|
function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
748
752
|
const offsettedArray = rawOffsets(blueprint, offset, offsetConfig);
|
|
749
|
-
|
|
753
|
+
const [onlyCurve] = offsettedArray;
|
|
754
|
+
if (!onlyCurve || offsettedArray.length === 1 && !samePoint(onlyCurve.firstPoint, onlyCurve.lastPoint)) return null;
|
|
750
755
|
const allIntersections = findSelfIntersections(offsettedArray);
|
|
751
756
|
if (!allIntersections.size) {
|
|
752
757
|
const offsettedBlueprint = new Blueprint(offsettedArray);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
4
4
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
5
5
|
// src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-LXV1nTaS.js";
|
|
4
4
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
5
5
|
// src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-DwvQUp9M.js";
|
|
2
|
+
import { j as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-B9d0Q0Vl.js";
|
|
3
3
|
import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError, x as isOk } from "./errors-BTccWbtE.js";
|
|
4
|
-
import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
4
|
+
import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
|
|
5
5
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
6
|
-
import { y as downcast } from "./faceFns-
|
|
7
|
-
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-
|
|
6
|
+
import { y as downcast } from "./faceFns-iVPbTxki.js";
|
|
7
|
+
import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-DT1gpVWM.js";
|
|
8
8
|
import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
9
9
|
// src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-DVxLkjlJ.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
5
5
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
6
|
+
const require_faceFns = require("./faceFns-B7MiDYj1.cjs");
|
|
7
|
+
const require_solidBuilders = require("./solidBuilders-iS5DDwg8.cjs");
|
|
8
8
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
9
9
|
// src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { q as getKernel, y as isFace } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, y as isFace } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { E as ok, g as err, o as queryError, x as isOk } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-S-m9H_fe.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-iVPbTxki.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-CgqKICF_.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-BP3srCfK.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-mxBdPiWa.js";
|
|
10
10
|
// 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-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.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-B7MiDYj1.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-C0w8vvfb.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-CyIvQNYT.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-CZHNWkiA.cjs");
|
|
10
10
|
// 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-DwvQUp9M.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.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-BhIk9Pvm.js";
|
|
6
6
|
// 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-Dc7j-MYg.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-D83DDDPb.cjs");
|
|
6
6
|
// src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-Czlt-GBJ.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-KEPAgbjj.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-DmjMzNbH.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-DUzIkns7.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Bezier2d, BSpline2d } from './geometry2d.js';
|
|
2
|
+
type Pt = [number, number];
|
|
3
|
+
/**
|
|
4
|
+
* Interpolate `points` with a clamped B-spline of `degree` (capped at
|
|
5
|
+
* `points.length - 1`). `params` are the increasing curve parameters assigned to
|
|
6
|
+
* the points, normalised to [0, 1]; chord length when omitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare function interpolateBSpline2d(points: readonly Pt[], degree?: number, params?: readonly number[]): BSpline2d;
|
|
9
|
+
interface FitOptions {
|
|
10
|
+
readonly degree?: number;
|
|
11
|
+
readonly minSegments?: number;
|
|
12
|
+
readonly maxSegments?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Parameters in (s0, s1) where the curve may change abruptly, such as a
|
|
15
|
+
* source B-spline's knots. Each piece between them is fitted on its own, so
|
|
16
|
+
* a feature narrower than the sample spacing cannot fall between samples.
|
|
17
|
+
*/
|
|
18
|
+
readonly breaks?: readonly number[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Approximate the parametric curve `evaluate` over [s0, s1] by interpolating
|
|
22
|
+
* uniformly spaced samples, doubling the sample count until the interpolant is
|
|
23
|
+
* within `tolerance` of the curve at every mid-sample parameter (or the
|
|
24
|
+
* segment cap is reached). With `breaks`, each piece between them is fitted
|
|
25
|
+
* separately and the pieces are joined. The B-spline runs over [0, 1] in step
|
|
26
|
+
* with s.
|
|
27
|
+
*/
|
|
28
|
+
export declare function fitBSpline2d(evaluate: (s: number) => Pt, s0: number, s1: number, tolerance: number, options?: FitOptions): BSpline2d;
|
|
29
|
+
/** The B-spline form of a Bezier; a B-spline is returned as is. */
|
|
30
|
+
export declare function asBSpline2d(c: Bezier2d | BSpline2d): BSpline2d;
|
|
31
|
+
/**
|
|
32
|
+
* The part of a clamped B-spline over [lo, hi] (inside its knot range, lo < hi)
|
|
33
|
+
* as a clamped B-spline of its own, exact by knot insertion.
|
|
34
|
+
*/
|
|
35
|
+
export declare function subBSpline2d(c: BSpline2d, lo: number, hi: number): BSpline2d;
|
|
36
|
+
/**
|
|
37
|
+
* Bezier poles of every non-empty knot span (The NURBS Book A5.6). A malformed
|
|
38
|
+
* knot vector yields the whole control polygon as one segment, which still
|
|
39
|
+
* bounds the curve.
|
|
40
|
+
*/
|
|
41
|
+
export declare function bezierSegments2d(c: BSpline2d): Pt[][];
|
|
42
|
+
export {};
|
|
@@ -69,6 +69,18 @@ export declare function curveBounds(c: Curve2dObj): {
|
|
|
69
69
|
last: number;
|
|
70
70
|
};
|
|
71
71
|
export declare function curveTypeName(c: Curve2dObj): string;
|
|
72
|
+
/**
|
|
73
|
+
* Collapse nested trimmed wrappers into a single trimmed curve over a
|
|
74
|
+
* non-trimmed basis (or return the curve itself when it is not trimmed).
|
|
75
|
+
* Evaluation is unchanged: both forms map t in [0, 1] to the same basis point.
|
|
76
|
+
*/
|
|
77
|
+
export declare function flattenTrimmed(c: Curve2dObj): Curve2dObj;
|
|
78
|
+
/**
|
|
79
|
+
* The same geometry traversed in the opposite direction (OCCT `Geom2d_Curve::Reversed`).
|
|
80
|
+
* Trimmed curves keep an increasing trim range: the basis is reversed and the
|
|
81
|
+
* range is remapped onto it.
|
|
82
|
+
*/
|
|
83
|
+
export declare function reverseCurve2d(c: Curve2dObj): Curve2dObj;
|
|
72
84
|
export declare function makeLine2d(x1: number, y1: number, x2: number, y2: number): Line2d;
|
|
73
85
|
export declare function makeCircle2d(cx: number, cy: number, radius: number, sense?: boolean): Circle2d;
|
|
74
86
|
export declare function makeArc2dThreePoints(x1: number, y1: number, xm: number, ym: number, x2: number, y2: number): Curve2dObj;
|
|
@@ -80,6 +92,39 @@ export declare function rotateCurve2d(c: Curve2dObj, angle: number, cx: number,
|
|
|
80
92
|
export declare function scaleCurve2d(c: Curve2dObj, factor: number, cx: number, cy: number): Curve2dObj;
|
|
81
93
|
export declare function mirrorAtPoint(c: Curve2dObj, cx: number, cy: number): Curve2dObj;
|
|
82
94
|
export declare function mirrorAcrossAxis(c: Curve2dObj, ox: number, oy: number, dx: number, dy: number): Curve2dObj;
|
|
95
|
+
/** The affine map x' = a*x + b*y + tx, y' = c*x + d*y + ty. */
|
|
96
|
+
export interface Affine2d {
|
|
97
|
+
readonly a: number;
|
|
98
|
+
readonly b: number;
|
|
99
|
+
readonly c: number;
|
|
100
|
+
readonly d: number;
|
|
101
|
+
readonly tx: number;
|
|
102
|
+
readonly ty: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Exact image of a curve under an affine map (OCCT `Geom2d_Curve::Transformed`
|
|
106
|
+
* with a `gp_GTrsf2d`): lines stay lines, circles and ellipses become ellipses
|
|
107
|
+
* (or circles), and pole-based curves map their poles.
|
|
108
|
+
*/
|
|
109
|
+
export declare function affineCurve2d(c: Curve2dObj, m: Affine2d): Curve2dObj;
|
|
110
|
+
/**
|
|
111
|
+
* Parameters of `c`, in its own parameter range, at the interior knots of its
|
|
112
|
+
* B-spline basis: where a fit of the curve (or of its offset) must sample.
|
|
113
|
+
*/
|
|
114
|
+
export declare function curveKnotParams(c: Curve2dObj): number[];
|
|
115
|
+
/**
|
|
116
|
+
* Offset `distance` to the right of the direction of travel (OCCT
|
|
117
|
+
* `Geom2d_OffsetCurve`: a counter-clockwise circle grows). Lines and circles
|
|
118
|
+
* are offset exactly; other curves are fitted within `tolerance` (by default
|
|
119
|
+
* relative to the curve's size).
|
|
120
|
+
*/
|
|
121
|
+
export declare function offsetCurve2d(c: Curve2dObj, distance: number, tolerance?: number): Curve2dObj;
|
|
122
|
+
/**
|
|
123
|
+
* Minimum distance between c1 over [from1, to1] and c2 over [from2, to2]
|
|
124
|
+
* (OCCT `Geom2dAPI_ExtremaCurveCurve`): every local minimum of a sampled
|
|
125
|
+
* distance grid seeds a Gauss-Newton refinement.
|
|
126
|
+
*/
|
|
127
|
+
export declare function distanceBetweenCurves2d(c1: Curve2dObj, c2: Curve2dObj, from1: number, to1: number, from2: number, to2: number): number;
|
|
83
128
|
/**
|
|
84
129
|
* Compute intersection points (and overlapping segments) between two 2D curves.
|
|
85
130
|
* Handles analytic cases (line-line, line-circle, circle-circle) and falls back
|
|
@@ -24,7 +24,7 @@ export declare function getCurve2dBounds(curve: Curve2dHandle): {
|
|
|
24
24
|
};
|
|
25
25
|
export declare function getCurve2dType(curve: Curve2dHandle): string;
|
|
26
26
|
export declare function trimCurve2d(curve: Curve2dHandle, start: number, end: number): Curve2dHandle;
|
|
27
|
-
export declare function reverseCurve2d(
|
|
27
|
+
export declare function reverseCurve2d(curve: Curve2dHandle): void;
|
|
28
28
|
export declare function copyCurve2d(curve: Curve2dHandle): Curve2dHandle;
|
|
29
29
|
export declare function offsetCurve2d(curve: Curve2dHandle, offset: number): Curve2dHandle;
|
|
30
30
|
export declare function translateCurve2d(curve: Curve2dHandle, dx: number, dy: number): Curve2dHandle;
|
|
@@ -31,7 +31,7 @@ export declare function getCurve2dBounds(curve: Curve2dHandle): {
|
|
|
31
31
|
};
|
|
32
32
|
export declare function getCurve2dType(curve: Curve2dHandle): string;
|
|
33
33
|
export declare function trimCurve2d(curve: Curve2dHandle, start: number, end: number): Curve2dHandle;
|
|
34
|
-
export declare function reverseCurve2d(
|
|
34
|
+
export declare function reverseCurve2d(curve: Curve2dHandle): void;
|
|
35
35
|
export declare function copyCurve2d(curve: Curve2dHandle): Curve2dHandle;
|
|
36
36
|
export declare function offsetCurve2d(curve: Curve2dHandle, offset: number): Curve2dHandle;
|
|
37
37
|
export declare function translateCurve2d(curve: Curve2dHandle, dx: number, dy: number): Curve2dHandle;
|
|
@@ -42,8 +42,7 @@ export declare function mirrorCurve2dAcrossAxis(curve: Curve2dHandle, originX: n
|
|
|
42
42
|
/**
|
|
43
43
|
* Directional affinity matching OCCT `gp_GTrsf2d::SetAffinity`: scales the
|
|
44
44
|
* component perpendicular to the axis `(dx, dy)` through `(ox, oy)` by `ratio`,
|
|
45
|
-
* leaving the parallel component fixed.
|
|
46
|
-
* Bezier, since occt-wasm has no native Geom2d transform.
|
|
45
|
+
* leaving the parallel component fixed.
|
|
47
46
|
*/
|
|
48
47
|
export declare function affinityCurve2d(curve: Curve2dHandle, ox: number, oy: number, dx: number, dy: number, ratio: number): Curve2dHandle;
|
|
49
48
|
export declare function affinityTransform2d(curve: Curve2dHandle, ox: number, oy: number, dx: number, dy: number, ratio: number): Curve2dHandle;
|
|
@@ -65,7 +64,11 @@ export declare function projectPointOnCurve2d(curve: Curve2dHandle, x: number, y
|
|
|
65
64
|
distance: number;
|
|
66
65
|
} | null;
|
|
67
66
|
export declare function distanceBetweenCurves2d(c1: Curve2dHandle, c2: Curve2dHandle, p1Start: number, p1End: number, p2Start: number, p2End: number): number;
|
|
68
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Degree <= 3 B-spline within `tolerance` of the curve (Geom2dConvert_ApproxCurve
|
|
69
|
+
* with MaxDegree 3, as brepjs calls it); exact where the curve already is one.
|
|
70
|
+
*/
|
|
71
|
+
export declare function approximateCurve2dAsBSpline(curve: Curve2dHandle, tolerance: number, maxSegments: number): Curve2dHandle;
|
|
69
72
|
export declare function decomposeBSpline2dToBeziers(curve: Curve2dHandle): Curve2dHandle[];
|
|
70
73
|
export declare function createBoundingBox2d(): BBox2dHandle;
|
|
71
74
|
export declare function addCurveToBBox2d(bbox: BBox2dHandle, curve: Curve2dHandle, tolerance: number): void;
|
|
@@ -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-DVxLkjlJ.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -390,7 +390,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
390
390
|
makeEllipse2d(cx: number, cy: number, majorRadius: number, minorRadius: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
391
391
|
makeEllipseArc2d(cx: number, cy: number, majorRadius: number, minorRadius: number, startAngle: number, endAngle: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
392
392
|
makeBezier2d(points: [number, number][]): Curve2dHandle;
|
|
393
|
-
makeBSpline2d(points: [number, number][],
|
|
393
|
+
makeBSpline2d(points: [number, number][], options?: {
|
|
394
394
|
degMin?: number;
|
|
395
395
|
degMax?: number;
|
|
396
396
|
continuity?: 'C0' | 'C1' | 'C2' | 'C3';
|
|
@@ -435,7 +435,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
435
435
|
distance: number;
|
|
436
436
|
} | null;
|
|
437
437
|
distanceBetweenCurves2d(c1: Curve2dHandle, c2: Curve2dHandle, p1Start: number, p1End: number, p2Start: number, p2End: number): number;
|
|
438
|
-
approximateCurve2dAsBSpline(curve: Curve2dHandle,
|
|
438
|
+
approximateCurve2dAsBSpline(curve: Curve2dHandle, tolerance: number, _continuity: 'C0' | 'C1' | 'C2' | 'C3', maxSegments: number): Curve2dHandle;
|
|
439
439
|
decomposeBSpline2dToBeziers(curve: Curve2dHandle): Curve2dHandle[];
|
|
440
440
|
createBoundingBox2d(): BBox2dHandle;
|
|
441
441
|
addCurveToBBox2d(bbox: BBox2dHandle, curve: Curve2dHandle, tolerance: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
export { t as OcctWasmAdapter } from "../../occtWasmAdapter-B9d0Q0Vl.js";
|
|
@@ -170,6 +170,8 @@ export interface OcctKernelWasm {
|
|
|
170
170
|
/** occt-wasm 5.8+: like makeEllipseArc with the major axis along (xx, xy, xz). */
|
|
171
171
|
makeEllipseArcOriented?(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, xx: number, xy: number, xz: number, majorRadius: number, minorRadius: number, startAngle: number, endAngle: number): number;
|
|
172
172
|
makeBezierEdge(flatPoints: EmVectorDouble): number;
|
|
173
|
+
/** occt-wasm 5.8+: non-rational when `weights` is empty; poles are flat xyz triples. */
|
|
174
|
+
makeBSplineEdge?(poles: EmVectorDouble, weights: EmVectorDouble, knots: EmVectorDouble, multiplicities: EmVectorInt, degree: number, periodic: boolean): number;
|
|
173
175
|
makeTangentArc(x1: number, y1: number, z1: number, tx: number, ty: number, tz: number, x2: number, y2: number, z2: number): number;
|
|
174
176
|
makeHelixWire(px: number, py: number, pz: number, dx: number, dy: number, dz: number, pitch: number, height: number, radius: number): number;
|
|
175
177
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
3
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DwvQUp9M.js";
|
|
2
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-BTccWbtE.js";
|
|
3
3
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
4
4
|
import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-B7MiDYj1.cjs");
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { E as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { E as kernelCallRaw } from "./topologyQueryFns-LXV1nTaS.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-iVPbTxki.js";
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
3
|
-
const require_principalBoxFns = require("./principalBoxFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-CZHNWkiA.cjs");
|
|
3
|
+
const require_principalBoxFns = require("./principalBoxFns-CG6kG7vT.cjs");
|
|
4
4
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
5
5
|
exports.measureArea = require_measureFns.measureArea;
|
|
6
6
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,3 +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
|
-
import { t as principalBoundingBox } from "./principalBoxFns-
|
|
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-mxBdPiWa.js";
|
|
2
|
+
import { t as principalBoundingBox } from "./principalBoxFns-3mW_hA6z.js";
|
|
3
3
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_originTrackingFns = require("./originTrackingFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
|
|
4
|
+
const require_originTrackingFns = require("./originTrackingFns-CHymOLLm.cjs");
|
|
5
5
|
// src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-DwvQUp9M.js";
|
|
2
2
|
import { E as ok, g as err, r as ioError } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
4
|
-
import { t as getFaceOrigins } from "./originTrackingFns-
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-LXV1nTaS.js";
|
|
4
|
+
import { t as getFaceOrigins } from "./originTrackingFns-CBnyKLm7.js";
|
|
5
5
|
// src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|