1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-24 07:13:34 +02:00

add an option

This commit is contained in:
Justin Lin
2019-05-31 10:12:59 +08:00
parent 699de29c53
commit b9a3d5c496

View File

@@ -16,7 +16,7 @@ include <__private__/__to3d.scad>;
// For backward compatibility, I directly include m_rotation here. // For backward compatibility, I directly include m_rotation here.
include <m_rotation.scad>; include <m_rotation.scad>;
module along_with(points, angles, twist = 0, scale = 1.0) { module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") {
leng_points = len(points); leng_points = len(points);
leng_points_minus_one = leng_points - 1; leng_points_minus_one = leng_points - 1;
twist_step_a = twist / leng_points; twist_step_a = twist / leng_points;
@@ -113,6 +113,11 @@ module along_with(points, angles, twist = 0, scale = 1.0) {
} }
} }
/*
Sadly, children(n) cannot be used with inner modules
so I have to do things in the first level. Ugly!!
*/
if(method == "AXIS_ANGLE") {
if(angles_defined) { if(angles_defined) {
if($children == 1) { if($children == 1) {
for(i = [0:leng_points_minus_one]) { for(i = [0:leng_points_minus_one]) {
@@ -148,4 +153,6 @@ module along_with(points, angles, twist = 0, scale = 1.0) {
} }
} }
} }
}
} }