mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
clarify that simple paths can have repeats
This commit is contained in:
parent
7c3990f2ed
commit
ea9d133408
1 changed files with 3 additions and 1 deletions
|
@ -485,6 +485,8 @@ function resample_path(path, N, spacing, closed=false) =
|
||||||
// bool = is_path_simple(path, [closed], [eps]);
|
// bool = is_path_simple(path, [closed], [eps]);
|
||||||
// Description:
|
// Description:
|
||||||
// Returns true if the path is simple, meaning that it has no self-intersections.
|
// Returns true if the path is simple, meaning that it has no self-intersections.
|
||||||
|
// Repeated points are not considered self-intersections: a path with such points can
|
||||||
|
// still be simple.
|
||||||
// If closed is set to true then treat the path as a polygon.
|
// If closed is set to true then treat the path as a polygon.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// path = path to check
|
// path = path to check
|
||||||
|
@ -497,7 +499,7 @@ function is_path_simple(path, closed=false, eps=EPSILON) =
|
||||||
normv1 = norm(v1),
|
normv1 = norm(v1),
|
||||||
normv2 = norm(v2)
|
normv2 = norm(v2)
|
||||||
)
|
)
|
||||||
if (/*approx(normv1,0) || approx(normv2,0) ||*/ approx(v1*v2/normv1/normv2,-1)) 1] == []
|
if (approx(v1*v2/normv1/normv2,-1)) 1] == []
|
||||||
&&
|
&&
|
||||||
_path_self_intersections(path,closed=closed,eps=eps) == [];
|
_path_self_intersections(path,closed=closed,eps=eps) == [];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue