polygon vs path

Bug #171366 reported by Rtc1
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
jazzynico

Bug Description

I have some files with <polygon> tags in them. They
display fine, but would be fine if they could be edited
without converting them to a path first. Also some
function to convert back to <polygon> or create
polygons in the first place would be great.

pencil should create polygon, tool below should create
path?

hash (hash-g)
Changed in inkscape:
importance: Undecided → Wishlist
Ryan Lerch (ryanlerch)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Sean Gilligan (sean-msgilligan) wrote :

I have written some JavaScript which will examine a <path> element, determine if it is a valid polygon and convert it to a <polygon> element if possible. I wrote it so I can use InkScape to create and edit polygonal shapes, but I want my run-time code to operate on <polygon> elements.

It runs as a command line tool, using the Rhino JavaScript interpreter. It uses env.js to provide a browser-like DOM model and then operates on the SVG Dom.

I plan on making it available as part of an Open Source toolkit for processing SVG at build time. It could possibly be converted to an InkScape Scripting Extension. Let me know if there is any interest.

su_v (suv-lp)
tags: added: shape-editing
Revision history for this message
jazzynico (jazzynico) wrote :

@sean - I'm currently reviewing old reports and blueprints, and it seems that your path to polygon could be a good answer to https://blueprints.launchpad.net/inkscape/+spec/svg-vector-export.
Could you please give a link to your toolkit or attach it to the bug report? Thanks in advance!

Revision history for this message
Sean Gilligan (sean-msgilligan) wrote :

The tools are in an old Google Code project that I had called "surf city":

https://code.google.com/p/surfcity/

The particular file that you are interested in is Paths2Shapes.js:

https://code.google.com/p/surfcity/source/browse/trunk/demo/releasetools/js/Paths2Shapes.js

I hope this helps, let me know if you have any questions.

Revision history for this message
jazzynico (jazzynico) wrote :

@Sean - Thanks! I'm going to investigate how we could use your tool (or maybe a Python version) in Inkscape.

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
Revision history for this message
dimumurray (dimumurray) wrote :

Any support for the remaining basic shapes <polyline> and <line>?

There's a blueprint for it:

 https://blueprints.launchpad.net/inkscape/+spec/full-basic-shapes-support-on-plain-svg-export-polyline-polygon-line

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.