mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
refactor
This commit is contained in:
@@ -23,20 +23,12 @@ function _in_shape_in_line_equation(edge, pt) =
|
|||||||
)
|
)
|
||||||
(pt[1] == a * pt[0] + b);
|
(pt[1] == a * pt[0] + b);
|
||||||
|
|
||||||
function _in_shape_in_any_edges_sub(edges, leng, pt, i, epsilon) =
|
function _in_shape_in_any_edges(edges, pt, epsilon) =
|
||||||
leng == i ? false : (
|
let(
|
||||||
__in_line(edges[i], pt, epsilon) ? true : _in_shape_in_any_edges_sub(edges, leng, pt, i + 1, epsilon)
|
leng = len(edges),
|
||||||
);
|
maybe_last = [for(i = 0; i < leng && !__in_line(edges[i], pt, epsilon); i = i + 1) i][leng - 1]
|
||||||
|
)
|
||||||
function _in_shape_in_any_edges(edges, pt, epsilon) = _in_shape_in_any_edges_sub(edges, len(edges), pt, 0, epsilon);
|
is_undef(maybe_last);
|
||||||
|
|
||||||
// function _in_shape_in_any_edges(edges, pt, epsilon) =
|
|
||||||
// let(
|
|
||||||
// leng = len(edges),
|
|
||||||
// last = [for(i = 0; i < leng && !__in_line(edges[i], pt, epsilon); i = i + 1) i][leng - 1]
|
|
||||||
// )
|
|
||||||
// is_undef(last);
|
|
||||||
|
|
||||||
|
|
||||||
function _in_shape_interpolate_x(y, p1, p2) =
|
function _in_shape_interpolate_x(y, p1, p2) =
|
||||||
p1[1] == p2[1] ? p1[0] : (
|
p1[1] == p2[1] ? p1[0] : (
|
||||||
|
Reference in New Issue
Block a user