mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-09-03 19:52:33 +02:00
shapt_pts accepts [[x, y], ...] format
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale = 1.0) {
|
module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale = 1.0) {
|
||||||
|
|
||||||
|
s_pts = len(shape_pts[0]) == 3 ? shape_pts : [for(p = shape_pts) [p[0], p[1], 0]];
|
||||||
|
|
||||||
function first_section() =
|
function first_section() =
|
||||||
let(
|
let(
|
||||||
p1 = path_pts[0],
|
p1 = path_pts[0],
|
||||||
@@ -25,7 +28,7 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale
|
|||||||
az = atan2(dy, dx)
|
az = atan2(dy, dx)
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(p = shape_pts)
|
for(p = s_pts)
|
||||||
rotate_p(p, [0, ay, az]) + p1
|
rotate_p(p, [0, ay, az]) + p1
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -50,7 +53,7 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale
|
|||||||
az = atan2(dy, dx)
|
az = atan2(dy, dx)
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(p = shape_pts)
|
for(p = s_pts)
|
||||||
let(scaled_p = [p[0] * (1 + scale_step_x * i), p[1] * (1 + scale_step_y * i), p[2]])
|
let(scaled_p = [p[0] * (1 + scale_step_x * i), p[1] * (1 + scale_step_y * i), p[2]])
|
||||||
rotate_p(
|
rotate_p(
|
||||||
rotate_p(scaled_p, twist_step * i) + [0, 0, length],
|
rotate_p(scaled_p, twist_step * i) + [0, 0, length],
|
||||||
|
Reference in New Issue
Block a user