fogleman/sdf ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python library for making 3D meshes from signed distance functions.
I want a simple, friendly API where I can combine shapes like spheres, boxes, and cylinders with normal operators for union, intersection, and subtraction, then export the result as an STL file. It should also support other common mesh formats if the file extension asks for it, and be able to generate the mesh in memory too.
Please include a few example scripts that show how to make a basic CSG model and some more interesting shapes like blobby or patterned models. It would be great if I could also preview a 2D slice of the SDF for debugging.
Keep it easy to install and use from a normal Python project, and make sure the output is good enough for 3D printing. If you need to check current library docs or best practices for mesh export, look them up online.
Are you gonna build this?
make sure you review the code using coderabbit