mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 20:11:50 +02:00
supported twist
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
module path_extrude(shape_pts, path_pts, triangles = "RADIAL", scale = 1.0) {
|
module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale = 1.0) {
|
||||||
function first_section() =
|
function first_section() =
|
||||||
let(
|
let(
|
||||||
p1 = path_pts[0],
|
p1 = path_pts[0],
|
||||||
@@ -31,6 +31,7 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", scale = 1.0) {
|
|||||||
|
|
||||||
len_path_pts = len(path_pts);
|
len_path_pts = len(path_pts);
|
||||||
scale_step = (scale - 1) / (len_path_pts - 1);
|
scale_step = (scale - 1) / (len_path_pts - 1);
|
||||||
|
twist_step = twist / (len_path_pts - 1);
|
||||||
|
|
||||||
function section(p1, p2, i) =
|
function section(p1, p2, i) =
|
||||||
let(
|
let(
|
||||||
@@ -43,7 +44,11 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", scale = 1.0) {
|
|||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(p = shape_pts)
|
for(p = shape_pts)
|
||||||
rotate_p(p * (1 + scale_step * i) + [0, 0, length], [0, ay, az]) + p1
|
rotate_p(
|
||||||
|
rotate_p(p * (1 + scale_step * i), twist_step * i) + [0, 0, length],
|
||||||
|
[0, ay, az]
|
||||||
|
) + p1
|
||||||
|
//rotate_p(p * (1 + scale_step * i) + [0, 0, length], [0, ay, az]) + p1
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user