mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-05 22:37:35 +02:00
det == 0 is never error
This commit is contained in:
@@ -18,16 +18,13 @@ 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),
|
||||||
|
x = (d1 * v0.y - d0 * v1.y) / det,
|
||||||
|
y = (d0 * v1.x - d1 * v0.x) / det,
|
||||||
|
center = [x, y],
|
||||||
|
v = p0 - center
|
||||||
)
|
)
|
||||||
det == 0 ? undef :
|
[center, v * v];
|
||||||
let(
|
|
||||||
x = (d1 * v0.y - d0 * v1.y) / det,
|
|
||||||
y = (d0 * v1.x - d1 * v0.x) / det,
|
|
||||||
center = [x, y],
|
|
||||||
v = p0 - center
|
|
||||||
)
|
|
||||||
[center, v * v];
|
|
||||||
|
|
||||||
function cc_center(cc) = cc[0];
|
function cc_center(cc) = cc[0];
|
||||||
function cc_rr(cc) = cc[1];
|
function cc_rr(cc) = cc[1];
|
||||||
|
Reference in New Issue
Block a user