snap rotation handle - bug?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

snap rotation handle - bug?

Postby brynn » Fri Mar 18, 2011 6:32 pm

Hi Friends,
I'm not sure if I may have come across a bug, so I thought I'd share the particulars, and also ask about other ways to accomplish what I want. I'm sure I can come up with something on my own, but it's always a learning experience to see how others approach things. The SVG file will be attached below, and here is a PNG too.

center-snap.PNG
center-snap.PNG (17.18 KiB) Viewed 3102 times


You can disregard the yellow and red crescents (and if a bug report is in order, they could be deleted).

I have a circle (light aqua), and on top of it, a black half-circle (eventually to be LPE hatches). The diameter of the half-circle does not lie on the horizontal. I created it by duplicating the original circle, then adding new nodes where I wanted to break the circle (using the Guide as a guide :mrgreen: ). And then I deleted the unwanted half.

Now I want to rotate it, so that the diameter lies about halfway back towards horizontal. But as you can see, the rotation center is not the same as the rotation center of the light aqua circle. That lies inside the pink circle, and I've shown it this way because both rotation centers could not be displayed simultaneously.

So my first thought was to snap the rotation center of the black half-circle to the rotation center of the aqua circle. But while no snap ever occurs, the signal of a successful snap is displayed at every position where I might move the rotation center: "Handle to object rotation center".

So to test, please set up snapping of nodes and handles to centers of objects and rotation centers. (It may be that snap to centers of objects should not be necessary, but deselecting it does not solve the problem.) (The SVG file should open with those already set.) Then grab the black half-circle's rotation center and drag -- just drag anywhere, and you can see the little "Handle to object rotation center" display wherever you move it. But it never does really snap at any of those places.

Is this a bug in snapping? Or for some technical reason (of which I'm unaware) should rotation centers not be able to snap together?

Also, what other ways would you approach this step? For me, the most direct idea would be to undo back to the the point where the black half-circle was a full circle, and rotate it before I delete half of it. Or delete it, and duplicate the original circle again. The problem with these 2 similar ideas is that I might not get the diameter of the half-circle on the proper angle just by guessing. It's the kind of situation where I might need to rotate back and forth a few times, to see what's going to look right to me. I'll probably rotate "manually" with selection tool, and experiment with Align and Distribute to get it back in place, while waiting for replies. Any other ideas??

This is with Inkscape 0.48 on Windows 7, 64-bit. And here is the SVG file:

rotation snap.svg
(30.88 KiB) Downloaded 238 times


Thanks for your help :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: snap rotation handle - bug?

Postby ~suv » Fri Mar 18, 2011 7:23 pm

brynn wrote:Is this a bug in snapping?

Yes, as far as I can tell it is The bug is fixed in the development version (milestoned for 0.49) but not in the 0.48.x branch (i.e. even if you decide to finally upgrade to 0.48.1, this specific bug in snapping not yet fixed - though I would really recommend using 0.48.1 instead of 0.48 nevertheless).
Last edited by ~suv on Fri Mar 18, 2011 8:04 pm, edited 1 time in total.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: snap rotation handle - bug?

Postby ~suv » Fri Mar 18, 2011 7:37 pm

Workaround with the current state of your drawing (tested with 0.48.1):
  1. deactivate unneeded snap targets (snap to path intersection, snap to path, snap from and to centers of objects)
  2. drag a guide and snap it to the rotation center of the pink circle (which isn't a precise circle by the way and seems to have its rotation center not precisely aligned with the original rotation center of the outer-most circle)
  3. deactivate "Snap from and to an item's rotation center"
  4. drag the rotation center of the black-filled shape and let it snap to the origin of the just created guide
  5. rotate at will (the minor differences are due to the pink circle not being precisely positioned imo)

Tip for new drawings: Before creating the circles, turn off the snap targets to midpoint & rotation center and drag two guides to mark the center for your sphere. Then draw the circles with 'Shift+Ctrl' pressed (i.e. draw from center, with constrained ratio), and let the ellipse tool snap to the guides intersection for the first (center) point. Later, you can position the rotation center of each shape by snapping to the intersection of the guides no matter how big the arcs/segment of each circle is (the dragged rotation center snaps to guides with the default snap settings: 'Snap nodes and handles' + 'Snap to guides').

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: snap rotation handle - bug?

Postby brynn » Sat Mar 19, 2011 3:46 am

Wow, thanks ~suv!

drag a guide and snap it to the rotation center of the pink circle (which isn't a precise circle by the way and seems to have its rotation center not precisely aligned with the original rotation center of the outer-most circle)

Yes, yes, the pink circle isn't part of the drawing. I just put it there to show where the rotation center of the aqua circle is, to show that the rotation center of the black half-circle isn't aligned with it. The aqua circle is the original, and the one to which I would snap a guide. And that's a great idea! And it could be any kind of guide, or more precisely any angle. I went to a lot of trouble to make the existing guide at just the right angle. But the snapping will occur to the guide's handle! Well, I could actually use the existing guide, for that matter :idea:

Also yes, yes, on using 2 guides' intersection as center of circles/objects. I certainly have done that in other drawings. In this one, I did not foresee that I might need them. You know the creative process is not usually predictable :lol:

Regarding the bug, that was a long read. So just to confirm the current status -- it's fixed in 0.48.1? Yeah, I've been holding off on upgrading, until I ran into the need for it. And especially if the Shift key deactivation of snapping on the fly is fixed, I certainly will upgrade asap!

Thanks again ~suv, you're the best :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: snap rotation handle - bug?

Postby ~suv » Sat Mar 19, 2011 4:01 am

~suv wrote:
brynn wrote:Is this a bug in snapping?

Yes, as far as I can tell it is The bug is fixed in the development version (milestoned for 0.49) but not in the 0.48.x branch (i.e. even if you decide to finally upgrade to 0.48.1, this specific bug in snapping not yet fixed - though I would really recommend using 0.48.1 instead of 0.48 nevertheless).

brynn wrote:Regarding the bug, that was a long read. So just to confirm the current status -- it's fixed in 0.48.1?

As mentioned in my first reply, the relevant comments in the bug report are #16-19 (I'm aware that there are other issues and crashes discussed in the report not relevant for your current problem).

And no, the bug (self-snapping of the rotation center) is not fixed in Inkscape 0.48.1 - the fix is only in the development version and will be in Inskcape 0.49.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: snap rotation handle - bug?

Postby druban » Sat Mar 19, 2011 9:17 am

the most direct idea would be to undo back to the the point where the black half-circle was a full circle, and rotate it before I delete half of it. Or delete it, and duplicate the original circle again. The problem with these 2 similar ideas is that I might not get the diameter of the half-circle on the proper angle just by guessing


I have to confess I do not understand most of the problems in your post.
But I think deleting half the circle is not the way to do this precisely. Better to make a circle with the ellipse tool, grab the circular control and drag it. the control bar will tell you how many degrees of arc your partial circle has. Just type 180.00 in this field and you have it precisely. If you don't want it horizontal, the difference between the two fields just has to be 180.

As to the other snapping issues, if ~suv says it's a bug it most certainly is one, but you can snap to the rotation center of most objects by snapping to the center of its bounding box; this worked for me in the file you sent, although, like I said, I don't quite understand what else you were trying to do...

Full disclosure: I am using r10094 in which rotation centers can snap correctly to other rotation centers, but I was ignoring that method since you can't use it.
More disclosure: The above edit was being made at the same time as ~suv's following post ...
Last edited by druban on Sat Mar 19, 2011 12:29 pm, edited 3 times in total.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: snap rotation handle - bug?

Postby ~suv » Sat Mar 19, 2011 9:31 am

druban wrote:I have to confess I do not understand most of the problems in your post.
(…)
(…) you can snap to the rotation center of most objects by snapping to the center of its bounding box; this worked for me in the file you sent (…)
As far as I remember you use development builds on Windows - as mentioned, those no longer have that specific bug with self-snapping of the rotation center (≥ 0.48+devel r9641).

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: snap rotation handle - bug?

Postby druban » Sat Mar 19, 2011 12:25 pm

Okay, to avoid the rotation center snapping issue, you can do this: draw a half circle using the method I described above, with the control bar and the ellipse control node etc. Do object to path. This will always give you a node at the "center" of the circle, even for half circles. You can now snap that node to the center of a bounding box if the proper controls are checked...

If you want to rotate several objects around a common point, draw an object (circles are best) from that center point that encloses ALL the objects you want to rotate. Select those objects and your new object, click the selection tool to get rotate handles, and drag to rotate.

In this example (if it plays) no rotation handles have been moved from their original location, and nothing has been grouped. The large circle is also rotating, but of course you can't see it.
anim.gif
anim.gif (72.96 KiB) Viewed 3014 times
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: snap rotation handle - bug?

Postby brynn » Sun Mar 20, 2011 7:00 am

~suv wrote:As mentioned in my first reply, the relevant comments in the bug report are #16-19 (I'm aware that there are other issues and crashes discussed in the report not relevant for your current problem).

And no, the bug (self-snapping of the rotation center) is not fixed in Inkscape 0.48.1 - the fix is only in the development version and will be in Inskcape 0.49.

Yes I saw that you referred to comments 16 - 19. But I wanted to read the whole thing anyway, in case I might learn something. At the end of the report, it sounded like the bug had been fixed, and since that was back in Dec 2010 (iirc) I assumed the fix would have been incorportated in 0.48.1. So thanks for clearing that up for me :D

druban wrote:But I think deleting half the circle is not the way to do this precisely. Better to make a circle with the ellipse tool, grab the circular control and drag it. the control bar will tell you how many degrees of arc your partial circle has. Just type 180.00 in this field and you have it precisely. If you don't want it horizontal, the difference between the two fields just has to be 180.

Well, I'll admit that I haven't used the ellipse tool control bar much. I've never had much need for arcs or "wedges" or whatever you call them. So it didn't occur to me to use those features to make the half circle. But I apprecieate your comments; I have definitely learned from them! This is a much more precise way to make a half circle.

druban wrote:As to the other snapping issues, if ~suv says it's a bug it most certainly is one, but you can snap to the rotation center of most objects by snapping to the center of its bounding box; this worked for me in the file you sent, although, like I said, I don't quite understand what else you were trying to do...

Oh no, I did not doubt ~suv, lol! It was the bug report that made me think it was fixed.
Actually I did try snapping the black half-circle rotation center to the aqua circle's bounding box center. But it didn't work. If I understand the bug, since the rotation center is snapping to itself, it would not be capable of snapping to anything else. (although admittedly I have a hard time imagining how it would be possible for it to snap to itself, lol)

druban wrote:Okay, to avoid the rotation center snapping issue, you can do this: draw a half circle using the method I described above, with the control bar and the ellipse control node etc. Do object to path. This will always give you a node at the "center" of the circle, even for half circles.

Oh, that's awesome, I had no idea!
druban wrote:You can now snap that node to the center of a bounding box if the proper controls are checked...

If you want to rotate several objects around a common point, draw an object (circles are best) from that center point that encloses ALL the objects you want to rotate. Select those objects and your new object, click the selection tool to get rotate handles, and drag to rotate.

Well, if I've done a good job, that center node should be already right on top of the center of the aqua circle's bounding box. BUT if snapping of the rotation center was functioning in my version, it would be a good thing to snap the rotation center to!

Oh, that's very clever druban! Select it together with the full (aqua) circle, and rotate them both! Thank you druban, another good technique!

Although I did note a bit of a glitch here. If I happen to have the mouse inside the circle (when I release the mouse button) then an arc is created, and the arc button on the ellipse control bar is automatically selected. If I do Object to Path, then the node at the center of the original circle is not created, because it's an open arc, or semi-circle, not a closed half-circle (or "segment" as it's called on the control bar). Wow, that feature where it's either an open arc or closed "segment" depending on whether the mouse is inside the original circle, or outside -- that's why I've avoided using the ellipse control bar! When I first started to use Inkscape, that was terribly confusing, and I only now realized how it works.

Off topic:
Actually I was kind of wondering if it might be a bug?? Because even if I click 'segment', if my mouse accidentally wanders inside the original circle when I release the mouse button, automatically the 'arc' button is selected (and vice versa). Wouldn't it be more reasonable for whatever button the users clicks, it should stay selected?? But I did just read the tavmjong bah Guide, and it appears to be this way by design!

I'm sure you all will have comments from which I will learn yet more :mrgreen: but this inside/outside the circle issue really is confusing -- especially for new users. I guess I just can't think of any positive benefits of this behavior. Is there some situation, or typical use of Inkscape by some particular field of endeavor, where the type of geometric object needs to be determined by the position of the mouse when the button is released? Eg - Well, I want to draw an arc, I'm dragging the handle, and I suddenly realize I want a 'segment' or closed shape, so it's convenient to move the mouse over here??


Return to “Help with using Inkscape”