3 ms·
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 https://git
by fogleman 4y ago
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 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.
- dr_kiszonka 4y agoThis is lovely. I will be playing with it soon!
- nullish_signal 4y agoReally nice, I've played around with SDFs trying to make Fluid Simulations, which after much hair pulling I realized hadd particles only "pushing" one way on eachother, because I didn't think that GPUs are unable to have different jobs write back to shared memory. Well, I just found a fluid asset that was 1000x better than what I made. The shape library looks pretty comprehensive, and the calling conventions are nice!
- saboot 4y agoOh man, this is great. I'm a nuclear engineer and an old but widely used program called MCNP relies on a constructive solid geometry approach (first intended for punch cards). I've been wishing for a way to go between a Python approach and MCNP for constructing geometry and this will make it very easy!
- zimpenfish 4y agoThanking you kindly because I have used this library to generate a few things for 3D printing - although I have slunk back to OpenSCAD a few times because the super-quick preview is extremely helpful when iterating on something.
- hansworst 4y agoDo you have some numbers on how fast this actually is? I know it’ll be hard to give specifics, but is this fast enough to convert a somewhat complex sdf into a mesh in (near) real-time? Could you for example build a modelling app around this that uses sdfs as an underlying data model, and uses this as an in between step to make rendering faster?
- fogleman 4y agoYou can change the resolution. A coarse resolution might be adequate for fairly quick feedback. Then you can crank up the resolution when you're ready to generate the final output. Or you could even progressively update the preview. I wouldn't call it realtime though. Like you wouldn't be able to animate a changing SDF.