yoeguang/figure-slicing-pipeline
0
ToyBuilder 3D - AI Figure Auto-Partitioner
ToyBuilder 3D is an automated pipeline and visual dashboard designed to generate 3D toy figure models from 2D images, scale them to target specifications, and auto-partition them into ready-to-print STL parts with assembly joints (Pegs & Holes) optimized for FDM printing on the Ender 3 Pro.
๐ Hugging Face Spaces Deployment
To deploy this project to your own Hugging Face Space:
- Create a new Space on Hugging Face Spaces.
- Choose Docker as the SDK (instead of Gradio or Streamlit).
- Select the Blank template or configure the port to
7860. - Clone your new Space repository locally or push your files directly via Git:
git init
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
git add .
git commit -m "Deploy ToyBuilder 3D"
git push -u origin main- Hugging Face will automatically build the Docker container and start your application!
๐ป Local Running
If you want to run the project locally on your machine:
- Install Python dependencies:
pip install -r requirements.txt- Start the server:
python server.py- Open
http://localhost:7860in your web browser.
๐ ๏ธ Key Pipeline Features
- Mesh Normalization: Centers the mesh, aligns the bottom to the floor ($Z=0$), and rescales the figure to your desired print height (e.g., 150mm).
- Heuristic Slicing Planes: Automatic planar cuts for the Neck ($Z \approx 82\%$), Waist ($Z \approx 45\%$), and Left/Right shoulders ($X$ bounds).
- Peg & Hole Joints: Places solid cylinder insert connectors and matching clearance sockets (0.2mm tolerance default) using the high-performance
manifold3dBoolean engine. - Interactive Three.js Preview: Displays the Ender 3 Pro build plate grid and real-time colored cutting plane guides as you adjust configuration sliders.
