Convert OBJ files to SVG with matched edge labeling. This tool processes 3D OBJ files and exports flat faces as 2D SVG drawings, with matching edges labeled for assembly.
- Extract and identify flat faces from OBJ files
- Project 3D faces to 2D space
- Automatic layout with minimum distance constraints
- Edge matching and labeling for assembly
- Outputs a single SVG with all faces arranged in a diamond pattern
While this tool arranges faces in a simple diamond pattern, you might want to optimize the layout for CNC cutting. For this purpose, you can use deepnest.io, which is a specialized tool for:
- Optimizing part layout to minimize material waste
- Nesting parts efficiently for CNC laser/plasma cutting
- Supporting various input formats including SVG
Using Poetry:
poetry install
Command line:
obj2svg <input.obj> <svg_width_inches> <svg_height_inches> <min_distance_inches>
Example:
obj2svg cube.obj 8 8 0.5
This will:
- Process the OBJ file
- Create a directory named after your input file (e.g., "cube")
- Generate a "sheet1.svg" file inside that directory
- Print detailed information about each face's dimensions and projections
Output includes:
- Face dimensions in millimeters (X, Y, Z ranges)
- Projection plane chosen for each face (XY, YZ, or XZ)
- Projected dimensions (width and height)
- Total number of faces processed
- Clone the repository
git clone https://github.com/yourusername/obj2svg.git
cd obj2svg
- Install with Poetry
poetry install
- Run tests
poetry run pytest
- Python 3.11 or higher
- svgwrite
- numpy
- scipy
- fonttools
- freetype-py
MIT License