question about Perspective extension

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:

question about Perspective extension

Postby brynn » Sun Oct 14, 2012 9:00 pm

Hi Friends,
I'm working (still) on drawing a to-scale realistic image of a bookcase. I'm using the 3D Box tool, and also using faces of a 3D box as my quadrilateral path for use with Perspective extension. I keep noticing that objects made with the extension are fractions of pixels off from the to-scale dimensions of the bookcase. After some investigation, I see that the objects created with the extension fit inside the quadrilateral path.

Here is the scale drawing of the front base of the bookcase (on top) and the quadrilateral path in blue (bottom), along with the result of the exension:
Image

Here you can see that the corner nodes of the result of the extension are slightly inset from the corner node of the quadrilateral path:

Image

My question is how does Inkscape know or calculate how much to inset the result? Why doesn't it put the result on top of the q-path, instead of inside the q-path? Or in other words, is there any way for me to calculate how much larger to make the result, so that the corner nodes of the bookcase piece lie precisely where the nodes of the quadrilateral path lie? If I make the quadrilateral path 0.001 px wide, will the result be placed as close as possible to the actual path? Or what if I make the q-path 0 px wide (although I realize....well, I'm not sure if it will be tricky to select, or unselectable)? Or is the inset amount not related to the stroke width? Is there any way to make the result the same size as the q-path?

Thanks for your help :D

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

Re: question about Perspective extension

Postby druban » Mon Oct 15, 2012 2:59 pm

Try removing all the strokes from the paths that you are modifying, and see if that changes the result.
In my experience, even one stroked path will introduce a misalignment, large or small, proportional to the stroke width, into the outcome.
I don't believe that the control quadrilateral's stroke status makes a difference, but i generally don't have it stroked anyway.
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: question about Perspective extension

Postby brynn » Mon Oct 15, 2012 7:26 pm

Thanks druban. I'll give it a try here in a few minutes. I'll report results :D

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

Re: question about Perspective extension

Postby brynn » Tue Oct 16, 2012 4:24 am

Ok, I've tried removing the stroke from the path I'm putting into perspective, but then the extension won't work at all. After I click OK on the dialog, there's a brief pause, and then the path disappears. Status bar says "No objects selected". I also tried removing the stroke from the quadrilateral path. In that case, after I click OK, both the path to be put into perspective AND the quadrilateral path disappear. Status bar says "No objects selected".

Whoops! Hhmmm, I'm not sure why, but it seems the 3rd time was the charm. If I add a fill and remove the stroke of the path to which I'm applying the perspective, I get the nodes of both paths in alignment. But if I add a fill and remove the stroke of the quadrilateral path, it doesn't have any effect, and the nodes are no more aligned than without the fill.

I surely don't understand this though. I don't see why not having a stroke should affect the result of the extension.

Well anyway, thanks druban :D

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

Re: question about Perspective extension

Postby druban » Tue Oct 16, 2012 1:50 pm

brynn wrote:If I add a fill and remove the stroke of the path to which I'm applying the perspective, I get the nodes of both paths in alignment. But if I add a fill and remove the stroke of the quadrilateral path, it doesn't have any effect, and the nodes are no more aligned than without the fill.

That's why i said
druban wrote:I don't believe that the control quadrilateral's stroke status makes a difference
Sorry i didn't specify that you should fill the object instead, not leave it w/o stroke or fill, if that's what you did...
brynn wrote:I surely don't understand this though. I don't see why not having a stroke should affect the result of the extension.

One possible reason is that it might use the visual bounding box, and this would account for the size of the stroke being a factor.
In any case it makes no sense to have a stroke on an object to be perspective transformed (from a rendering point of view) because the stroke would need to be gradually tapered into the distance, and that capability is still quite nascent in Inkscape. If this effect is desired the stroke has to be converted to a path first.
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: question about Perspective extension

Postby brynn » Wed Oct 17, 2012 1:55 am

druban wrote:
brynn wrote:If I add a fill and remove the stroke of the path to which I'm applying the perspective, I get the nodes of both paths in alignment. But if I add a fill and remove the stroke of the quadrilateral path, it doesn't have any effect, and the nodes are no more aligned than without the fill.

That's why i said
druban wrote:I don't believe that the control quadrilateral's stroke status makes a difference

But then you said
druban wrote:...but i generally don't have it stroked anyway.

So I thought I would try it with a fill but no stroke. But it didn't help with the problem. You really draw the quadrilateral path, then add a fill and remove the stroke? If it doesn't make any difference to the result, isn't that a lot of extra work? I don't mean to be critical at all. I'm just curious about the benefits of this kind of workflow.

druban wrote:Sorry i didn't specify that you should fill the object instead, not leave it w/o stroke or fill, if that's what you did...

No, I used a fill but no stroke. Otherwise, it would be really tricky to select an object with no fill or stroke, as the 2nd selection. If it were the first selection, you could use Tab to select it. But since you have to select the object first, I don't even know how to select the quadrilateral path, if it has no stroke or fill, as the 2nd in a multiple selection. Actually, I don't think it's possible.

druban wrote:
brynn wrote:I surely don't understand this though. I don't see why not having a stroke should affect the result of the extension.

One possible reason is that it might use the visual bounding box, and this would account for the size of the stroke being a factor.

Hhmm....well, that does make some sense to me. But if the extension only recognizes the bounding box, how does it move the nodes and have them aligned to the quadrilateral shape. I'm starting to wonder if this might be a bug or bug-related???

druban wrote:In any case it makes no sense to have a stroke on an object to be perspective transformed (from a rendering point of view) because the stroke would need to be gradually tapered into the distance, and that capability is still quite nascent in Inkscape. If this effect is desired the stroke has to be converted to a path first.


I tend to use strokes like a pen or pencil to make a line drawing. The stroke will never be part of the finished work, but it helps me to visualize the various objects, and general structure of the drawing, until I'm ready to add the coloring. No, I never expected the stroke itself to be perspectivized. But I didn't expect that having a stroke would cause this inset issue either.

Anyway, thanks for your help -- the problem is solved :D

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

Re: question about Perspective extension

Postby druban » Wed Oct 17, 2012 12:37 pm

brynn wrote:You really draw the quadrilateral path, then add a fill and remove the stroke?

No.
I'm sure you know that the Bezier tool can use its own style or take the style last used, even if that style doesn't have a stroke?
brynn wrote:But since you have to select the object first, I don't even know how to select the quadrilateral path, if it has no stroke or fill, as the 2nd in a multiple selection. Actually, I don't think it's possible.

Working in outline mode makes a lot of things possible. I don't suppose you use this mode at all, but i frequently do. I find it convenient to leave paths unstroked and unfilled if they are just working objects to be deleted later ... sort of like custom guides.
brynn wrote:But if the extension only recognizes the bounding box...

Why 'only'? In fact I have no idea if this is the reason but there's no rule that says it can't use bounding box size as well as node data; in fact it would make things quite a bit easier to use both; transform the bounding box and then calculate proportional transformations for each node relative to the four corners of the bounding box, pre and post transform. Not saying that's the algorithm they used...

Glad you have your problem solved!
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: question about Perspective extension

Postby brynn » Wed Oct 17, 2012 1:12 pm

I hope I wasn't too intrusive by asking about that. It's really things like this that help me to learn and grow my Inkscape skills. For instance, it kind of blows my mind to think of using the Pen tool with no stroke (and fill only)! Oooh yes, outline mode. It sounds like you might use outline mode, almost in the way that I use the Pen itself. Very interesting! I do use outline mode from time to time, but certainly could probably benefit by using it more. "Why 'only'?" Because of my technical naivety. Actually the manual does say both. :D

Thanks for taking the time -- it's much appreciated!


Return to “Help with using Inkscape”