[OpenSCAD] Curved Chain (tentacle) using a series of pill shapes - recursive function?

nop head nop.head at gmail.com
Wed Oct 26 13:15:50 EDT 2016


I think you want a recursive module that draws one link, then translates to
the end and rotates a recursive call to itself.

On 26 October 2016 at 18:10, Benjamin Hill <benjaminhill at gmail.com> wrote:

> I'm trying to create an octopus tentacle, but am running into
> roadblocks and would love suggestions.
>
> I'm thinking about it like creating a chain of "capsules" (cylinders
> with hemisphere ends) - I can create a single link of the chain, and I
> can call that function in a loop, and I can even scale the chain links
> through the loop, but that system doesn't work when I try to curve the
> chain.
>
> I'm wondering if a recursive function would help?  Something like
> "draw link from origin, move to other side of the link, scale down
> slightly, rotate slightly (this is the part that gets me), recurse"
>
> See image for what I mean.
>
> When I rotate slightly, that means the next link's "other end" isn't a
> simple offset, but involves math of the current rotation.  Is there a
> way to do it internally to the recursion so I don't have to calculate
> it myself?  This would also enable all sorts of neat fractal things.
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20161026/99e45f51/attachment-0002.html>


More information about the Discuss mailing list