discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Ring with simple CSG compling

H
Higraphics
Mon, Mar 30, 2020 1:06 PM

Hello evey body
,
i can make ring by 2 cylinder under a difference function


module ring_in(){
translate([0,0,1.5])
rotate([0,90,0]){
cylinder(r=4.8, h=1, center=true, $fn=130);
}
}
module ring_out(){
translate([0,0,1.1])
scale([1,1.3,1.2]){
rotate([0,90,0]){
cylinder(r=2.8, h=1.1, center=true, $fn=130);
}
}
}
module Ring(){
difference(){
ring_in();
ring_out();
}
}


but i like to make is smooth not shape as this method below
something like that:
http://forum.openscad.org/file/t2643/torus-simple-3d-shape-isolated-on-transparent-background-volumetric-round-ring-golden-color-PHWE6F.jpg

--
Sent from: http://forum.openscad.org/

Hello evey body , i can make ring by 2 cylinder under a difference function _______________________________________________ module ring_in(){ translate([0,0,1.5]) rotate([0,90,0]){ cylinder(r=4.8, h=1, center=true, $fn=130); } } module ring_out(){ translate([0,0,1.1]) scale([1,1.3,1.2]){ rotate([0,90,0]){ cylinder(r=2.8, h=1.1, center=true, $fn=130); } } } module Ring(){ difference(){ ring_in(); ring_out(); } } _____________________________________________________ but i like to make is smooth not shape as this method below something like that: <http://forum.openscad.org/file/t2643/torus-simple-3d-shape-isolated-on-transparent-background-volumetric-round-ring-golden-color-PHWE6F.jpg> -- Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Mon, Mar 30, 2020 1:34 PM

What you want is called a circular torus. If the circular section radius is
constant as seems to be in your picture, you can get it by doing a
rotate_extrude of a circle.

module ring(r, R) {
rotate_extrude()
translate([R,0,0])
circle(r);
}

$fn=24;
scale([1,1.3,1.2])
rotate([0,90,0])
ring(0.4,1.5);

If you want the section radius changes along the circular path then you
will need to compute all vertices of the torus surface and build a
polyhedron(), a much harder task. The use of some library support may
simplify part of the task.

What you want is called a circular torus. If the circular section radius is constant as seems to be in your picture, you can get it by doing a rotate_extrude of a circle. module ring(r, R) { rotate_extrude() translate([R,0,0]) circle(r); } $fn=24; scale([1,1.3,1.2]) rotate([0,90,0]) ring(0.4,1.5); If you want the section radius changes along the circular path then you will need to compute all vertices of the torus surface and build a polyhedron(), a much harder task. The use of some library support may simplify part of the task.