On Thu, 6 May 2004, Landon Blake wrote:
Let me check out some C code and see what I think. I definitley want to get involved in Inkscape is ever ported to Java.
Learning new languages is good for ya. ;-)
I'm curious what issues there would be with the relationship between SVG and snapping node-to-node in Inkscape. If two objects were snapped together at their nodes, wouldn't they just be stored in SVG with the same coordinate for the common node? Would anything else really need to be defined? I had imagined it working very similar to snapping nodes to the grid.
Well, in object-to-object linking, the linkage needs to be permanent and stored with the document. I guess this is a step beyond just snapping, in that once the two objects are linked, moving one object needs to cause the other one to move. For example, if you link a line to a box, and then move the box, the connected endpoint of the line needs to move.
This implies that some sort of information would need to be stored in the document, so if you save the file and reload it, the 'connectivity' information is still there.
Example: Line
<SnapNode> <Type>Midpoint</Type> <YCoordinate>24.56324</YCoordinate> <XCoordinate>10.32564</XCoordinate> </SnapNode>
This is just a rough idea of how it might look in XML. I imagine the SnapNode Element as a child element of the shape or path element. The Type Element might enable users in Inkscape to shut the different types of snaps on and off. (For example, if the user only wanted to snap to endpoints.) In the above scenario a simple one segment path or line would have 3 SnapNode Elements: 2 endpoints and 1 midpoint.
I did a quick google and found this bit on SVG and connection points: http://www.infoloom.com/gcaconfs/WEB/granada99/her.HTM
Scroll down to 'Automatic Connections'. It shows an example of connecting two shapes. I'm not sure if the syntax they're using is valid SVG or if it's particular to the application (drawml), though.
Bryce