brepjs 18.124.8 → 18.125.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/brepjs.cjs +42 -0
- package/dist/brepjs.js +49 -7
- package/dist/csg/builders.d.ts +2 -1
- package/dist/csg/evaluators/extrude.d.ts +5 -0
- package/dist/csg/index.d.ts +2 -2
- package/dist/csg/types.d.ts +7 -1
- package/package.json +7 -7
package/dist/brepjs.cjs
CHANGED
|
@@ -5597,6 +5597,16 @@ function mirror$1(target, options) {
|
|
|
5597
5597
|
freeParams: depsOf(target, nE, atE)
|
|
5598
5598
|
};
|
|
5599
5599
|
}
|
|
5600
|
+
function extrude$1(profile, vector) {
|
|
5601
|
+
const ve = asVec3Expr(vector);
|
|
5602
|
+
return {
|
|
5603
|
+
kind: "Extrude",
|
|
5604
|
+
profile,
|
|
5605
|
+
vector: ve,
|
|
5606
|
+
structuralHash: mix(mix(startHash("Extrude"), profile), ve),
|
|
5607
|
+
freeParams: depsOf(profile, ve)
|
|
5608
|
+
};
|
|
5609
|
+
}
|
|
5600
5610
|
function compound$1(children) {
|
|
5601
5611
|
let h = fnvMixInt32(startHash("Compound"), children.length);
|
|
5602
5612
|
for (const c of children) h = mix(h, c);
|
|
@@ -5643,6 +5653,7 @@ function outputKindOf(node) {
|
|
|
5643
5653
|
case "Rotate":
|
|
5644
5654
|
case "Scale":
|
|
5645
5655
|
case "Mirror": return outputKindOf(node.target);
|
|
5656
|
+
case "Extrude": return "Solid";
|
|
5646
5657
|
case "Compound": return "Compound";
|
|
5647
5658
|
case "Instance": return node.fuse ? "Solid" : "Compound";
|
|
5648
5659
|
}
|
|
@@ -5922,6 +5933,19 @@ function evalInstance(node, ctx) {
|
|
|
5922
5933
|
return materialize(instance(r.value, node.placements), { fuse: node.fuse });
|
|
5923
5934
|
}
|
|
5924
5935
|
//#endregion
|
|
5936
|
+
//#region src/csg/evaluators/extrude.ts
|
|
5937
|
+
function evalExtrude(node, ctx) {
|
|
5938
|
+
const v = evalVec3(node.vector, ctx.env, "Extrude.vector");
|
|
5939
|
+
if (!v.ok) return v;
|
|
5940
|
+
const p = ctx.evalNode(node.profile);
|
|
5941
|
+
if (!p.ok) return p;
|
|
5942
|
+
if (!require_shapeTypes.isFace(p.value)) return require_errors.err(require_errors.typeCastError("CSG_NOT_FACE", "Extrude.profile: node did not produce a Face"));
|
|
5943
|
+
const oriented = require_validityTypes.orientedFace(p.value);
|
|
5944
|
+
if (!oriented.ok) return require_errors.err(require_errors.typeCastError("CSG_NOT_FACE", `Extrude.profile: ${oriented.error}`));
|
|
5945
|
+
if (!require_validityTypes.isPlanarFace(oriented.value)) return require_errors.err(require_errors.typeCastError("CSG_NOT_FACE", "Extrude.profile: face is not planar"));
|
|
5946
|
+
return require_textBlueprints.extrude(oriented.value, v.value);
|
|
5947
|
+
}
|
|
5948
|
+
//#endregion
|
|
5925
5949
|
//#region src/csg/evaluate.ts
|
|
5926
5950
|
function dispatch(node, ctx) {
|
|
5927
5951
|
switch (node.kind) {
|
|
@@ -5946,6 +5970,7 @@ function dispatch(node, ctx) {
|
|
|
5946
5970
|
case "Mirror": return evalMirror(node, ctx);
|
|
5947
5971
|
case "Compound": return evalCompound(node, ctx);
|
|
5948
5972
|
case "Instance": return evalInstance(node, ctx);
|
|
5973
|
+
case "Extrude": return evalExtrude(node, ctx);
|
|
5949
5974
|
}
|
|
5950
5975
|
}
|
|
5951
5976
|
function hashExprValue(h, v) {
|
|
@@ -6512,6 +6537,11 @@ function transformToJson(n) {
|
|
|
6512
6537
|
}
|
|
6513
6538
|
}
|
|
6514
6539
|
function nodeToJson(n) {
|
|
6540
|
+
if (n.kind === "Extrude") return {
|
|
6541
|
+
kind: "Extrude",
|
|
6542
|
+
profile: nodeToJson(n.profile),
|
|
6543
|
+
vector: exprToJson(n.vector)
|
|
6544
|
+
};
|
|
6515
6545
|
if (n.kind === "Compound") return {
|
|
6516
6546
|
kind: "Compound",
|
|
6517
6547
|
children: n.children.map(nodeToJson)
|
|
@@ -6663,6 +6693,7 @@ function readNode(j) {
|
|
|
6663
6693
|
case "Mirror": return readTransform(kind, j);
|
|
6664
6694
|
case "Compound": return readCompound(j);
|
|
6665
6695
|
case "Instance": return readInstance(j);
|
|
6696
|
+
case "Extrude": return readExtrude(j);
|
|
6666
6697
|
default: return bad(`unknown node kind: ${String(kind)}`);
|
|
6667
6698
|
}
|
|
6668
6699
|
}
|
|
@@ -6817,6 +6848,13 @@ function readMirror(j, target) {
|
|
|
6817
6848
|
at: at.value
|
|
6818
6849
|
}));
|
|
6819
6850
|
}
|
|
6851
|
+
function readExtrude(j) {
|
|
6852
|
+
const profile = readNode(j["profile"]);
|
|
6853
|
+
if (!profile.ok) return profile;
|
|
6854
|
+
const vector = readExpr(j["vector"]);
|
|
6855
|
+
if (!vector.ok) return vector;
|
|
6856
|
+
return require_errors.ok(extrude$1(profile.value, vector.value));
|
|
6857
|
+
}
|
|
6820
6858
|
function readCompound(j) {
|
|
6821
6859
|
const children = readNodeArray(j["children"], "Compound.children");
|
|
6822
6860
|
return children.ok ? require_errors.ok(compound$1(children.value)) : children;
|
|
@@ -6928,6 +6966,7 @@ function optimizeNode(n) {
|
|
|
6928
6966
|
});
|
|
6929
6967
|
case "Compound": return compound$1(n.children.map(optimizeNode).filter((c) => c.kind !== "Empty"));
|
|
6930
6968
|
case "Instance": return instance$1(optimizeNode(n.source), n.placements, n.fuse);
|
|
6969
|
+
case "Extrude": return extrude$1(optimizeNode(n.profile), foldExpr(n.vector));
|
|
6931
6970
|
}
|
|
6932
6971
|
}
|
|
6933
6972
|
function optimizeFuse(a, b, tol) {
|
|
@@ -7018,6 +7057,7 @@ function rebuildChildren(n, pred, repl) {
|
|
|
7018
7057
|
});
|
|
7019
7058
|
case "Compound": return compound$1(n.children.map((c) => walk(c, pred, repl)));
|
|
7020
7059
|
case "Instance": return instance$1(walk(n.source, pred, repl), n.placements, n.fuse);
|
|
7060
|
+
case "Extrude": return extrude$1(walk(n.profile, pred, repl), n.vector);
|
|
7021
7061
|
}
|
|
7022
7062
|
}
|
|
7023
7063
|
function forEachNode(root, fn) {
|
|
@@ -7047,6 +7087,7 @@ function childrenOf(n) {
|
|
|
7047
7087
|
case "Mirror": return [n.target];
|
|
7048
7088
|
case "Compound": return n.children;
|
|
7049
7089
|
case "Instance": return [n.source];
|
|
7090
|
+
case "Extrude": return [n.profile];
|
|
7050
7091
|
}
|
|
7051
7092
|
}
|
|
7052
7093
|
function nodeCount(root) {
|
|
@@ -7078,6 +7119,7 @@ var csg_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
|
7078
7119
|
emptyFace: () => emptyFace,
|
|
7079
7120
|
emptySolid: () => emptySolid,
|
|
7080
7121
|
emptyWire: () => emptyWire,
|
|
7122
|
+
extrude: () => extrude$1,
|
|
7081
7123
|
foldExpr: () => foldExpr,
|
|
7082
7124
|
forEachNode: () => forEachNode,
|
|
7083
7125
|
fromJSON: () => fromJSON,
|
package/dist/brepjs.js
CHANGED
|
@@ -28,7 +28,7 @@ import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints
|
|
|
28
28
|
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, n as createCompoundBlueprint, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-COSD5yZH.js";
|
|
29
29
|
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-BId6d2pt.js";
|
|
30
30
|
import { a as multiSectionSweep, c as twistExtrude, i as guidedSweep, n as loftAll, o as supportExtrude, r as complexExtrude, s as sweep$1, t as loft$1 } from "./loftFns-m7LoJWE2.js";
|
|
31
|
-
import { a as Sketch, b as extrudeAll, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, n as getFont, o as compoundSketchExtrude, p as sketchRevolve, r as loadFont, s as compoundSketchFace, t as textBlueprints, u as sketchExtrude, v as CompoundSketch, x as revolve$1, y as extrude$
|
|
31
|
+
import { a as Sketch, b as extrudeAll, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, n as getFont, o as compoundSketchExtrude, p as sketchRevolve, r as loadFont, s as compoundSketchFace, t as textBlueprints, u as sketchExtrude, v as CompoundSketch, x as revolve$1, y as extrude$2 } from "./textBlueprints-C1aMaWLc.js";
|
|
32
32
|
import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-VVI0cWLa.js";
|
|
33
33
|
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-DH3YPwVC.js";
|
|
34
34
|
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns-CwcdjOsT.js";
|
|
@@ -3737,7 +3737,7 @@ function isEmpty(shape) {
|
|
|
3737
3737
|
*/
|
|
3738
3738
|
function extrude(face, height) {
|
|
3739
3739
|
const f = resolve(face);
|
|
3740
|
-
return extrude$
|
|
3740
|
+
return extrude$2(f, typeof height === "number" ? [
|
|
3741
3741
|
0,
|
|
3742
3742
|
0,
|
|
3743
3743
|
height
|
|
@@ -3927,7 +3927,7 @@ function pocket(shape, options) {
|
|
|
3927
3927
|
scope.register(faceResult.value);
|
|
3928
3928
|
const positioned = scope.register(translate$2(faceResult.value, center));
|
|
3929
3929
|
const extDir = vecScale(vecNormalize(normal), -depth);
|
|
3930
|
-
const toolResult = extrude$
|
|
3930
|
+
const toolResult = extrude$2(positioned, extDir);
|
|
3931
3931
|
if (isErr(toolResult)) return toolResult;
|
|
3932
3932
|
scope.register(toolResult.value);
|
|
3933
3933
|
return cut$2(s, toolResult.value, { unsafe: true });
|
|
@@ -3962,7 +3962,7 @@ function boss(shape, options) {
|
|
|
3962
3962
|
scope.register(faceResult.value);
|
|
3963
3963
|
const positioned = scope.register(translate$2(faceResult.value, center));
|
|
3964
3964
|
const extDir = vecScale(vecNormalize(normal), height);
|
|
3965
|
-
const toolResult = extrude$
|
|
3965
|
+
const toolResult = extrude$2(positioned, extDir);
|
|
3966
3966
|
if (isErr(toolResult)) return toolResult;
|
|
3967
3967
|
scope.register(toolResult.value);
|
|
3968
3968
|
return fuse$2(s, toolResult.value, { unsafe: true });
|
|
@@ -4750,7 +4750,7 @@ function finalizeExternalSolid(wire, thickness, bore, geom, diagnostics) {
|
|
|
4750
4750
|
const faceResult = makeFace(wire);
|
|
4751
4751
|
if (isErr(faceResult)) return faceResult;
|
|
4752
4752
|
profileScope.register(faceResult.value);
|
|
4753
|
-
const solidResult = extrude$
|
|
4753
|
+
const solidResult = extrude$2(faceResult.value, [
|
|
4754
4754
|
0,
|
|
4755
4755
|
0,
|
|
4756
4756
|
thickness
|
|
@@ -4762,7 +4762,7 @@ function finalizeExternalSolid(wire, thickness, bore, geom, diagnostics) {
|
|
|
4762
4762
|
const boreFaceResult = makeBoreFace(bore / 2);
|
|
4763
4763
|
if (isErr(boreFaceResult)) return boreFaceResult;
|
|
4764
4764
|
boreScope.register(boreFaceResult.value);
|
|
4765
|
-
const boreRaw = extrude$
|
|
4765
|
+
const boreRaw = extrude$2(boreFaceResult.value, [
|
|
4766
4766
|
0,
|
|
4767
4767
|
0,
|
|
4768
4768
|
thickness + 1
|
|
@@ -4791,7 +4791,7 @@ function makeBoreFace(radius) {
|
|
|
4791
4791
|
function finalizeInternalSolid(outerWire, innerToothedWire, thickness, geom, diagnostics) {
|
|
4792
4792
|
const faceResult = makeFace(outerWire, [innerToothedWire]);
|
|
4793
4793
|
if (isErr(faceResult)) return faceResult;
|
|
4794
|
-
const solidResult = extrude$
|
|
4794
|
+
const solidResult = extrude$2(faceResult.value, [
|
|
4795
4795
|
0,
|
|
4796
4796
|
0,
|
|
4797
4797
|
thickness
|
|
@@ -5606,6 +5606,16 @@ function mirror$1(target, options) {
|
|
|
5606
5606
|
freeParams: depsOf(target, nE, atE)
|
|
5607
5607
|
};
|
|
5608
5608
|
}
|
|
5609
|
+
function extrude$1(profile, vector) {
|
|
5610
|
+
const ve = asVec3Expr(vector);
|
|
5611
|
+
return {
|
|
5612
|
+
kind: "Extrude",
|
|
5613
|
+
profile,
|
|
5614
|
+
vector: ve,
|
|
5615
|
+
structuralHash: mix(mix(startHash("Extrude"), profile), ve),
|
|
5616
|
+
freeParams: depsOf(profile, ve)
|
|
5617
|
+
};
|
|
5618
|
+
}
|
|
5609
5619
|
function compound$1(children) {
|
|
5610
5620
|
let h = fnvMixInt32(startHash("Compound"), children.length);
|
|
5611
5621
|
for (const c of children) h = mix(h, c);
|
|
@@ -5652,6 +5662,7 @@ function outputKindOf(node) {
|
|
|
5652
5662
|
case "Rotate":
|
|
5653
5663
|
case "Scale":
|
|
5654
5664
|
case "Mirror": return outputKindOf(node.target);
|
|
5665
|
+
case "Extrude": return "Solid";
|
|
5655
5666
|
case "Compound": return "Compound";
|
|
5656
5667
|
case "Instance": return node.fuse ? "Solid" : "Compound";
|
|
5657
5668
|
}
|
|
@@ -5931,6 +5942,19 @@ function evalInstance(node, ctx) {
|
|
|
5931
5942
|
return materialize(instance(r.value, node.placements), { fuse: node.fuse });
|
|
5932
5943
|
}
|
|
5933
5944
|
//#endregion
|
|
5945
|
+
//#region src/csg/evaluators/extrude.ts
|
|
5946
|
+
function evalExtrude(node, ctx) {
|
|
5947
|
+
const v = evalVec3(node.vector, ctx.env, "Extrude.vector");
|
|
5948
|
+
if (!v.ok) return v;
|
|
5949
|
+
const p = ctx.evalNode(node.profile);
|
|
5950
|
+
if (!p.ok) return p;
|
|
5951
|
+
if (!isFace(p.value)) return err(typeCastError("CSG_NOT_FACE", "Extrude.profile: node did not produce a Face"));
|
|
5952
|
+
const oriented = orientedFace(p.value);
|
|
5953
|
+
if (!oriented.ok) return err(typeCastError("CSG_NOT_FACE", `Extrude.profile: ${oriented.error}`));
|
|
5954
|
+
if (!isPlanarFace(oriented.value)) return err(typeCastError("CSG_NOT_FACE", "Extrude.profile: face is not planar"));
|
|
5955
|
+
return extrude$2(oriented.value, v.value);
|
|
5956
|
+
}
|
|
5957
|
+
//#endregion
|
|
5934
5958
|
//#region src/csg/evaluate.ts
|
|
5935
5959
|
function dispatch(node, ctx) {
|
|
5936
5960
|
switch (node.kind) {
|
|
@@ -5955,6 +5979,7 @@ function dispatch(node, ctx) {
|
|
|
5955
5979
|
case "Mirror": return evalMirror(node, ctx);
|
|
5956
5980
|
case "Compound": return evalCompound(node, ctx);
|
|
5957
5981
|
case "Instance": return evalInstance(node, ctx);
|
|
5982
|
+
case "Extrude": return evalExtrude(node, ctx);
|
|
5958
5983
|
}
|
|
5959
5984
|
}
|
|
5960
5985
|
function hashExprValue(h, v) {
|
|
@@ -6521,6 +6546,11 @@ function transformToJson(n) {
|
|
|
6521
6546
|
}
|
|
6522
6547
|
}
|
|
6523
6548
|
function nodeToJson(n) {
|
|
6549
|
+
if (n.kind === "Extrude") return {
|
|
6550
|
+
kind: "Extrude",
|
|
6551
|
+
profile: nodeToJson(n.profile),
|
|
6552
|
+
vector: exprToJson(n.vector)
|
|
6553
|
+
};
|
|
6524
6554
|
if (n.kind === "Compound") return {
|
|
6525
6555
|
kind: "Compound",
|
|
6526
6556
|
children: n.children.map(nodeToJson)
|
|
@@ -6672,6 +6702,7 @@ function readNode(j) {
|
|
|
6672
6702
|
case "Mirror": return readTransform(kind, j);
|
|
6673
6703
|
case "Compound": return readCompound(j);
|
|
6674
6704
|
case "Instance": return readInstance(j);
|
|
6705
|
+
case "Extrude": return readExtrude(j);
|
|
6675
6706
|
default: return bad(`unknown node kind: ${String(kind)}`);
|
|
6676
6707
|
}
|
|
6677
6708
|
}
|
|
@@ -6826,6 +6857,13 @@ function readMirror(j, target) {
|
|
|
6826
6857
|
at: at.value
|
|
6827
6858
|
}));
|
|
6828
6859
|
}
|
|
6860
|
+
function readExtrude(j) {
|
|
6861
|
+
const profile = readNode(j["profile"]);
|
|
6862
|
+
if (!profile.ok) return profile;
|
|
6863
|
+
const vector = readExpr(j["vector"]);
|
|
6864
|
+
if (!vector.ok) return vector;
|
|
6865
|
+
return ok(extrude$1(profile.value, vector.value));
|
|
6866
|
+
}
|
|
6829
6867
|
function readCompound(j) {
|
|
6830
6868
|
const children = readNodeArray(j["children"], "Compound.children");
|
|
6831
6869
|
return children.ok ? ok(compound$1(children.value)) : children;
|
|
@@ -6937,6 +6975,7 @@ function optimizeNode(n) {
|
|
|
6937
6975
|
});
|
|
6938
6976
|
case "Compound": return compound$1(n.children.map(optimizeNode).filter((c) => c.kind !== "Empty"));
|
|
6939
6977
|
case "Instance": return instance$1(optimizeNode(n.source), n.placements, n.fuse);
|
|
6978
|
+
case "Extrude": return extrude$1(optimizeNode(n.profile), foldExpr(n.vector));
|
|
6940
6979
|
}
|
|
6941
6980
|
}
|
|
6942
6981
|
function optimizeFuse(a, b, tol) {
|
|
@@ -7027,6 +7066,7 @@ function rebuildChildren(n, pred, repl) {
|
|
|
7027
7066
|
});
|
|
7028
7067
|
case "Compound": return compound$1(n.children.map((c) => walk(c, pred, repl)));
|
|
7029
7068
|
case "Instance": return instance$1(walk(n.source, pred, repl), n.placements, n.fuse);
|
|
7069
|
+
case "Extrude": return extrude$1(walk(n.profile, pred, repl), n.vector);
|
|
7030
7070
|
}
|
|
7031
7071
|
}
|
|
7032
7072
|
function forEachNode(root, fn) {
|
|
@@ -7056,6 +7096,7 @@ function childrenOf(n) {
|
|
|
7056
7096
|
case "Mirror": return [n.target];
|
|
7057
7097
|
case "Compound": return n.children;
|
|
7058
7098
|
case "Instance": return [n.source];
|
|
7099
|
+
case "Extrude": return [n.profile];
|
|
7059
7100
|
}
|
|
7060
7101
|
}
|
|
7061
7102
|
function nodeCount(root) {
|
|
@@ -7087,6 +7128,7 @@ var csg_exports = /* @__PURE__ */ __exportAll({
|
|
|
7087
7128
|
emptyFace: () => emptyFace,
|
|
7088
7129
|
emptySolid: () => emptySolid,
|
|
7089
7130
|
emptyWire: () => emptyWire,
|
|
7131
|
+
extrude: () => extrude$1,
|
|
7090
7132
|
foldExpr: () => foldExpr,
|
|
7091
7133
|
forEachNode: () => forEachNode,
|
|
7092
7134
|
fromJSON: () => fromJSON,
|
package/dist/csg/builders.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScalarInput, Vec3Input } from './expressions.js';
|
|
2
2
|
import { Matrix4x4 } from '../core/types.js';
|
|
3
|
-
import { BoxNode, SphereNode, CylinderNode, ConeNode, TorusNode, PolygonNode, CircleNode, LineNode, VertexLitNode, EmptyNode, FuseNode, CutNode, IntersectNode, FuseAllNode, CutAllNode, TranslateNode, RotateNode, ScaleNode, MirrorNode, CompoundNode, InstanceNode, IRNode, SolidNode, FaceNode, EdgeNode, VertexNode } from './types.js';
|
|
3
|
+
import { BoxNode, SphereNode, CylinderNode, ConeNode, TorusNode, PolygonNode, CircleNode, LineNode, VertexLitNode, EmptyNode, FuseNode, CutNode, IntersectNode, FuseAllNode, CutAllNode, TranslateNode, RotateNode, ScaleNode, MirrorNode, ExtrudeNode, CompoundNode, InstanceNode, IRNode, SolidNode, FaceNode, EdgeNode, VertexNode } from './types.js';
|
|
4
4
|
export declare function box(x: ScalarInput, y: ScalarInput, z: ScalarInput): BoxNode;
|
|
5
5
|
export declare function sphere(radius: ScalarInput): SphereNode;
|
|
6
6
|
export declare function cylinder(radius: ScalarInput, height: ScalarInput): CylinderNode;
|
|
@@ -33,6 +33,7 @@ export interface MirrorOptions {
|
|
|
33
33
|
readonly at?: Vec3Input | undefined;
|
|
34
34
|
}
|
|
35
35
|
export declare function mirror(target: IRNode, options?: MirrorOptions): MirrorNode;
|
|
36
|
+
export declare function extrude(profile: FaceNode, vector: Vec3Input): ExtrudeNode;
|
|
36
37
|
export declare function compound(children: ReadonlyArray<IRNode>): CompoundNode;
|
|
37
38
|
export declare function instance(source: IRNode, placements: ReadonlyArray<Matrix4x4>, fuse?: boolean): InstanceNode;
|
|
38
39
|
export type { FaceNode, EdgeNode, VertexNode, SolidNode };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Result } from '../../core/result.js';
|
|
2
|
+
import { AnyShape, Dimension } from '../../core/shapeTypes.js';
|
|
3
|
+
import { ExtrudeNode } from '../types.js';
|
|
4
|
+
import { EvalContext } from './context.js';
|
|
5
|
+
export declare function evalExtrude(node: ExtrudeNode, ctx: EvalContext): Result<AnyShape<Dimension>>;
|
package/dist/csg/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* parameterize via named expression bindings; evaluate against the active
|
|
6
6
|
* kernel with subtree-level cache reuse for incremental parametric edits.
|
|
7
7
|
*/
|
|
8
|
-
export { box, sphere, cylinder, cone, torus, polygon, circle, line, vertex, emptySolid, emptyFace, emptyWire, fuse, cut, intersect, fuseAll, cutAll, translate, rotate, scale, mirror, compound, instance, type RotateOptions, type ScaleOptions, type MirrorOptions, } from './builders.js';
|
|
8
|
+
export { box, sphere, cylinder, cone, torus, polygon, circle, line, vertex, emptySolid, emptyFace, emptyWire, fuse, cut, intersect, fuseAll, cutAll, translate, rotate, scale, mirror, extrude, compound, instance, type RotateOptions, type ScaleOptions, type MirrorOptions, } from './builders.js';
|
|
9
9
|
export { numLit, vec3Lit, vec2Lit, param, binOp, unaryOp, component, buildVec, add, mul, asScalarExpr, asVec3Expr, asVec2Expr, type Expr, type ExprValue, type Env, type ScalarInput, type Vec3Input, type Vec2Input, type BinaryOp, type UnaryOp, } from './expressions.js';
|
|
10
|
-
export type { IRNode, NodeKind, OutputKind, PrimitiveNode, BooleanNode, TransformIRNode, InstanceNode, SolidNode, FaceNode, EdgeNode, VertexNode, AnyNode, } from './types.js';
|
|
10
|
+
export type { IRNode, NodeKind, OutputKind, PrimitiveNode, BooleanNode, TransformIRNode, ExtrudeNode, InstanceNode, SolidNode, FaceNode, EdgeNode, VertexNode, AnyNode, } from './types.js';
|
|
11
11
|
export { outputKindOf } from './types.js';
|
|
12
12
|
export { Evaluator, withEvaluator, type EvaluatorOptions, type StepInfo, type CacheStats, } from './evaluate.js';
|
|
13
13
|
export { toJSON, fromJSON, CSG_VERSION, type CsgEnvelope } from './serialize.js';
|
package/dist/csg/types.d.ts
CHANGED
|
@@ -108,6 +108,12 @@ export interface MirrorNode extends IRNodeBase {
|
|
|
108
108
|
readonly normal?: Expr | undefined;
|
|
109
109
|
readonly at?: Expr | undefined;
|
|
110
110
|
}
|
|
111
|
+
export interface ExtrudeNode extends IRNodeBase {
|
|
112
|
+
readonly kind: 'Extrude';
|
|
113
|
+
/** Must produce OutputKind 'Face'. */
|
|
114
|
+
readonly profile: IRNode;
|
|
115
|
+
readonly vector: Expr;
|
|
116
|
+
}
|
|
111
117
|
export interface CompoundNode extends IRNodeBase {
|
|
112
118
|
readonly kind: 'Compound';
|
|
113
119
|
readonly children: readonly IRNode[];
|
|
@@ -123,7 +129,7 @@ export interface InstanceNode extends IRNodeBase {
|
|
|
123
129
|
export type PrimitiveNode = BoxNode | SphereNode | CylinderNode | ConeNode | TorusNode | PolygonNode | CircleNode | LineNode | VertexLitNode | EmptyNode;
|
|
124
130
|
export type BooleanNode = FuseNode | CutNode | IntersectNode | FuseAllNode | CutAllNode;
|
|
125
131
|
export type TransformIRNode = TranslateNode | RotateNode | ScaleNode | MirrorNode;
|
|
126
|
-
export type IRNode = PrimitiveNode | BooleanNode | TransformIRNode | CompoundNode | InstanceNode;
|
|
132
|
+
export type IRNode = PrimitiveNode | BooleanNode | TransformIRNode | ExtrudeNode | CompoundNode | InstanceNode;
|
|
127
133
|
export type NodeKind = IRNode['kind'];
|
|
128
134
|
export type AnyNode = IRNode;
|
|
129
135
|
/** Nodes that produce a 3D solid. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.125.0",
|
|
4
4
|
"description": "Web CAD library with pluggable geometry kernel",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cad",
|
|
@@ -265,8 +265,8 @@
|
|
|
265
265
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
266
266
|
"@vitest/coverage-v8": "4.1.10",
|
|
267
267
|
"brepjs-opencascade": "*",
|
|
268
|
-
"brepkit-wasm": "3.2.
|
|
269
|
-
"eslint": "10.8.
|
|
268
|
+
"brepkit-wasm": "3.2.13",
|
|
269
|
+
"eslint": "10.8.1",
|
|
270
270
|
"fast-check": "4.9.0",
|
|
271
271
|
"husky": "9.1.7",
|
|
272
272
|
"knip": "6.27.0",
|
|
@@ -274,14 +274,14 @@
|
|
|
274
274
|
"lz-string": "1.5.0",
|
|
275
275
|
"occt-wasm": "4.2.0",
|
|
276
276
|
"prettier": "3.9.6",
|
|
277
|
-
"puppeteer": "25.
|
|
277
|
+
"puppeteer": "25.5.0",
|
|
278
278
|
"size-limit": "13.0.3",
|
|
279
279
|
"sucrase": "3.35.1",
|
|
280
|
-
"tsx": "4.23.
|
|
280
|
+
"tsx": "4.23.11",
|
|
281
281
|
"typedoc": "0.28.20",
|
|
282
282
|
"typescript": "6.0.3",
|
|
283
|
-
"typescript-eslint": "8.
|
|
284
|
-
"vite": "8.2.
|
|
283
|
+
"typescript-eslint": "8.66.0",
|
|
284
|
+
"vite": "8.2.1",
|
|
285
285
|
"vite-plugin-dts": "5.0.3",
|
|
286
286
|
"vitest": "4.1.10"
|
|
287
287
|
},
|