Automatic Connectors to edge of shape and routing via specific point

Registered by Stéphane V on 2008-12-17

In Inkscape, it is possible to connect two shapes from their centers. But if you want to make a schematic with represent a family (for example), it's not possible to add connectors from an edge of a shape.

It will be great if connectors can be added to edge of shape, in a way that auto adaptation to "best path" is still possible.

Another idea is to implement a tool that can *restrict* the connector to vertical and horizontal lines only. For now, Inkscape is tracing straight lines or broken line if there is an shape in the path, but lines go in any direction.

It will be great if connectors can be configured in a way that they must avoid others shapes, AND pass through some specific points, AND stay even horizontal even vertical.

I do not speak yet about the functionality of making a little "bridge" when two lines cross each others and are not connected. This is a functionality that exists in M$ Visio but does not work very well :-/

Thanks for reading !

Blueprint information

Status:
Started
Approver:
None
Priority:
High
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
None
Implementation:
Started
Milestone target:
None
Started by
jazzynico on 2009-12-11

Whiteboard

I'd like to formalise aspects of this project proposal. I'm the author of libavoid (the library used for routing in Inkscape) and the person who added the existing connector tool. I'd also probably be the most appropriate person to mentor this project if it were undertaken as a Google Summer of Code (GSoC) project. Below are some connector improvement tasks, along with some comments.

1) Drawing to shape edge, rather than bounding box:
Currently, the connector tool only draws connectors to the bounding box of shapes. It should (probably) instead draw them up to the first intersection point with the shape's stroke. This is probably quite easy to achieve now that lib2geom is included in Inkscape -- 2geom can find intersection points between lines or curves making up shapes. Otherwise, the old Boolean Ops code could be used instead.

2) Connector ports (Connecting to a specific point on a shape):
libavoid is able to route connectors to specific points. This work would require adding a GUI for this feature to Inkscape so that users could define connector ports on shapes. These would need to be editable through the canvas and the information saved and loaded from files. I think this activity, along with the other minor items on this list, would form the basis of a good GSoC project.

3) Orthogonal connector support (vertical and horizontal lines only):
This is something I am working on in libavoid right now. An initial version will be complete during the 2009 GSoC period, so this feature will shortly become fairly trivial to add to Inkscape.

4) Routing connectors through specific points:
This is not currently a feature of libavoid, though it is a fundamentally easy thing to do. I would be able to add this feature to libavoid fairly easily, and then the work would be in creating an interface for creating such points and working with them in Inkscape.

5) Visualising connector crossings:
libavoid can be queried to determine where connector crossings occur. Thus, Inkscape could be updated to use this information to modify the connector's path to visualise the crossings distinctly (such as by drawing a little "bridge").

6) Curved poly-line and orthogonal connectors:
Inkscape can return versions of poly-line or orthogonal connector paths with curved corners. This is purely an aesthetic improvement. Inkscape could be fairly easily modified to add an option for this and to use this feature of libavoid.

7) Routing preferences and penalties:
libavoid can provide routes that have less segments, or that have less large bends. It does this by penalising these features when determining the routes. These options could be exposed within Inkscape to give users more control over the quality of the generated paths for connectors.

I'm willing to mentor and assist an interested student who is willing to work on one or more of these tasks. -- Michael Wybrow

JazzyNico, 2009-12-11
Some improvements have been committed in the 0.48 development trunk (GSoC2009 project).
Michael, would you be willing to update the specification and status of this blueprint so that we can see what's missing?

Michael Wybrow, 2009-12-14
Arcadie and I have a TODO list of things remaining for us to be happy with the branch work, this is listed as a comment in src/connector-context.cpp. I'm very busy right now, but I will take a look at this and talk with Arcadie over the Christmas period.

2011-07-15 Andreas Becker: <2) Connector ports (Connecting to a specific point on a shape)> I proposed this already for the fillet tool: The connector points could be actually nodes, for which properties can be defined, in this case a reference to the other connected node. This can be implemented as a std::map in Geom::Point/Geom::Path or whatever is used internally. The maps have to be saved in SVG, too.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.