geometrix 0.5.40 → 0.5.42
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/index.js +26 -13
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3703,8 +3703,9 @@ function fcFaceContour(paxCtr, outName) {
|
|
|
3703
3703
|
let px1 = 0;
|
|
3704
3704
|
let py1 = 0;
|
|
3705
3705
|
let pIdx = 0;
|
|
3706
|
+
let pIdxLast = 0;
|
|
3706
3707
|
let sIdx = 0;
|
|
3707
|
-
for (const seg of paxCtr) {
|
|
3708
|
+
for (const [segIdx, seg] of paxCtr.entries()) {
|
|
3708
3709
|
if (seg.typ === 0 /* eStart */) {
|
|
3709
3710
|
rStr += ` P${fid(pIdx)} = App.Vector(${ff6(seg.px)}, ${ff6(seg.py)}, 0)
|
|
3710
3711
|
`;
|
|
@@ -3712,7 +3713,12 @@ function fcFaceContour(paxCtr, outName) {
|
|
|
3712
3713
|
} else if (seg.typ === 1 /* eStroke */) {
|
|
3713
3714
|
rStr += ` P${fid(pIdx)} = App.Vector(${ff6(seg.px)}, ${ff6(seg.py)}, 0)
|
|
3714
3715
|
`;
|
|
3715
|
-
|
|
3716
|
+
if (segIdx < paxCtr.length - 1) {
|
|
3717
|
+
pIdxLast = pIdx;
|
|
3718
|
+
} else {
|
|
3719
|
+
pIdxLast = 0;
|
|
3720
|
+
}
|
|
3721
|
+
rStr += ` S${fid(sIdx)} = Part.LineSegment(P${fid(pIdx - 1)}, P${fid(pIdxLast)})
|
|
3716
3722
|
`;
|
|
3717
3723
|
pIdx += 1;
|
|
3718
3724
|
sIdx += 1;
|
|
@@ -3728,7 +3734,12 @@ function fcFaceContour(paxCtr, outName) {
|
|
|
3728
3734
|
}
|
|
3729
3735
|
rStr += ` P${fid(pIdx)} = App.Vector(${ff6(seg.px)}, ${ff6(seg.py)}, 0)
|
|
3730
3736
|
`;
|
|
3731
|
-
|
|
3737
|
+
if (segIdx < paxCtr.length - 1) {
|
|
3738
|
+
pIdxLast = pIdx;
|
|
3739
|
+
} else {
|
|
3740
|
+
pIdxLast = 0;
|
|
3741
|
+
}
|
|
3742
|
+
rStr += ` S${fid(sIdx)} = Part.Arc(P${fid(pIdx - 2)}, P${fid(pIdx - 1)}, P${fid(pIdxLast)})
|
|
3732
3743
|
`;
|
|
3733
3744
|
pIdx += 1;
|
|
3734
3745
|
sIdx += 1;
|
|
@@ -3858,13 +3869,13 @@ print(f"outFileName: {outFileName}")
|
|
|
3858
3869
|
}
|
|
3859
3870
|
rStr += ` VEX = FIG.extrude(App.Vector(0, 0, ${extrud.length}))`;
|
|
3860
3871
|
} else if (extrud.extrudeMethod === 1 /* eRotate */) {
|
|
3861
|
-
rStr += ` VEX = FIG.
|
|
3872
|
+
rStr += ` VEX = FIG.revolve(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 360).rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 90)`;
|
|
3862
3873
|
}
|
|
3863
3874
|
rStr += `
|
|
3864
|
-
VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), ${radToDeg(extrud.rotate[0])})
|
|
3865
|
-
VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), ${radToDeg(extrud.rotate[1])})
|
|
3866
|
-
VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), ${radToDeg(extrud.rotate[2])})
|
|
3867
|
-
VFP = VR3.translate(App.Vector(${extrud.translate[0]}, ${extrud.translate[1]}, ${extrud.translate[2]}))
|
|
3875
|
+
VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), ${ff6(radToDeg(extrud.rotate[0]))})
|
|
3876
|
+
VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), ${ff6(radToDeg(extrud.rotate[1]))})
|
|
3877
|
+
VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), ${ff6(radToDeg(extrud.rotate[2]))})
|
|
3878
|
+
VFP = VR3.translate(App.Vector(${ff6(extrud.translate[0])}, ${ff6(extrud.translate[1])}, ${ff6(extrud.translate[2])}))
|
|
3868
3879
|
return VFP
|
|
3869
3880
|
${extrud.outName} = fex_${extrud.outName}()
|
|
3870
3881
|
|
|
@@ -3928,11 +3939,13 @@ ${extrud.outName} = fex_${extrud.outName}()
|
|
|
3928
3939
|
return rGeoms;
|
|
3929
3940
|
}
|
|
3930
3941
|
getOneInherit(inherit) {
|
|
3931
|
-
const rStr = `
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3942
|
+
const rStr = `def finh_${inherit.outName}():
|
|
3943
|
+
IVR1 = ${inherit.subdesign}.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), ${ff6(radToDeg(inherit.rotate[0]))})
|
|
3944
|
+
IVR2 = IVR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), ${ff6(radToDeg(inherit.rotate[1]))})
|
|
3945
|
+
IVR3 = IVR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), ${ff6(radToDeg(inherit.rotate[2]))})
|
|
3946
|
+
IVF = IVR3.translate(App.Vector(${ff6(inherit.translate[0])}, ${ff6(inherit.translate[1])}, ${ff6(inherit.translate[2])}))
|
|
3947
|
+
return IVF
|
|
3948
|
+
${inherit.outName} = finh_${inherit.outName}()
|
|
3936
3949
|
|
|
3937
3950
|
`;
|
|
3938
3951
|
return rStr;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geometrix",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.42",
|
|
4
4
|
"description": "The 2D geometry engine of the parametrix",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"json5": "^2.2.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@types/node": "^20.
|
|
70
|
+
"@types/node": "^20.14.1",
|
|
71
71
|
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
72
72
|
"@typescript-eslint/parser": "^7.0.1",
|
|
73
73
|
"eslint": "^8.57.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"npm-run-all": "^4.1.5",
|
|
76
76
|
"prettier": "^3.3.0",
|
|
77
77
|
"shx": "^0.3.4",
|
|
78
|
-
"tsup": "^8.0
|
|
78
|
+
"tsup": "^8.1.0",
|
|
79
79
|
"typescript": "^5.4.5",
|
|
80
80
|
"vitest": "^1.6.0"
|
|
81
81
|
}
|