JustinSDK / dotSCAD

Reduce the burden of mathematics when playing OpenSCAD
https://openhome.cc/zh-tw/openscad/
GNU Lesser General Public License v3.0
784 stars 107 forks source link

"donut ring" using ellipse_extrude? #6

Closed r4dr3fr4d closed 5 years ago

r4dr3fr4d commented 5 years ago

Looking for a way to do a rotate_extrude in openscad but with different x and y distances, meaning the resulting ring would be elliptical rather than a circle. ellipse_extrude seemed at first like what I'm looking for but seems to be something else when I actually try it out. Any suggestions? Thanks!

JustinSDK commented 5 years ago

Is this you want?

include <shape_ellipse.scad>;
include <shape_pentagram.scad>;
include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;

path = shape_ellipse([40, 20], $fn = 48);
shape = shape_pentagram(5);

path_extrude(
    shape, 
    concat(path, [path[0]]), 
    closed = true, 
    method = "EULER_ANGLE"
);

ellipse

r4dr3fr4d commented 5 years ago

Bingo. Thanks!