fogleman / sdf

Simple SDF mesh generation in Python
MIT License
1.61k stars 132 forks source link

`capped_cylinder` API is confusing #41

Open hweom opened 1 year ago

hweom commented 1 year ago

Documentation says:

f = capped_cylinder(-Z, Z, 0.5)

But what are the first and the second arguments? I assume Z is an axis designator? Why does it need to be passed twice with opposite signs?

nobodyinperson commented 1 year ago

It's the start and end point of the cylinder.

hweom commented 1 year ago

Yeah, I eventually figured Z should be a unit vector for Z axis, although it's not explained anywhere.

It would be nice if the APIs for 3D primitives are normalized. For example, rounded_cylinder takes two radii and a height...