Skip to content

Instantly share code, notes, and snippets.

@arnholm
Last active April 9, 2021 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnholm/87ccd342abc8b8bef712791f648b5021 to your computer and use it in GitHub Desktop.
Save arnholm/87ccd342abc8b8bef712791f648b5021 to your computer and use it in GitHub Desktop.
Sweep along spline curve
// AngelCAD code.
shape@ main_shape(as_args@ args)
{
array<pos3d@> pts = {
{0.000000,0,10.593750}
,{0.000000,0,10.406250}
,{-0.003906,0,10.199219}
,{-0.011719,0,9.972656}
,{-0.023438,0,9.726562}
,{-0.039062,0,9.460938}
,{-0.058594,0,9.175781}
,{-0.082031,0,8.871094}
,{-0.109375,0,8.546875}
,{-0.140625,0,8.203125}
,{-0.175781,0,7.839844}
,{-0.214844,0,7.457031}
,{-0.257812,0,7.054688}
,{-0.304688,0,6.632812}
,{-0.355469,0,6.191406}
,{-0.410156,0,5.730469}
,{-0.468750,0,5.250000}
,{-0.531250,0,4.750000}
,{-0.582031,0,4.273438}
,{-0.621094,0,3.820312}
,{-0.648438,0,3.390625}
,{-0.664062,0,2.984375}
,{-0.667969,0,2.601562}
,{-0.660156,0,2.242188}
,{-0.640625,0,1.906250}
,{-0.609375,0,1.593750}
,{-0.566406,0,1.304688}
,{-0.511719,0,1.039062}
,{-0.445312,0,0.796875}
,{-0.367188,0,0.578125}
,{-0.277344,0,0.382812}
,{-0.175781,0,0.210938}
,{-0.062500,0,0.062500}
};
spline_path path(pts,vec3d(1,0,0));
return sweep(circle(r:0.2),path);
}
void main()
{
shape@ obj = main_shape(GetArgs());
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.001);
}
Display the source blob
Display the rendered blob
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment