May 17, 2019
Description
This is a parametric leaf for openscad.
You define 3 lists of control points which are splined to make the center vein and two edges, and you define several other constants such as the number of veins, their angle, the concavity of the leaf, the radius of veins (leaf thickness), and "resolution" (it takes quite long to compile, so beware. if you're going to use this in another model, it might be better to compile/export it separately and then importing the STL).
Under the hood, this is actually quite simple. 1) use existing community spline code and path_extrude to spline between control points, and extrude along the path 2) for a given numbered vein, use a point on the edge and center vein and a calculated point in the middle to do the same thing (spline + path_extrude), 3) take your vein paths, and raise and lower these to construct a profile, which you can then sweep between.
You can also call this as a library from within any other document.
If you'd like to see any tweaks to this, or have suggests, don't be afraid to holler!
Note, this has several dependencies as follows:
splines.scad;/https://www.thingiverse.com/thing:1208001
path_extrude_TWP_V3.scad; https://www.thingiverse.com/thing:3354650
dumbSweep.scad; https://www.thingiverse.com/thing:3635671
Shoutout to https://www.raphaelluckom.com/posts/bezier_curves.html for the inspiration (and making me believe it was possible ;-) )
versions: leaf.scad will always be the latest
2019-05-16: published V1
2019-05-17: V2, updated to make the angle cleaner (previously the angle of a vein was based on counting points along the center path and edge path, so actual angle would change as you get wider, which isn't great).
License:
Creative Commons - Attribution