question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How are we supposed to handle the Elliptical Arc commands?

See original GitHub issue

I have an open source SVG renderer which really struggles to render these. Your elliptical arc commands by looks of things do not follow the SVG spec, elliptical arcs should contain 7 parameters as its command, these icons vary from 5-10, These only seem to render inside browsers and Sketch, Illustrator, IconJar all cant render these correctly.

Command like : a8 8 0 100-16 8 8 0 000 16 is completely invalid according to the SVG spec.

How is this supposed to be parsed? is it 8 8 0 100 -16 8 0 then 0 0 0 16? But then 16 would have to be a 1 or a 0 for the sweeping arc.

Cheers.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wolfgang42commented, Dec 10, 2019

This arc command is correct and standards-conformant SVG; your renderer (and presumably Illustrator and IconJar) just isn’t parsing it properly. See SVG 1.1 §8.3.9 for an exhaustive grammar, but the gist of it is that you can condense a lot. Relevant for this particular case are the following rules:

  • flags are always exactly one character (0/1)
  • Whitespace can be left out wherever it’s not absolutely necessary (including after flags and before negative numbers and leading decimal points)
  • If a command letter is not given, it’s the same as the previous command (except in the case of M/m, where it’s L/l instead)

That is, the string a8 8 0 100-16 8 8 0 000 16 should parse as two arc commands:

“a” nonnegative-number comma-wsp? nonnegative-number comma-wsp? number comma-wsp flag flag coordinate-pair
a 8 8 0 1 0 0 -16
  8 8 0 0 0 0   16

svg/svgo#1137 discusses this same problem, and offers some optimizations that can be turned off to work around the Illustrator bugs.

0reactions
wolfgang42commented, Dec 11, 2019

Glad I could help! I spent a lot of time figuring this stuff out for a project and I’m happy to see that the effort I spent is useful 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paths — SVG 2
An elliptical arc segment draws a segment of an ellipse. 9.3.3. The "moveto" commands. The "moveto" commands (M or m) must establish a...
Read more >
AutoCAD Ellipse Command Tutorial Complete - YouTube
AutoCAD Ellipse Command Tutorial Complete | Center, Axis End, Elliptical Arc, Isometric Circle, Rotation. This tutorial covers all the ...
Read more >
circle, ellipse, elliptical arc command in autoCAD. [ How to draw]
This video explains how you can draw ellipse, elliptical arc, and circle using draw panel. command for circle is 'C' enter.
Read more >
ELLIPSE (Command) | AutoCAD 2022
ELLIPSE (Command) ; End Parameter: Defines the end angle of the elliptical arc by using a parametric vector equation. The Start Parameter option ......
Read more >
Isometric views with elliptical arcs - AutoCAD Tutorial - LinkedIn
In this video, author Shaun Bryant shows you how to create isometric views effectively in AutoCAD, using elliptical arcs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found