Show HN: 3D Meshes of Signed Distance Functions in Python

  • Hi HN.

    Well, I wanted to make a 3D model and 3D print it, but I just didn't want to use OpenSCAD. So I ended up making a whole new 3D modeling library based on signed distance functions. I'm pretty happy with how it turned out so far, so I thought I would write a nice README and share it here.

    It's certainly complete enough that you could try it out and make your own 3D models - let me know if you make anything interesting!

  • Not sure how this will be received in HN, but I just want to say... when I grow up, I want to be like fogleman :-). Just look at his portfolio of truly great projects [1].

    Something that I find inspiring in his work is that he seems to use pretty !boring! tech (imho). No rust?! No lisp/reactive/functional/esoteric programming!? what?! You can't be cool if you use mainstream tech like go or python, right? Well, it turns out, you can!

    Well done sir :-)

    1: https://www.michaelfogleman.com/

  • It would be really cool to have a library like this that could spit out a shader for real-time rendering with ray marching on your GPU and then use marching cubes to compute the final STL when you’re done prototyping.

  • I am also a big fan of iquilez, and a little fed up with openscad. I recently tried out deadsy/sdfx, a similar tool written in golang. I was impressed and I enjoyed using it, but there was a little too much friction when I had a complicated design that I just wanted to make and print ASAP.

    I'm a little more comfortable in python, plus I think the language is better suited to this, as a DSL or something like it. I'll definitely try it out, thank you for sharing.

  • Really neat! I can use this for CFD simulations where geometries need to be optimized; OpenFOAM should snap on to these stls just fine! https://www.openfoam.com/documentation/guides/latest/doc/gui...

  • Nice! Do you have any plans to publish to PyPI? Is there an API to access numpy array containing the evaluated SDF volume?

  • Impressive work!

    CadQuery is another library for programming 3d-models in Python. A good alternative to OpenSCAD. Has integration in FreeCAD but can also be used stand-alone.

  • Most Engineering software uses surface models or meshes today. Are there specific advantages of using SDFs here instead?

  • Looks pretty cool! Kind of reminds me of Google sketchup but in code.

  • Is it ok if I make a Blender node system out of this?

  • Is it possible to plug these into a VR/AR system?

  • Very cool, love the simple syntax