Re: OpenSCAD Digest, Vol 33, Issue 16

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

Re: OpenSCAD Digest, Vol 33, Issue 16

Robert H. Morrison
Hi Peter,

I think what you want to do is a union with a circle and a triangle (polygon).
This will give you the pie shape you want and you only have to define three points.
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech



Message: 4
Date: Tue, 21 Aug 2012 16:05:05 +0200
From: Peter Uithoven <[hidden email]>
Subject: [OpenSCAD] Creating pie (pizza slice) shape (need a dynamic
    length    array)
To: [hidden email]
Message-ID:
    <CAGab-uEYPZe_iZ1YhRiq5Nu-fJrPv1DqBY+Eq+[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Hi OpenSCAD people,

I work a lot in 2D and I really mis a way to create a way to create a pie
(pizza slice) shape.

A workaround for me is the following function in which I create a circle
and then remove parts of it with rectangles, but this is limited to whole
quarters.

So my plan was to create a circle with a polygon, but then I need to create
a array with a dynamic length (according to $fn). For example, if $fn is 3
I want to create (part of) a circle out of 3 points, but when it's 6 I need
6 points. Is there any way to do this?

Thanks in advance,
Best regards,
Peter Uithoven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120821/8273ae08/attachment.html

------------------------------

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


End of OpenSCAD Digest, Vol 33, Issue 16
****************************************


Reply | Threaded
Open this post in threaded view
|

Fw: OpenSCAD Digest, Vol 33, Issue 16

Robert H. Morrison
Hi Peter,

e.g. :

intersection() {
   circle(r=2, $fn=100);
   polygon(points=[[0,0],[3,0],[3,2]]);
}
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech


----- Forwarded Message -----
From: Robert H. Morrison <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Tuesday, August 21, 2012 4:39 PM
Subject: Re: OpenSCAD Digest, Vol 33, Issue 16

Hi Peter,

I think what you want to do is a union with a circle and a triangle (polygon).
This will give you the pie shape you want and you only have to define three points.
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech



Message: 4
Date: Tue, 21 Aug 2012 16:05:05 +0200
From: Peter Uithoven <[hidden email]>
Subject: [OpenSCAD] Creating pie (pizza slice) shape (need a dynamic
    length    array)
To: [hidden email]
Message-ID:
    <CAGab-uEYPZe_iZ1YhRiq5Nu-fJrPv1DqBY+Eq+[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Hi OpenSCAD people,

I work a lot in 2D and I really mis a way to create a way to create a pie
(pizza slice) shape.

A workaround for me is the following function in which I create a circle
and then remove parts of it with rectangles, but this is limited to whole
quarters.

So my plan was to create a circle with a polygon, but then I need to create
a array with a dynamic length (according to $fn). For example, if $fn is 3
I want to create (part of) a circle out of 3 points, but when it's 6 I need
6 points. Is there any way to do this?

Thanks in advance,
Best regards,
Peter Uithoven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120821/8273ae08/attachment.html

------------------------------

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


End of OpenSCAD Digest, Vol 33, Issue 16
****************************************




Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 33, Issue 16

Bob Crimmins
In reply to this post by Robert H. Morrison
Thanks everyone for the great (and fast) responses!  Andrew, your atan2 suggestion looks pretty straight forward.  But, alas, I wouldn't know where to start to implement it in code.  I really am trying to learn this stuff but I'm only just getting my feet wet.  Any chance you could place you snippet into a code module that will actually compile and render?  Then I could tweak-and-learn as I try to understand it and modify it.  I know it's a lot to ask and if you're too busy I totally get that.

Cheers, 

Bob


Message: 2
Date: Tue, 21 Aug 2012 11:42:28 +0100
From: nop head <[hidden email]>
Subject: Re: [OpenSCAD] Triangular tessellation on a sphere
To: [hidden email]
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Hi Andrew,

I Just noticed this:

(x>0) ? atan(y/x) : (
        (x<0 && y>0) ? atan(y/x)+180 : (
        (x<0 && y<0) ? atan(y/x)-180 : (
        (x==0 && y>0) ? 90 : -90 ) ) )

I think you can just use atan2 to do the same.

Reply | Threaded
Open this post in threaded view
|

Re: Fw: OpenSCAD Digest, Vol 33, Issue 16

Peter Falke
In reply to this post by Robert H. Morrison
This works only for small pies. Or in radian: For pies with an angle smaller than pi.

LOL

TakeItAndRun

On 21 August 2012 16:55, Robert H. Morrison <[hidden email]> wrote:
Hi Peter,

e.g. :

intersection() {
   circle(r=2, $fn=100);
   polygon(points=[[0,0],[3,0],[3,2]]);
}
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech


----- Forwarded Message -----
From: Robert H. Morrison <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Tuesday, August 21, 2012 4:39 PM
Subject: Re: OpenSCAD Digest, Vol 33, Issue 16

Hi Peter,

I think what you want to do is a union with a circle and a triangle (polygon).
This will give you the pie shape you want and you only have to define three points.
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech



Message: 4
Date: Tue, 21 Aug 2012 16:05:05 +0200
From: Peter Uithoven <[hidden email]>
Subject: [OpenSCAD] Creating pie (pizza slice) shape (need a dynamic
    length    array)
To: [hidden email]
Message-ID:
    <CAGab-uEYPZe_iZ1YhRiq5Nu-fJrPv1DqBY+Eq+[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Hi OpenSCAD people,

I work a lot in 2D and I really mis a way to create a way to create a pie
(pizza slice) shape.

A workaround for me is the following function in which I create a circle
and then remove parts of it with rectangles, but this is limited to whole
quarters.

So my plan was to create a circle with a polygon, but then I need to create
a array with a dynamic length (according to $fn). For example, if $fn is 3
I want to create (part of) a circle out of 3 points, but when it's 6 I need
6 points. Is there any way to do this?

Thanks in advance,
Best regards,
Peter Uithoven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120821/8273ae08/attachment.html

------------------------------

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


End of OpenSCAD Digest, Vol 33, Issue 16
****************************************





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

Reply | Threaded
Open this post in threaded view
|

Re: Fw: OpenSCAD Digest, Vol 33, Issue 16

Robert H. Morrison
Hi Peter,

TRUE, but that is also true of the solution with the intersection of two squares and a circle which I thought was much more simpler since you only need to enter the degrees of rotation whereas for my polygon solution you need to calculate the two points.
 
Best regards,

Bob Morrison
BSEE, 78, Ga Tech



From: Peter Falke <[hidden email]>
To: Robert H. Morrison <[hidden email]>; [hidden email]
Sent: Tuesday, August 21, 2012 8:20 PM
Subject: Re: [OpenSCAD] Fw: OpenSCAD Digest, Vol 33, Issue 16

This works only for small pies. Or in radian: For pies with an angle smaller than pi.

LOL

TakeItAndRun

On 21 August 2012 16:55, Robert H. Morrison <[hidden email]> wrote:
Hi Peter,

e.g. :

intersection() {
   circle(r=2, $fn=100);
   polygon(points=[[0,0],[3,0],[3,2]]);
}
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech


----- Forwarded Message -----
From: Robert H. Morrison <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Tuesday, August 21, 2012 4:39 PM
Subject: Re: OpenSCAD Digest, Vol 33, Issue 16

Hi Peter,

I think what you want to do is a union with a circle and a triangle (polygon).
This will give you the pie shape you want and you only have to define three points.
 
Best regards,
   __            _ _ _
  /  )      /   ' ) ) )
 /--<  ____/_    / / / __,_  __  o _   ________
/___/_(_) /_)   / ' (_(_) (_/ (_<_/_)_(_) / / <_
                                 ,,,
                               (o o)
--- --- --- --- --- --- ---oOo--(_)--oOo--- --- --- --- --- --- ---
                       "Luke, use the source!"
--- --- --- --- --- --- ---oOo-------oOo--- --- --- --- --- --- ---

Bob Morrison
BSEE, 78, Ga Tech



Message: 4
Date: Tue, 21 Aug 2012 16:05:05 +0200
From: Peter Uithoven <[hidden email]>
Subject: [OpenSCAD] Creating pie (pizza slice) shape (need a dynamic
    length    array)
To: [hidden email]
Message-ID:
    <CAGab-uEYPZe_iZ1YhRiq5Nu-fJrPv1DqBY+Eq+[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Hi OpenSCAD people,

I work a lot in 2D and I really mis a way to create a way to create a pie
(pizza slice) shape.

A workaround for me is the following function in which I create a circle
and then remove parts of it with rectangles, but this is limited to whole
quarters.

So my plan was to create a circle with a polygon, but then I need to create
a array with a dynamic length (according to $fn). For example, if $fn is 3
I want to create (part of) a circle out of 3 points, but when it's 6 I need
6 points. Is there any way to do this?

Thanks in advance,
Best regards,
Peter Uithoven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120821/8273ae08/attachment.html

------------------------------

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


End of OpenSCAD Digest, Vol 33, Issue 16
****************************************





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!