brepjs 18.76.0 → 18.78.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-BHyTsY5E.cjs → blueprint-BE93BNYE.cjs} +5 -5
- package/dist/{blueprint-DuT3LJGx.js → blueprint-BVe9JU-L.js} +5 -5
- package/dist/{blueprintFns-dPHJgrqC.cjs → blueprintFns-B_7kKwEZ.cjs} +2 -2
- package/dist/{blueprintFns-qaEV4X2R.js → blueprintFns-DWinspVK.js} +2 -2
- package/dist/{blueprintSketcher-Th4H1tao.cjs → blueprintSketcher-D75tuXkF.cjs} +3 -3
- package/dist/{blueprintSketcher-IY1gJ613.js → blueprintSketcher-DL-wgnVs.js} +3 -3
- package/dist/{boolean2D-BGK18W_l.cjs → boolean2D-C4Txi8U1.cjs} +4 -4
- package/dist/{boolean2D-DUDg_dMv.js → boolean2D-OtHT7POp.js} +4 -4
- package/dist/brepjs.cjs +153 -152
- package/dist/brepjs.js +26 -26
- package/dist/{cameraFns-Ctxe8ev-.js → cameraFns-DCXqzH_m.js} +2 -2
- package/dist/{cameraFns-G2lc5c9M.cjs → cameraFns-DfSRnD1k.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-DamaTij5.js → cornerFinder-DPkLU1Of.js} +1 -1
- package/dist/{cornerFinder-CxqA_AYe.cjs → cornerFinder-KuLU-4pQ.cjs} +1 -1
- package/dist/{curveFns-CwOY58kC.js → curveFns-B4KEYU1M.js} +1 -1
- package/dist/{curveFns-B8UdENpg.cjs → curveFns-C0oCmjV2.cjs} +1 -1
- package/dist/{drawFns-CcR9_01X.js → drawFns-C6h_w03r.js} +12 -12
- package/dist/{drawFns-BwfhGs8Z.cjs → drawFns-DxjMxRpE.cjs} +12 -12
- package/dist/{faceFns-BJ0mbRh5.js → faceFns-BJ2hzXJp.js} +2 -2
- package/dist/{faceFns-CZvemlPW.cjs → faceFns-p0lyVuyw.cjs} +2 -2
- package/dist/{primitiveFns-FudrSXrp.cjs → healingFns-B7dElsC4.cjs} +9 -466
- package/dist/{primitiveFns-B6Q6lx9-.js → healingFns-DS_nK9KF.js} +8 -303
- package/dist/{helpers-DsaGpuUh.js → helpers-C78MY-s6.js} +6 -6
- package/dist/{helpers-90SKWHEY.cjs → helpers-DTBDjbdR.cjs} +6 -6
- package/dist/{importFns-CXH2OmJ6.cjs → importFns-CUAiLgt_.cjs} +2 -2
- package/dist/{importFns-B02-HKco.js → importFns-Rv22QSn6.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occt/geometryQueryOps.d.ts +5 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/surfaceOps.d.ts +5 -1
- package/dist/{extrudeFns-msxcCUm2.js → loftFns-DuxEscJB.js} +93 -2
- package/dist/{extrudeFns-b7JHaMsv.cjs → loftFns-DycLH1Pq.cjs} +104 -1
- package/dist/{measureFns-DYeTPyHr.js → measureFns-C8c6xRUE.js} +3 -3
- package/dist/{measureFns-CRS3U8gj.cjs → measureFns-DnxobCbD.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CvmTzMPL.cjs → meshFns-BawS1xNA.cjs} +3 -3
- package/dist/{meshFns-CLQL2D95.js → meshFns-CuYzpojl.js} +3 -3
- package/dist/{occtWasmAdapter-m4Nua92H.js → occtWasmAdapter-BrTkhQYK.js} +83 -6
- package/dist/{occtWasmAdapter-DdghAlnN.cjs → occtWasmAdapter-W86SRBpi.cjs} +83 -6
- package/dist/operations/threadFns.d.ts +39 -0
- package/dist/operations.cjs +33 -32
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +3 -3
- package/dist/{booleanFns-Cu-J1THp.js → primitiveFns-BxH5omw3.js} +301 -7
- package/dist/{booleanFns-DxnTjP19.cjs → primitiveFns-JRmXxbRr.cjs} +460 -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-CQmd2W5F.cjs → shapeFns-D5WNrq3s.cjs} +2 -2
- package/dist/{shapeFns-CQRGTifg.js → shapeFns-DZ6poxP7.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-DoPplxoN.cjs → shapeRefFns-BOWP8n4j.cjs} +4 -4
- package/dist/{shapeRefFns-DvIvS0do.js → shapeRefFns-ClsyeZp4.js} +4 -4
- package/dist/{shapeTypes-C4cMKLoj.cjs → shapeTypes-CxSqNvHA.cjs} +55 -26
- package/dist/{shapeTypes-VCBsDI43.js → shapeTypes-CyTY0prh.js} +55 -26
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-DBsHetmI.js → solidBuilders-BtEFUFQ9.js} +2 -2
- package/dist/{solidBuilders-B0Hzin8a.cjs → solidBuilders-diw2zyyN.cjs} +2 -2
- package/dist/{surfaceBuilders-QK_Cnn_u.cjs → surfaceBuilders-CPHOXRLE.cjs} +2 -2
- package/dist/{surfaceBuilders-DllH3kXs.js → surfaceBuilders-Do0rypyD.js} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-C_ThSDVg.js → textBlueprints-C3IbySW_.js} +9 -99
- package/dist/{textBlueprints-8lNMcsUv.cjs → textBlueprints-SKuamOmI.cjs} +17 -119
- package/dist/{textMetrics-CxdhimFF.js → textMetrics--BwiJH2B.js} +1 -1
- package/dist/{textMetrics-Bn5VPcTV.cjs → textMetrics-Bzbkal_A.cjs} +1 -1
- package/dist/{historyFns-BV5sQxft.js → threadFns-D8-zfJ0b.js} +73 -6
- package/dist/{historyFns-xUNAdUYV.cjs → threadFns-aWgxzqmT.cjs} +79 -6
- package/dist/topology/booleanFns.d.ts +9 -1
- package/dist/topology.cjs +39 -39
- package/dist/topology.js +7 -7
- package/dist/{topologyQueryFns-BtfhAVY2.js → topologyQueryFns-BomrmBie.js} +1 -1
- package/dist/{topologyQueryFns-Bj5wpC75.cjs → topologyQueryFns-Dzxrwn-E.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-W86SRBpi.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
|
|
3
3
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
4
4
|
//#region src/kernel/quality.ts
|
|
@@ -2886,33 +2886,61 @@ function getSurfaceCylinderData$1(oc, surface) {
|
|
|
2886
2886
|
adaptor.delete();
|
|
2887
2887
|
return result;
|
|
2888
2888
|
}
|
|
2889
|
-
/**
|
|
2889
|
+
/**
|
|
2890
|
+
* Extract the `gp_Ax1` axis of an analytic surface adaptor by type index, or
|
|
2891
|
+
* null. GeomAbs_SurfaceType: 1 = Cylinder, 2 = Cone, 4 = Torus, 7 =
|
|
2892
|
+
* SurfaceOfRevolution. gp_Cone / gp_Torus are not bound in the shipped
|
|
2893
|
+
* opencascade.js build, so their accessors throw; that is treated as "no axis".
|
|
2894
|
+
*/
|
|
2895
|
+
function surfaceAxisAx1(adaptor, typeIdx) {
|
|
2896
|
+
let prim = null;
|
|
2897
|
+
try {
|
|
2898
|
+
if (typeIdx === 7) return adaptor.AxeOfRevolution();
|
|
2899
|
+
if (typeIdx === 1) prim = adaptor.Cylinder();
|
|
2900
|
+
else if (typeIdx === 2) prim = adaptor.Cone();
|
|
2901
|
+
else if (typeIdx === 4) prim = adaptor.Torus();
|
|
2902
|
+
else return null;
|
|
2903
|
+
const axis = prim.Axis();
|
|
2904
|
+
prim.delete();
|
|
2905
|
+
return axis;
|
|
2906
|
+
} catch {
|
|
2907
|
+
prim?.delete?.();
|
|
2908
|
+
return null;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Get the axis of symmetry (point on axis + unit direction) for an analytic
|
|
2913
|
+
* face that has one: cylinder, cone, torus, or surface of revolution. Null
|
|
2914
|
+
* otherwise (plane, sphere, free-form).
|
|
2915
|
+
*/
|
|
2890
2916
|
function getSurfaceAxis$1(oc, face) {
|
|
2891
2917
|
const adaptor = new oc.BRepAdaptor_Surface_2(face, false);
|
|
2892
2918
|
try {
|
|
2893
2919
|
const typeVal = adaptor.GetType();
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2920
|
+
const axis = surfaceAxisAx1(adaptor, typeof typeVal === "number" ? typeVal : Number(typeVal?.value ?? typeVal));
|
|
2921
|
+
if (!axis) return null;
|
|
2922
|
+
let loc = null;
|
|
2923
|
+
let dir = null;
|
|
2924
|
+
try {
|
|
2925
|
+
loc = axis.Location();
|
|
2926
|
+
dir = axis.Direction();
|
|
2927
|
+
return {
|
|
2928
|
+
origin: [
|
|
2929
|
+
loc.X(),
|
|
2930
|
+
loc.Y(),
|
|
2931
|
+
loc.Z()
|
|
2932
|
+
],
|
|
2933
|
+
direction: [
|
|
2934
|
+
dir.X(),
|
|
2935
|
+
dir.Y(),
|
|
2936
|
+
dir.Z()
|
|
2937
|
+
]
|
|
2938
|
+
};
|
|
2939
|
+
} finally {
|
|
2940
|
+
loc?.delete?.();
|
|
2941
|
+
dir?.delete?.();
|
|
2942
|
+
axis.delete();
|
|
2943
|
+
}
|
|
2916
2944
|
} finally {
|
|
2917
2945
|
adaptor.delete();
|
|
2918
2946
|
}
|
|
@@ -6022,8 +6050,9 @@ function getSurfaceCylinderData(bk, surface) {
|
|
|
6022
6050
|
}
|
|
6023
6051
|
function getSurfaceAxis(bk, face) {
|
|
6024
6052
|
const params = JSON.parse(bk.getAnalyticSurfaceParams(unwrap$1(face, "face")));
|
|
6025
|
-
|
|
6026
|
-
|
|
6053
|
+
const point = params.type === "cylinder" ? params.origin : params.type === "cone" ? params.apex : null;
|
|
6054
|
+
if (!point || !params.axis) return null;
|
|
6055
|
+
const [ox, oy, oz] = point;
|
|
6027
6056
|
const [ax, ay, az] = params.axis;
|
|
6028
6057
|
const len = Math.hypot(ax, ay, az);
|
|
6029
6058
|
if (len < 1e-12) return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as translateCurve2d$2, E as EXACT_BREP_CAPABILITIES, S as tangentCurve2d, _ as mirrorAcrossAxis, a as buildBinarySTL, b as scaleCurve2d$2, c as curveBounds, d as evaluateCurve2d$2, f as intersectCurves2dFn, g as makeLine2d$2, h as makeEllipse2d$2, i as buildAsciiSTL, l as curveTypeName, m as makeCircle2d$2, n as DEFAULT_STL_ANGULAR_TOLERANCE, o as addCurveToBBox, p as makeBezier2d$2, r as DEFAULT_STL_TOLERANCE, s as createBBox2d, t as OcctWasmAdapter, u as deserializeCurve2d$2, v as mirrorAtPoint, w as quickHull, x as serializeCurve2d$2, y as rotateCurve2d$2 } from "./occtWasmAdapter-
|
|
1
|
+
import { C as translateCurve2d$2, E as EXACT_BREP_CAPABILITIES, S as tangentCurve2d, _ as mirrorAcrossAxis, a as buildBinarySTL, b as scaleCurve2d$2, c as curveBounds, d as evaluateCurve2d$2, f as intersectCurves2dFn, g as makeLine2d$2, h as makeEllipse2d$2, i as buildAsciiSTL, l as curveTypeName, m as makeCircle2d$2, n as DEFAULT_STL_ANGULAR_TOLERANCE, o as addCurveToBBox, p as makeBezier2d$2, r as DEFAULT_STL_TOLERANCE, s as createBBox2d, t as OcctWasmAdapter, u as deserializeCurve2d$2, v as mirrorAtPoint, w as quickHull, x as serializeCurve2d$2, y as rotateCurve2d$2 } from "./occtWasmAdapter-BrTkhQYK.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At } from "./vec3-Dpha8d5k.js";
|
|
3
3
|
import { A as ok, b as err } from "./errors-DNWJsfVU.js";
|
|
4
4
|
//#region src/kernel/quality.ts
|
|
@@ -2886,33 +2886,61 @@ function getSurfaceCylinderData$1(oc, surface) {
|
|
|
2886
2886
|
adaptor.delete();
|
|
2887
2887
|
return result;
|
|
2888
2888
|
}
|
|
2889
|
-
/**
|
|
2889
|
+
/**
|
|
2890
|
+
* Extract the `gp_Ax1` axis of an analytic surface adaptor by type index, or
|
|
2891
|
+
* null. GeomAbs_SurfaceType: 1 = Cylinder, 2 = Cone, 4 = Torus, 7 =
|
|
2892
|
+
* SurfaceOfRevolution. gp_Cone / gp_Torus are not bound in the shipped
|
|
2893
|
+
* opencascade.js build, so their accessors throw; that is treated as "no axis".
|
|
2894
|
+
*/
|
|
2895
|
+
function surfaceAxisAx1(adaptor, typeIdx) {
|
|
2896
|
+
let prim = null;
|
|
2897
|
+
try {
|
|
2898
|
+
if (typeIdx === 7) return adaptor.AxeOfRevolution();
|
|
2899
|
+
if (typeIdx === 1) prim = adaptor.Cylinder();
|
|
2900
|
+
else if (typeIdx === 2) prim = adaptor.Cone();
|
|
2901
|
+
else if (typeIdx === 4) prim = adaptor.Torus();
|
|
2902
|
+
else return null;
|
|
2903
|
+
const axis = prim.Axis();
|
|
2904
|
+
prim.delete();
|
|
2905
|
+
return axis;
|
|
2906
|
+
} catch {
|
|
2907
|
+
prim?.delete?.();
|
|
2908
|
+
return null;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Get the axis of symmetry (point on axis + unit direction) for an analytic
|
|
2913
|
+
* face that has one: cylinder, cone, torus, or surface of revolution. Null
|
|
2914
|
+
* otherwise (plane, sphere, free-form).
|
|
2915
|
+
*/
|
|
2890
2916
|
function getSurfaceAxis$1(oc, face) {
|
|
2891
2917
|
const adaptor = new oc.BRepAdaptor_Surface_2(face, false);
|
|
2892
2918
|
try {
|
|
2893
2919
|
const typeVal = adaptor.GetType();
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2920
|
+
const axis = surfaceAxisAx1(adaptor, typeof typeVal === "number" ? typeVal : Number(typeVal?.value ?? typeVal));
|
|
2921
|
+
if (!axis) return null;
|
|
2922
|
+
let loc = null;
|
|
2923
|
+
let dir = null;
|
|
2924
|
+
try {
|
|
2925
|
+
loc = axis.Location();
|
|
2926
|
+
dir = axis.Direction();
|
|
2927
|
+
return {
|
|
2928
|
+
origin: [
|
|
2929
|
+
loc.X(),
|
|
2930
|
+
loc.Y(),
|
|
2931
|
+
loc.Z()
|
|
2932
|
+
],
|
|
2933
|
+
direction: [
|
|
2934
|
+
dir.X(),
|
|
2935
|
+
dir.Y(),
|
|
2936
|
+
dir.Z()
|
|
2937
|
+
]
|
|
2938
|
+
};
|
|
2939
|
+
} finally {
|
|
2940
|
+
loc?.delete?.();
|
|
2941
|
+
dir?.delete?.();
|
|
2942
|
+
axis.delete();
|
|
2943
|
+
}
|
|
2916
2944
|
} finally {
|
|
2917
2945
|
adaptor.delete();
|
|
2918
2946
|
}
|
|
@@ -6018,8 +6046,9 @@ function getSurfaceCylinderData(bk, surface) {
|
|
|
6018
6046
|
}
|
|
6019
6047
|
function getSurfaceAxis(bk, face) {
|
|
6020
6048
|
const params = JSON.parse(bk.getAnalyticSurfaceParams(unwrap$1(face, "face")));
|
|
6021
|
-
|
|
6022
|
-
|
|
6049
|
+
const point = params.type === "cylinder" ? params.origin : params.type === "cone" ? params.apex : null;
|
|
6050
|
+
if (!point || !params.axis) return null;
|
|
6051
|
+
const [ox, oy, oz] = point;
|
|
6023
6052
|
const [ax, ay, az] = params.axis;
|
|
6024
6053
|
const len = Math.hypot(ax, ay, az);
|
|
6025
6054
|
if (len < 1e-12) return null;
|
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-SKuamOmI.cjs");
|
|
3
|
+
const require_blueprintSketcher = require("./blueprintSketcher-D75tuXkF.cjs");
|
|
4
|
+
const require_drawFns = require("./drawFns-DxjMxRpE.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-DL-wgnVs.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-C6h_w03r.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-C3IbySW_.js";
|
|
4
4
|
//#region src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, _ as isSolid, c as createSolid, g as isShell, h as isShape3D, i as createCompound, l as createVertex } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, _ as isSolid, c as createSolid, g as isShell, h as isShape3D, i as createCompound, l as createVertex } from "./shapeTypes-CyTY0prh.js";
|
|
2
2
|
import { A as ok, R as unwrap, b as err, l as typeCastError, v as andThen } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { _ as cast, v as downcast } from "./faceFns-
|
|
3
|
+
import { _ as cast, v as downcast } from "./faceFns-BJ2hzXJp.js";
|
|
4
4
|
//#region src/topology/shapeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Shape assembly utilities — welding and sewing operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CxSqNvHA.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_faceFns = require("./faceFns-p0lyVuyw.cjs");
|
|
4
4
|
//#region src/topology/shapeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Shape assembly utilities — welding and sewing operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CxSqNvHA.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_faceFns = require("./faceFns-p0lyVuyw.cjs");
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-CyTY0prh.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, v as andThen } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { _ as cast, u as outerWire } from "./faceFns-
|
|
3
|
+
import { _ as cast, u as outerWire } from "./faceFns-BJ2hzXJp.js";
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
package/dist/text.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
3
|
-
const require_textMetrics = require("./textMetrics-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-SKuamOmI.cjs");
|
|
3
|
+
const require_textMetrics = require("./textMetrics-Bzbkal_A.cjs");
|
|
4
4
|
exports.fontMetrics = require_textMetrics.fontMetrics;
|
|
5
5
|
exports.getFont = require_textBlueprints.getFont;
|
|
6
6
|
exports.loadFont = require_textBlueprints.loadFont;
|
package/dist/text.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-
|
|
2
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics
|
|
1
|
+
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-C3IbySW_.js";
|
|
2
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics--BwiJH2B.js";
|
|
3
3
|
export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
|
|
@@ -1,106 +1,16 @@
|
|
|
1
|
-
import { Z as getKernel,
|
|
2
|
-
import { A as ok, R as unwrap, T as isOk, b as err,
|
|
1
|
+
import { Z as getKernel, o as createFace, p as isFace, u as createWire } from "./shapeTypes-CyTY0prh.js";
|
|
2
|
+
import { A as ok, R as unwrap, T as isOk, b as err, h as bug, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-SKPRvPH-.js";
|
|
5
5
|
import { n as createPlane } from "./planeOps-DSjjtrjg.js";
|
|
6
|
-
import { _ as cast, v as downcast } from "./faceFns-
|
|
7
|
-
import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-
|
|
6
|
+
import { _ as cast, v as downcast } from "./faceFns-BJ2hzXJp.js";
|
|
7
|
+
import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-B4KEYU1M.js";
|
|
8
8
|
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
9
|
-
import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-
|
|
10
|
-
import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
11
|
-
import { o as makeSolid, t as makeCompound } from "./solidBuilders-
|
|
12
|
-
import {
|
|
9
|
+
import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-Do0rypyD.js";
|
|
10
|
+
import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DL-wgnVs.js";
|
|
11
|
+
import { o as makeSolid, t as makeCompound } from "./solidBuilders-BtEFUFQ9.js";
|
|
12
|
+
import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DuxEscJB.js";
|
|
13
13
|
import opentype from "opentype.js";
|
|
14
|
-
//#region src/operations/loftFns.ts
|
|
15
|
-
/**
|
|
16
|
-
* Functional loft operation using branded shape types.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Loft through a set of wire profiles to create a 3D shape.
|
|
20
|
-
*
|
|
21
|
-
* Builds a `BRepOffsetAPI_ThruSections` surface through the given wires,
|
|
22
|
-
* optionally starting and/or ending at point vertices. Produces a solid
|
|
23
|
-
* by default, or a shell when `returnShell` is `true`.
|
|
24
|
-
*
|
|
25
|
-
* @param wires - Ordered wire profiles to loft through.
|
|
26
|
-
* @param config - Loft configuration (ruled interpolation, start/end points).
|
|
27
|
-
* @param returnShell - When `true`, return a shell instead of a solid.
|
|
28
|
-
* @returns `Result` containing the lofted 3D shape, or an error on failure.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @see {@link loft!loft | loft} for the OOP API equivalent.
|
|
36
|
-
*/
|
|
37
|
-
function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
38
|
-
if (wires.length === 0 && !startPoint && !endPoint) return err(validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
39
|
-
const kernel = getKernel();
|
|
40
|
-
const startVertex = startPoint ? kernel.makeVertex(...toVec3(startPoint)) : void 0;
|
|
41
|
-
const endVertex = endPoint ? kernel.makeVertex(...toVec3(endPoint)) : void 0;
|
|
42
|
-
try {
|
|
43
|
-
const result = castShape(kernel.loftAdvanced(wires.map((w) => w.wrapped), {
|
|
44
|
-
solid: !returnShell,
|
|
45
|
-
ruled,
|
|
46
|
-
tolerance,
|
|
47
|
-
...startVertex ? { startVertex } : {},
|
|
48
|
-
...endVertex ? { endVertex } : {}
|
|
49
|
-
}));
|
|
50
|
-
if (!isShape3D(result)) return err(typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
51
|
-
return ok(result);
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return err(kernelError("LOFT_FAILED", "Loft operation failed", e, void 0, "Common causes: wire profiles with different edge counts, self-intersecting result, or profiles too far apart. Ensure profiles are compatible and ordered."));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Batch loft: build N independent lofts in a single kernel call.
|
|
58
|
-
*
|
|
59
|
-
* Uses the C++ LoftBatch extractor when available (single WASM call),
|
|
60
|
-
* falling back to N individual loft operations otherwise.
|
|
61
|
-
*
|
|
62
|
-
* @returns Array of 3D shapes, one per entry.
|
|
63
|
-
*/
|
|
64
|
-
function loftAll(entries) {
|
|
65
|
-
if (entries.length === 0) return ok([]);
|
|
66
|
-
const kernel = getKernel();
|
|
67
|
-
const verticesToDelete = [];
|
|
68
|
-
const kernelEntries = entries.map((e) => {
|
|
69
|
-
const startVertex = e.startPoint ? kernel.makeVertex(...toVec3(e.startPoint)) : void 0;
|
|
70
|
-
const endVertex = e.endPoint ? kernel.makeVertex(...toVec3(e.endPoint)) : void 0;
|
|
71
|
-
if (startVertex) verticesToDelete.push(startVertex);
|
|
72
|
-
if (endVertex) verticesToDelete.push(endVertex);
|
|
73
|
-
return {
|
|
74
|
-
wires: e.wires.map((w) => w.wrapped),
|
|
75
|
-
solid: true,
|
|
76
|
-
ruled: e.ruled ?? true,
|
|
77
|
-
tolerance: e.tolerance ?? 1e-6,
|
|
78
|
-
startVertex,
|
|
79
|
-
endVertex
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
try {
|
|
83
|
-
const shapes = kernel.loftBatch?.(kernelEntries) ?? kernelEntries.map((e) => kernel.loftAdvanced(e.wires, {
|
|
84
|
-
solid: e.solid,
|
|
85
|
-
ruled: e.ruled,
|
|
86
|
-
tolerance: e.tolerance,
|
|
87
|
-
startVertex: e.startVertex,
|
|
88
|
-
endVertex: e.endVertex
|
|
89
|
-
}));
|
|
90
|
-
const results = [];
|
|
91
|
-
for (const shape of shapes) {
|
|
92
|
-
const cast = castShape(shape);
|
|
93
|
-
if (!isShape3D(cast)) return err(typeCastError("LOFT_ALL_NOT_3D", "Batch loft entry did not produce a 3D shape"));
|
|
94
|
-
results.push(cast);
|
|
95
|
-
}
|
|
96
|
-
return ok(results);
|
|
97
|
-
} catch (e) {
|
|
98
|
-
return err(kernelError("LOFT_ALL_FAILED", "Batch loft operation failed", e));
|
|
99
|
-
} finally {
|
|
100
|
-
for (const v of verticesToDelete) kernel.dispose(v);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
14
|
//#region src/sketching/compoundSketch.ts
|
|
105
15
|
/**
|
|
106
16
|
* Represent a face with holes as a group of sketches (one outer + zero or more inner).
|
|
@@ -640,4 +550,4 @@ function textBlueprints(text, { startX = 0, startY = 0, fontSize = 16, fontFamil
|
|
|
640
550
|
return organiseBlueprints(Array.from(sketchFontCommands(writtenText.commands))).mirror([0, 0]);
|
|
641
551
|
}
|
|
642
552
|
//#endregion
|
|
643
|
-
export { wrapSketchDataArray as _, Sketch as a,
|
|
553
|
+
export { wrapSketchDataArray as _, Sketch as a, compoundSketchLoft as c, sketchFace as d, sketchLoft as f, wrapSketchData as g, sketchWires as h, Sketches as i, compoundSketchRevolve as l, sketchSweep as m, getFont as n, compoundSketchExtrude as o, sketchRevolve as p, loadFont as r, compoundSketchFace as s, textBlueprints as t, sketchExtrude as u, CompoundSketch as v };
|
|
@@ -29,110 +29,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
enumerable: true
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
//#endregion
|
|
32
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
32
|
+
const require_shapeTypes = require("./shapeTypes-CxSqNvHA.cjs");
|
|
33
33
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
34
34
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
35
35
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
36
36
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
37
|
-
const require_faceFns = require("./faceFns-
|
|
38
|
-
const require_curveFns = require("./curveFns-
|
|
37
|
+
const require_faceFns = require("./faceFns-p0lyVuyw.cjs");
|
|
38
|
+
const require_curveFns = require("./curveFns-C0oCmjV2.cjs");
|
|
39
39
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
40
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
41
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
42
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
43
|
-
const
|
|
40
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CPHOXRLE.cjs");
|
|
41
|
+
const require_blueprintSketcher = require("./blueprintSketcher-D75tuXkF.cjs");
|
|
42
|
+
const require_solidBuilders = require("./solidBuilders-diw2zyyN.cjs");
|
|
43
|
+
const require_loftFns = require("./loftFns-DycLH1Pq.cjs");
|
|
44
44
|
let opentype_js = require("opentype.js");
|
|
45
45
|
opentype_js = __toESM(opentype_js, 1);
|
|
46
|
-
//#region src/operations/loftFns.ts
|
|
47
|
-
/**
|
|
48
|
-
* Functional loft operation using branded shape types.
|
|
49
|
-
*/
|
|
50
|
-
/**
|
|
51
|
-
* Loft through a set of wire profiles to create a 3D shape.
|
|
52
|
-
*
|
|
53
|
-
* Builds a `BRepOffsetAPI_ThruSections` surface through the given wires,
|
|
54
|
-
* optionally starting and/or ending at point vertices. Produces a solid
|
|
55
|
-
* by default, or a shell when `returnShell` is `true`.
|
|
56
|
-
*
|
|
57
|
-
* @param wires - Ordered wire profiles to loft through.
|
|
58
|
-
* @param config - Loft configuration (ruled interpolation, start/end points).
|
|
59
|
-
* @param returnShell - When `true`, return a shell instead of a solid.
|
|
60
|
-
* @returns `Result` containing the lofted 3D shape, or an error on failure.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* const result = loft([bottomWire, topWire], { ruled: false });
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* @see {@link loft!loft | loft} for the OOP API equivalent.
|
|
68
|
-
*/
|
|
69
|
-
function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
70
|
-
if (wires.length === 0 && !startPoint && !endPoint) return require_errors.err(require_errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
71
|
-
const kernel = require_shapeTypes.getKernel();
|
|
72
|
-
const startVertex = startPoint ? kernel.makeVertex(...require_types.toVec3(startPoint)) : void 0;
|
|
73
|
-
const endVertex = endPoint ? kernel.makeVertex(...require_types.toVec3(endPoint)) : void 0;
|
|
74
|
-
try {
|
|
75
|
-
const result = require_shapeTypes.castShape(kernel.loftAdvanced(wires.map((w) => w.wrapped), {
|
|
76
|
-
solid: !returnShell,
|
|
77
|
-
ruled,
|
|
78
|
-
tolerance,
|
|
79
|
-
...startVertex ? { startVertex } : {},
|
|
80
|
-
...endVertex ? { endVertex } : {}
|
|
81
|
-
}));
|
|
82
|
-
if (!require_shapeTypes.isShape3D(result)) return require_errors.err(require_errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
83
|
-
return require_errors.ok(result);
|
|
84
|
-
} catch (e) {
|
|
85
|
-
return require_errors.err(require_errors.kernelError("LOFT_FAILED", "Loft operation failed", e, void 0, "Common causes: wire profiles with different edge counts, self-intersecting result, or profiles too far apart. Ensure profiles are compatible and ordered."));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Batch loft: build N independent lofts in a single kernel call.
|
|
90
|
-
*
|
|
91
|
-
* Uses the C++ LoftBatch extractor when available (single WASM call),
|
|
92
|
-
* falling back to N individual loft operations otherwise.
|
|
93
|
-
*
|
|
94
|
-
* @returns Array of 3D shapes, one per entry.
|
|
95
|
-
*/
|
|
96
|
-
function loftAll(entries) {
|
|
97
|
-
if (entries.length === 0) return require_errors.ok([]);
|
|
98
|
-
const kernel = require_shapeTypes.getKernel();
|
|
99
|
-
const verticesToDelete = [];
|
|
100
|
-
const kernelEntries = entries.map((e) => {
|
|
101
|
-
const startVertex = e.startPoint ? kernel.makeVertex(...require_types.toVec3(e.startPoint)) : void 0;
|
|
102
|
-
const endVertex = e.endPoint ? kernel.makeVertex(...require_types.toVec3(e.endPoint)) : void 0;
|
|
103
|
-
if (startVertex) verticesToDelete.push(startVertex);
|
|
104
|
-
if (endVertex) verticesToDelete.push(endVertex);
|
|
105
|
-
return {
|
|
106
|
-
wires: e.wires.map((w) => w.wrapped),
|
|
107
|
-
solid: true,
|
|
108
|
-
ruled: e.ruled ?? true,
|
|
109
|
-
tolerance: e.tolerance ?? 1e-6,
|
|
110
|
-
startVertex,
|
|
111
|
-
endVertex
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
try {
|
|
115
|
-
const shapes = kernel.loftBatch?.(kernelEntries) ?? kernelEntries.map((e) => kernel.loftAdvanced(e.wires, {
|
|
116
|
-
solid: e.solid,
|
|
117
|
-
ruled: e.ruled,
|
|
118
|
-
tolerance: e.tolerance,
|
|
119
|
-
startVertex: e.startVertex,
|
|
120
|
-
endVertex: e.endVertex
|
|
121
|
-
}));
|
|
122
|
-
const results = [];
|
|
123
|
-
for (const shape of shapes) {
|
|
124
|
-
const cast = require_shapeTypes.castShape(shape);
|
|
125
|
-
if (!require_shapeTypes.isShape3D(cast)) return require_errors.err(require_errors.typeCastError("LOFT_ALL_NOT_3D", "Batch loft entry did not produce a 3D shape"));
|
|
126
|
-
results.push(cast);
|
|
127
|
-
}
|
|
128
|
-
return require_errors.ok(results);
|
|
129
|
-
} catch (e) {
|
|
130
|
-
return require_errors.err(require_errors.kernelError("LOFT_ALL_FAILED", "Batch loft operation failed", e));
|
|
131
|
-
} finally {
|
|
132
|
-
for (const v of verticesToDelete) kernel.dispose(v);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
46
|
//#region src/sketching/compoundSketch.ts
|
|
137
47
|
/**
|
|
138
48
|
* Represent a face with holes as a group of sketches (one outer + zero or more inner).
|
|
@@ -230,7 +140,7 @@ function sketchWires(sketch) {
|
|
|
230
140
|
*/
|
|
231
141
|
function sketchRevolve(sketch, revolutionAxis, { origin } = {}) {
|
|
232
142
|
const face = require_errors.unwrap(require_surfaceBuilders.makeFace(sketch.wire));
|
|
233
|
-
const solid = require_errors.unwrap(
|
|
143
|
+
const solid = require_errors.unwrap(require_loftFns.revolve(face, origin ? require_types.toVec3(origin) : sketch.defaultOrigin, revolutionAxis ? require_types.toVec3(revolutionAxis) : [
|
|
234
144
|
0,
|
|
235
145
|
0,
|
|
236
146
|
1
|
|
@@ -251,16 +161,16 @@ function sketchExtrude(sketch, extrusionDistance, { extrusionDirection, extrusio
|
|
|
251
161
|
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : sketch.defaultDirection), extrusionDistance);
|
|
252
162
|
const originVec = origin ? require_types.toVec3(origin) : sketch.defaultOrigin;
|
|
253
163
|
if (extrusionProfile && !twistAngle) {
|
|
254
|
-
const solid = require_errors.unwrap(
|
|
164
|
+
const solid = require_errors.unwrap(require_loftFns.complexExtrude(sketch.wire, [...originVec], [...extrusionVec], extrusionProfile));
|
|
255
165
|
sketch.delete();
|
|
256
166
|
return solid;
|
|
257
167
|
}
|
|
258
168
|
if (twistAngle) {
|
|
259
|
-
const solid = require_errors.unwrap(
|
|
169
|
+
const solid = require_errors.unwrap(require_loftFns.twistExtrude(sketch.wire, twistAngle, [...originVec], [...extrusionVec], extrusionProfile));
|
|
260
170
|
sketch.delete();
|
|
261
171
|
return solid;
|
|
262
172
|
}
|
|
263
|
-
const solid = require_errors.unwrap(
|
|
173
|
+
const solid = require_errors.unwrap(require_loftFns.extrude(require_errors.unwrap(require_surfaceBuilders.makeFace(sketch.wire)), [...extrusionVec]));
|
|
264
174
|
sketch.delete();
|
|
265
175
|
return solid;
|
|
266
176
|
}
|
|
@@ -287,7 +197,7 @@ function sketchSweep(sketch, sketchOnPlane, sweepConfig = {}) {
|
|
|
287
197
|
...sweepConfig
|
|
288
198
|
};
|
|
289
199
|
if (sketch.baseFace) config.support = sketch.baseFace.wrapped;
|
|
290
|
-
const shape = require_errors.unwrap(
|
|
200
|
+
const shape = require_errors.unwrap(require_loftFns.sweep(profile.wire, sketch.wire, config));
|
|
291
201
|
sketch.delete();
|
|
292
202
|
return shape;
|
|
293
203
|
}
|
|
@@ -298,7 +208,7 @@ function sketchSweep(sketch, sketchOnPlane, sweepConfig = {}) {
|
|
|
298
208
|
*/
|
|
299
209
|
function sketchLoft(sketch, otherSketches, loftConfig = {}, returnShell = false) {
|
|
300
210
|
const sketchArray = Array.isArray(otherSketches) ? [sketch, ...otherSketches] : [sketch, otherSketches];
|
|
301
|
-
const shape = require_errors.unwrap(loft(sketchArray.map((s) => s.wire), loftConfig, returnShell));
|
|
211
|
+
const shape = require_errors.unwrap(require_loftFns.loft(sketchArray.map((s) => s.wire), loftConfig, returnShell));
|
|
302
212
|
sketchArray.forEach((s) => {
|
|
303
213
|
s.delete();
|
|
304
214
|
});
|
|
@@ -360,9 +270,9 @@ function compoundSketchWires(sketch) {
|
|
|
360
270
|
*/
|
|
361
271
|
function compoundSketchExtrude(sketch, extrusionDistance, { extrusionDirection, extrusionProfile, twistAngle, origin } = {}) {
|
|
362
272
|
const extrusionVec = require_vecOps.vecScale(require_vecOps.vecNormalize(extrusionDirection ? require_types.toVec3(extrusionDirection) : sketch.outerSketch.defaultDirection), extrusionDistance);
|
|
363
|
-
if (extrusionProfile && !twistAngle) return solidFromShellGenerator(sketch.sketches, (s) =>
|
|
364
|
-
if (twistAngle) return solidFromShellGenerator(sketch.sketches, (s) =>
|
|
365
|
-
return require_errors.unwrap(
|
|
273
|
+
if (extrusionProfile && !twistAngle) return solidFromShellGenerator(sketch.sketches, (s) => require_loftFns.complexExtrude(s.wire, origin ? require_types.toVec3(origin) : sketch.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
274
|
+
if (twistAngle) return solidFromShellGenerator(sketch.sketches, (s) => require_loftFns.twistExtrude(s.wire, twistAngle, origin ? require_types.toVec3(origin) : sketch.outerSketch.defaultOrigin, extrusionVec, extrusionProfile, true));
|
|
275
|
+
return require_errors.unwrap(require_loftFns.extrude(compoundSketchFace(sketch), extrusionVec));
|
|
366
276
|
}
|
|
367
277
|
/** Revolve a compound sketch (outer + holes) around an axis. */
|
|
368
278
|
function compoundSketchRevolve(sketch, revolutionAxis, { origin } = {}) {
|
|
@@ -372,7 +282,7 @@ function compoundSketchRevolve(sketch, revolutionAxis, { origin } = {}) {
|
|
|
372
282
|
0,
|
|
373
283
|
1
|
|
374
284
|
];
|
|
375
|
-
return require_errors.unwrap(
|
|
285
|
+
return require_errors.unwrap(require_loftFns.revolve(compoundSketchFace(sketch), center, dir));
|
|
376
286
|
}
|
|
377
287
|
/** Loft between two compound sketches with matching sub-sketch counts. */
|
|
378
288
|
function compoundSketchLoft(sketch, other, loftConfig) {
|
|
@@ -732,18 +642,6 @@ Object.defineProperty(exports, "loadFont", {
|
|
|
732
642
|
return loadFont;
|
|
733
643
|
}
|
|
734
644
|
});
|
|
735
|
-
Object.defineProperty(exports, "loft", {
|
|
736
|
-
enumerable: true,
|
|
737
|
-
get: function() {
|
|
738
|
-
return loft;
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
Object.defineProperty(exports, "loftAll", {
|
|
742
|
-
enumerable: true,
|
|
743
|
-
get: function() {
|
|
744
|
-
return loftAll;
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
645
|
Object.defineProperty(exports, "sketchExtrude", {
|
|
748
646
|
enumerable: true,
|
|
749
647
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
2
|
-
import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-
|
|
2
|
+
import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-C3IbySW_.js";
|
|
3
3
|
//#region src/text/sketchText.ts
|
|
4
4
|
/**
|
|
5
5
|
* Render text as 3D sketch outlines on a plane.
|