1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00

use assert

This commit is contained in:
Justin Lin 2022-05-07 13:59:46 +08:00
parent 98a5a64293
commit 7bf7c17b36

View File

@ -19,7 +19,5 @@ function tri_circumcenter(shape_pts) =
d1 = (p2 + p1) / 2 * v1,
det = -cross(v0 , v1)
)
det == 0 ? undef : [
cross([d1, d0], [v1.y, v0.y]),
cross([d0, d1], [v0.x, v1.x])
] / det;
assert(det != 0, "shape_pts is not a triangle")
[cross([d1, d0], [v1.y, v0.y]), cross([d0, d1], [v0.x, v1.x])] / det;