mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
refactor
This commit is contained in:
@@ -9,7 +9,10 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
use <__comm__/__to3d.scad>;
|
use <__comm__/__to3d.scad>;
|
||||||
use <ptf/ptf_rotate.scad>;
|
|
||||||
|
use <matrix/m_scaling.scad>;
|
||||||
|
use <matrix/m_translation.scad>;
|
||||||
|
use <matrix/m_rotation.scad>;
|
||||||
|
|
||||||
function cross_sections(shape_pts, path_pts, angles, twist = 0, scale = 1.0) =
|
function cross_sections(shape_pts, path_pts, angles, twist = 0, scale = 1.0) =
|
||||||
let(
|
let(
|
||||||
@@ -23,12 +26,15 @@ function cross_sections(shape_pts, path_pts, angles, twist = 0, scale = 1.0) =
|
|||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(i = 0; i <= len_path_pts_minus_one; i = i + 1)
|
for(i = 0; i <= len_path_pts_minus_one; i = i + 1)
|
||||||
[
|
let(
|
||||||
for(p = sh_pts)
|
transform_m = m_translation(pth_pts[i]) *
|
||||||
let(scaled_p = [p.x * (1 + scale_step_vt.x * i), p.y * (1 + scale_step_vt.y * i), p.z])
|
m_rotation(angles[i]) *
|
||||||
ptf_rotate(
|
m_rotation(twist_step * i) *
|
||||||
ptf_rotate(scaled_p, twist_step * i)
|
m_scaling([1 + scale_step_vt.x * i, 1 + scale_step_vt.y * i, 1])
|
||||||
, angles[i]
|
)
|
||||||
) + pth_pts[i]
|
[
|
||||||
]
|
for(p = sh_pts)
|
||||||
|
let(transformed = transform_m * [each p, 1])
|
||||||
|
[transformed.x, transformed.y, transformed.z]
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user