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

add closed param

This commit is contained in:
Justin Lin
2019-05-29 09:15:48 +08:00
parent 561e2b69b1
commit 429abba8ae
3 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
function __edges_from(pts, closed = true) =
function __edges_from(pts, closed = false) =
let(leng = len(pts))
concat(
[for(i = [0:leng - 2]) [pts[i], pts[i + 1]]],

View File

@@ -44,7 +44,7 @@ function _bijection__bijection_offset_edges(edges, d) =
function bijection_offset(pts, d) =
let(
es = __edges_from(pts),
es = __edges_from(pts, true),
offset_es = _bijection__bijection_offset_edges(es, d),
leng = len(offset_es),
last_p = __line_intersection(offset_es[leng - 1], offset_es[0])

View File

@@ -39,7 +39,7 @@ function _in_shape_sub(shapt_pts, leng, pt, cond, i, j) =
function in_shape(shapt_pts, pt, include_edge = false, epsilon = 0.0001) =
let(
leng = len(shapt_pts),
edges = __edges_from(points)
edges = __edges_from(points, true)
)
_in_shape_in_any_edges(edges, pt, epsilon) ? include_edge :
_in_shape_sub(shapt_pts, leng, pt, false, leng - 1, 0);