brepjs 18.118.0 → 18.118.2
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/README.md +4 -0
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-d8ZabkvX.cjs → adjacencyFns-COWMJ1OX.cjs} +2 -2
- package/dist/{adjacencyFns-BYnyXXqt.js → adjacencyFns-D026zKM3.js} +2 -2
- package/dist/{blueprint-ccFH0CU4.js → blueprint-BeCL-AAl.js} +5 -5
- package/dist/{blueprint-Bb6y8xmG.cjs → blueprint-xcDMSkia.cjs} +5 -5
- package/dist/{blueprintFns-Cvhzcmrk.js → blueprintFns-BkSFPipn.js} +2 -2
- package/dist/{blueprintFns-B7nDXYsr.cjs → blueprintFns-DIMiD67q.cjs} +2 -2
- package/dist/{blueprintSketcher-BY6R2umG.cjs → blueprintSketcher-DGcCDQq2.cjs} +3 -3
- package/dist/{blueprintSketcher-Cw_Epicg.js → blueprintSketcher-DKfkNg71.js} +3 -3
- package/dist/{boolean2D-BiPWJMSB.js → boolean2D-BCTOcf19.js} +4 -4
- package/dist/{boolean2D-mBIMAMP3.cjs → boolean2D-Dh4IPW_X.cjs} +4 -4
- package/dist/brepjs.cjs +25 -25
- package/dist/brepjs.js +25 -25
- package/dist/{cameraFns-uo1sZbBT.cjs → cameraFns-BAm-2Clq.cjs} +2 -2
- package/dist/{cameraFns-bk9e0F-T.js → cameraFns-CRln-7RT.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-Baa3j5Ph.js → cornerFinder-Bu482P3S.js} +1 -1
- package/dist/{cornerFinder-DaHVcKSL.cjs → cornerFinder-DMJBP4I2.cjs} +1 -1
- package/dist/{curveFns-DgUJpH4z.cjs → curveFns-CpaxYpa4.cjs} +1 -1
- package/dist/{curveFns-CcSn4-Rf.js → curveFns-pGQFlJG-.js} +1 -1
- package/dist/{drawFns-Blkxt9ei.js → drawFns-BAETgRWM.js} +12 -12
- package/dist/{drawFns-NEdyNRo-.cjs → drawFns-D-PqWuBQ.cjs} +12 -12
- package/dist/{faceFns-B86WGqDg.js → faceFns-Bc6sBrBV.js} +2 -2
- package/dist/{faceFns-BV0GnTlt.cjs → faceFns-rbWcdpvj.cjs} +2 -2
- package/dist/{healingFns-TnTWI_K_.js → healingFns-DHxzmeCt.js} +5 -5
- package/dist/{healingFns-DiVnJgwh.cjs → healingFns-DfshoSeQ.cjs} +5 -5
- package/dist/{helpers-Cy4IH0Dc.cjs → helpers-CKbgoPDr.cjs} +6 -6
- package/dist/{helpers-BuJ2542Q.js → helpers-YD71h41H.js} +6 -6
- package/dist/{importFns-DU6m8NVC.js → importFns-A437Sgj6.js} +2 -2
- package/dist/{importFns-2X1Bh_-e.cjs → importFns-CQ16LqPQ.cjs} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/helpers.d.ts +2 -2
- package/dist/kernel/optionalBackend.d.ts +15 -0
- package/dist/{loftFns-fpTmrIdd.cjs → loftFns-BQktV4u4.cjs} +1 -1
- package/dist/{loftFns-CmShFQlv.js → loftFns-CXc9tRv6.js} +1 -1
- package/dist/{measureFns-a5Vx25or.js → measureFns-B_vJqwDc.js} +3 -3
- package/dist/{measureFns-DblG0Yaz.cjs → measureFns-I5KcAgSb.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-DBsxqJd3.js → meshFns-COdN1kVO.js} +3 -3
- package/dist/{meshFns-HyzvCIhb.cjs → meshFns-fPnPGEPl.cjs} +3 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-DvGRmEox.cjs → primitiveFns-Cohp602Q.cjs} +4 -4
- package/dist/{primitiveFns-LYeAjO6E.js → primitiveFns-DxP7GVQh.js} +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/quick.js +7 -2
- package/dist/{refResolveFns-BGcsRo5a.cjs → refResolveFns-Du0v4e3Y.cjs} +5 -5
- package/dist/{refResolveFns-BzIXnBrs.js → refResolveFns-NGXXyTBa.js} +5 -5
- package/dist/{shapeFns-DJHbIsRX.js → shapeFns-DqGDtCsE.js} +2 -2
- package/dist/{shapeFns-aI4Hr4XV.cjs → shapeFns-DvmBIZaX.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-BTTwjHy5.cjs → shapeTypes-BLREi6xB.cjs} +67 -16
- package/dist/{shapeTypes-Dpu6mD3m.js → shapeTypes-EI4Uxlsb.js} +67 -16
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-DSokszEg.cjs → solidBuilders-B6DBRdRc.cjs} +5 -5
- package/dist/{solidBuilders-CjrjwCtG.js → solidBuilders-Oq-hxTvJ.js} +5 -5
- package/dist/{surfaceBuilders-UyyfZy8w.cjs → surfaceBuilders-C-UhFlpS.cjs} +2 -2
- package/dist/{surfaceBuilders-rkE-jE90.js → surfaceBuilders-C0pJwtCO.js} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-gMoNCh6B.js → textBlueprints-fBpuvT3m.js} +7 -7
- package/dist/{textBlueprints-BvD0c2S0.cjs → textBlueprints-lSKzw-nT.cjs} +7 -7
- package/dist/{textMetrics-BZwyjpX_.cjs → textMetrics-BkTdFBwC.cjs} +1 -1
- package/dist/{textMetrics-7Je4nat3.js → textMetrics-CnrAQwLI.js} +1 -1
- package/dist/{threadFns-cKaZIY34.cjs → threadFns-DJt3EStH.cjs} +7 -7
- package/dist/{threadFns-B9udL9Zs.js → threadFns-Dlts4xFy.js} +7 -7
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-CoXVHuN7.cjs → topologyQueryFns-1PqfeHrV.cjs} +1 -1
- package/dist/{topologyQueryFns-BeKaWpNm.js → topologyQueryFns-BjgBf2t-.js} +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Z as getKernel, p as isFace } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, p as isFace } from "./shapeTypes-EI4Uxlsb.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-BjgBf2t-.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-Bc6sBrBV.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-DqGDtCsE.js";
|
|
8
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-pGQFlJG-.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-B_vJqwDc.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
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-EI4Uxlsb.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-BeCL-AAl.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BLREi6xB.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-xcDMSkia.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/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-fPnPGEPl.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-CQ16LqPQ.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-COdN1kVO.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-A437Sgj6.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -52,9 +52,9 @@ export declare function copyWasmBytes(bytes: Uint8Array): ArrayBuffer;
|
|
|
52
52
|
/** Build a row-major 4x4 translation matrix. */
|
|
53
53
|
export declare function translationMatrix(x: number, y: number, z: number): number[];
|
|
54
54
|
/** Build a row-major 4x4 rotation matrix (angle in degrees, optional axis/center). */
|
|
55
|
-
export declare function rotationMatrix(angleDeg: number,
|
|
55
|
+
export declare function rotationMatrix(angleDeg: number, axisInput?: readonly [number, number, number], centerInput?: readonly [number, number, number]): number[];
|
|
56
56
|
/** Build a row-major 4x4 uniform scale matrix about a center point. */
|
|
57
|
-
export declare function scaleMatrix(
|
|
57
|
+
export declare function scaleMatrix(centerInput: readonly [number, number, number], factor: number): number[];
|
|
58
58
|
/** Build a row-major 4x4 matrix from a 3x3 linear part + translation. */
|
|
59
59
|
export declare function affineMatrix(linear: readonly number[], translation: readonly [number, number, number]): number[];
|
|
60
60
|
/** Build a 4x4 reflection matrix for a plane defined by origin + normal. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamically import an optional kernel backend (`occt-wasm`,
|
|
3
|
+
* `brepjs-opencascade`, `brepkit-wasm`) at runtime.
|
|
4
|
+
*
|
|
5
|
+
* The specifier is passed through a parameter so the `import()` argument is a
|
|
6
|
+
* variable, never a string literal. A computed dynamic import is unanalyzable
|
|
7
|
+
* to every bundler (esbuild dep pre-bundling, Rollup, Vite import-analysis), so
|
|
8
|
+
* an uninstalled optional peer is always left as a runtime import instead of
|
|
9
|
+
* hard-failing a build. A string literal guarded only by a `@vite-ignore`
|
|
10
|
+
* comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
|
|
11
|
+
* the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
|
|
12
|
+
* Vite's "cannot be analyzed" dev warning and its placement no longer affects
|
|
13
|
+
* correctness.
|
|
14
|
+
*/
|
|
15
|
+
export declare function importOptionalBackend(specifier: string): Promise<unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-EI4Uxlsb.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Z as getKernel } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-EI4Uxlsb.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-BjgBf2t-.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-Bc6sBrBV.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-BLREi6xB.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-1PqfeHrV.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-rbWcdpvj.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-I5KcAgSb.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-B_vJqwDc.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-EI4Uxlsb.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 { j as getFaceOrigins } from "./shapeFns-
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-BjgBf2t-.js";
|
|
4
|
+
import { j as getFaceOrigins } from "./shapeFns-DqGDtCsE.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-BLREi6xB.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-1PqfeHrV.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-DvmBIZaX.cjs");
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_threadFns = require("./threadFns-
|
|
3
|
-
const require_loftFns = require("./loftFns-
|
|
2
|
+
const require_threadFns = require("./threadFns-DJt3EStH.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-BQktV4u4.cjs");
|
|
4
4
|
exports.addChild = require_threadFns.addChild;
|
|
5
5
|
exports.addJoint = require_threadFns.addJoint;
|
|
6
6
|
exports.addStep = require_threadFns.addStep;
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-
|
|
2
|
-
import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-
|
|
1
|
+
import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-Dlts4xFy.js";
|
|
2
|
+
import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-CXc9tRv6.js";
|
|
3
3
|
export { addChild, addJoint, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, cylindricalJoint, exportAssemblySTEP, exportURDF, findNode, findStep, forwardKinematics, getShape as getHistoryShape, gridPattern, importURDF, inverseKinematics, jointTrajectory, jointTransform, jointsFromDH, linearPattern, mechanismDOF, modifyStep, planarJoint, prismaticJoint, registerOperation, registerShape, removeChild, replayFrom, replayHistory, revoluteJoint, setJointValue, setJointValues, sphericalJoint, stepCount, stepsFrom, supportExtrude, sweep, thread, twistExtrude, undoLast, updateNode, walkAssembly };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
3
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
4
|
-
const require_shapeFns = require("./shapeFns-
|
|
5
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
6
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
4
|
+
const require_shapeFns = require("./shapeFns-DvmBIZaX.cjs");
|
|
5
|
+
const require_surfaceBuilders = require("./surfaceBuilders-C-UhFlpS.cjs");
|
|
6
|
+
const require_solidBuilders = require("./solidBuilders-B6DBRdRc.cjs");
|
|
7
7
|
//#region src/topology/primitiveFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Create a box with the given dimensions.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Z as getKernel, c as createSolid, x as isClosedWire } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, c as createSolid, x as isClosedWire } from "./shapeTypes-EI4Uxlsb.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, v as andThen } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
4
|
-
import { g as translate } from "./shapeFns-
|
|
5
|
-
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-
|
|
6
|
-
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-
|
|
4
|
+
import { g as translate } from "./shapeFns-DqGDtCsE.js";
|
|
5
|
+
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-C0pJwtCO.js";
|
|
6
|
+
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-Oq-hxTvJ.js";
|
|
7
7
|
//#region src/topology/primitiveFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Create a box with the given dimensions.
|
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-BAm-2Clq.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-CRln-7RT.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-CKbgoPDr.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-DMJBP4I2.cjs");
|
|
4
4
|
exports.cornerFinder = require_cornerFinder.cornerFinder;
|
|
5
5
|
exports.edgeFinder = require_helpers.edgeFinder;
|
|
6
6
|
exports.faceFinder = require_helpers.faceFinder;
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-
|
|
2
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
1
|
+
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-YD71h41H.js";
|
|
2
|
+
import { t as cornerFinder } from "./cornerFinder-Bu482P3S.js";
|
|
3
3
|
export { cornerFinder, edgeFinder, faceFinder, getSingleFace };
|
package/dist/quick.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { initFromOC, registerKernel, OcctWasmAdapter } from './brepjs.js';
|
|
2
2
|
// occt-wasm first (the default kernel); fall back to brepjs-opencascade.
|
|
3
3
|
// Dynamic imports so an install with only one of the two packages still loads.
|
|
4
|
+
// The specifier is passed through a variable so the import() argument is never a
|
|
5
|
+
// string literal: a computed dynamic import is unanalyzable to every bundler, so
|
|
6
|
+
// an uninstalled optional peer is left as a runtime import instead of breaking a
|
|
7
|
+
// consumer's Vite dep pre-bundling (#1726).
|
|
8
|
+
const importBackend = (specifier) => import(/* @vite-ignore */ specifier);
|
|
4
9
|
try {
|
|
5
|
-
const { OcctKernel } = await
|
|
10
|
+
const { OcctKernel } = await importBackend('occt-wasm');
|
|
6
11
|
const kernel = await OcctKernel.init();
|
|
7
12
|
registerKernel('occt-wasm', OcctWasmAdapter.fromKernel(kernel));
|
|
8
13
|
} catch {
|
|
9
|
-
const { default: opencascade } = await
|
|
14
|
+
const { default: opencascade } = await importBackend('brepjs-opencascade');
|
|
10
15
|
const oc = await opencascade();
|
|
11
16
|
initFromOC(oc);
|
|
12
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
2
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
-
const require_shapeFns = require("./shapeFns-
|
|
4
|
-
const require_measureFns = require("./measureFns-
|
|
5
|
-
const require_adjacencyFns = require("./adjacencyFns-
|
|
1
|
+
const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
|
|
2
|
+
const require_faceFns = require("./faceFns-rbWcdpvj.cjs");
|
|
3
|
+
const require_shapeFns = require("./shapeFns-DvmBIZaX.cjs");
|
|
4
|
+
const require_measureFns = require("./measureFns-I5KcAgSb.cjs");
|
|
5
|
+
const require_adjacencyFns = require("./adjacencyFns-COWMJ1OX.cjs");
|
|
6
6
|
//#region src/topology/shapeRef/scoring.ts
|
|
7
7
|
/**
|
|
8
8
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as vertexPosition, c as getFaces } from "./topologyQueryFns-
|
|
2
|
-
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-
|
|
3
|
-
import { n as getHashCode } from "./shapeFns-
|
|
4
|
-
import { n as measureArea, s as measureLength } from "./measureFns-
|
|
5
|
-
import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-
|
|
1
|
+
import { S as vertexPosition, c as getFaces } from "./topologyQueryFns-BjgBf2t-.js";
|
|
2
|
+
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-Bc6sBrBV.js";
|
|
3
|
+
import { n as getHashCode } from "./shapeFns-DqGDtCsE.js";
|
|
4
|
+
import { n as measureArea, s as measureLength } from "./measureFns-B_vJqwDc.js";
|
|
5
|
+
import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-D026zKM3.js";
|
|
6
6
|
//#region src/topology/shapeRef/scoring.ts
|
|
7
7
|
/**
|
|
8
8
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, t as castShape } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-EI4Uxlsb.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { C as kernelCall, c as getFaces, l as getOrCreateCache, r as getCacheEntry, w as kernelCallRaw } from "./topologyQueryFns-
|
|
3
|
+
import { C as kernelCall, c as getFaces, l as getOrCreateCache, r as getCacheEntry, w as kernelCallRaw } from "./topologyQueryFns-BjgBf2t-.js";
|
|
4
4
|
import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
5
|
//#region src/topology/metadata/originTrackingFns.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
//#region src/topology/metadata/originTrackingFns.ts
|
|
6
6
|
/**
|
package/dist/shapeRef.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
2
|
+
const require_refResolveFns = require("./refResolveFns-Du0v4e3Y.cjs");
|
|
3
3
|
exports.assignRoles = require_refResolveFns.assignRoles;
|
|
4
4
|
exports.captureHint = require_refResolveFns.captureHint;
|
|
5
5
|
exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
|
package/dist/shapeRef.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-
|
|
1
|
+
import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-NGXXyTBa.js";
|
|
2
2
|
export { assignRoles, captureHint, createDerivedFaceRef, createEdgeRef, createRef, createVertexRef, defaultScorer, isDerivedFaceRef, isEdgeRef, isFaceRef, isLineageRef, isVertexRef, resolveDerivedFaceRef, resolveEdgeRef, resolveLineageRef, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, updateRoles };
|
|
@@ -5453,16 +5453,50 @@ function translationMatrix$1(x, y, z) {
|
|
|
5453
5453
|
1
|
|
5454
5454
|
];
|
|
5455
5455
|
}
|
|
5456
|
+
/**
|
|
5457
|
+
* Coerce a possibly-malformed value into a Vec3 tuple, falling back to `fallback`.
|
|
5458
|
+
*
|
|
5459
|
+
* The matrix builders sit at the JS↔WASM boundary where `no-unsafe-*` is off, so
|
|
5460
|
+
* an `axis`/`center` typed as `Vec3` can arrive as a non-iterable at runtime (a
|
|
5461
|
+
* `{x,y,z}` object, `null`, a scalar from a malformed compose op). Default
|
|
5462
|
+
* parameters only guard `undefined`, so destructuring such a value throws a
|
|
5463
|
+
* cryptic `center is not iterable`. This extends the existing `undefined → default`
|
|
5464
|
+
* tolerance to any non-Vec3 input instead of crashing.
|
|
5465
|
+
*/
|
|
5466
|
+
function asVec3$1(value, fallback) {
|
|
5467
|
+
if (!Array.isArray(value) || value.length < 3) return fallback;
|
|
5468
|
+
const [x, y, z] = value;
|
|
5469
|
+
return typeof x === "number" && typeof y === "number" && typeof z === "number" && Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z) ? [
|
|
5470
|
+
x,
|
|
5471
|
+
y,
|
|
5472
|
+
z
|
|
5473
|
+
] : fallback;
|
|
5474
|
+
}
|
|
5456
5475
|
/** Build a row-major 4x4 rotation matrix (angle in degrees, optional axis/center). */
|
|
5457
|
-
function rotationMatrix$1(angleDeg,
|
|
5476
|
+
function rotationMatrix$1(angleDeg, axisInput = [
|
|
5458
5477
|
0,
|
|
5459
5478
|
0,
|
|
5460
5479
|
1
|
|
5461
|
-
],
|
|
5480
|
+
], centerInput = [
|
|
5462
5481
|
0,
|
|
5463
5482
|
0,
|
|
5464
5483
|
0
|
|
5465
5484
|
]) {
|
|
5485
|
+
const rawAxis = asVec3$1(axisInput, [
|
|
5486
|
+
0,
|
|
5487
|
+
0,
|
|
5488
|
+
1
|
|
5489
|
+
]);
|
|
5490
|
+
const axis = rawAxis[0] === 0 && rawAxis[1] === 0 && rawAxis[2] === 0 ? [
|
|
5491
|
+
0,
|
|
5492
|
+
0,
|
|
5493
|
+
1
|
|
5494
|
+
] : rawAxis;
|
|
5495
|
+
const center = asVec3$1(centerInput, [
|
|
5496
|
+
0,
|
|
5497
|
+
0,
|
|
5498
|
+
0
|
|
5499
|
+
]);
|
|
5466
5500
|
const rad = angleDeg * Math.PI / 180;
|
|
5467
5501
|
const c = Math.cos(rad);
|
|
5468
5502
|
const s = Math.sin(rad);
|
|
@@ -5503,8 +5537,12 @@ function rotationMatrix$1(angleDeg, axis = [
|
|
|
5503
5537
|
];
|
|
5504
5538
|
}
|
|
5505
5539
|
/** Build a row-major 4x4 uniform scale matrix about a center point. */
|
|
5506
|
-
function scaleMatrix$1(
|
|
5507
|
-
const [cx, cy, cz] =
|
|
5540
|
+
function scaleMatrix$1(centerInput, factor) {
|
|
5541
|
+
const [cx, cy, cz] = asVec3$1(centerInput, [
|
|
5542
|
+
0,
|
|
5543
|
+
0,
|
|
5544
|
+
0
|
|
5545
|
+
]);
|
|
5508
5546
|
return [
|
|
5509
5547
|
factor,
|
|
5510
5548
|
0,
|
|
@@ -15260,6 +15298,28 @@ var ManifoldAdapter = class {
|
|
|
15260
15298
|
}
|
|
15261
15299
|
};
|
|
15262
15300
|
//#endregion
|
|
15301
|
+
//#region src/kernel/optionalBackend.ts
|
|
15302
|
+
/**
|
|
15303
|
+
* Dynamically import an optional kernel backend (`occt-wasm`,
|
|
15304
|
+
* `brepjs-opencascade`, `brepkit-wasm`) at runtime.
|
|
15305
|
+
*
|
|
15306
|
+
* The specifier is passed through a parameter so the `import()` argument is a
|
|
15307
|
+
* variable, never a string literal. A computed dynamic import is unanalyzable
|
|
15308
|
+
* to every bundler (esbuild dep pre-bundling, Rollup, Vite import-analysis), so
|
|
15309
|
+
* an uninstalled optional peer is always left as a runtime import instead of
|
|
15310
|
+
* hard-failing a build. A string literal guarded only by a `@vite-ignore`
|
|
15311
|
+
* comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
|
|
15312
|
+
* the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
|
|
15313
|
+
* Vite's "cannot be analyzed" dev warning and its placement no longer affects
|
|
15314
|
+
* correctness.
|
|
15315
|
+
*/
|
|
15316
|
+
function importOptionalBackend(specifier) {
|
|
15317
|
+
return import(
|
|
15318
|
+
/* @vite-ignore */
|
|
15319
|
+
specifier
|
|
15320
|
+
);
|
|
15321
|
+
}
|
|
15322
|
+
//#endregion
|
|
15263
15323
|
//#region src/kernel/types.ts
|
|
15264
15324
|
/** Check if the kernel supports hidden-line-removal projection. */
|
|
15265
15325
|
function supportsProjection(kernel) {
|
|
@@ -15442,26 +15502,17 @@ function prewarm() {
|
|
|
15442
15502
|
async function init() {
|
|
15443
15503
|
if (_defaultKernelId) return _defaultKernelId;
|
|
15444
15504
|
try {
|
|
15445
|
-
const { OcctKernel } = await
|
|
15446
|
-
/* @vite-ignore */
|
|
15447
|
-
"occt-wasm"
|
|
15448
|
-
);
|
|
15505
|
+
const { OcctKernel } = await importOptionalBackend("occt-wasm");
|
|
15449
15506
|
const kernel = await OcctKernel.init();
|
|
15450
15507
|
registerKernel("occt-wasm", require_occtWasmAdapter.OcctWasmAdapter.fromKernel(kernel));
|
|
15451
15508
|
return "occt-wasm";
|
|
15452
15509
|
} catch {}
|
|
15453
15510
|
try {
|
|
15454
|
-
initFromOC(await (await
|
|
15455
|
-
/* @vite-ignore */
|
|
15456
|
-
"brepjs-opencascade"
|
|
15457
|
-
)).default());
|
|
15511
|
+
initFromOC(await (await importOptionalBackend("brepjs-opencascade")).default());
|
|
15458
15512
|
return "occt";
|
|
15459
15513
|
} catch {}
|
|
15460
15514
|
try {
|
|
15461
|
-
const bk = await
|
|
15462
|
-
/* @vite-ignore */
|
|
15463
|
-
"brepkit-wasm"
|
|
15464
|
-
);
|
|
15515
|
+
const bk = await importOptionalBackend("brepkit-wasm");
|
|
15465
15516
|
if (typeof bk.default === "function") await bk.default();
|
|
15466
15517
|
registerKernel("brepkit", new BrepkitAdapter(new bk.BrepKernel()));
|
|
15467
15518
|
return "brepkit";
|
|
@@ -5449,16 +5449,50 @@ function translationMatrix$1(x, y, z) {
|
|
|
5449
5449
|
1
|
|
5450
5450
|
];
|
|
5451
5451
|
}
|
|
5452
|
+
/**
|
|
5453
|
+
* Coerce a possibly-malformed value into a Vec3 tuple, falling back to `fallback`.
|
|
5454
|
+
*
|
|
5455
|
+
* The matrix builders sit at the JS↔WASM boundary where `no-unsafe-*` is off, so
|
|
5456
|
+
* an `axis`/`center` typed as `Vec3` can arrive as a non-iterable at runtime (a
|
|
5457
|
+
* `{x,y,z}` object, `null`, a scalar from a malformed compose op). Default
|
|
5458
|
+
* parameters only guard `undefined`, so destructuring such a value throws a
|
|
5459
|
+
* cryptic `center is not iterable`. This extends the existing `undefined → default`
|
|
5460
|
+
* tolerance to any non-Vec3 input instead of crashing.
|
|
5461
|
+
*/
|
|
5462
|
+
function asVec3$1(value, fallback) {
|
|
5463
|
+
if (!Array.isArray(value) || value.length < 3) return fallback;
|
|
5464
|
+
const [x, y, z] = value;
|
|
5465
|
+
return typeof x === "number" && typeof y === "number" && typeof z === "number" && Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z) ? [
|
|
5466
|
+
x,
|
|
5467
|
+
y,
|
|
5468
|
+
z
|
|
5469
|
+
] : fallback;
|
|
5470
|
+
}
|
|
5452
5471
|
/** Build a row-major 4x4 rotation matrix (angle in degrees, optional axis/center). */
|
|
5453
|
-
function rotationMatrix$1(angleDeg,
|
|
5472
|
+
function rotationMatrix$1(angleDeg, axisInput = [
|
|
5454
5473
|
0,
|
|
5455
5474
|
0,
|
|
5456
5475
|
1
|
|
5457
|
-
],
|
|
5476
|
+
], centerInput = [
|
|
5458
5477
|
0,
|
|
5459
5478
|
0,
|
|
5460
5479
|
0
|
|
5461
5480
|
]) {
|
|
5481
|
+
const rawAxis = asVec3$1(axisInput, [
|
|
5482
|
+
0,
|
|
5483
|
+
0,
|
|
5484
|
+
1
|
|
5485
|
+
]);
|
|
5486
|
+
const axis = rawAxis[0] === 0 && rawAxis[1] === 0 && rawAxis[2] === 0 ? [
|
|
5487
|
+
0,
|
|
5488
|
+
0,
|
|
5489
|
+
1
|
|
5490
|
+
] : rawAxis;
|
|
5491
|
+
const center = asVec3$1(centerInput, [
|
|
5492
|
+
0,
|
|
5493
|
+
0,
|
|
5494
|
+
0
|
|
5495
|
+
]);
|
|
5462
5496
|
const rad = angleDeg * Math.PI / 180;
|
|
5463
5497
|
const c = Math.cos(rad);
|
|
5464
5498
|
const s = Math.sin(rad);
|
|
@@ -5499,8 +5533,12 @@ function rotationMatrix$1(angleDeg, axis = [
|
|
|
5499
5533
|
];
|
|
5500
5534
|
}
|
|
5501
5535
|
/** Build a row-major 4x4 uniform scale matrix about a center point. */
|
|
5502
|
-
function scaleMatrix$1(
|
|
5503
|
-
const [cx, cy, cz] =
|
|
5536
|
+
function scaleMatrix$1(centerInput, factor) {
|
|
5537
|
+
const [cx, cy, cz] = asVec3$1(centerInput, [
|
|
5538
|
+
0,
|
|
5539
|
+
0,
|
|
5540
|
+
0
|
|
5541
|
+
]);
|
|
5504
5542
|
return [
|
|
5505
5543
|
factor,
|
|
5506
5544
|
0,
|
|
@@ -15252,6 +15290,28 @@ var ManifoldAdapter = class {
|
|
|
15252
15290
|
}
|
|
15253
15291
|
};
|
|
15254
15292
|
//#endregion
|
|
15293
|
+
//#region src/kernel/optionalBackend.ts
|
|
15294
|
+
/**
|
|
15295
|
+
* Dynamically import an optional kernel backend (`occt-wasm`,
|
|
15296
|
+
* `brepjs-opencascade`, `brepkit-wasm`) at runtime.
|
|
15297
|
+
*
|
|
15298
|
+
* The specifier is passed through a parameter so the `import()` argument is a
|
|
15299
|
+
* variable, never a string literal. A computed dynamic import is unanalyzable
|
|
15300
|
+
* to every bundler (esbuild dep pre-bundling, Rollup, Vite import-analysis), so
|
|
15301
|
+
* an uninstalled optional peer is always left as a runtime import instead of
|
|
15302
|
+
* hard-failing a build. A string literal guarded only by a `@vite-ignore`
|
|
15303
|
+
* comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
|
|
15304
|
+
* the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
|
|
15305
|
+
* Vite's "cannot be analyzed" dev warning and its placement no longer affects
|
|
15306
|
+
* correctness.
|
|
15307
|
+
*/
|
|
15308
|
+
function importOptionalBackend(specifier) {
|
|
15309
|
+
return import(
|
|
15310
|
+
/* @vite-ignore */
|
|
15311
|
+
specifier
|
|
15312
|
+
);
|
|
15313
|
+
}
|
|
15314
|
+
//#endregion
|
|
15255
15315
|
//#region src/kernel/types.ts
|
|
15256
15316
|
/** Check if the kernel supports hidden-line-removal projection. */
|
|
15257
15317
|
function supportsProjection(kernel) {
|
|
@@ -15434,26 +15494,17 @@ function prewarm() {
|
|
|
15434
15494
|
async function init() {
|
|
15435
15495
|
if (_defaultKernelId) return _defaultKernelId;
|
|
15436
15496
|
try {
|
|
15437
|
-
const { OcctKernel } = await
|
|
15438
|
-
/* @vite-ignore */
|
|
15439
|
-
"occt-wasm"
|
|
15440
|
-
);
|
|
15497
|
+
const { OcctKernel } = await importOptionalBackend("occt-wasm");
|
|
15441
15498
|
const kernel = await OcctKernel.init();
|
|
15442
15499
|
registerKernel("occt-wasm", OcctWasmAdapter.fromKernel(kernel));
|
|
15443
15500
|
return "occt-wasm";
|
|
15444
15501
|
} catch {}
|
|
15445
15502
|
try {
|
|
15446
|
-
initFromOC(await (await
|
|
15447
|
-
/* @vite-ignore */
|
|
15448
|
-
"brepjs-opencascade"
|
|
15449
|
-
)).default());
|
|
15503
|
+
initFromOC(await (await importOptionalBackend("brepjs-opencascade")).default());
|
|
15450
15504
|
return "occt";
|
|
15451
15505
|
} catch {}
|
|
15452
15506
|
try {
|
|
15453
|
-
const bk = await
|
|
15454
|
-
/* @vite-ignore */
|
|
15455
|
-
"brepkit-wasm"
|
|
15456
|
-
);
|
|
15507
|
+
const bk = await importOptionalBackend("brepkit-wasm");
|
|
15457
15508
|
if (typeof bk.default === "function") await bk.default();
|
|
15458
15509
|
registerKernel("brepkit", new BrepkitAdapter(new bk.BrepKernel()));
|
|
15459
15510
|
return "brepkit";
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
4
|
-
const require_drawFns = require("./drawFns-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-lSKzw-nT.cjs");
|
|
3
|
+
const require_blueprintSketcher = require("./blueprintSketcher-DGcCDQq2.cjs");
|
|
4
|
+
const require_drawFns = require("./drawFns-D-PqWuBQ.cjs");
|
|
5
5
|
//#region src/sketching.ts
|
|
6
6
|
/**
|
|
7
7
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
2
|
-
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
3
|
-
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-
|
|
1
|
+
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-DKfkNg71.js";
|
|
2
|
+
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-BAETgRWM.js";
|
|
3
|
+
import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-fBpuvT3m.js";
|
|
4
4
|
//#region src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|