brepjs 18.100.3 → 18.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{blueprint-DZB6Drrd.js → blueprint-CF12Nceg.js} +5 -5
- package/dist/{blueprint-1x01ITBT.cjs → blueprint-D5ArjKiA.cjs} +5 -5
- package/dist/{blueprintFns-o4dhTIZQ.js → blueprintFns-BuPAK4OB.js} +2 -2
- package/dist/{blueprintFns-DkmuKpz6.cjs → blueprintFns-CcCfkbyd.cjs} +2 -2
- package/dist/{blueprintSketcher-C5Q-JLEK.js → blueprintSketcher-CEQ8s7TD.js} +3 -3
- package/dist/{blueprintSketcher-BoHwuwaU.cjs → blueprintSketcher-DCttG3KS.cjs} +3 -3
- package/dist/{boolean2D-DV642GXt.js → boolean2D-8rB2sUzj.js} +4 -4
- package/dist/{boolean2D-C1Akp29q.cjs → boolean2D-BCqDjg0y.cjs} +4 -4
- package/dist/brepjs.cjs +234 -39
- package/dist/brepjs.js +228 -40
- package/dist/{cameraFns-B62EdiYs.js → cameraFns-Bu6jgTKc.js} +2 -2
- package/dist/{cameraFns-B-T9D-ie.cjs → cameraFns-S7YbAxfg.cjs} +2 -2
- package/dist/core/kernelBoundary.d.ts +1 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-Bmjk2BOw.js → cornerFinder-COqoeY--.js} +1 -1
- package/dist/{cornerFinder-CqSNuWBI.cjs → cornerFinder-Ci2NbbAW.cjs} +1 -1
- package/dist/csg/evaluate.d.ts +29 -6
- package/dist/{curveFns-CaEoZJFJ.js → curveFns-CG05Jygr.js} +1 -1
- package/dist/{curveFns-BIlzT4bO.cjs → curveFns-Dx7_wMut.cjs} +1 -1
- package/dist/{drawFns-BVVGRW0h.js → drawFns-CsXPFyDe.js} +12 -12
- package/dist/{drawFns-Dwq6JHbb.cjs → drawFns-DYkjT_hx.cjs} +12 -12
- package/dist/{faceFns-B7yceDjt.cjs → faceFns-DKg2St8b.cjs} +4 -7
- package/dist/{faceFns-CFvc_qXI.js → faceFns-mo4ThIHz.js} +4 -7
- package/dist/{healingFns-BY6Q9gge.js → healingFns-Bb3eEBNm.js} +5 -5
- package/dist/{healingFns-CEzX-45q.cjs → healingFns-CM5mVMow.cjs} +5 -5
- package/dist/{helpers-A0a3O6af.cjs → helpers-8zxf2gkc.cjs} +6 -6
- package/dist/{helpers-BamnXOMX.js → helpers-DT44wBAD.js} +6 -6
- package/dist/{importFns-Dj107tFY.cjs → importFns-B6hw9Nhx.cjs} +3 -3
- package/dist/{importFns-Cfe_tEh_.js → importFns-CEczwPdN.js} +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +6 -7
- package/dist/kernel/brepkit/kernel2dOps.d.ts +3 -4
- package/dist/kernel/geometry2d.d.ts +2 -0
- package/dist/kernel/occt/kernel2dOps.d.ts +3 -4
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-CFyOO359.cjs → loftFns-DaRDYpfB.cjs} +11 -1
- package/dist/{loftFns-D5rQxNOI.js → loftFns-DyNuD9XL.js} +11 -1
- package/dist/{measureFns-Bb0Do7in.js → measureFns-Dkh_DmrE.js} +3 -3
- package/dist/{measureFns-Cmc_y0WE.cjs → measureFns-Q2dnokUU.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-Bkcg1u5D.js → meshFns-CAAarhVm.js} +3 -3
- package/dist/{meshFns-BKBGgLB4.cjs → meshFns-DeKdpmu7.cjs} +3 -3
- package/dist/{occtWasmAdapter-D7mOxU0Q.js → occtWasmAdapter-BDEPveZs.js} +82 -14
- package/dist/{occtWasmAdapter-Bv2OTOX9.cjs → occtWasmAdapter-DDZELjlB.cjs} +93 -13
- package/dist/operations/extrudeUtils.d.ts +1 -6
- package/dist/operations/instanceFns.d.ts +66 -0
- package/dist/operations/sweepFns.d.ts +1 -7
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-DS7-3evP.js → primitiveFns-62SO4ti5.js} +4 -4
- package/dist/{primitiveFns-B898KlXM.cjs → primitiveFns-BAWtMd9H.cjs} +4 -4
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{shapeFns-D-4StVDd.js → shapeFns-DyBbhU30.js} +2 -2
- package/dist/{shapeFns-B3GP-0FJ.cjs → shapeFns-L4a8kH_A.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-DzVlxDhd.js → shapeRefFns-Cn4WNb3q.js} +4 -4
- package/dist/{shapeRefFns-C6L7KhTi.cjs → shapeRefFns-Dij41NuC.cjs} +4 -4
- package/dist/{shapeTypes-DQfoZt_L.cjs → shapeTypes-Bwgm5N6R.cjs} +5 -133
- package/dist/{shapeTypes-z5bfGPVI.js → shapeTypes-C4lPfrc2.js} +3 -131
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-8H08aDto.js → solidBuilders-Biwv2cW3.js} +5 -5
- package/dist/{solidBuilders-B0Uyvvyy.cjs → solidBuilders-CgRmJEdn.cjs} +5 -5
- package/dist/{surfaceBuilders-BYopOndo.js → surfaceBuilders-Bww4jhBo.js} +2 -2
- package/dist/{surfaceBuilders-zGpnLDxz.cjs → surfaceBuilders-FLnYYA70.cjs} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-B8cDsSHe.cjs → textBlueprints-08NcMO9T.cjs} +7 -7
- package/dist/{textBlueprints-ziKppdNm.js → textBlueprints-CEzTC9vX.js} +7 -7
- package/dist/{textMetrics-CP-jrZ98.js → textMetrics-CBbDQ5QW.js} +1 -1
- package/dist/{textMetrics-B8qEy3dh.cjs → textMetrics-W-H6jUDj.cjs} +1 -1
- package/dist/{threadFns-7jlwHbES.js → threadFns-8rKpQXiR.js} +6 -6
- package/dist/{threadFns-B_8tna0V.cjs → threadFns-DGYdomjN.cjs} +6 -6
- package/dist/topology.cjs +8 -8
- package/dist/topology.js +8 -8
- package/dist/{topologyQueryFns-De27Nxmf.js → topologyQueryFns-Do8E4EXj.js} +1 -1
- package/dist/{topologyQueryFns-BLkQkExs.cjs → topologyQueryFns-ygBBXxnP.cjs} +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -35,11 +35,8 @@ var TOPO_TO_SHAPE_TYPE = {
|
|
|
35
35
|
shape: "compound"
|
|
36
36
|
};
|
|
37
37
|
var iterTopo = function* iterTopo(shape, topo) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const shapes = require_shapeTypes.getKernel().iterShapes(shape, shapeType);
|
|
41
|
-
for (const s of shapes) yield s;
|
|
42
|
-
}
|
|
38
|
+
const shapes = require_shapeTypes.getKernel().iterShapes(shape, TOPO_TO_SHAPE_TYPE[topo]);
|
|
39
|
+
for (const s of shapes) yield s;
|
|
43
40
|
};
|
|
44
41
|
/** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
|
|
45
42
|
var shapeType = (shape) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-Do8E4EXj.js";
|
|
4
4
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -35,11 +35,8 @@ var TOPO_TO_SHAPE_TYPE = {
|
|
|
35
35
|
shape: "compound"
|
|
36
36
|
};
|
|
37
37
|
var iterTopo = function* iterTopo(shape, topo) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const shapes = getKernel().iterShapes(shape, shapeType);
|
|
41
|
-
for (const s of shapes) yield s;
|
|
42
|
-
}
|
|
38
|
+
const shapes = getKernel().iterShapes(shape, TOPO_TO_SHAPE_TYPE[topo]);
|
|
39
|
+
for (const s of shapes) yield s;
|
|
43
40
|
};
|
|
44
41
|
/** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
|
|
45
42
|
var shapeType = (shape) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { v as downcast } from "./faceFns-
|
|
6
|
-
import { _ as propagateAllMetadata, g as collectInputFaceHashes } from "./shapeFns-
|
|
5
|
+
import { v as downcast } from "./faceFns-mo4ThIHz.js";
|
|
6
|
+
import { _ as propagateAllMetadata, g as collectInputFaceHashes } from "./shapeFns-DyBbhU30.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
|
-
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-
|
|
8
|
+
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-Biwv2cW3.js";
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.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-DKg2St8b.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
8
|
+
const require_solidBuilders = require("./solidBuilders-CgRmJEdn.cjs");
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.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-DKg2St8b.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-Dx7_wMut.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-Q2dnokUU.cjs");
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Z as getKernel, p as isFace } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, p as isFace } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
3
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
|
|
6
|
-
import { l as normalAt, s as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { l as normalAt, s as getSurfaceType } from "./faceFns-mo4ThIHz.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-DyBbhU30.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CG05Jygr.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-Dkh_DmrE.js";
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-D5ArjKiA.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) {
|
|
@@ -619,7 +619,7 @@ for (let i = 0; i < 256; i++) {
|
|
|
619
619
|
}
|
|
620
620
|
function crc32(data) {
|
|
621
621
|
let crc = 4294967295;
|
|
622
|
-
for (const byte of data) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
|
|
622
|
+
for (const byte of data) crc = (crcTable[(crc ^ byte) & 255] ?? 0) ^ crc >>> 8;
|
|
623
623
|
return (crc ^ 4294967295) >>> 0;
|
|
624
624
|
}
|
|
625
625
|
function writeLocalHeader(view, bytes, pos, entry) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At$1 } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-CF12Nceg.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) {
|
|
@@ -619,7 +619,7 @@ for (let i = 0; i < 256; i++) {
|
|
|
619
619
|
}
|
|
620
620
|
function crc32(data) {
|
|
621
621
|
let crc = 4294967295;
|
|
622
|
-
for (const byte of data) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
|
|
622
|
+
for (const byte of data) crc = (crcTable[(crc ^ byte) & 255] ?? 0) ^ crc >>> 8;
|
|
623
623
|
return (crc ^ 4294967295) >>> 0;
|
|
624
624
|
}
|
|
625
625
|
function writeLocalHeader(view, bytes, pos, entry) {
|
package/dist/index.d.ts
CHANGED
|
@@ -118,7 +118,8 @@ export { guidedSweep, type GuidedSweepOptions } from './operations/guidedSweepFn
|
|
|
118
118
|
export { roof, type RoofOptions } from './operations/roofFns.js';
|
|
119
119
|
export { computeStraightSkeleton, type SkPoint2D, type SkeletonNode, type SkeletonFace, type StraightSkeleton, } from './operations/straightSkeleton.js';
|
|
120
120
|
export { exportAssemblySTEP, type ShapeOptions, type SupportedUnit, } from './operations/exporterFns.js';
|
|
121
|
-
export { linearPattern, circularPattern } from './operations/patternFns.js';
|
|
121
|
+
export { linearPattern, circularPattern, gridPattern } from './operations/patternFns.js';
|
|
122
|
+
export { instance, instanceGrid, materialize, instancedMesh, instanceCount, isInstanced, type InstancedShape, type InstancedMesh, type InstanceGridOptions, type MaterializeOptions, } from './operations/instanceFns.js';
|
|
122
123
|
export { createAssemblyNode, addChild, removeChild, updateNode, findNode, walkAssembly, countNodes, collectShapes, type AssemblyNode, type AssemblyNodeOptions, } from './operations/assemblyFns.js';
|
|
123
124
|
export { addMate, solveAssembly, type MateConstraint, type MateEntity, type AssemblySolveResult, } from './operations/mateFns.js';
|
|
124
125
|
export { revoluteJoint, prismaticJoint, cylindricalJoint, planarJoint, sphericalJoint, setJointValue, setJointValues, jointTransform, addJoint, forwardKinematics, mechanismDOF, type Joint, type JointDOF, type JointAxis, type JointType, type JointPose, type JointOptions, type CylindricalOptions, type PlanarOptions, type SphericalOptions, } from './operations/jointFns.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-DeKdpmu7.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-B6hw9Nhx.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-CAAarhVm.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-CEczwPdN.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type-safe interface for the brepkit WASM kernel (`BrepKernel`).
|
|
3
3
|
*
|
|
4
4
|
* AUTO-GENERATED by `npm run sync:brepkit-types`.
|
|
5
|
-
* Synced against `brepkit-wasm@2.
|
|
5
|
+
* Synced against `brepkit-wasm@2.116.1`.
|
|
6
6
|
*
|
|
7
7
|
* Methods not yet referenced in the adapter layer are tagged `@unwired`.
|
|
8
8
|
*
|
|
@@ -312,7 +312,6 @@ export interface BrepkitKernel {
|
|
|
312
312
|
makeCircleEdge(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number): number;
|
|
313
313
|
/** @unwired */
|
|
314
314
|
makeCircleEdgeWithRef(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, rx: number, ry: number, rz: number): number;
|
|
315
|
-
/** @unwired */
|
|
316
315
|
makeEllipseArc3d(startX: number, startY: number, startZ: number, endX: number, endY: number, endZ: number, centerX: number, centerY: number, centerZ: number, axisX: number, axisY: number, axisZ: number, refX: number, refY: number, refZ: number, semiMajor: number, semiMinor: number): number;
|
|
317
316
|
makeEllipseEdge(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, semiMajor: number, semiMinor: number): number;
|
|
318
317
|
makeEllipseEdgeWithRef(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, semiMajor: number, semiMinor: number, rx: number, ry: number, rz: number): number;
|
|
@@ -330,15 +329,15 @@ export interface BrepkitKernel {
|
|
|
330
329
|
/** @unwired */
|
|
331
330
|
toBrepJson(solid: number): string;
|
|
332
331
|
transformFace(face: number, matrix: Float64Array | number[]): void;
|
|
333
|
-
/** @future Not in brepkit-wasm 2.
|
|
332
|
+
/** @future Not in brepkit-wasm 2.116.1. Referenced with feature detection in adapter. */
|
|
334
333
|
chamferAsymmetric?(solid: number, edgeHandles: Uint32Array | number[], d1: number, d2: number): number;
|
|
335
|
-
/** @future Not in brepkit-wasm 2.
|
|
334
|
+
/** @future Not in brepkit-wasm 2.116.1. Referenced with feature detection in adapter. */
|
|
336
335
|
compoundFuse?(solidIds: Uint32Array | number[]): number;
|
|
337
|
-
/** @future Not in brepkit-wasm 2.
|
|
336
|
+
/** @future Not in brepkit-wasm 2.116.1. Referenced with feature detection in adapter. */
|
|
338
337
|
copyEdge?(edge: number): number;
|
|
339
|
-
/** @future Not in brepkit-wasm 2.
|
|
338
|
+
/** @future Not in brepkit-wasm 2.116.1. Referenced with feature detection in adapter. */
|
|
340
339
|
transformEdge?(edge: number, matrix: Float64Array | number[]): void;
|
|
341
|
-
/** @future Not in brepkit-wasm 2.
|
|
340
|
+
/** @future Not in brepkit-wasm 2.116.1. Referenced with feature detection in adapter. */
|
|
342
341
|
validateSolidDetails?(solid: number): string;
|
|
343
342
|
/** Release the entire arena. */
|
|
344
343
|
free(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BrepkitKernel } from './brepkitWasmTypes.js';
|
|
2
2
|
import { KernelShape, KernelType } from '../types.js';
|
|
3
3
|
import { Curve2dHandle, BBox2dHandle } from '../kernel2dTypes.js';
|
|
4
|
+
import { Curve2dObj } from '../geometry2d.js';
|
|
4
5
|
export declare function createPoint2d(x: number, y: number): KernelType;
|
|
5
6
|
export declare function createDirection2d(x: number, y: number): KernelType;
|
|
6
7
|
export declare function createVector2d(x: number, y: number): KernelType;
|
|
@@ -9,8 +10,6 @@ export declare function wrapCurve2dHandle(handle: KernelType): Curve2dHandle;
|
|
|
9
10
|
export declare function createCurve2dAdaptor(handle: Curve2dHandle): KernelType;
|
|
10
11
|
export declare function makeLine2d(x1: number, y1: number, x2: number, y2: number): Curve2dHandle;
|
|
11
12
|
export declare function makeCircle2d(cx: number, cy: number, radius: number, sense?: boolean): Curve2dHandle;
|
|
12
|
-
export declare function makeArc2dThreePoints(x1: number, y1: number, xm: number, ym: number, x2: number, y2: number): Curve2dHandle;
|
|
13
|
-
export declare function makeArc2dTangent(sx: number, sy: number, tx: number, ty: number, ex: number, ey: number): Curve2dHandle;
|
|
14
13
|
export declare function makeEllipse2d(cx: number, cy: number, major: number, minor: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
15
14
|
export declare function makeEllipseArc2d(cx: number, cy: number, major: number, minor: number, start: number, end: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
16
15
|
export declare function makeBezier2d(points: [number, number][]): Curve2dHandle;
|
|
@@ -107,8 +106,8 @@ export declare function makeKernel2dOps(bk: BrepkitKernel): {
|
|
|
107
106
|
createCurve2dAdaptor: (handle: any) => any;
|
|
108
107
|
makeLine2d: (x1: number, y1: number, x2: number, y2: number) => any;
|
|
109
108
|
makeCircle2d: (cx: number, cy: number, radius: number, sense: boolean | undefined) => any;
|
|
110
|
-
makeArc2dThreePoints: (x1: number, y1: number, xm: number, ym: number, x2: number, y2: number) =>
|
|
111
|
-
makeArc2dTangent: (sx: number, sy: number, tx: number, ty: number, ex: number, ey: number) =>
|
|
109
|
+
makeArc2dThreePoints: (x1: number, y1: number, xm: number, ym: number, x2: number, y2: number) => Curve2dObj;
|
|
110
|
+
makeArc2dTangent: (sx: number, sy: number, tx: number, ty: number, ex: number, ey: number) => Curve2dObj;
|
|
112
111
|
makeEllipse2d: (cx: number, cy: number, major: number, minor: number, xDirX: number | undefined, xDirY: number | undefined, sense: boolean | undefined) => any;
|
|
113
112
|
makeEllipseArc2d: (cx: number, cy: number, major: number, minor: number, start: number, end: number, xDirX: number | undefined, xDirY: number | undefined, sense: boolean | undefined) => any;
|
|
114
113
|
makeBezier2d: (points: [number, number][]) => any;
|
|
@@ -71,6 +71,8 @@ export declare function curveBounds(c: Curve2dObj): {
|
|
|
71
71
|
export declare function curveTypeName(c: Curve2dObj): string;
|
|
72
72
|
export declare function makeLine2d(x1: number, y1: number, x2: number, y2: number): Line2d;
|
|
73
73
|
export declare function makeCircle2d(cx: number, cy: number, radius: number, sense?: boolean): Circle2d;
|
|
74
|
+
export declare function makeArc2dThreePoints(x1: number, y1: number, xm: number, ym: number, x2: number, y2: number): Curve2dObj;
|
|
75
|
+
export declare function makeArc2dTangent(sx: number, sy: number, tx: number, ty: number, ex: number, ey: number): Curve2dObj;
|
|
74
76
|
export declare function makeEllipse2d(cx: number, cy: number, majorRadius: number, minorRadius: number, xDirX?: number, xDirY?: number, sense?: boolean): Ellipse2d;
|
|
75
77
|
export declare function makeBezier2d(poles: [number, number][]): Bezier2d;
|
|
76
78
|
export declare function translateCurve2d(c: Curve2dObj, dx: number, dy: number): Curve2dObj;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KernelInstance, KernelShape, KernelType } from '../types.js';
|
|
2
2
|
import { Curve2dHandle, BBox2dHandle } from '../kernel2dTypes.js';
|
|
3
|
+
import { Curve2dObj } from '../geometry2d.js';
|
|
3
4
|
export declare function createPoint2d(x: number, y: number): KernelType;
|
|
4
5
|
export declare function createDirection2d(x: number, y: number): KernelType;
|
|
5
6
|
export declare function createVector2d(x: number, y: number): KernelType;
|
|
@@ -8,8 +9,6 @@ export declare function wrapCurve2dHandle(handle: KernelType): Curve2dHandle;
|
|
|
8
9
|
export declare function createCurve2dAdaptor(handle: Curve2dHandle): KernelType;
|
|
9
10
|
export declare function makeLine2d(x1: number, y1: number, x2: number, y2: number): Curve2dHandle;
|
|
10
11
|
export declare function makeCircle2d(cx: number, cy: number, radius: number, sense?: boolean): Curve2dHandle;
|
|
11
|
-
export declare function makeArc2dThreePoints(x1: number, y1: number, xm: number, ym: number, x2: number, y2: number): Curve2dHandle;
|
|
12
|
-
export declare function makeArc2dTangent(sx: number, sy: number, tx: number, ty: number, ex: number, ey: number): Curve2dHandle;
|
|
13
12
|
export declare function makeEllipse2d(cx: number, cy: number, major: number, minor: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
14
13
|
export declare function makeEllipseArc2d(cx: number, cy: number, major: number, minor: number, start: number, end: number, xDirX?: number, xDirY?: number, sense?: boolean): Curve2dHandle;
|
|
15
14
|
export declare function makeBezier2d(points: [number, number][]): Curve2dHandle;
|
|
@@ -114,8 +113,8 @@ export declare function makeKernel2dOps(oc: KernelInstance): {
|
|
|
114
113
|
createAxis2d: (px: number, py: number, dx: number, dy: number) => any;
|
|
115
114
|
makeLine2d: (x1: number, y1: number, x2: number, y2: number) => any;
|
|
116
115
|
makeCircle2d: (cx: number, cy: number, radius: number, sense: boolean | undefined) => any;
|
|
117
|
-
makeArc2dThreePoints: (x1: number, y1: number, xm: number, ym: number, x2: number, y2: number) =>
|
|
118
|
-
makeArc2dTangent: (startX: number, startY: number, tangentX: number, tangentY: number, endX: number, endY: number) =>
|
|
116
|
+
makeArc2dThreePoints: (x1: number, y1: number, xm: number, ym: number, x2: number, y2: number) => Curve2dObj;
|
|
117
|
+
makeArc2dTangent: (startX: number, startY: number, tangentX: number, tangentY: number, endX: number, endY: number) => Curve2dObj;
|
|
119
118
|
makeEllipse2d: (cx: number, cy: number, majorRadius: number, minorRadius: number, xDirX: number | undefined, xDirY: number | undefined, sense: boolean | undefined) => any;
|
|
120
119
|
makeEllipseArc2d: (cx: number, cy: number, majorRadius: number, minorRadius: number, startAngle: number, endAngle: number, xDirX: number | undefined, xDirY: number | undefined, sense: boolean | undefined) => any;
|
|
121
120
|
makeBezier2d: (points: [number, number][]) => any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-DDZELjlB.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-BDEPveZs.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
6
6
|
/**
|
|
7
|
+
* Shared utilities for extrusion operations.
|
|
8
|
+
* Used by both class-based (extrude.ts) and functional (extrudeFns.ts) APIs.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
7
11
|
* Build an kernel scaling law from an extrusion profile configuration.
|
|
8
12
|
*
|
|
9
13
|
* The law defines how the cross-section scales along the extrusion path.
|
|
@@ -22,6 +26,12 @@ function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
|
22
26
|
}
|
|
23
27
|
//#endregion
|
|
24
28
|
//#region src/operations/sweepFns.ts
|
|
29
|
+
/**
|
|
30
|
+
* Sweep operations — generic sweep, support extrude, complex extrude,
|
|
31
|
+
* twist extrude, multi-section sweep, and guided sweep.
|
|
32
|
+
*
|
|
33
|
+
* Consolidated from extrudeFns, multiSweepFns, and guidedSweepFns.
|
|
34
|
+
*/
|
|
25
35
|
/** Build a wire spine from start to end point (line segment). */
|
|
26
36
|
function makeSpineWire(start, end) {
|
|
27
37
|
const kernel = require_shapeTypes.getKernel();
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
6
6
|
/**
|
|
7
|
+
* Shared utilities for extrusion operations.
|
|
8
|
+
* Used by both class-based (extrude.ts) and functional (extrudeFns.ts) APIs.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
7
11
|
* Build an kernel scaling law from an extrusion profile configuration.
|
|
8
12
|
*
|
|
9
13
|
* The law defines how the cross-section scales along the extrusion path.
|
|
@@ -22,6 +26,12 @@ function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
|
22
26
|
}
|
|
23
27
|
//#endregion
|
|
24
28
|
//#region src/operations/sweepFns.ts
|
|
29
|
+
/**
|
|
30
|
+
* Sweep operations — generic sweep, support extrude, complex extrude,
|
|
31
|
+
* twist extrude, multi-section sweep, and guided sweep.
|
|
32
|
+
*
|
|
33
|
+
* Consolidated from extrudeFns, multiSweepFns, and guidedSweepFns.
|
|
34
|
+
*/
|
|
25
35
|
/** Build a wire spine from start to end point (line segment). */
|
|
26
36
|
function makeSpineWire(start, end) {
|
|
27
37
|
const kernel = getKernel();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { w as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
3
|
+
import { w as kernelCallRaw } from "./topologyQueryFns-Do8E4EXj.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-mo4ThIHz.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-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-DKg2St8b.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-Q2dnokUU.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-Dkh_DmrE.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-C4lPfrc2.js";
|
|
2
2
|
import { A as ok, b as err, r as ioError } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
4
|
-
import { O as getFaceOrigins } from "./shapeFns-
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-Do8E4EXj.js";
|
|
4
|
+
import { O as getFaceOrigins } from "./shapeFns-DyBbhU30.js";
|
|
5
5
|
//#region 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
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_shapeFns = require("./shapeFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -392,6 +392,70 @@ function makeCircle2d$1(cx, cy, radius, sense = true) {
|
|
|
392
392
|
sense
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
+
function makeArc2dThreePoints$1(x1, y1, xm, ym, x2, y2) {
|
|
396
|
+
const d = 2 * (x1 * (ym - y2) + xm * (y2 - y1) + x2 * (y1 - ym));
|
|
397
|
+
if (Math.abs(d) < 1e-12) return makeLine2d$1(x1, y1, x2, y2);
|
|
398
|
+
const cx = ((x1 * x1 + y1 * y1) * (ym - y2) + (xm * xm + ym * ym) * (y2 - y1) + (x2 * x2 + y2 * y2) * (y1 - ym)) / d;
|
|
399
|
+
const cy = ((x1 * x1 + y1 * y1) * (x2 - xm) + (xm * xm + ym * ym) * (x1 - x2) + (x2 * x2 + y2 * y2) * (xm - x1)) / d;
|
|
400
|
+
const radius = Math.sqrt((x1 - cx) ** 2 + (y1 - cy) ** 2);
|
|
401
|
+
const a1 = Math.atan2(y1 - cy, x1 - cx);
|
|
402
|
+
const am = Math.atan2(ym - cy, xm - cx);
|
|
403
|
+
const a2 = Math.atan2(y2 - cy, x2 - cx);
|
|
404
|
+
let da1m = am - a1;
|
|
405
|
+
if (da1m < 0) da1m += 2 * Math.PI;
|
|
406
|
+
let da12 = a2 - a1;
|
|
407
|
+
if (da12 < 0) da12 += 2 * Math.PI;
|
|
408
|
+
const sense = da1m < da12;
|
|
409
|
+
const circle = makeCircle2d$1(cx, cy, radius, sense);
|
|
410
|
+
if (!sense) {
|
|
411
|
+
const tStart = -a1;
|
|
412
|
+
let tEnd = -a2;
|
|
413
|
+
if (tEnd < tStart - 1e-9) tEnd += 2 * Math.PI;
|
|
414
|
+
return {
|
|
415
|
+
__bk2d: "trimmed",
|
|
416
|
+
basis: circle,
|
|
417
|
+
tStart,
|
|
418
|
+
tEnd
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
let tEnd = a2;
|
|
422
|
+
if (tEnd < a1 - 1e-9) tEnd += 2 * Math.PI;
|
|
423
|
+
return {
|
|
424
|
+
__bk2d: "trimmed",
|
|
425
|
+
basis: circle,
|
|
426
|
+
tStart: a1,
|
|
427
|
+
tEnd
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function makeArc2dTangent$1(sx, sy, tx, ty, ex, ey) {
|
|
431
|
+
const len = Math.sqrt(tx * tx + ty * ty);
|
|
432
|
+
const ntx = len > 0 ? tx / len : 0;
|
|
433
|
+
const nty = len > 0 ? ty / len : 0;
|
|
434
|
+
const dx = sx - ex;
|
|
435
|
+
const dy = sy - ey;
|
|
436
|
+
const denom = 2 * (dy * ntx - dx * nty);
|
|
437
|
+
if (Math.abs(denom) < 1e-12) return makeLine2d$1(sx, sy, ex, ey);
|
|
438
|
+
const t = -(dx * dx + dy * dy) / denom;
|
|
439
|
+
const cx = sx - t * nty;
|
|
440
|
+
const cy = sy + t * ntx;
|
|
441
|
+
const radius = Math.abs(t);
|
|
442
|
+
const a1 = Math.atan2(sy - cy, sx - cx);
|
|
443
|
+
const a2 = Math.atan2(ey - cy, ex - cx);
|
|
444
|
+
const ccwTanX = -(sy - cy) / radius;
|
|
445
|
+
const ccwTanY = (sx - cx) / radius;
|
|
446
|
+
const dotCcw = ntx * ccwTanX + nty * ccwTanY;
|
|
447
|
+
let aMid;
|
|
448
|
+
if (dotCcw > 0) {
|
|
449
|
+
let da = a2 - a1;
|
|
450
|
+
if (da <= 0) da += 2 * Math.PI;
|
|
451
|
+
aMid = a1 + da / 2;
|
|
452
|
+
} else {
|
|
453
|
+
let da = a2 - a1;
|
|
454
|
+
if (da >= 0) da -= 2 * Math.PI;
|
|
455
|
+
aMid = a1 + da / 2;
|
|
456
|
+
}
|
|
457
|
+
return makeArc2dThreePoints$1(sx, sy, cx + radius * Math.cos(aMid), cy + radius * Math.sin(aMid), ex, ey);
|
|
458
|
+
}
|
|
395
459
|
function makeEllipse2d$1(cx, cy, majorRadius, minorRadius, xDirX = 1, xDirY = 0, sense = true) {
|
|
396
460
|
return {
|
|
397
461
|
__bk2d: "ellipse",
|
|
@@ -3621,7 +3685,7 @@ function getCurve2dBounds(curve) {
|
|
|
3621
3685
|
}
|
|
3622
3686
|
function getCurve2dType(curve) {
|
|
3623
3687
|
let cu = c2d(curve);
|
|
3624
|
-
while (cu.__bk2d === "trimmed"
|
|
3688
|
+
while (cu.__bk2d === "trimmed") cu = cu.basis;
|
|
3625
3689
|
return curveTypeName(cu);
|
|
3626
3690
|
}
|
|
3627
3691
|
function trimCurve2d(curve, start, end) {
|
|
@@ -3810,7 +3874,7 @@ function projectPointOnCurve2d(curve, x, y) {
|
|
|
3810
3874
|
distance: Math.sqrt(bestDist)
|
|
3811
3875
|
};
|
|
3812
3876
|
};
|
|
3813
|
-
if (c.__bk2d === "trimmed"
|
|
3877
|
+
if (c.__bk2d === "trimmed") {
|
|
3814
3878
|
const tStart = c.tStart;
|
|
3815
3879
|
const tEnd = c.tEnd;
|
|
3816
3880
|
const basisResult = projectOnBasis(c.basis, tStart, tEnd);
|
|
@@ -3872,12 +3936,16 @@ function approximateCurve2dAsBSpline(curve, maxSegments) {
|
|
|
3872
3936
|
}
|
|
3873
3937
|
function decomposeBSpline2dToBeziers(curve) {
|
|
3874
3938
|
let cu = c2d(curve);
|
|
3875
|
-
while (cu.__bk2d === "trimmed"
|
|
3939
|
+
while (cu.__bk2d === "trimmed") cu = cu.basis;
|
|
3876
3940
|
if (cu.__bk2d !== "bspline") return [curve];
|
|
3877
3941
|
const poles = cu.poles;
|
|
3878
3942
|
const p = cu.degree;
|
|
3879
3943
|
const U = [];
|
|
3880
|
-
for (let i = 0; i < cu.knots.length; i++)
|
|
3944
|
+
for (let i = 0; i < cu.knots.length; i++) {
|
|
3945
|
+
const knot = cu.knots[i] ?? 0;
|
|
3946
|
+
const mult = cu.multiplicities[i] ?? 0;
|
|
3947
|
+
for (let j = 0; j < mult; j++) U.push(knot);
|
|
3948
|
+
}
|
|
3881
3949
|
const m = poles.length - 1 + p + 1;
|
|
3882
3950
|
if (p < 1 || U.length !== m + 1) return [c2dWrap(makeBezier2d$1(poles))];
|
|
3883
3951
|
const clone = (pt) => [pt[0], pt[1]];
|
|
@@ -3947,36 +4015,36 @@ function isBBox2dOutPoint(bbox, x, y) {
|
|
|
3947
4015
|
}
|
|
3948
4016
|
function getCurve2dCircleData(curve) {
|
|
3949
4017
|
let c = c2d(curve);
|
|
3950
|
-
while (c.__bk2d === "trimmed"
|
|
4018
|
+
while (c.__bk2d === "trimmed") c = c.basis;
|
|
3951
4019
|
if (c.__bk2d === "circle") return {
|
|
3952
4020
|
cx: c.cx,
|
|
3953
4021
|
cy: c.cy,
|
|
3954
4022
|
radius: c.radius,
|
|
3955
|
-
isDirect: c.sense
|
|
4023
|
+
isDirect: c.sense
|
|
3956
4024
|
};
|
|
3957
4025
|
return null;
|
|
3958
4026
|
}
|
|
3959
4027
|
function getCurve2dEllipseData(curve) {
|
|
3960
4028
|
let c = c2d(curve);
|
|
3961
|
-
while (c.__bk2d === "trimmed"
|
|
4029
|
+
while (c.__bk2d === "trimmed") c = c.basis;
|
|
3962
4030
|
if (c.__bk2d === "ellipse") return {
|
|
3963
4031
|
majorRadius: c.majorRadius,
|
|
3964
4032
|
minorRadius: c.minorRadius,
|
|
3965
|
-
xAxisAngle: c.xDirAngle
|
|
3966
|
-
isDirect: c.sense
|
|
4033
|
+
xAxisAngle: c.xDirAngle,
|
|
4034
|
+
isDirect: c.sense
|
|
3967
4035
|
};
|
|
3968
4036
|
return null;
|
|
3969
4037
|
}
|
|
3970
4038
|
function getCurve2dBezierPoles(curve) {
|
|
3971
4039
|
let c = c2d(curve);
|
|
3972
|
-
while (c.__bk2d === "trimmed"
|
|
3973
|
-
if (c.__bk2d === "bezier"
|
|
4040
|
+
while (c.__bk2d === "trimmed") c = c.basis;
|
|
4041
|
+
if (c.__bk2d === "bezier") return c.poles;
|
|
3974
4042
|
return null;
|
|
3975
4043
|
}
|
|
3976
4044
|
function getCurve2dBezierDegree(curve) {
|
|
3977
4045
|
let c = c2d(curve);
|
|
3978
|
-
while (c.__bk2d === "trimmed"
|
|
3979
|
-
if (c
|
|
4046
|
+
while (c.__bk2d === "trimmed") c = c.basis;
|
|
4047
|
+
if (c.__bk2d === "bezier") return c.poles.length - 1;
|
|
3980
4048
|
return null;
|
|
3981
4049
|
}
|
|
3982
4050
|
function serializeCurve2d(curve) {
|
|
@@ -5227,4 +5295,4 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5227
5295
|
}
|
|
5228
5296
|
};
|
|
5229
5297
|
//#endregion
|
|
5230
|
-
export {
|
|
5298
|
+
export { serializeCurve2d$1 as C, DEFAULT_CAPABILITIES as D, quickHull as E, EXACT_BREP_CAPABILITIES as O, scaleCurve2d$1 as S, translateCurve2d$1 as T, makeEllipse2d$1 as _, buildBinarySTL as a, mirrorAtPoint as b, curveBounds as c, evaluateCurve2d$1 as d, intersectCurves2dFn as f, makeCircle2d$1 as g, makeBezier2d$1 as h, buildAsciiSTL as i, curveTypeName as l, makeArc2dThreePoints$1 as m, DEFAULT_STL_ANGULAR_TOLERANCE as n, addCurveToBBox as o, makeArc2dTangent$1 as p, DEFAULT_STL_TOLERANCE as r, createBBox2d as s, OcctWasmAdapter as t, deserializeCurve2d$1 as u, makeLine2d$1 as v, tangentCurve2d as w, rotateCurve2d$1 as x, mirrorAcrossAxis as y };
|