Closed matopeto closed 6 months ago
Hi matopeto,
The lack of a viewBox attribute is definitely causing some issues here. Do you know why it is missing? Looking at the W3 specs I see:
All elements that establish a new viewport (see elements that establish viewports), plus the ‘marker’, ‘pattern’ and ‘view’ elements have attribute ‘viewBox’.
... The following elements establish new viewports:
- The ‘svg’ element ...
So svg2gcode expects a viewBox to be present and uses that for some calculations.
@sameer OK, thanks for explenation. So if svg without viewbox is not supported, maybe showing some error would be appropriate.
Do you know why it is missing?
Viewbox in my svg is missing becase i check "without viewbox" checkbox in export. I was thinking it will be workaround for #20
Good point, I'll add some logic to make that required.
This should be resolved after https://github.com/sameer/svg2gcode/commit/8f9db323c5753f3ee88b6041becb1ee25ac7ba00 which now accounts for viewboxes that don't exist.
I plan to publish and release this soon
I exported SVG from "Affinity photo" (with without viewBox option, so #20 is not the issue in this case)
SVG look like this:
so
width="354px" height="1181px"
it is cca 3x10cm with 300 DPIi run svg2gcode and specify
--dpi=300
And it generates:
Values are very high
1035830.93889024
Also if i run command without DPI option (it should use 96 default)
But it generates also "nonsense" values: