mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-07 23:37:13 +02:00
add px_polyline
This commit is contained in:
11
src/px_polyline.scad
Normal file
11
src/px_polyline.scad
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
include <__private__/__to3d.scad>;
|
||||||
|
include <__private__/__to2d.scad>;
|
||||||
|
include <__private__/__lines_from.scad>;
|
||||||
|
|
||||||
|
function px_polyline(points) =
|
||||||
|
let(
|
||||||
|
is_2d = len(points[0]) == 2,
|
||||||
|
pts = is_2d ? [for(pt = points) __to3d(pt)] : points,
|
||||||
|
polyline = [for(line = __lines_from(pts)) each px_line(line[0], line[1])]
|
||||||
|
)
|
||||||
|
is_2d ? [for(pt = polyline) __to2d(pt)] : polyline;
|
Reference in New Issue
Block a user