CoolFace
Apppublic

yoeguang/figure-slicing-pipeline

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
App README

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:

  1. 1.Create a new Space on Hugging Face Spaces.
  2. 2.Choose Docker as the SDK (instead of Gradio or Streamlit).
  3. 3.Select the Blank template or configure the port to 7860.
  4. 4.Clone your new Space repository locally or push your files directly via Git:
bash
   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
  1. 1.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:

  1. 1.Install Python dependencies:
bash
   pip install -r requirements.txt
  1. 1.Start the server:
bash
   python server.py
  1. 1.Open http://localhost:7860 in 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 manifold3d Boolean 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.