1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

refactor: vector minus

This commit is contained in:
Justin Lin
2022-04-14 09:52:22 +08:00
parent 963bcab381
commit e3c5d035aa

View File

@@ -11,7 +11,8 @@ function _vx_bezier_pt3(p1, p2, p3, p4, pts) =
_vx_bezier3(c, b2, a3, p4, _vx_bezier3(p1, a1, b1, c, [each pts, p]));
function _vx_bezier3(p1, p2, p3, p4, pts) =
(abs(p1[0] - p4[0]) < 0.5 && abs(p1[1] - p4[1]) < 0.5 && abs(p1[2] - p4[2]) < 0.5) ?
let(v = p1 - p4)
abs(v.x) < 0.5 && abs(v.y) < 0.5 && abs(v.z) < 0.5 ?
pts :
_vx_bezier_pt3(p1, p2, p3, p4, pts);
@@ -28,6 +29,7 @@ function _vx_bezier_pt2(p1, p2, p3, p4, pts) =
_vx_bezier2(c, b2, a3, p4, _vx_bezier2(p1, a1, b1, c, [each pts, p]));
function _vx_bezier2(p1, p2, p3, p4, pts) =
(abs(p1[0] - p4[0]) < 0.5 && abs(p1[1] - p4[1]) < 0.5) ?
let(v = p1 - p4)
abs(v.x) < 0.5 && abs(v.y) < 0.5 ?
pts :
_vx_bezier_pt2(p1, p2, p3, p4, pts);