openscad / list-comprehension-demos

106 stars 34 forks source link

Using an array of shapes in sweep() #6

Open Jerimon1998 opened 7 years ago

Jerimon1998 commented 7 years ago

Is there an existing way to use a different shape for each point in path_transforms, besides using the transformation matrices in path_transformations? Or is this something yet to be implemented?

I need this to create a special kind of spur gear with teeth that are pointed at the sides (sort of like the involute curve already on the teeth). I already have the methods down for creating the individual shapes for each step in the path (thanks to the hyperbolic worm gear that this gear mates with). My initial thought for a workaround is to use some version of loft() with a large number of these shapes, achieving a reasonable curve, but it may be quite tedious for CGAL to render.

OskarLinde commented 7 years ago

sweep() could potentially be hacked to support individual shapes for each step, but the limitation is that each step needs to have the same number of vertices. loft() relaxes that requirement. Using loft() should not be a CGAL problem. The geometry is directly instantiated without any CSG operations. On Wed, May 10, 2017 at 16:59 Jerimon1998 notifications@github.com wrote:

Is there an existing way to use a different shape for each point in path_transforms, besides using the transformation matrices in path_transformations? Or is this something yet to be implemented?

I need this to create a special kind of spur gear with teeth that are pointed at the sides (sort of like the involute curve already on the teeth). I already have the methods down for creating the individual shapes for each step in the path (thanks to the hyperbolic worm gear that this gear mates with). My initial thought for a workaround is to use some version of loft() with a large number of these shapes, achieving a reasonable curve, but it may be quite tedious for CGAL to render.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openscad/list-comprehension-demos/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/ADjYAVQW3cbsk9HlCNBTatvT_G9U8I2kks5r4dC_gaJpZM4NWytA .

Jerimon1998 commented 7 years ago

Oh yeah, I forgot to mention the vertices. I did assume that a consistent number of points would be needed, and it is actually the default of the method I am using. Each gear shape is basically a point array version of the involute gears in MCAD. As such, my plan was to use a function to set each shape with a different backlash. The number of points always stays the same, but the shapes are not convex, which could throw a wrench into the plan for any methods not capable of handling such shapes. So far the only functional "loft" that I have found for openscad is one that uses python to prepare the shapes and then openscad to execute the tweening. The entire workflow for my existing project is in OpenSCAD, so I will have to either find a way to replicate the code in OpenSCAD or go back to using my old dxf->xyz->scad workflow (except now as dxf->xyz->python->scad).

kintel commented 7 years ago

Sounds like skin() would work: https://github.com/openscad/list-comprehension-demos#extrusionscad