deadsy / sdfx

A simple CAD package using signed distance functions
MIT License
543 stars 51 forks source link

Creating an arbitraty shape for a chain #75

Closed Megidd closed 1 year ago

Megidd commented 1 year ago

Shapes like gyroid can already be created by signed distance functions, SDF:

https://github.com/deadsy/sdfx/blob/7a4c3139ef6ca8511e44080aaf971b9606460c84/sdf/gyroid.go#L23

I wonder if any arbitrary shape is feasible to be created by SDF. Shapes like this type of chain. I just want to make sure there is no possible hurdle.

deadsy commented 1 year ago

SDFs are general so you can create arbitrary objects. It's conceivable that there is a mathematical oddity implementing the SDF for a chain, but in practice you typically construct such things with CSG on primitive shapes. E.g. everything in the objects directory- useful things, all built from simpler primitives.