Hoi Diederik,
Very nice idea! In notepath.cpp from line 4051 onwards, the node type is determined. This is saved in sodipodi:nodetypes attribute, but I don't know whether you can rely on that if it is present. I think 2geom will replace all path representations in the end, but I don't know. (I think 2geom paths also contain no information about the nodes, only about segments, correct me if I'm wrong!). Maybe if you only calculate the nodetypes when a path is loaded or changed, the speed penalty will not be that large?
Perhaps I can interest you in some other snapping business? ;-) Right now, guide-grid intersections do not snap. Another thing is angled snap lines. Angled guides are often requested, and the axonometric grid can also use those snaplines. Let me know if you want to hear what I've thought up. I won't have the time to implement it soon.
Grtz, Johan
On Tue, 2007-08-21 at 20:10 +0200, Diederik van Lierop wrote:
Hi,
I hope you don't mind if I increase the traffic on inkscape-devel even more ;-)
At some point an idea popped up to only snap to nodes at discontinuities in paths, and not to nodes at smooth transitions from one Bézier segment to another. This is more intuitive (less "Hey, what it is Inkscape snapping to now?") and might increase performance.
Problem is that in the object-snapper I only have access to SPCurve, which is a wrapper for "old-style" NArtBpath. It's easy to find out whether a point is inbetween two Bézier segments, but how do I find out if a transition is smooth? I guess that should be done by comparing the control points, or is there an easier way? With the transition to lib2geom, will the NArtBpath be deprecated in favor of the Path class? (that would make this rather exercise useless in the long run).
Any pointers would be appreciated here,
Diederik
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel