{"id":45919754,"url":"https://github.com/retospect/microweldr","last_synced_at":"2026-02-28T08:36:13.790Z","repository":{"id":320739500,"uuid":"1083198153","full_name":"retospect/microweldr","owner":"retospect","description":"Takes SVG or DXF files and generates gCode for 3d printer to weld films together for microfluidics. Solid welds and frangible welds.","archived":false,"fork":false,"pushed_at":"2025-12-02T22:15:10.000Z","size":22442,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-05T22:04:21.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retospect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T14:39:35.000Z","updated_at":"2025-12-02T22:15:08.000Z","dependencies_parsed_at":"2025-10-25T16:28:12.283Z","dependency_job_id":null,"html_url":"https://github.com/retospect/microweldr","commit_stats":null,"previous_names":["retospect/microweldr"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/retospect/microweldr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fmicroweldr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fmicroweldr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fmicroweldr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fmicroweldr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retospect","download_url":"https://codeload.github.com/retospect/microweldr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retospect%2Fmicroweldr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29928982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-28T08:36:13.096Z","updated_at":"2026-02-28T08:36:13.778Z","avatar_url":"https://github.com/retospect.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MicroWeldr\n\n[![PyPI version](https://badge.fury.io/py/microweldr.svg)](https://badge.fury.io/py/microweldr)\n[![Test Suite](https://github.com/retospect/microweldr/actions/workflows/test.yml/badge.svg)](https://github.com/retospect/microweldr/actions/workflows/test.yml)\n[![CodeQL](https://github.com/retospect/microweldr/actions/workflows/codeql.yml/badge.svg)](https://github.com/retospect/microweldr/actions/workflows/codeql.yml)\n\nA Python package that converts **SVG and DXF files** to Prusa Core One G-code for **continuous plastic line welding**. The package processes vector graphics and generates G-code that creates **waterproof welded lines** by placing many precise weld \"dots\" in sequence along the paths, without extruding any plastic material.\n\n**Multi-Format Support** - Processes both SVG and DXF files with automatic weld type detection based on colors, layers, or filenames.\n\n**Optimized for Prusa Core One**: Includes chamber temperature control (M141/M191), proper bed dimensions (250×220×270mm), and CoreXY-specific settings for reliable plastic welding operations.\n\nThis enables rapid **microfluidics prototyping** with a 3D printer by creating **sealed, waterproof channels and barriers**. Each vector path becomes a continuous welded line through precisely controlled sequential dot placement.\n\n![MicroWeldr Animation](examples/combined_animation.gif)\n\n*Complete welding process showing both normal welds (blue) and frangible welds (red) with 1mm spacing and 2mm diameter dots representing actual welding spots*\n\n## 🆕 Version 6.1.10\n\n- **Unified Configuration**: Consistent 1mm dot spacing across SVG and DXF formats\n- **Professional Examples**: Complete example collection with combined weld types\n- **Improved Animations**: Uniform timing with 3-second pause for final result viewing\n- **Proper Weld Heights**: 0.1mm normal welds, 0.6mm frangible welds for breakaway functionality\n- **Comprehensive Testing**: Full test coverage including weld height validation\n- **Modern Dependencies**: Updated to pytest 9.0.1, pre-commit 4.4.0, optimized package set\n- **CI/CD Ready**: Complete GitHub Actions workflows with multi-platform testing\n\n## Project Structure\n\n```\nmicroweldr/\n├── microweldr/           # Main package\n│   ├── core/            # Core functionality \u0026 configuration\n│   │   ├── config.py          # Configuration management\n│   │   ├── unified_config.py  # Unified configuration system\n│   │   ├── data_models.py     # Structured data models\n│   │   ├── events.py          # Event system for processing\n│   │   └── constants.py       # Application constants\n│   ├── parsers/         # File format parsers\n│   │   ├── dxf_reader.py      # DXF file processing\n│   │   ├── svg_parser.py      # SVG file processing\n│   │   └── enhanced_svg_parser.py # Advanced SVG features\n│   ├── generators/      # Point and G-code generation\n│   │   ├── point_iterator_factory.py # Factory pattern for iterators\n│   │   ├── svg_point_iterator.py     # SVG point generation\n│   │   └── dxf_point_iterator.py     # DXF point generation\n│   ├── outputs/         # Output generation\n│   │   ├── streaming_gcode_subscriber.py # G-code generation\n│   │   └── gif_animation_subscriber.py   # Animation generation\n│   ├── cli/             # Command line interface\n│   │   ├── simple_main.py     # Main CLI entry point\n│   │   └── enhanced_main.py   # Advanced CLI features\n│   └── prusalink/       # Printer integration\n├── tests/               # Comprehensive test suite\n│   ├── unit/           # Unit tests (121 tests)\n│   ├── parsing/        # Parser tests\n│   ├── outputs/        # Output generation tests\n│   └── test_linting.py # Code quality tests\n├── examples/           # Professional example collection\n│   ├── flask_simple.svg        # SVG example (628 points)\n│   ├── flask.dxf              # DXF example (467 points)\n│   ├── combined_normal.dxf     # Combined example (801 points)\n│   ├── combined_frangible.dxf  # Frangible welds (5 points)\n│   └── *.gif                  # Generated animations\n└── pyproject.toml     # Modern Poetry configuration (PEP 621)\n```\n\n## Features\n\n### File Format Support\n- **SVG Files**: Paths, lines, circles, rectangles, groups, and use elements\n- **DXF Files**: Lines, arcs, circles, polylines, and LWPOLYLINES\n- **Multi-File Processing**: Mix SVG and DXF files in single command\n- **Unit Validation**: DXF files must use millimeters (throws exception otherwise)\n- **Construction Filtering**: Automatically ignores construction layers in DXF\n\n### Weld Type Detection\nMultiple methods for determining weld types:\n\n#### 1. Color-Based (SVG)\n- **Black elements** → Normal welds\n- **Blue elements** → Frangible welds (breakaway seals)\n- **Red elements** → Stop points (pause for user intervention)\n- **Magenta elements** → Pipette points (filling operations)\n\n#### 2. Layer-Based (DXF)\n- **Normal layers**: Any layer name\n- **Frangible layers**: Containing `frangible`, `light`, `break`, `seal`, `weak`\n- **Construction layers**: Containing `construction`, `const`, `guide`, `reference`, `ref` (ignored)\n\n#### 3. Filename-Based (Fallback)\nWhen colors/layers don't specify weld type, filenames are checked:\n- **Normal welds**: `main_welds.dxf`, `structure.svg`\n- **Frangible welds**: `frangible_seals.dxf`, `light_welds.svg`, `break_points.dxf`\n\n### Advanced Features\n- **Configurable Parameters**: TOML-based configuration for temperatures, heights, and timing\n- **Multi-Pass Welding**: Configurable initial and final dot spacing\n- **Optimized Z Movement**: Separate weld move height for faster intra-path welding\n- **Chamber Temperature Control**: Prusa Core One chamber heating\n- **Animation Output**: Generates animated SVG showing the welding sequence\n- **Proper G-code Structure**: Includes heating, cooling, and safety procedures\n- **Error Handling**: Comprehensive error reporting and recovery\n- **Statistics Collection**: Processing metrics and validation results\n\n## Installation\n\n### From PyPI\n```bash\npip install microweldr\n```\n\n### With DXF Support\n```bash\npip install microweldr[dxf]  # Includes ezdxf for DXF processing\n```\n\n### From Source\n```bash\ngit clone https://github.com/retospect/microweldr.git\ncd microweldr\npoetry install --with dev\n```\n\n## Quick Start\n\n### Basic Usage\n```bash\n# Convert single SVG file\nmicroweldr -weld design.svg -g_out output.gcode\n\n# Convert DXF file with unit validation\nmicroweldr -weld drawing.dxf -g_out output.gcode\n\n# Process combined normal and frangible welds\nmicroweldr -weld main_welds.dxf -frange frangible_seals.dxf -g_out combined.gcode\n\n# Generate animation along with G-code\nmicroweldr -weld design.svg -g_out output.gcode -animation output_animation.gif\n```\n\n### Fusion 360 Workflow\nPerfect for CAD-based microfluidics design:\n\n1. **Design in Fusion 360**: Create your microfluidic channels and seals\n2. **Export two DXF files**:\n   - `main_welds.dxf` - Primary structural welds\n   - `frangible_seals.dxf` - Breakaway seals for filling ports\n3. **Process both files**: `microweldr -weld main_welds.dxf -frange frangible_seals.dxf -g_out device.gcode`\n4. **Print**: Load G-code on Prusa Core One\n\n### Configuration\n\nCreate `microweldr_config.toml` for custom settings:\n\n```toml\n[printer]\nbed_x = 250\nbed_y = 220\nbed_z = 270\nchamber_temperature = 45\n\n[movement]\nmove_height = 5.0  # mm - height for safe movement between paths\nweld_height = 0.02  # mm - height for actual welding (touching plastic)\nweld_move_height = 2.0  # mm - height for moving between weld points (faster than safe height)\nframe_height = 10.0  # mm - height for frame drawing (clearance check)\ntravel_speed = 3000  # mm/min - travel speed for movements\nz_speed = 600  # mm/min - optimized Z speed (near maximum safe limit for Core One)\n\n[normal_welds]\nweld_height = 0.1           # mm - structural weld depth\nweld_temperature = 160      # °C - nozzle temperature\nweld_time = 0.1            # seconds - dwell time\ndot_spacing = 0.5          # mm - unified spacing\n\n[frangible_welds]\nweld_height = 0.6          # mm - deeper for breakaway functionality\nweld_temperature = 160     # °C - same temperature\nweld_time = 0.3           # seconds - longer for controlled weakness\ndot_spacing = 0.5         # mm - unified spacing\n\n[output]\ngcode_extension = \".gcode\"\nanimation_extension = \"_animation.svg\"\n```\n\n## Command Reference\n\n### Main Command\n```bash\nmicroweldr [OPTIONS]\n\nOptions:\n  -weld PATH           Normal weld file (SVG or DXF)\n  -frange PATH         Frangible weld file (SVG or DXF)\n  -g_out PATH          Output G-code file\n  -animation PATH      Output animation GIF file\n  -quiet              Suppress verbose output\n  --help              Show help message\n```\n\n### Examples\n```bash\n# Single file processing\nmicroweldr -weld design.svg -g_out output.gcode\n\n# Combined weld types\nmicroweldr -weld structural.dxf -frange seals.dxf -g_out device.gcode\n\n# With animation\nmicroweldr -weld design.svg -animation preview.gif -g_out output.gcode\n```\n\n## File Format Details\n\n### SVG Support\n- **Elements**: `\u003cpath\u003e`, `\u003cline\u003e`, `\u003ccircle\u003e`, `\u003crect\u003e`, `\u003cg\u003e`, `\u003cuse\u003e`\n- **Attributes**: `stroke`, `class`, `id` for weld type detection\n- **Namespaces**: Handles standard SVG namespaces\n- **Definitions**: Processes `\u003cdefs\u003e` and referenced elements\n\n### DXF Support\n- **Entities**: LINE, ARC, CIRCLE, POLYLINE, LWPOLYLINE\n- **Units**: Must be millimeters (validated automatically)\n- **Layers**: Used for weld type and construction detection\n- **Coordinate System**: Preserves original coordinates\n\n### Weld Type Examples\n\n#### Filename-Based Detection\n```bash\n# These filenames automatically detect frangible welds:\nmicroweldr convert frangible_seals.dxf      # → Frangible\nmicroweldr convert light_connections.svg    # → Frangible\nmicroweldr convert break_points.dxf         # → Frangible\nmicroweldr convert seal_layer.svg           # → Frangible\n\n# These default to normal welds:\nmicroweldr convert main_structure.dxf       # → Normal\nmicroweldr convert primary_welds.svg        # → Normal\n```\n\n#### Layer-Based Detection (DXF)\n```\nLayer \"main_welds\"        → Normal welds\nLayer \"frangible_seals\"   → Frangible welds\nLayer \"construction\"      → Ignored\nLayer \"break_points\"      → Frangible welds\n```\n\n## Development\n\n### Running Tests\n```bash\npoetry run pytest                    # All tests\npoetry run pytest tests/unit/       # Unit tests only\npoetry run pytest -v               # Verbose output\n```\n\n### Code Quality\n```bash\npoetry run black .                  # Format code\npoetry run bandit -r microweldr/   # Security check\npoetry run pre-commit run --all-files  # All checks\n```\n\n### Building\n```bash\npoetry build                        # Build wheel and source\npoetry install dist/*.whl          # Install local build\n```\n\n## Examples\n\n### Professional Examples\n```bash\n# See examples/ directory for complete example collection:\n# - flask_simple.svg (628 points, Bézier curves)\n# - flask.dxf (467 points, line interpolation)\n# - combined_normal.dxf + combined_frangible.dxf (806 total points)\n\n# Process the combined example\nmicroweldr -weld examples/combined_normal.dxf \\\n           -frange examples/combined_frangible.dxf \\\n           -g_out examples/combined_animation.gif \\\n           -animation examples/combined_animation.gif\n```\n\n### Production Workflow\n```bash\n# 1. Design in CAD software (Fusion 360, etc.)\n# 2. Export separate files for different weld types\n# 3. Process with MicroWeldr\nmicroweldr -weld structural_welds.dxf -frange breakaway_seals.dxf -g_out device.gcode\n\n# 4. Load G-code on Prusa Core One and print\n```\n\n## Troubleshooting\n\n### DXF Issues\n- **Unit Error**: Ensure DXF uses millimeters in drawing units\n- **No Entities**: Check that layers contain supported entities (lines, arcs, circles)\n- **Construction Layers**: Rename layers to avoid construction keywords\n\n### SVG Issues\n- **No Paths**: Ensure elements have `stroke` attribute (not just `fill`)\n- **Complex Paths**: Curves are approximated with line segments\n- **Nested Groups**: Deep nesting may affect processing\n\n### Weld Type Detection\n- **Wrong Type**: Check filename, layer names, or SVG colors\n- **All Normal**: Add frangible keywords to filenames or layers\n- **All Frangible**: Remove frangible keywords from filenames\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make changes with tests: `poetry run pytest`\n4. Format code: `poetry run black .`\n5. Submit pull request\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Changelog\n\n### Version 5.3.0 (Latest)\n- **NEW**: Full DXF file support with ezdxf integration\n- **NEW**: Multi-file processing (mix SVG and DXF)\n- **NEW**: Filename-based weld type detection as fallback\n- **BREAKING**: Renamed \"light_welds\" to \"frangible_welds\" in all configs\n- **IMPROVED**: Modular CLI architecture with better error handling\n- **IMPROVED**: Publisher-subscriber file processing framework\n- **IMPROVED**: Comprehensive test coverage (33 tests)\n- **IMPROVED**: Structured data models with validation\n\n### Version 5.2.x\n- Enhanced SVG processing\n- Animation improvements\n- Configuration validation\n\n### Version 5.1.x\n- Initial public release\n- Basic SVG to G-code conversion\n- Prusa Core One optimization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretospect%2Fmicroweldr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretospect%2Fmicroweldr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretospect%2Fmicroweldr/lists"}