Filter extension for wireframe import

Bug #179560 reported by vonHalenbach
6
Affects Status Importance Assigned to Milestone
Inkscape
Won't Fix
Wishlist
Joshua Blocher

Bug Description

  I have written an Inkscape extension for the Effects menu. The purpose is to import wireframe path data from a different svg file into the current document. Would it be possible to submit it to someone for review and/or inclusion in the package?
  Where would be the best place to submit the code?

Revision history for this message
vonHalenbach (lustik) wrote :

Hello Alvin,
Thank you for your interest in inkscape. I have changed this question to a bug report. Then you are able to attach the patch as zipped or tarred file to this report.

Inkscape is at the moment in a freezing phase. This means usually no more features will be added to 0.46. This is to ensure not to introduce new bugs in the last minute. If your patch is well tested and won't likely break the stability of the program, it could be still considered to be included, but this is the descision of the developers. Please upload it soon.

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Alvin Penner (apenner) wrote :

Thanks for the fast response. I am attaching a zip file with 2 files in it, import_path.inx and *.py. Have tried to stay consistent with previous extensions, first Python program ever, but hopefully not the last...

Thanks for your help, and use it any way you think appropriate.

Alvin Penner

Revision history for this message
vonHalenbach (lustik) wrote :

Thank you for your filter patch, Alvin!

Changed in inkscape:
status: Incomplete → Triaged
Revision history for this message
Ted Gould (ted) wrote :

A couple of comments:

* I think this would be better as an input extension. That way someone can use it from the import menu. They can import a path from another SVG file.
* The gui-text strings shouldn't contain all the spaces and ':' characters. Those can effect the translations in weird ways. It makes more sense to make them as short as possible.
* This is the same with the description text. Lots of formatting isn't really a good thing when it gets translated. Better to let GTK+ handle that stuff.

Revision history for this message
Alvin Penner (apenner) wrote :

    Thanks for the feedback, I like very much the idea of implementing this in a File|Open or a File|Import menu item. However, my problem is that I don't know how to specify the path id in that case. I need an extra text box input for the 'id' in addition to the file name. Do you know of a user interface that would allow me to do that? I've searched through the existing samples and haven't found anything suitable, other than the one that I used, on the 'Effects' menu.
    As for the text data, I will take a look at that this weekend. What I would like to do is implement a "notebook" parameter, similar to 'measure.inx'. If I succeed with that, and can simplify the text, then I will post a new version.

Alvin Penner (apenner)
Changed in inkscape:
status: Triaged → New
Revision history for this message
Alvin Penner (apenner) wrote :

this is a re-worked version of the original proposal
this will show up in the Effects | Modify Path | Import SVG Paths menu
- the file to import data from must be specified
- the path(s) to be edited are selected by mouse
- only wireframe data is transferred
- the intent is to transfer wireframe data from non-Inkscape applications

Revision history for this message
Alvin Penner (apenner) wrote :
Revision history for this message
Joshua Blocher (verbalshadow) wrote :

here is an example of an input extension, if the inx file could be update to reflect the changes.

<inkscape-extension>
    <_name>AI 8.0 Input</_name>
    <id>org.inkscape.input.ai</id>
    <dependency type="executable" location="path">perl</dependency>
    <dependency type="executable" location="extensions">ill2svg.pl</dependency>
    <input>
        <extension>.ai</extension>
        <mimetype>image/x-adobe-illustrator</mimetype>
        <_filetypename>Adobe Illustrator 8.0 and below (*.ai)</_filetypename>
        <_filetypetooltip>Open files saved with Adobe Illustrator 8.0 or
        older</_filetypetooltip>
        <output_extension>org.inkscape.output.ai</output_extension>
    </input>
    <script>
        <command reldir="extensions" interpreter="perl">ill2svg.pl</command>
    </script>
</inkscape-extension>

Changed in inkscape:
assignee: nobody → verbalshadow
status: New → In Progress
Revision history for this message
Alvin Penner (apenner) wrote :

Hello Joshua,
    Thank you for your interest in this extension. Right from the start, there has always been a problem trying to know where to put this in the menu system. The suggestion was made earlier to put it into the File | Import menu. This would have a significant advantage of having a user-friendly way of choosing the source file. However, it has some drawbacks as well, that I do not think I can work around.

1) When you use the File | Import menu to call up a python script, then the python script does not receive any information about which objects are selected, so there is no way to know which objects to modify.

2) Using File | Import, when you want to write data to the image, you would probably use a command like :
filedoc = inkex.etree.parse(filename)
filedoc.write(sys.stdout)
However, as far as I can tell, this command will only create a new path node, it will not allow you to edit an existing node, which is what I need to do.

3) When using the write command as above, the data is written in relative coordinates, relative to the mouse, while I need to transfer absolute coordinates.

For these reasons I decided to keep the proposal as an item on the Effects menu, but allowed the target object(s) to be selectable by mouse. The intent of the extension is to import and modify wireframe information from a file, but leave the style information on fills and gradients intact.

hope this helps,
Alvin Penner

Revision history for this message
Joshua Blocher (verbalshadow) wrote :

Currently this extensions errors if try to load an svgd or svg file with the following error.
I placed it in my /home/.inkscape/ directory.

Traceback (most recent call last):
  File "/home/verbalshadow/.inkscape/extensions/import_path.py", line 30, in <module>
    import sys, inkex, os, fnmatch
ImportError: No module named inkex

Revision history for this message
Joshua Blocher (verbalshadow) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

on a windows system the directory would be
C:\Program Files\Inkscape\share\extensions\

on a non-windows system it might be /usr/inkscape/extensions/share/
or something like that.

In any event, it must be in the same directory as the inkex.py file.

Revision history for this message
Alvin Penner (apenner) wrote :

also, the file banana.svg does not appear to be a valid .svg file. I was not able to view it in Inkscape. I am attaching a small .svg file as a test case.

Revision history for this message
Alvin Penner (apenner) wrote :
jazzynico (jazzynico)
tags: added: extensions-plugins importing
Revision history for this message
jazzynico (jazzynico) wrote :

Is someone still working on this extension?

Revision history for this message
Alvin Penner (apenner) wrote :

I have more or less abandoned this extension, on the grounds that it is too specialized, not of general interest.

summary: - Filter extention for wireframe import
+ Filter extension for wireframe import
Revision history for this message
Jean-Luc JOULIN (jean-luc-joulin) wrote :
Revision history for this message
Jean-Luc JOULIN (jean-luc-joulin) wrote :

 I have written an Inkscape extension to draw isometric grid with different parameter (size, thickness, subdivisions). These grid are used for isometric drawing and piping schematic. Is it possible to submit this extension to someone for review and inclusion in the package?
   Where would be the best place to submit the code?

Revision history for this message
Alvin Penner (apenner) wrote :

Hi,
   Thanks for the new proposal. It would probably be best to submit this as a separate Bug report with its own title, so it does not get lost.

Revision history for this message
su_v (suv-lp) wrote :

@Jean-Luc - maybe your extension could offer a (temporary) solution for

  Bug #588057 “It should be possible to rotate grids”
  <https://bugs.launchpad.net/inkscape/+bug/588057>

to help drawing (maps or tilings of) hexagons with the flat sides up (and down).

Revision history for this message
jazzynico (jazzynico) wrote :

@Jean-Luc - New report created for your isometric grid extension: https://bugs.launchpad.net/inkscape/+bug/744230

Revision history for this message
jazzynico (jazzynico) wrote :

Since nobody's working on it, I'm closing the report "Won't fix".
As explained by Alvin in comment #16, this extension is too specialized to be embedded in Inkscape, but it would be interesting to keep track of it (in http://wiki.inkscape.org/wiki/index.php/Extension_repository) in case we manage to build an extension repo one day...

Changed in inkscape:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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