Official Website: https://apisxia.github.io/Draw2Cut/
This project uses poetry for environment management. Follow these steps to set up the environment:
-
Create a virtual environment using
Anacondaorvenv. -
Install
poetryand project dependencies:pip install poetry poetry install
The project requires the external library zbar. Install it using the commands below:
-
For Ubuntu:
sudo apt-get install libzbar0
-
For Mac:
brew install zbar
The current pyproject.toml does not include pyrealsense2. If you need depth camera support, install it manually:
-
Note: This library is not compatible with macOS.
pip install pyrealsense2
If depth camera functionality is not required, you can skip this step.
-
Download Test Data
- Access the demo data from Google Drive
- Download the
point_cloud.npzfile
-
Setup Data Directory
- Create a
datafolder in the project root if it doesn't exist - Create a
teatablesubfolder insidedata - Place the downloaded
point_cloud.npzfile at:data/ └── teatable/ └── point_cloud.npz
- Create a
Run the following command to launch the interface:
python main.py-
Library Errors: Additional libraries may need to be installed if you encounter errors.
-
Display Scaling: Layout issues may arise if the display scaling is not set to 100%.
-
Click Start Capture to simultaneously capture color and depth images.
-
Switch visualization modes using:
- Show Depth
- Show Color Image
-
Select the relevant case.
-
Click Show Collected Point Cloud to view data from Step 1.
-
Adjust parameters and click Start Separation to segment the cutting surface. The result will appear in the left window.
-
Select the relevant case.
-
Click Start Mask Extraction to generate color masks. Results will appear in the left window.
-
Review the mask table:
- Click 💡 to view masks for specific colors.
- ❌ indicates undetected masks for that color type.
-
Edit parameters in the table:
- Type, HSV Value, and Action settings will affect future mask extractions.
-
Save the current configuration by clicking Save Current.
-
Click Start Centerline Extraction to detect centerlines:
- Use the table to inspect results for each type of centerline.
-
If results are unsatisfactory, adjust the color table and repeat the process.
-
Remember to click Save to File.
-
Select the relevant case.
-
Click Start Trajectory Planning to generate cutting trajectories:
- View the 2D visualization of coarse trajectories at different cutting levels.
-
Use the visualization options:
- Original Mesh: Display the pre-cut mesh.
- Target Mesh: Display the target mesh.
-
Click Start Animation to play the cutting animation:
- Use Stop to halt the animation.
-
Generate G-code:
- Click Generate Gcode to create G-code files for CNC execution.
Ensure all parameters are fine-tuned during each step for optimal results. Repeat steps as necessary to refine outputs.
@inproceedings{gui2025draw2cut,
title={Draw2Cut: Direct On-Material Annotations for CNC Milling},
author={Gui, Xinyue and Xia, Ding and Gao, Wang and Doga Dogan, Mustafa and Larsson, Maria and Igarashi, Takeo},
booktitle={Proceedings of The ACM conference on Human Factors in Computing Systems (CHI)},
year={2025},
}