1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 06:47:46 +02:00

det == 0 is never error

This commit is contained in:
Justin Lin
2022-04-04 21:27:11 +08:00
parent 38ce75b708
commit 7c40e28e64

View File

@@ -18,10 +18,7 @@ function _tri_circumcircle(shape_pts) =
d0 = (p1 + p0) / 2 * v0, d0 = (p1 + p0) / 2 * v0,
v1 = p2 - p1, v1 = p2 - p1,
d1 = (p2 + p1) / 2 * v1, d1 = (p2 + p1) / 2 * v1,
det = -cross(v0 , v1) det = -cross(v0 , v1),
)
det == 0 ? undef :
let(
x = (d1 * v0.y - d0 * v1.y) / det, x = (d1 * v0.y - d0 * v1.y) / det,
y = (d0 * v1.x - d1 * v0.x) / det, y = (d0 * v1.x - d1 * v0.x) / det,
center = [x, y], center = [x, y],