deadsy / sdfx

A simple CAD package using signed distance functions
MIT License
518 stars 52 forks source link

Creating an arbitraty shape for a chain #75

Closed Megidd closed 8 months ago

Megidd commented 8 months 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 8 months 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.