Inkscape.org
Beyond the Basics Feature request: Show coordinates of selected nodes
  1. #1
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Can we get a feature that allows us to display coordinates of multiple selected nodes? When it comes to node coordinates, I can only get coordinates of one individual node, or if I click on more than one node, coordinates that are the average of those nodes. In most drawings I do, I like to have certain edges lined up perfectly with each other, and that means certain groups of nodes have to be in the exact same position as each other. It gets tedious zooming in to the maximum magnification to check whether two nodes are perfectly aligned, and there are times when I want to make sure certain nodes form a perfectly horizontal or vertical line. I feel like it would be more efficient if I could simply select a given number of nodes that are close to each other and have the coordinates of each one displayed on the canvas. Granted, I'm aware that the XML editor displays node coordinates of the selected path, but like I said, I only want to see the coordinates of a few selected nodes. Plus, I struggle to understand how the XML editor presents information.

  2. #2
    bleke bleke @bleke

    Would align work for you?

    Note the "Relative to" dropdown menu.. the nodes will align to the first node you selected in this case.

  3. #3
    Tyler Durden Tyler Durden @TylerDurden

    It's worth noting that align nodes works across objects as well. That and snapping to nodes covers a lot of ground.

    I like the idea of coordinates of selected nodes, though. Like Flight Tracker for nodes, lol.  Feature requests can be made: https://inkscape.org/forums/beyond/how-to-report-bugs-or-request-new-features/

  4. #4
    cartoonygothica cartoonygothica @cartoonygothicpunker

    To clarify, it's not how to align nodes that I'm concerned about. It's checking whether two or more nodes are already aligned. As I stated in my original post, I can easily check the coordinates of one individual node when I select it, but what I want is to be able to select more than one node at a time and see the coordinates of each selected node. Sometimes, I find that two or more nodes are extremely close to each other, but not in the exact same position. I actually made my feature request on gitlab first, before posting in the forums.

  5. #5
    Tyler Durden Tyler Durden @TylerDurden

    Duly noted. Mostly users around here... we refer all feature requests to the devs on GitLab.

  6. #6
    bleke bleke @bleke

    How would this be presented in the user interface?

    If it's a list in the side panel, how do we know which node the number belongs to? Should they be colour coded? Would that work if there are lots of nodes? What about colour blind people? One plus point for the side panel could be that it's easy to copy the number.

    If the numbers are displayed on canvas, how can they be readable if there are many nodes close to one another?

  7. #7
    cartoonygothica cartoonygothica @cartoonygothicpunker

    If not displayed on canvas, then yes, I can imagine a list of coordinates might be displayed in a side panel. You do bring up a good point about nodes that are very close to each other. Yes, I suppose color-coding the nodes could be of some help, but if you're color-blind, I know that there's an extension that allows you to assign numbers to nodes. Perhaps a list of coordinates in a side panel could refer to the nodes by number? When it comes to selecting nodes that are very close to each other, I'm not yet sure how Inkscape should show which coordinates belong to which node.

  8. #8
    Tyler Durden Tyler Durden @TylerDurden

    If the goal is to simply identify which selected node locations are coincident and which are not (within a user-defined tolerance), maybe a circle around the coincident ones and a triangle around the ones that are not?

  9. #9
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Yes, that sounds like a good idea. Even if I don't get to see coordinates of multiple individual nodes, my main reason for wanting to see coordinates is to check whether two or more nodes are, indeed, in the exact same spot.

  10. #10
    Adam Belis Adam Belis @AdamBelis

     yes indicator for colition souns like a better solution

  11. #11
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Okay, I made a feature request for an indicator to show whether two or more nodes are in the same location.

  12. #12
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Update. Apparently, there was a demo extension made that shows information about selected nodes. https://bugs.launchpad.net/inkscape/+bug/171640 I downloaded it today, but I don't know how it's supposed to work, since I didn't see any new information pop up when I tried to use it.

  13. #13
    Tyler Durden Tyler Durden @TylerDurden

    I don't think that development went very far...  it may have been some sub-architecture for other extensions and almost certainly would not be compatible with current extension architecture (python3).

  14. #14
    cartoonygothica cartoonygothica @cartoonygothicpunker

    I certainly hope it can be developed into either a built-in feature for newer versions of Inkscape or an official extension. Now that I made feature requests on GitLab, is there anything I can do to increase my chances of having either the coordinates or indicator feature showing up in newer versions of Inkscape?

  15. #15
    Tyler Durden Tyler Durden @TylerDurden

    My impression is that it is possible to make the extension, so that's a start. 

    The developers have a process of selection that I'm not knowledgeable about; but I presume there are priorities based on bug severity, future needs, user interest, etc.

    It does not need to be an "official" extension though... many extensions are developed by parties outside of the Inkscape project. I've hired developers to write extensions for specific applications, and shared those with the community. So, that's an option, particularly if the extension provides an ROI in time saved, productivity increases, etc.

  16. #16
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Is there any chance that the developers you know might be willing to write extensions for the selected coordinates feature or the indicator for close nodes feature? If I had the money, I might hire them myself, but I don't currently.

  17. #17
    Tyler Durden Tyler Durden @TylerDurden

    The guy I hired is busy with other projects at this point. 

    Your request did not go unnoticed... something might get developed, but don't hold your breath.

  18. #18
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Okay. Where did you share the extensions that were made? I'd be interested to see what they do.

  19. #19
    Tyler Durden Tyler Durden @TylerDurden

    It's an extension for exporting files to CAD/CAM/Plotters. It was broken for some time, but maybe now it is fixed. https://gitlab.com/inkscape/extensions/-/issues/256

     

  20. #20
    inklinea inklinea @inklinea⛰️

    ** I haven't worked with nodes really ** however:

    In the extension system the selected nodes are found in self.options.selected_nodes

    So inkex.errormsg(self.options.selected_nodes)

    would give ['path10591:0:5', 'path10591:0:0']

    So you have the path id, then a number that represents non connected items (for example a combined path with an air gap on canvas), and finally the node number.

    and the nodes can be found in a path object at nodes = first.path.end_points

    So if you use selected_nodes to make a new list from the end_points

    You have the coordinates of the selected nodes.

     

     

    Number Nodes
  21. #21
    cartoonygothica cartoonygothica @cartoonygothicpunker

    And this information would be found in the XML editor? I was hoping that the feature to show coordinates would do so in a way that's easy for anyone to understand, without having to understand code or anything.

  22. #22
    inklinea inklinea @inklinea⛰️

    If you know how to install an extension, will see if I can upload to gitlab at somepoint.

    Will post a reply if I do.

  23. #23
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Okay, sounds good. I only recently learned how to install extensions.

  24. #24
    inklinea inklinea @inklinea⛰️

    I've made a basic extension at:

    https://gitlab.com/inklinea/inspect-nodes

    I've not been able to test on Windows ( should work ) but have tested on Ubuntu.

     

  25. #25
    Tyler Durden Tyler Durden @TylerDurden
    *

    Works nicely here on Win 8.1, Inkscape 1.2.1 (9c6d41e410, 2022-07-14).

    👏

     

    New Document 1   Inkscape 2022 10 20 16 11 52
  26. #26
    cartoonygothica cartoonygothica @cartoonygothicpunker
    *

    Thank you so much, inklinea. This just might be a game-changer!

    Update: It worked fine when I tested it on a simple shape I drew in a blank document, but when I tried to test it on a drawing that I already had, Inkscape kept crashing... even after I installed the newest version!

  27. #27
    Tyler Durden Tyler Durden @TylerDurden

    If you have installed a new version, I suggest resetting the preferences (which are retained during uninstall/install).

  28. #28
    cartoonygothica cartoonygothica @cartoonygothicpunker

    In that case, how do you reset preferences?

  29. #29
    Tyler Durden Tyler Durden @TylerDurden

    https://inkscape.org/forums/questions/getting-back-to-square-one-and-starting-over-its-easy/

  30. #30
    cartoonygothica cartoonygothica @cartoonygothicpunker
    *

    Oh, okay. Dang it. It looks like Inkscape still crashes on me, even after I tried resetting preferences. If anyone's curious, this is the file that I've been trying to test the extension on.

    Prideflag
  31. #31
    inklinea inklinea @inklinea⛰️
    *

    Yes, crashes instantly on that file for me.

    I will investigate :)

    --- Well this is a bit of a mystery but seems to be unrelated to the extension.

    I've opened this file on Ubuntu 22.04 - Inkscape 1.2 (1:1.2.1+202207142221+cd75a1ee6d)

    I can't seem to do very much with it at all - running any extension causes it to instant crash to the desktop (core extensions supplied with Inkscape), trying to save the file causes instant crashing. 

    I've opened the file in an older AppImage - Inkscape 1.1-beta1 (77e7b44, 2021-03-28) and it works fine.

    I can't get any error message at the console to give clues. 

    Tyler - perhaps you have see why ? 

     

  32. #32
    Tyler Durden Tyler Durden @TylerDurden

    I cleaned 680 unused defs from the file. Please try this attachment.

    Prideflag Td
  33. #33
    inklinea inklinea @inklinea⛰️

    Yes, that has resolved the problem - works :)

  34. #34
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Thanks! The extension worked much better on that version. What are "defs" and how do I clean unused ones?

  35. #35
    inklinea inklinea @inklinea⛰️
    *

    I've jazzed it up a bit to allow for:

    Different units on the canvas

    Connectors between node points and the labels

    Choice of font size

    It should be able to handle all the layer / shape transforms now.

    That Edit>Resize Page to Selection feature is great - but introduces some interesting layer transforms.

  36. #36
    cartoonygothica cartoonygothica @cartoonygothicpunker

    I noticed that on some areas, coordinates that should be the same show up as different numbers when I use the extension. I mean, those nodes were literally snapped to each other. On other areas, the extension does not even give me coordinates; it gives me a wall of text. What's up with that?

  37. #37
    inklinea inklinea @inklinea⛰️

    hmm, can you post an example.

    After selecting nodes, if you look at the bottom of the Inkscape window in the status bar, it will tell you how many nodes are selected ? 

    Do you have an example of the wall of text ? 

  38. #38
    cartoonygothica cartoonygothica @cartoonygothicpunker
    *

    In one screenshot, the nodes that form where the bottom of the nose and the upper lip meet should have the same coordinates, but the extension gave two different coordinates. In the other screenshot, when I selected the six nodes that form the top of the head and the hair, the extension did not even give me coordinates.

     

    Walloftext
    Nodecoordinatediscrepancy
  39. #39
    inklinea inklinea @inklinea⛰️

    The wall of text, is when the extension has crashed :(

    For the first result, I was able to reproduce it. 

    However when I select the nodes in question, it says 2 of 13 nodes selected, but nothing is highlighted. I wonder if this could be a selection error in the main program ? 

    Generally if the nodes are blue, it should work. 

    However - apologies - if its not doing what you want at the moment.

  40. #40
    cartoonygothica cartoonygothica @cartoonygothicpunker

    Oh no. It's too bad the extension crashed. Well, it's a good thing we were here to test your extension, I guess?

  41. #41
    cartoonygothica cartoonygothica @cartoonygothicpunker
    *

    I wonder if it's the extension, the Inkscape file of my drawing, or Inkscape itself that needs to be changed to fix the problem, though.

  42. #42
    inklinea inklinea @inklinea⛰️

    I suspect it may be my code :)

    I will review it at some point.

  43. #43
    cartoonygothica cartoonygothica @cartoonygothicpunker
    *

    Okay. Let me know if you find any issues in the code.

  44. #44
    cartoonygothica cartoonygothica @cartoonygothicpunker

    If you do manage to find and address issues in the code, could you possibly upload the extension to the Extensions section of Inkscape, so that it may be more accessible to everyone?

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Feature request: Show coordinates of selected nodes