Inkscape 0.48+devel r9931
OS: WIndows XP sp2
The atached screen shot shows a triangle that is zoomed into. It also shows that the bounding box doesn't really match the uttermost edges of the triangle. A result of this is that the Align fuctions doesn't work properly on this object.
Is there any way to get around this issue If I want to perfectly align the edges to another object (straight orthogonal line) without changing (destroy) the edges (milter limit) of the triangle?
Sharp triangle - bounding boxes doesn't match real edges
Sharp triangle - bounding boxes doesn't match real edges
- Attachments
-
- Inkscape_boundingBoxTriangle.png (12.22 KiB) Viewed 3427 times

Re: Sharp triangle - bounding boxes doesn't match real edges
Looks like a known bug. visual bounding box is being calculated assuming a round join rather than a miter join.
There is this closed one: https://bugs.launchpad.net/inkscape/+bug/166659 which fixes the issue, but only for exporting pngs. In that bug report it states:
Which is why the displayed bounding box doesn't do this.
I also found this one: https://bugs.launchpad.net/inkscape/+bug/473608 which seems to capture your issue.
-Rob A>
There is this closed one: https://bugs.launchpad.net/inkscape/+bug/166659 which fixes the issue, but only for exporting pngs. In that bug report it states:
Calculating correct bbox for stroked paths is very very
expensive. It's difficult to implement and will slow the
program down a lot. I can only hope Cairo will be able to
help this somewhat.
Which is why the displayed bounding box doesn't do this.
I also found this one: https://bugs.launchpad.net/inkscape/+bug/473608 which seems to capture your issue.
-Rob A>
Re: Sharp triangle - bounding boxes doesn't match real edges
I had asked a similar question on the 'inkscape-devel' mailing list after the bounding box calculation for bitmap export was improved earlier this year:
You could file a feature request to use the same improved (more precise) bounding box (from exporting to bitmap) also when aligning objects with the 'Align and Distribute' dialog.
Note that the dialog has another limitation which can be as annoying: Inkscape knows two bounding box modes (Visual: includes the stroke width, and Geometric: only include the centerline geometry). Most commands respect the user setting which bounding box to use, the 'Align and Stroke' dialog however always uses the visual bounding box (ignoring the user setting in 'Inkscape Preferences > Tools > Bounding box to use').
(Discussed earlier in Bug #473608 “Aligning stroked and strokeless items & bounding box issues”)
> What is strange now imho: when resizing the page to
> selection, the bounding box of the selected object is smaller
> than the resized page margin (seen with both test cases of
> bug #479964 and #186182) -> does the command (button label)
> need to be rephrased or will the selection bounding box also
> be changed to include long miters / stroke endcaps?
The shown selection bounding box (the dashed rectangle) will not include
stroke endcaps and stuff. Calculating the precise bbox is expensive and
I think should only be done for action that require the precision, and
not for interactive things like the selection cue.
You could file a feature request to use the same improved (more precise) bounding box (from exporting to bitmap) also when aligning objects with the 'Align and Distribute' dialog.
Note that the dialog has another limitation which can be as annoying: Inkscape knows two bounding box modes (Visual: includes the stroke width, and Geometric: only include the centerline geometry). Most commands respect the user setting which bounding box to use, the 'Align and Stroke' dialog however always uses the visual bounding box (ignoring the user setting in 'Inkscape Preferences > Tools > Bounding box to use').
(Discussed earlier in Bug #473608 “Aligning stroked and strokeless items & bounding box issues”)
Re: Sharp triangle - bounding boxes doesn't match real edges
Hi.
I found a pretty simple workaround. Just make a triangle where Stroke Width is zeero or very thin compared to object size.
If I had any programming skills I would have found the positions to bounding boxes by threating the rectangle as a simple triangle, not conserning about Stroke issues. I cannot imagine that would be that difficult.
Thanks
I found a pretty simple workaround. Just make a triangle where Stroke Width is zeero or very thin compared to object size.
If I had any programming skills I would have found the positions to bounding boxes by threating the rectangle as a simple triangle, not conserning about Stroke issues. I cannot imagine that would be that difficult.
Thanks

Re: Sharp triangle - bounding boxes doesn't match real edges
You've probably already thought about this, but just in case -- visual vs geometric bounding box....?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Sharp triangle - bounding boxes doesn't match real edges
Yes, it's mentioned before in this thread. But that is not the solution for me.brynn wrote:You've probably already thought about this, but just in case -- visual vs geometric bounding box....?
As long I only create custom arrowheads that is without stroke, I'm just fine


Re: Sharp triangle - bounding boxes doesn't match real edges
Does increasing the Miter limit help?
just hand over the chocolate and nobody gets hurt
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download
Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download
Re: Sharp triangle - bounding boxes doesn't match real edges
No, it doesn't.prkos wrote:Does increasing the Miter limit help?

Re: Sharp triangle - bounding boxes doesn't match real edges
Grobe wrote:No, it doesn't.prkos wrote:Does increasing the Miter limit help?
..because it assumes rounded corners (for speed) when calculating the visual bounding box. The miters are completely ignored.
-Rob A>