#7423 closed defect (fixed)
[patch] Align nodes in circle results are unstable
Reported by: | alv | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.03 |
Component: | Core | Version: | tested |
Keywords: | align node circle | Cc: |
Description
Steps to reproduce:
- select any 3+ node way or enough nodes
- hit O to align nodes in circle; shape is changed
- hit O again to align nodes in circle: shape is changed again
What is the expected result:
- second align nodes in circle should not move anything, because the nodes were just (should have been, anyway) already aligned in a circle.
Attachments (3)
Change History (12)
comment:1 by , 13 years ago
Priority: | minor → normal |
---|
comment:2 by , 11 years ago
Problem is that center is computed as centroid of nodes.
Even if nodes are already aligned in circle, centroid may differ from center.
I propose a last square method based on bisector.
I will put an update of the patch after ticket #8431 will be done.
comment:3 by , 11 years ago
Summary: | Align nodes in circle results are unstable → [patch working] Align nodes in circle results are unstable |
---|
comment:4 by , 11 years ago
Keywords: | align node added |
---|
comment:5 by , 11 years ago
Summary: | [patch working] Align nodes in circle results are unstable → [patch] Align nodes in circle results are unstable |
---|
Patch is now OK (and I wish without bugs !!)
I use a least square method to compute center of circle, that ensure exact computation of center if nodes are already align in circle.
comment:6 by , 11 years ago
Milestone: | → 14.03 |
---|
Good, but some remarks before committing:
- I'd prefer a new method in Geometry class, with a clear distinction about the difference between getCentroid and getCenter
- Can you rephrase the displayed error message to be more user friendly? Something about the number of required nodes for example.
comment:7 by , 11 years ago
I have put a new version. getCenter is now in Geometry class.
There remain a bug: result can be strange if you apply AlignInCircle action over a self crossing way.
But it is not a normal "use case", so I don't know if this bug is blocking.
In normal case, it is an improvement, since result is stable if you apply this action twice, and over an arc, the center is at the right place.
I have a real nice example where this action does not work at all