Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading SVG at its native physical-unit scaling? #258

Open
DEF7 opened this issue Aug 13, 2024 · 0 comments
Open

Loading SVG at its native physical-unit scaling? #258

DEF7 opened this issue Aug 13, 2024 · 0 comments

Comments

@DEF7
Copy link

DEF7 commented Aug 13, 2024

This is not a bug per-se, I've just been having an issue, perhaps with SVG as a format in general. I thought maybe someone here could help.

I've been developing a project that allows users to load various 2D geometry that is meant to be of a physical scale. I cannot, for the life of me, figure out what parameters to use for nsvgParse() for the units and dpi so that the shapes I receive back are the same as what are displayed in Inkscape.

Changing units in Inkscape doesn't appear to actually do anything to the SVG file it saves - it's as though shapes are permanently in whatever units they were created in? Users might not always know ahead of time what units an SVG is defined in. I've been telling everyone to just save their geometry from Inkscape as a DXF and use that instead, because there has not been any reliable way that I can find to ensure that an SVG is scaled as a user would expect - or that I can make load using nanosvg to give me shapes that are in the units the user expects.

I have been wrestling with this for some years now and have yet to come up with a proper solution.

I'm just checking to see if anyone here has any idea whatsoever - I don't know if this is an Inkscape problem, or the SVG format is just poorly suited for conveying physical-unit geometry because of how much of a cluster-F that it seems to be for such things, supporting a bunch of units, representing them in who knows what units internally, and then trying to import it into my CAD software project at its supposed physical size. It hasn't been fun trying to figure it out every time I attempt it over the last several years. Posting here is basically my last resort now but my hopes are not very high :P

Anyway, thanks for taking the time to read this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant