-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SVG import: Add normalize_coordinates option #5038
base: master
Are you sure you want to change the base?
Conversation
The option name feels a bit awkward, but I suppose the feature itself is useful. I don't have a good suggestion yet though.
Why? Is there a technical reason? It does not bring any additional feature as it should be identical to normal centered + y axis flipped but it might be helpful to not impose the exclusivity restriction. |
I'm open for any other name. As for being mutually exclusive with centering, this overrides all the coordinate processing -- scaling, flipping, viewbox adjustment and center offset. It's probably possible to apply center offsets still, but it kind of defeats the purpose of having the raw coordinates applied. All use cases where I've run into this were along the lines of "some tool generates me an SVG with a sidecar file of coordinates, and I want to put them together in 3D". (About 10 years ago it was visualizing PCBs, now it's assembling laser cut boxes in 3D). If you think it's useful to have, I think I can make it work, but I think it reduces maintainability without a practical benefit. |
Oh, it skips transformations even on the objects? I don't think that will work, e.g. Inkscape has the tendency to modify the object transforms instead of the actual coordinates (create circle, make it a bit smaller, move slightly). Skipping those will just import random data. |
flip=<true|*false>??
|
default is more but only flip. maybe name it "normalize" ?
…On Fri, Mar 15, 2024 at 8:16 AM Michael ***@***.***> wrote:
I'm open for any other name.
flip=<true|*false>??
By default (i.e., when literal_coordinate=false), the import command
*FLIPS* an SVG file's y coordinates, and shifts the whole drawing into
the positive area.
—
Reply to this email directly, view it on GitHub
<#5038 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCO4MWYSOOCK5CZEQCNSFLYYKN4JAVCNFSM6AAAAABEVVSEIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZGA3DONZWHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
No, it skips only the transformations that OpenSCAD would apply (the handedness correction / flip, the shift, and any centering). Anything internal to the SVG is preserved.
Sounds good, so it'd be |
The new parameter has the opposite semantics of the old parameter, and thus the other default value.
With the PR updated, the documentation to be added would now be:
|
I've slightly extended the help text (around appearing mirrored), but that's kind of outside the PR. Is there anything I can do (add or remove) to advance this issue? |
This adds an option as described in #3460 (comment), closing #3460:
There is open point from #3460 (comment): Should literal_coordinate also disregard scaling and force the import units to be SVG units, or is it fine as it is (and the documentation just needs slight adjustment)?