[OpenSCAD] Computing polygon by function?
Henning Meyer
tutmann at gmail.com
Wed Aug 24 07:22:39 CEST 2011
actually in openscadpy its pretty straightforward:
from math import pi,sin
psteps = 100
points = [[b*1.0/psteps, sin(b*pi/psteps)] for b in range(0,psteps)]
poly = polygon( points )
obj = rotate_extrude(child=poly).fn(30)
assemble( obj )
it's available on https://github.com/hmeyer/openscadpy or as
ppa:hmeyer/openscadpy
2011/8/22 Christopher Olah <christopherolah.co at gmail.com>:
> You could do this with surfcad quite easily:
>
> https://christopherolah.wordpress.com/2011/03/28/extending-openscad/
>
> In fact, that's practically the goal of cylinderical_surface.
>
> As far as I know, the various python scads don't really support this,
> though you could brute force it with them (and even with openscad) by
> unioning lots of tiny rotated layers together.
>
> On Mon, Aug 22, 2011 at 12:02 PM, Whosawhatsis <whosawhatsis at gmail.com> wrote:
>> No. This is a much requested but not (yet) available feature. There
>> are several projects, though, to create python bindings so that you
>> can use
>>
>> On Mon, Aug 22, 2011 at 6:53 AM, Michael Reifenberger
>> <mike at reifenberger.com> wrote:
>>> Hi,
>>> maybe a newcomer question but I couldn't find an example so far.
>>>
>>> I want to generate a solid model by rotate_extrude'ing a polygon.
>>>
>>> The points of the poygon are defined by a mathematical formula like:
>>> Let: 0 <= b <= Pi
>>> // resp. 0 <= b <= 180 since OpenSCAD seems to use
>>> // degrees for the trigonometrical functions
>>> y(b) = b
>>> x(b) = abs(sin(b))
>>>
>>> How can this be accomplished with OpenSCAD?
>>>
>>> Can a OpenSCAD function return a list of points generated inside a loop?
>>>
>>> Thanks in advance!
>>>
>>> Bye/2
>>> ---
>>> Michael Reifenberger
>>> Michael at Reifenberger.com
>>> http://www.Reifenberger.com
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> OpenSCAD at rocklinux.org
>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> OpenSCAD at rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>>
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openscadpy.png
Type: image/png
Size: 11830 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20110824/1a2a43af/openscadpy-0001.png
More information about the OpenSCAD
mailing list