SolidCode / SolidPython

A python frontend for solid modelling that compiles to OpenSCAD
1.1k stars 171 forks source link

Allow generating the shape dynamically, along the extrusion path #198

Closed mathieu-lacage closed 9 months ago

mathieu-lacage commented 2 years ago

I know that extrude_along_path has a transform parameter to transform shape points during extrusion but it's not entirely sufficient to handle my use-case because I want to generate a scaled profile along the path with constant width, regardless of scale.

The attached patch implements something similar to the openscad skin function from list-comprehension-demos that takes as input a callable to generate the profile along the extrusion path.

This patch is not really correct with regard to type checking (I did not change the type of the input shape_pts because I have no idea on how to specifiy a union between the native list type and a callable).

I'd be happy to revise the patch as needed based on your feedback.