Last active
September 17, 2023 19:08
-
-
Save tcurdt/5b58e6826ec795227c36e95b935d3659 to your computer and use it in GitHub Desktop.
sweep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use <list-comprehension/skin.scad> | |
use <list-comprehension/extrusion.scad> | |
use <scad-utils/transformations.scad> | |
use <scad-utils/lists.scad> | |
use <scad-utils/shapes.scad> | |
use <dotSCAD/bezier_curve.scad> | |
o=0; | |
points = [ | |
[-50,-200,0], | |
[0,-20,0], | |
[0,30,0], | |
[110,40,30], | |
[110,40,80], | |
]; | |
function _circle(r) = [ for (a = [0 : 10 : 360]) [ | |
r * cos(a), r * sin(a) | |
]]; | |
function _rect(size) = [ | |
[-size[0],-size[1]], | |
[+size[0],-size[1]], | |
[+size[0],+size[1]], | |
[-size[0],+size[1]], | |
]; | |
path = bezier_curve(0.11, points); | |
//path = [ for (p=points) p ]; | |
/* | |
function profile(t) = | |
(1-t) * augment_profile(to_3d(_rect([70+2*o,25+2*o])),4) + | |
t * augment_profile(to_3d(_circle($fn=64,r=55/2+o)),4); | |
*/ | |
function profile(t) = | |
0 * _rect([70+2*o,25+2*o]) + | |
1 * _circle(55/2+o); | |
/* | |
function profile(t) = | |
(1-t) * _rect([70+2*o,25+2*o]) + | |
t * _circle(55/2+o); | |
*/ | |
/* | |
function profile(t) = | |
_rect([70+2*o,25+2*o]); | |
*/ | |
/* | |
function profile(t) = | |
_circle($fn=64,r=55/2+o); | |
*/ | |
total = len(path)-1; | |
trans = [ for (i=[0:len(path)-1]) transform( | |
translation(path[i]) * rotation([-90*(1-i/total),0,0]) | |
, profile(1)) ]; | |
// , profile(i/total)) ]; | |
skin(trans); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somewhat like this but...