snap to path intersections doesn't work

Bug #405419 reported by willsketch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Diederik van Lierop

Bug Description

Development version as of 4-19-2009
Windows Vista

See attached file for examples.
(It's my understanding that the Snap to path intersections makes it so when two paths intersect it creates a snap point and when you drag a third path over the intersection the closest point on the third path should snap to the intersection and then the path should dynamically "flow"/"follow" the intersection snap point until you drag too far from the object.)

I was trying to create some guides using circles drawn with the circle tool. I tiled a circle with a 72 degree rotation so they perfectly aligned to form a pattern. Then over that i wanted to put some more circles, using the path intersections of the circles as my guides. When I enabled Snapping>Snap nodes or handles>Snap to paths>Snap to path intersections the circle wouldn't dynamically snap to the various path intersections. What it would do is snap the closest two handles whenever they crossed a path. (Due to the Snap nodes or handles button) but it wouldn't snap any of the other handles, even if they crossed a path. And if ONLY Snap to nodes or handles was selected, then NO snapping would occur.

I also noticed that I couldn't enable Snap to path, Snap to intersections, Snap to cusp nodes, Snap to smooth nodes, Snap from and to midpoints, Snap from and to centers of objects, or Snap from and to an item's rotation center, without first enabling the Snap to nodes or handles button. (To me these should all be independent buttons)

Notes on attachment:
Left image is what I am currently working with
-The green circle somehow snapped properly, but still would snap handles like other circles did
-When I tried adding the blue circle, it wouldn't snap properly, exhibiting the handle snap
-Black circle is centered perfectly in the image, where it intersects the red circles is where I want to snap other circles
Right image is essentially what I want to achieve, just an imperfect version

Revision history for this message
willsketch (wllmbellamy) wrote :
Changed in inkscape:
assignee: nobody → Diederik van Lierop (mail-diedenrezi)
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

> What it would do is snap the closest two handles whenever they crossed a path

This happens only when creating a new circle by dragging, right? This is by design, as at that moment only the two opposite corners of the rectangle being dragged are considered for snapping. After that, the quadrant points of the circle should be snappable, or the circle's center when that option has been enabled. So in this case you would have to create a circle of the correct dimensions first, and then snap it.

> And if ONLY Snap to nodes or handles was selected, then NO snapping would occur.

If you read carefully, then the tooltip says "snap nodes or handles", not "snap TO nodes or handles". This is because the nodes or handles can be both a source and a target for snapping. Inkscape basically has two modes: snapping to/from bounding boxes or snapping to/from nodes/handles. These can be toggled individually. After you've done that, you can specify detailed options for each of these modes.

> To me these should all be independent buttons

IMHO they shouldn't. It's done like this to communicate to the user that there are two different snap modes, and that's the only reason that the "snap nodes or handles" button has been added. It does not specify any snap target.

> Right image is essentially what I want to achieve, just an imperfect version

What might work here is snapping a quadrant point to such an intersection of paths, then snap the rotation origin of the circle to that intersection too, and rotate the circle around that point.

Revision history for this message
LucaDC (lucadc) wrote :

Diederik, I'd catch the opportunity to ask you if it's possible to have guides snap to paths' intersection too (while dragging and while rotating).
Now I always have to create a segment snapped to the intersection(s) and after convert it to a guide or use its nodes for snapping the guide.
Also, snap to intersections between paths and guides would be great (now I have to draw a segment on the guide and use its intersections with surrounding paths) but this would add a lot of snapping points in a drawing and I'm not sure it's a good idea. At least there should be an option to enable/disable it as needed.

> What might work here is snapping a quadrant point to such an intersection of paths,
> then snap the rotation origin of the circle to that intersection too, and rotate the circle
> around that point.
One problem on this procedure is that you don't have any snapping working while rotating an object, only fixed angles with ctrl.
Recently I had to draw a circle having as diameter a given oblique segment and I had to do a geometric construction while somethig much more simple would have been:
 - drag a vertical guide on the middle of the segment;
 - copy-rotate (space before starting rotation) the segment until you snap its nodes to the guide (now you can't);
 - add a couple of guides (0° and 45°) and draw the circle;
 - delete the vertical segment and guides.
Having nodes and bounding box corners (if enabled) snap to guides while rotating could be a good starting point.

Thanks.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : RE: [Bug 405419] Re: snap to path intersections doesn't work

> Diederik, I'd catch the opportunity to ask you if it's possible to have
> guides snap to paths' intersection too (while dragging and while rotating).

Confirmed, that isn't working yet. I will look into this.

> One problem on this procedure is that you don't have any snapping working
> while rotating an object, only fixed angles with ctrl.

Snapping while rotating is something that still has to be implemented, but it has been on my todo list for some time already :-)

Diederik

Revision history for this message
willsketch (wllmbellamy) wrote :

"What might work here is snapping a quadrant point to such an intersection of paths, then snap the rotation origin of the circle to that intersection too, and rotate the circle around that point."

This did work. Here's exactly what I did:

Select the circle/object you want to snap to two intersections.
Enable Snapping>Snap nodes or handles>Snap to paths>Snap to path intersections
Snap one quadrant point to one of the two intersections (i.e. a quadrant point is where the objects handle meets a secondary path)
Click on the object to enable rotation
Move the rotation center to where the quadrant point is
Rotate the object into place using the corner rotation handles

Diederik, I noticed that when I had the circle in rotation mode I could only rotate the object using the corner handles, when I used the middle handles they would skew the circle into an elipse, while still keeping the rotation center anchored. Is this how it's supposed to work?

Revision history for this message
willsketch (wllmbellamy) wrote :

Sorry, I forgot an important step:

Select the circle/object you want to snap to two intersections.
Enable Snapping>Snap nodes or handles>Snap to paths>Snap to path intersections
Snap one quadrant point to one of the two intersections (i.e. a quadrant point is where the objects handle meets a secondary path)
>Disable Snap nodes or handles (if snap conditions are met and you didn't disable the button, it will pull the object out of place when trying to rotate, I guess the snapping guidelines supersede the rotation command)
Click on the object to enable rotation
Move the rotation center to where the quadrant point is
Rotate the object into place using the corner rotation handles

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Luca: Snapping a guide to an intersection of paths has just been implemented (as of rev #21933). Please test!
willsketch: I will try to answer your question tomorrow; it's bedtime for me!

Revision history for this message
LucaDC (lucadc) wrote :

I took a quick look and everything seems fine. Be sure I'm going to use this new feature soon. Thanks so much!
Now waiting for your todos in the list being finished... :)

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

> Diederik, I noticed that when I had the circle in rotation mode I could only rotate the object using the corner
> handles, when I used the middle handles they would skew the circle into an elipse, while still keeping the
> rotation center anchored. Is this how it's supposed to work?

Yes.

> (if snap conditions are met and you didn't disable the button, it will pull the object out of place when trying
> to rotate, I guess the snapping guidelines supersede the rotation command)

While rotating, the rotation center should never move. Is that what's happening? If so then this is a bug. I haven't been able to reproduce this though. Could you explain this in (even more) detail, for example using some screenshots (or even a movie if you know how to)?

Revision history for this message
willsketch (wllmbellamy) wrote :

I tried to recreate it, but for some reason I couldn't. I don't know why, obviously something was missing that I didn't notice, cause I know it happened. I did notice something else that was odd when I tried recreating it.
The quadrant point could shift around the circle. Instead of being static at the handles, they gradually shifted with each new circle, and the handles would no longer snap like they had originally done. There were still four points that would snap, but they weren't the same on each circle.

Notes on Attachments:
1: 1st circle, shows that it's handles snapped properly.
2: 2nd circle, shows that it shifted just slightly, although it may not be noticeable to you
3-6: Show's the 4th cirlce, highlighting the 4 quadrant path points that have now shifted considrably in relation to the position of the original circle's snap points
7. Show's 4th circle, showing that handles no longer snap
8: Shows the 1st circle again, but now the snap points have shifted slightly out of the original alignment with the handles
9: Shows the 3rd circle, which also has shifted snap points, which do not line up with any of the other circles snap points.

Also, the 2nd, 3rd, and 4th circles were all copies of the 1st, but why then did the snap points shift on the 1st circle after awhile?

Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
willsketch (wllmbellamy) wrote :
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

On 07/31/2009 07:57 PM, willsketch wrote:
> The quadrant point could shift around the circle. Instead of being static at the handles, they gradually shifted with each new circle, and the handles would no longer snap like they had originally done. There were still four points that would snap, but they weren't the same on each circle.
>

That's by design. If the circle rotates, the the quadrants rotate with
it. If you open the XML editor window and delete the transform
attribute, the circle will loose its rotation and the quadrant points
will be back at 3/6/9/12 o'clock
> Notes on Attachments:
> 1: 1st circle, shows that it's handles snapped properly.
> 2: 2nd circle, shows that it shifted just slightly, although it may not be noticeable to you
>

It's about 40 degrees! How could I miss that ;-) ? Or is this not what
you're trying to show me?
> 3-6: Show's the 4th cirlce, highlighting the 4 quadrant path points that have now shifted considrably in relation to the position of the original circle's snap points
> 7. Show's 4th circle, showing that handles no longer snap
>

Then that would probably be because the handles are not where you expect
them to be.
> Also, the 2nd, 3rd, and 4th circles were all copies of the 1st, but why
> then did the snap points shift on the 1st circle after awhile?
>

Maybe it got rotated somehow? Do they get restored when you delete the
transformation?

BTW, the current behaviour allows you to place the quadrant points at
any angle you like. If you make sure not to rotate the circle then
they'll be at 3/6/9/12 o'clock, but you could just as easily have them
at 1/4/7/10 o'clock by rotating 30 degrees.

Revision history for this message
willsketch (wllmbellamy) wrote :

No, I meant that the quadrant point had shifted around on the selected circle, not that it had shifted around on the central circle. I realize now that everything I explained to you in my last post was due to the nature of the Quadrant points, not because of a bug. As for the shift on the first circle after all was said and done, it too was due to the rotation of the circle,

One thing: It would be helpful to make the quadrant points visible. That would have eliminated confusion on my part, and just make it easier to place a specific quadrant point at a specific snap location.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

On 07/31/2009 11:39 PM, willsketch wrote:
> One thing: It would be helpful to make the quadrant points visible.
> That would have eliminated confusion on my part, and just make it easier
> to place a specific quadrant point at a specific snap location.

For that we would need to introduce another handle type, which might be
confusing. An ellipse already shows two different types of handles, and
same holds for example for a rectangle. So we could show the extra
handle only while dragging, such that a user will not get the idea that
it can be used to alter the shape.... but thinking of that I just
realized that we already have something similar: please enable "only
snap the node closest to the pointer" in the preferences dialog (on the
"Snapping" tab). No when you try grabbing the ellipse close to the
quadrant point (you will have to guess where it is), a snap source will
be highlighted once you start dragging. This discloses where the
quadrant point is located! Although I recognize that it might be better
to show all quadrant points simultaneously, this should already be
useful or just a decent work around.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

OK, so a short recap:

- Snapping guides to path intersections has been implemented
- I'm not planning to reveal all quadrant points when Inkscape is about to snap; we would then have to take this further, e.g. all corners of a rectangle or bounding box, in fact all snappoints in the current selection... which could be a huge number! That is not helpful at all, so I'll just leave it at only revealing the snap source closest to the mouse pointer (but only when that option has been enabled)
- Snapping while rotating is in the works, I hope to implement this for v0.48. But as this was not what this bug report was about, I'll ignore this for now and close the bug. If you're worried that I might forget this then please file a new bug report for this ;-)

Thanks for your effort willsketch and LucaDC!

Changed in inkscape:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.