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:
@@ -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]));
|
_vx_bezier3(c, b2, a3, p4, _vx_bezier3(p1, a1, b1, c, [each pts, p]));
|
||||||
|
|
||||||
function _vx_bezier3(p1, p2, p3, p4, pts) =
|
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 :
|
pts :
|
||||||
_vx_bezier_pt3(p1, p2, p3, p4, 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]));
|
_vx_bezier2(c, b2, a3, p4, _vx_bezier2(p1, a1, b1, c, [each pts, p]));
|
||||||
|
|
||||||
function _vx_bezier2(p1, p2, p3, p4, pts) =
|
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 :
|
pts :
|
||||||
_vx_bezier_pt2(p1, p2, p3, p4, pts);
|
_vx_bezier_pt2(p1, p2, p3, p4, pts);
|
Reference in New Issue
Block a user