1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 09:14:29 +02:00

avoid p1 == p2

This commit is contained in:
Justin Lin
2022-05-08 10:00:59 +08:00
parent fca63e677f
commit b37508dd94
2 changed files with 5 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ function _lines(t, codes, angle, leng) =
i = i + 1,
t2 = _next_t2(t1, codes[i], angle, leng)
)
if(search(codes[i], "F+-") != [])
[turtle2d("pt", t1), turtle2d("pt", t2)]
let(p1 = turtle2d("pt", t1), p2 = turtle2d("pt", t2))
if(search(codes[i], "F+-") != [] && p1 != p2)
[p1, p2]
];

View File

@@ -46,6 +46,7 @@ function _lines(t, codes, angle, leng) =
i = i + 1,
t2 = _next_t2(t1, codes[i], angle, leng)
)
if(search(codes[i], "F+-") != [])
let(p1 = turtle3d("pt", t1), p2 = turtle3d("pt", t2))
if(search(codes[i], "F+-") != [] && p1 != p2)
[turtle3d("pt", t1), turtle3d("pt", t2)]
];