polygon, polyline, and line on plain SVG export

Registered by dimumurray on 2016-03-10

Add support for <polygon>, <polyline> and <line> on export to plain SVGs.

Currently there is only partial support for basic shapes on export to plain SVG. Rectangles, circles and ellipses are converted to their corresponding tags (<rect>, <circle> and <ellipse>) when exported to plain SVG. However tags for polygons, polylines and lines (<polygon>, <polyline> and <line>) are not generated. The default behavior is to generate these remaining types of shapes as path elements.

There are use cases where it is desirable to have a shape described using <polygon>, <polyline> or <line>. It need not be the default behavior but an option that could be enabled from the Preferences panel (Preferences->Input/Output->SVG ouput->Enable polyline, polygon, line output ).

Criteria for generating these unsupported shapes (based on SVG 1.1 specification) could work as follows :

For <line> tags
- shape must be defined by exactly 2 points representing 'start' and 'end' of a single line segment

For <polygon> tags
- shape must be closed
- shape must be composed of 3 or more straight line segments (No curves)

For <polyline> tags
- shape must be open
- shape must be composed of 2 or more straight line segments (No curves)

-------------------------------------------------------------------------------------------------
SVG Spec for basic shapes - https://www.w3.org/TR/SVG/shapes.html

Related issues:
https://blueprints.launchpad.net/inkscape/+spec/svg-vector-export
https://bugs.launchpad.net/inkscape/+bug/171366

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
dimumurray
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.