discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How to create an cylindrical arc?

A
adrian
Wed, Jan 28, 2015 12:30 AM

I need to make an cylindrical arc given 3 points: start, middle and end.
It's been a while since I've done vector algebra, but I'm guessing I'll have
to find the centre point which I would use to translate from the origin,
find the plane, which I would use to rotate from the x,y plane to the actual
plane, find the radius and extrude several linear segments of a circle and
then rotate and translate it into position.

Does that sound reasonable?  Is there another way to do this?  A prefabbed
lib maybe?

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I need to make an cylindrical arc given 3 points: start, middle and end. It's been a while since I've done vector algebra, but I'm guessing I'll have to find the centre point which I would use to translate from the origin, find the plane, which I would use to rotate from the x,y plane to the actual plane, find the radius and extrude several linear segments of a circle and then rotate and translate it into position. Does that sound reasonable? Is there another way to do this? A prefabbed lib maybe? A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 28, 2015 12:48 AM

Oh, I can use the rotate_extrude().  But everything else should be good
right?

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11258.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Oh, I can use the rotate_extrude(). But everything else should be good right? A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11258.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 28, 2015 1:58 AM

Actually, is it "cheaper" to make a bunch of segments and subtract the
sections I don't want?  Or is it better to use a bunch of linearly extruded
segments?

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11259.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Actually, is it "cheaper" to make a bunch of segments and subtract the sections I don't want? Or is it better to use a bunch of linearly extruded segments? A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11259.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 28, 2015 2:33 AM

Actually, I think that doing a bunch of segments wouldn't work since every
time I add a new segment, it would not properly intersect with the last one.
I would need some type of function to "round the corner" between one segment
and the next. :(

So I guess that answers my question.  Unless there is some other way to make
an arc.  Unfortunately, it looks like rotate_extrude() is limited to only
doing a full 360 degrees and no partial.  At least the documentation doesn't
seem to indicate that it is possible...

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11261.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Actually, I think that doing a bunch of segments wouldn't work since every time I add a new segment, it would not properly intersect with the last one. I would need some type of function to "round the corner" between one segment and the next. :( So I guess that answers my question. Unless there is some other way to make an arc. Unfortunately, it looks like rotate_extrude() is limited to only doing a full 360 degrees and no partial. At least the documentation doesn't seem to indicate that it is possible... A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11261.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 28, 2015 2:59 AM

Nice little conversation you're having with yourself ;)

Try donutslice() from MCAD/2Dshapes.scad, in libraries under your OpenSCAD
program installation directory. You'll need to extrude it.

You should checkout all the MCAD libraries too.

Cheers.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11263.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Nice little conversation you're having with yourself ;) Try donutslice() from MCAD/2Dshapes.scad, in libraries under your OpenSCAD program installation directory. You'll need to extrude it. You should checkout all the MCAD libraries too. Cheers. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11263.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 28, 2015 3:44 AM

MichaelAtOz wrote

Nice little conversation you're having with yourself ;)

Well, had to talk to someone intelligent around here. ;)

MichaelAtOz wrote

Try donutslice() from MCAD/2Dshapes.scad, in libraries under your OpenSCAD
program installation directory. You'll need to extrude it.

You should checkout all the MCAD libraries too.

Oh, that's good to know.  Didn't look around the file system for that.

Thanks,

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11268.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

MichaelAtOz wrote > Nice little conversation you're having with yourself ;) Well, had to talk to someone intelligent around here. ;) MichaelAtOz wrote > Try donutslice() from MCAD/2Dshapes.scad, in libraries under your OpenSCAD > program installation directory. You'll need to extrude it. > > You should checkout all the MCAD libraries too. Oh, that's good to know. Didn't look around the file system for that. Thanks, A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11268.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 28, 2015 3:51 AM

You should also do a search for OpenSCAD on thingiverse.com, there are some
good libraries there.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11270.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You should also do a search for OpenSCAD on thingiverse.com, there are some good libraries there. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11270.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 28, 2015 4:24 AM

Documentation is sparse on donutSlice().  From what I can see, it makes a
blocky donut slice.  Not very useful. :/

A

--
View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11273.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Documentation is sparse on donutSlice(). From what I can see, it makes a blocky donut slice. Not very useful. :/ A -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11273.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 28, 2015 4:34 AM

If you mean the line segments, try
donutSlice(30,50,190,270,$fn=64);


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11274.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

If you mean the line segments, try donutSlice(30,50,190,270,$fn=64); ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/How-to-create-an-cylindrical-arc-tp11257p11274.html Sent from the OpenSCAD mailing list archive at Nabble.com.
IN
Ian Nichols
Wed, Jan 28, 2015 10:34 AM

On 28 January 2015 at 02:33, adrian adrianh.bsc@gmail.com wrote:

Actually, I think that doing a bunch of segments wouldn't work since every
time I add a new segment, it would not properly intersect with the last
one.
I would need some type of function to "round the corner" between one
segment
and the next. :(

So I guess that answers my question.  Unless there is some other way to
make
an arc.  Unfortunately, it looks like rotate_extrude() is limited to only
doing a full 360 degrees and no partial.  At least the documentation
doesn't
seem to indicate that it is possible...

I've done things like this in the past (to make a tubular arc in the case
below) by doing a rotate_extrude (to make a torus) and finding the
intersection of that and a wedge shape made by linear_extruding a sort of
fanning polygon that starts at the centre of the rotation and expands
around the outside of  the torus.  You could probably adapt that to your
needs.
$fn=64;

pipebend (4,3,20,135);

module pipebend (thickness, id, od, ang)
intersection (){
difference(){
torus (thickness, od);
torus (id,od);
}
wedge (thickness, (od+thickness)/1.7,ang);
}
// ********************** End of Module ******************

module torus (thickness, dia,)
rotate_extrude(convexity = 10) translate([dia/2, 0, 0]) circle(r =
thickness/2) ;
// ********************** End of Module ******************

module wedge (thickness, rad, ang)
translate ([0,0,-(thickness/2)-1]) {
linear_extrude (height = thickness+2) {
polygon(points=[
[radcos(ang/2),-radsin(ang/2)],
[0,0],
[radcos(ang/2),radsin(ang/2)],
[radcos(ang/3),radsin(ang/3)],
[radcos(ang/6),radsin(ang/6)],
[rad,0],
[radcos(ang/6),-radsin(ang/6)],
[radcos(ang/3),-radsin(ang/3)]],
paths=[[0,1,2,3,4,5,6,7]]);}
}
// ********************** End of Module ******************

--
Stand firm for what you believe in, until and unless logic and experience
prove you wrong.  Remember: when the emperor looks naked, the emperor is
naked, the truth and a lie are not "sort-of the same thing" and there is
no aspect, no facet, no moment of life that can't be improved with pizza.

-Daria Morgendorffer

On 28 January 2015 at 02:33, adrian <adrianh.bsc@gmail.com> wrote: > Actually, I think that doing a bunch of segments wouldn't work since every > time I add a new segment, it would not properly intersect with the last > one. > I would need some type of function to "round the corner" between one > segment > and the next. :( > > So I guess that answers my question. Unless there is some other way to > make > an arc. Unfortunately, it looks like rotate_extrude() is limited to only > doing a full 360 degrees and no partial. At least the documentation > doesn't > seem to indicate that it is possible... > I've done things like this in the past (to make a tubular arc in the case below) by doing a rotate_extrude (to make a torus) and finding the intersection of that and a wedge shape made by linear_extruding a sort of fanning polygon that starts at the centre of the rotation and expands around the outside of the torus. You could probably adapt that to your needs. $fn=64; pipebend (4,3,20,135); module pipebend (thickness, id, od, ang) intersection (){ difference(){ torus (thickness, od); torus (id,od); } wedge (thickness, (od+thickness)/1.7,ang); } // ********************** End of Module ****************** module torus (thickness, dia,) rotate_extrude(convexity = 10) translate([dia/2, 0, 0]) circle(r = thickness/2) ; // ********************** End of Module ****************** module wedge (thickness, rad, ang) translate ([0,0,-(thickness/2)-1]) { linear_extrude (height = thickness+2) { polygon(points=[ [rad*cos(ang/2),-rad*sin(ang/2)], [0,0], [rad*cos(ang/2),rad*sin(ang/2)], [rad*cos(ang/3),rad*sin(ang/3)], [rad*cos(ang/6),rad*sin(ang/6)], [rad,0], [rad*cos(ang/6),-rad*sin(ang/6)], [rad*cos(ang/3),-rad*sin(ang/3)]], paths=[[0,1,2,3,4,5,6,7]]);} } // ********************** End of Module ****************** -- Stand firm for what you believe in, until and unless logic and experience prove you wrong. Remember: when the emperor looks naked, the emperor *is* naked, the truth and a lie are not "sort-of the same thing" and there is no aspect, no facet, no moment of life that can't be improved with pizza. -Daria Morgendorffer