Skip to content

Commit 8f9db32

Browse files
committed
svg2gcode v0.2.0: coordinate system overhaul
This commit completely changes how the coodinate system works based on a read-through of the W3C SVG docs. It should be _correct_ now. Circular interpolation is still EXPERIMENTAL! There are known bugs, even in the test output :( Miscellaneous brain dump of changes: - Support polygon - Better docs - Explained why transforms are in the opposite order of what you would expect - Support preserveAspectRatio - Proper viewBox support - Fix SVG -> g-code coordinate system mapping - DPI conversion: only apply after svg is processed via a wrapper turtle - Proper handling for percentage units - Clean up converter/mod.rs, split it up - Nested viewport support (untested)
1 parent 6155d0f commit 8f9db32

20 files changed

Lines changed: 7500 additions & 13646 deletions

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "svg2gcode"
3-
version = "0.1.6"
3+
version = "0.2.0"
44
authors = ["Sameer Puri <crates@purisa.me>"]
55
edition = "2021"
66
description = "Convert paths in SVG files to GCode for a pen plotter, laser engraver, or other machine."

lib/src/arc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ mod tests {
284284
use crate::arc::{ArcOrLineSegment, FlattenWithArcs};
285285

286286
#[test]
287+
#[ignore = "Creates an image file, will revise later"]
287288
fn flatten_returns_expected_arcs() {
288289
const PATH: &'static str = "M 8.0549,11.9023
289290
c

lib/src/converter/length_serde.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Makes it possible to serialize an array of two optional [`svgtypes::Length`]s,
2+
//! used for [super::ConversionOptions::dimensions]
3+
14
use serde::{
25
de::{SeqAccess, Visitor},
36
ser::SerializeSeq,

0 commit comments

Comments
 (0)