What does HackerNews think of sdf?

Simple SDF mesh generation in Python

Language: Python

#4 in 3D
#61 in Python
I used to like OpenSCAD for its simple approach but then I discovered SDF-based modelling with Python made possible with this neat library: [1]. This is perfect if you are a programmer that doesn't know anything about CAD-Software.

1.: https://github.com/fogleman/sdf

>these the the central core that understands BREP and implements the geometric operations.

I've seen people quote a good modern CAD kernal as a 100 man year project. It's probably not going to happen, maybe there's some avenue for government funding?

Alternatively Signed-Distance-Functions are pretty nice. They're not BREP, but they're a lot easier to implement, and it might be possible to shove them into a BREP-shaped hole.

Here's a signed-distance-function based CAD kernal written in a few thousand lines of python+numpy, that seems to be about as fast as openscad. Maybe faster. https://github.com/fogleman/sdf

Excellent. You might be interested in a Python library that I wrote for generating 3D meshes (STL files) from SDFs : https://github.com/fogleman/sdf

It just uses marching cubes for triangulation but the SDFs are all numpy'd and the SDF is evaluated in batches on multiple threads so it's relatively fast.

I wrote it because I was a little frustrated with OpenSCAD. SDFs make it trivial to do things like rounded corners, for example.

Try out fogleman/sdf[1]. It is like OpenSCAD in many ways but the distance field model gives you offsets and fillets more easily.

[1] https://github.com/fogleman/sdf

Just a quick diff between your list and mine, apologies if I missed them or if there is a reason to exclude these:

    - https://github.com/nickc92/ViewSCAD
    - Matt Keeter's stuff (listed here https://www.mattkeeter.com/projects/, including https://github.com/mkeeter/antimony and https://www.mattkeeter.com/projects/ao/, though I see you have libfive)
    - https://solvespace.com/index.pl
    - https://mirmik.github.io/zencad/en/
    - https://github.com/fogleman/sdf
This is from a list entitled "migrate away from OpenSCAD", but somehow I can never manage to do that...

Thanks for this site!

> Basic things like 'hollow this object out, leaving a 3mm shell' are nearly impossible.

Yeah, I think that's a consequence of how they're constructing the objects. But things like signed distance fields make that easier* because it'd just be "expand the SDF by 3mm" - https://github.com/fogleman/sdf has `shell` for this.

* if you can wrap your head around the math/geometry, I guess

> https://github.com/fogleman/sdf

Holy crap, why have I not seen this before?!?!!? I was even planning to start coding something like this myself. This is awesome! Thanks!!!!