How to create an cylindrical arc?

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

How to create an cylindrical arc?

adrian
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
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

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


A
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
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
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
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
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
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.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
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
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
You should also do a search for OpenSCAD on thingiverse.com, there are some good libraries there.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

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


A
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
If you mean the line segments, try
donutSlice(30,50,190,270,$fn=64);
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

Ian Nichols
In reply to this post by adrian
On 28 January 2015 at 02:33, adrian <[hidden email]> 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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
In reply to this post by MichaelAtOz
Well that's less blocky but its too big and I also want a circle extruded along an arc.  I've been looking around and it looks like sweep() is what I'm looking for, but I need to figure out how it works and where all the modules are to use it.  I see it here, but some of the modules it includes are not there.


A
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
In reply to this post by Ian Nichols
Thanks Ian!  That has good possibilities. :)


A
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
In reply to this post by adrian
adrian wrote
but some of the modules it includes are not there.
You need the development version to use it.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
In reply to this post by adrian
> too big and I also want a circle extruded along an arc.

IOW a curved tube??
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

kintel
Administrator
In reply to this post by adrian

On Jan 28, 2015, at 22:03 PM, adrian <[hidden email]> wrote:

> Well that's less blocky but its too big and I also want a circle extruded
> along an arc.  I've been looking around and it looks like sweep() is what
> I'm looking for, […]

Sweep is a bit general and probably requires too much configuration to fit your needs perfectly.
Currently, the best solution I can think of is to just intersect your 360 degree rotation volume with a wedge.
Here’s a quick starting point:

module rotate_extrude_angle(angle, size) {
  module pie(a) {
    r=sqrt(2);
    hull() polyhedron(points=[[0,0,-r], [r,0,-r], [r*cos(a),r*sin(a),-r],[0,0,r], [r,0,r], [r*cos(a),r*sin(a),r]], faces=[[0,1,2,3,4,5]]);
  }

  intersection() {
    scale(size) pie(angle);
    rotate_extrude() children();
  }
}

rotate_extrude_angle(45, 13) translate([8,0]) circle(5);

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

MichaelAtOz
Administrator
OpenCSG doesn't like that
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Obviously 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/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

kintel
Administrator
On Jan 29, 2015, at 00:04 AM, MichaelAtOz <[hidden email]> wrote:

> OpenCSG doesn't like that
>
Yep, quick and dirty. the rotate_extrude() needs a convexity parameter to render correctly. I guess we could be helpful and automatically set it higher for rotate_extrude as it tends to always have a depth complexity of minimum 2..

 -Marius

 
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

kintel
Administrator
On Jan 29, 2015, at 00:08 AM, Marius Kintel <[hidden email]> wrote:

>  I guess we could be helpful and automatically set it higher for rotate_extrude as it tends to always have a depth complexity of minimum 2..
>
Fixed in latest master ;)

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

glennswest
In reply to this post by adrian
Ive done a few like theses, I use a pie library.
It can slide up a circle easy enough, and then a difference of a another
pie. Pretty easy.


On Wed, Jan 28, 2015 at 8:30 AM, adrian <[hidden email]> wrote:
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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: How to create an cylindrical arc?

adrian
In reply to this post by MichaelAtOz
<quote author="MichaelAtOz">
You need the development version to use it.
<quote author="MichaelAtOz">
And where do I get that?  I have the 2015.01.23.  Isn't that development?

<quote author="MichaelAtOz">
> too big and I also want a circle extruded along an arc.

IOW a curved tube??
<quote author="MichaelAtOz">
Yes.

12