Aligning object centers to polygon vertices
Hello all,
I am trying to align five paths so that the center of each is located on a vertex of a regular pentagon (or, equivalently, the point of a five-pointed star). The paths are all different sizes. Does anyone know of a way to do this?
Thanks a lot,
Benjamin Esham schrieb:
I am trying to align five paths so that the center of each is located on a vertex of a regular pentagon (or, equivalently, the point of a five-pointed star). The paths are all different sizes. Does anyone know of a way to do this?
I guess you need it to be 100% exact. You could do this with a script.
If you can live with a little bit of error, you can align the paths to a cross (just two perpendicular lines which are centered on each other). Now you can select the path and the cross and move this until the center of the cross is where you want it to be (the cross just gives you visual feedback where the center of the path is). Delete the cross afterwards and you're done.
If you need to find the center of a vertex, just school geometry: Align two circles to the endpoints (they must be large enough to intersect), connect the intersection points with a line and you'll have the center.
Not really 100% perfect but usually good enough.
Another solution might be to draw these parts in a CAD program which can do this and export in a format that Inkscape can read.
Regards,
On 7/18/07, Benjamin Esham <bdesham@...155...> wrote:
Hello all,
I am trying to align five paths so that the center of each is located on a vertex of a regular pentagon (or, equivalently, the point of a five-pointed star). The paths are all different sizes. Does anyone know of a way to do this?
Just draw a star with star tool and position your path at the tips. If you need absolute precision, you can turn on snapping to object paths and snap them exactly to the star tips.
bulia byak wrote:
Benjamin Esham wrote:
I am trying to align five paths so that the center of each is located on a vertex of a regular pentagon (or, equivalently, the point of a five-pointed star). The paths are all different sizes. Does anyone know of a way to do this?
Just draw a star with star tool and position your path at the tips. If you need absolute precision, you can turn on snapping to object paths and snap them exactly to the star tips.
Thanks for the replies! My problem is that I need to align the *center* of each path to the points of the star. Since there is not necessarily a node at the exact center of each path, I don't think the snapping approach will work.
Cheers,
On 7/22/07, Benjamin Esham <bdesham@...155...> wrote:
Just draw a star with star tool and position your path at the tips. If you need absolute precision, you can turn on snapping to object paths and snap them exactly to the star tips.
Thanks for the replies! My problem is that I need to align the *center* of each path to the points of the star. Since there is not necessarily a node at the exact center of each path, I don't think the snapping approach will work.
Actually, it should snap the object's rotation center (which you can place anywhere you want) as you drag the object. Diederik, what do you think? I was under the impression that it already does, but looks like it's not, so this needs to be enabled.
bulia byak wrote:
Thanks for the replies! My problem is that I need to align the *center* of each path to the points of the star. Since there is not necessarily a node at the exact center of each path, I don't think the snapping approach will work.
Actually, it should snap the object's rotation center (which you can place anywhere you want) as you drag the object. Diederik, what do you think? I was under the impression that it already does, but looks like it's not, so this needs to be enabled.
I just tried this, and indeed the rotation center is not snapped.
Thanks anyway for the help,
On 7/22/07, Benjamin Esham <bdesham@...155...> wrote:
Actually, it should snap the object's rotation center (which you can place anywhere you want) as you drag the object. Diederik, what do you think? I was under the impression that it already does, but looks like it's not, so this needs to be enabled.
I just tried this, and indeed the rotation center is not snapped.
This now works in SVN - thanks Diederik!
bulia byak wrote:
Actually, it should snap the object's rotation center (which you can place anywhere you want) as you drag the object. Diederik, what do you think? I was under the impression that it already does, but looks like it's not, so this needs to be enabled.
Yep, that's a bug. At some point we decided not to snap the path nodes in the selector tool (see http://sourceforge.net/tracker/?func=detail&aid=1589436&group_id=934...), but the way it's implemented now the center of a path-object doesn't snap either. It did work however for shapes, at least in recent versions.
I have just fixed this, but it will take a couple of days before I commit the patch (due to other pending changes).
Diederik
Hi,
Snapping the object's rotation center is quite useful in some cases, but it can also be confusing in other cases. Imagine trying to align a square to a grid, with the square dimensions being an uneven multiple of the grid's pitch. While dragging the square around, it snaps it's edges to the grid as expected. But then suddenly it snaps while none of its edges appear to be aligned..... It's the center that is snapping, but there is no visual clue or anything pointing in that direction. Even after all the time I've spend plowing through the snapping code, it still fools me from time to time. In general, we should only snap points that have a visual clue, such as a corner of a bounding box, a tip of a star, or a node at a salient point of a path. Snapping nodes at a smooth path or object center's, which don't have a visual clue, can be confusing.
Maybe an additional checkbox in the snapping preferences dialog would be justified in this case: to enable/disable snapping the rotation center. By default it should be disabled. Too much checkboxes (like in v0.45.1) is confusing, but I think we need one for this. Does any one think otherwise or know of a better way?
In SVN the snapping dialog has changed for the better I hope, but feedback is always appreciated!
Diederik
On 7/22/07, Benjamin Esham <bdesham@...155...> wrote:
Just draw a star with star tool and position your path at the tips.
If you
need absolute precision, you can turn on snapping to object paths
and snap
them exactly to the star tips.
Thanks for the replies! My problem is that I need to align the *center* of each path to the points of the star. Since there is not necessarily a node at the exact center of each path, I don't think the snapping approach will work.
bulia byak wrote:
Actually, it should snap the object's rotation center (which you can place anywhere you want) as you drag the object. Diederik, what do you think? I was under the impression that it already does, but looks like it's not, so this needs to be enabled.
well... if you start with a STAR... using the star drawing tool... you can draw in five lines, one from each point of the star, to the opposite inward angle vertex... and you'll have five lines intersecting at the center of that star, which you can then erase. That should give you a start.
Benjamin Esham wrote:
Hello all,
I am trying to align five paths so that the center of each is located on a vertex of a regular pentagon (or, equivalently, the point of a five-pointed star). The paths are all different sizes. Does anyone know of a way to do this?
Thanks a lot,
Benjamin D. Esham E-mail/Jabber: bdesham@...155... | AIM bdesham128 | PGP D676BB9A "It is the unknown we fear when we look upon death and darkness, nothing more." — Albus Dumbledore in HBP
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
participants (5)
-
Aaron Digulla
-
Benjamin Esham
-
bulia byak
-
Diederik van Lierop
-
stuseven