DXF Generator
Convert a photo of your tool drawer into precise CNC-ready vector files.
1. Quick Start Guide: From Photo to DXF Cut File
This application converts a single photograph of tools in a drawer/tray into a ready-to-use DXF file for CNC cutting foam inserts.
- Preparation: Place your tools in a drawer and include a reference coin (assumed to be 0.955 inches / 24.25mm wide, e.g., a US Quarter). Ensure clear, even lighting.
- Upload: Upload the image.
- Configure: Adjust the
Offset Value(clearance around the tool) and select options likeFinger ClearanceandBoundary. - Run: Click the "Submit" button (automatically generated by Gradio).
- Download: Review the
OutlinesandOutput Image, then download the final DXF file for your cutting machine.
2. Expected Inputs
Image Requirements
- Reference Object is Mandatory: The system must detect a specific reference object (default: coin roughly 0.955 inches wide) to correctly calculate the real-world scale (inches/pixel).
- Placement: The image should be taken from directly above the drawer (minimal perspective distortion).
- Lighting: Clear, shadow-free lighting is crucial for object detection and masking.
Processing Parameters
| Parameter | Purpose | Default Value | Guidance for Non-Tech Users |
|---|---|---|---|
| Offset Value | The amount of space (clearance) added around the tool profile. This is the buffer to ensure the tool fits easily into the foam cutout. | 0.075 | Increase this value for thicker tools or if you need looser cutouts. |
| Offset Unit | Specifies whether the offset value is in millimeters or inches. | inches | Match this to your preferred measurement system. |
| Add Finger Clearance? | Adds a small circular cutout to the side of the tool profile to allow easy removal using a finger. | Yes | Recommended for most tools. |
| Add Rectangular Boundary? | Defines the exterior rectangular shape of the entire foam insert (the boundary of the drawer). | Yes | Required if you need a rectangular outer boundary for cutting. |
| Boundary Length/Width | The actual dimensions of the drawer/tray area for the foam insert. | 50.0 (in the selected unit) | Must be larger than the combined area of all tools plus margins. |
| Annotation | Text to engrave/cut into the foam, typically placed at the top of the boundary box. (Max 20 chars) | (Empty) | Use this to label the tray (e.g., "Wrench Set"). |
3. Expected Outputs
| Output Field | Description | Purpose |
|---|---|---|
| Output Image | The original image overlaid with the detected tool outlines (including offset and finger clearance). | Visual confirmation that the detection and sizing are correct relative to the original photo. |
| Outlines of Objects | A clean, scaled, white-background image showing only the outlines (blue lines). This visually represents the final geometry exported to the DXF. | Final quality check for shape and spacing before CNC cutting. |
| DXF file | The final vector file containing the tool outlines, boundary box, and text annotation (if included). | Ready to upload to CNC machine software (AutoCAD DXF R2000 format). |
| Mask | The binary image used internally to generate the tool contours after applying the offset value. | Technical output for debugging segmentation issues. |
| Scaling Factor | The calculated real-world scale (inches per pixel) determined by the reference coin. | Confirmation of measurement accuracy. Values close to 0.7 are common for phone photos. |
Step 1: Upload Image and Configure Parameters
Step 2: Configure Parameters
Offset Unit
Add Finger Clearance?
Add Rectangular Boundary?
Step 3: Click Generate DXF & Previews
Outputs
Example Data (Click a row to load the image and parameters)
Examples
| Input Image | Offset value for Mask | Offset Unit | Add Finger Clearance? | Add Rectangular Boundary? | Boundary Length | Boundary Width | Annotation (max 20 chars) |
|---|