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

Text in SVG - the result is mirror-inverted #3

Open
schittli opened this issue Oct 12, 2019 · 1 comment
Open

Text in SVG - the result is mirror-inverted #3

schittli opened this issue Oct 12, 2019 · 1 comment

Comments

@schittli
Copy link

Good Morning

This is more a note than an issue,
therefore I selected an issue title which describes the visible result so it hopefully gets found by other users who have similar results.

Thank you very much!

for sharing your knowledge in your Blog and your source code!,
it is always amazing to see how mathematicians miraculously simplify complex problems and develop solutions with surprisingly few lines of code.
Even your SVG drawing visualizer is great and the result can be interpreted very fast.

The issue: penkit-optimize removes the source file <svg …> and <g transform=…> elements

I tried to use penkit-optimize with AxiDraw, the handwriting machine to optimize one page filled with Text (which was converted from the TTF outline Text to Single Stroke with created 2650 SVG Path elements) and the result is great:

InitialCost / GreedyCost = 19.47
InitialCost / VRPOptimizationCost = 22.05
Plotting time of the example below: 06:55 reduced to 01:51. Amazing.

Unfortunately, the result is mirror-inverted.

Ex - penkit-optimize - Text, John C  Lennox, Original vs Optimized

I've analyzed the issue and found that penkit-optimize removes the original <svg …> and <g transform=…> elements. My source file (from Inkscape) has this SVG definition:

<svg xmlns="http://www.w3.org/2000/svg" 
  width="210.000000mm" height="297.000000mm" 
  viewBox="0.000000 -0.000000 9921.000000 14031.000000">
  <g transform="matrix(1,0,0,-1,0,14031.000000)">

Because the source uses <g transform=…> and penkit-optimize removes those elements, the result is mirrored.

Yesterday I tried to fix it and to make penkit-optimize compatible with the latest Google OR-Tools 7.3, but failed to start your Python Package from the command line :-(.
Starting Python scripts is often a big annoyance for non Python developers. Because I don't know Python, I probably wouldn't have reached my goal within a useful time anyway.

@paulgb
Copy link
Owner

paulgb commented Oct 21, 2019 via email

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

2 participants