Skip to content

Instantly share code, notes, and snippets.

@tcurdt
Last active September 17, 2023 19:08
Show Gist options
  • Save tcurdt/5b58e6826ec795227c36e95b935d3659 to your computer and use it in GitHub Desktop.
Save tcurdt/5b58e6826ec795227c36e95b935d3659 to your computer and use it in GitHub Desktop.
sweep
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);
@tcurdt
Copy link
Author

tcurdt commented Sep 17, 2023

Somewhat like this but...

Screenshot 2023-09-17 at 03 21 02

@tcurdt
Copy link
Author

tcurdt commented Sep 17, 2023

I kind of got it working using a skin()
Screenshot 2023-09-17 at 04 28 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment