Bryce,
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.
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.
Most CAD programs allow you to snap to endpoints, midpoints, intersection points, and even to the center of circular or eliptical objects and to points perpendicular to a line. I'm no expert on SVG, but if Inkscape needed to store information about the snap points of an object it might look like this in XML code:
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.
-----Original Message----- From: Bryce Harrington [mailto:bryce@...69...] Sent: Thursday, May 06, 2004 11:23 AM To: inkscape-user@lists.sourceforge.net Subject: RE: [Inkscape-user] Snapping to the Grid
Node-to-node snapping is in the roadmap for the 0.46 release. That's quite a ways off in the future, though (estimate a bit over a year), but if you or someone else with an interest in this wants to start working on it, that'd help get it in sooner. (We've had several features that got implemented ahead of schedule due to new developers getting involved, and so we definitely encourage it.)
Note that while work is on-going to C++-ify the codebase, the vast bulk is still written in a fairly general C style. If you've done Java and understand C pointers, you'd probably be able to pick up the codebase without much more difficulty than anyone else has had. The main challenges tend to be that there isn't very much code documentation and that there's so much code it can be hard to find where to start working.
But anyway, yeah, object-to-object snapping and snap points are *definitely* features that a lot of us want in there, especially now that we've got markers to a point of usability. I don't know if anyone's defined *how* they should work or planned out how to implement them; it isn't part of the SVG spec so to a degree we're a bit on our own with this. I can give some more suggestions if you're interested in working on it.
Bryce
On Thu, 6 May 2004, Landon Blake wrote:
Bryce,
Thanks a lot for the suggestions. I'll give them a try. Is there any plans to enable node-to-node snapping in future versions of Inkscape? I would love to help with the design, but I only know a little Java, and not any C++. I think this would be a very helpful feature. It would also be great if you could specify coordinates for each node of a shape/path or line. Although I know Inkscape is not a CAD program, these features would allow some more "precise" drawing.
Thanks Again,
Landon
-----Original Message----- From: Bryce Harrington [mailto:bryce@...69...] Sent: Thursday, May 06, 2004 9:53 AM To: inkscape-user@lists.sourceforge.net Subject: Re: [Inkscape-user] Snapping to the Grid
Okay, I've played around with it at these settings and I think I see what you're experiencing. The snapping does seem to be working, but you may need to play with the settings.
First, try zooming in a bunch. You'll notice that at the most zoomed-out level, it doesn't display every grid line but rather every tenth or whatever, so sometimes it may be snapping but you can't tell since you don't see the lines its snapping to. I zoomed in about 2000% to check that things actually were snapping. So you may want to try a larger X/Y spacing.
Next, check if your Snap units are in px. If so, then note that this is screen coordinates (I think), so if you have it set to <1, this essentially disables snapping since it'll snap to any pixel on your screen. I usually like to set it to 5 for 'loose' snapping, or 10-20 for more aggressive snaps.
Good luck, Bryce
On Thu, 6 May 2004, Landon Blake wrote:
Inkscape Users,
I'm not sure if this went through the first time, so I thought I would try again. Please accept my apologies if this is a duplicate post. I'm having some trouble using the "snap to grid" feature. I checked "snap to grid" in the document options dialog, and set my grid spacing to 0.25 inch. My snap distance was set to 0.20. I played with some different snap distances, but I can't seem to get the nodes of any paths or shapes to snap to the grid. Any suggestions? Also, is there any way to specify the coordinates of a node?
Thanks,
Landon Blake
The Sunburned Surveyor
Redefined Horizons
"Defining New Horizons in Open Source Geospatial Software."
Do you Yahoo!? Win a $20,000 Care
------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user