complicated reflection -- 2 problems

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:

complicated reflection -- 2 problems

Postby brynn » Sat Jun 25, 2011 9:54 am

Hi Friends,
I'm drawing a picture of a book, with about 1.5 inch spine, with a title printed on the spine. The spine is at roughly a 45 degree angle to me...to the horizon, so that it is easily readable. The book is on a reflective surface, so that part of the title on the spine is reflected. I used the Envelope Deformation LPE to create simple perspective for the text (title). I understand that the Envelope Deform LPE is not the same as using the Perspective extension, but it does the job in this case.

However, I'm stumped on the reflection, and think one or both problems might be solved by using the Perspective extension instead. I'm not sure though, and hope you wise Inkscapers can help explain things :D

I was hoping I could use the same text by duplicating the title, but simply flipping the text vertically, while it does make the text upside-down, also makes it at a roughly 45 degrees to the horizon, in the opposite direction. This is along the line of text.....I might have to make some screenshots. I can rotate it around to where I lies along the same angle as the original, but then it's at the wrong angle along the height of the text.

The other problem is that not all of the text needs to be reflected. It would take too long to explain why, and the why doesn't matter. But I only need around half of the title to be reflected. So I thought I would just delete what I don't need. The only way I can do that, is to select each letter with the Node tool, switch to Selection tool, and delete. I'm not sure why that's the only way to do it, but it probably has something to do with having used the Envelope Deform LPE. Anyway, that's what I did. But as soon as I move it, the remaining text jumps to almost twice its original size.

The original title along the spine lies on 2 lines of text. One word on the first line and the other word on the 2nd line. I deleted the first word, letter by letter, and the 2nd word still looked fine. But then when I moved the 2nd remaining word, it became what was the original size of both words. I'm pretty sure this also is related to having used the Envelope Deform LPE. I'm guessing that the deformation I applied to the 2 words, now applies to only one word, and thereby makes it bigger. Is that what's happening?

I'm pretty sure I'm gonna have to create a 2nd set of text for the reflection, rather than using a duplicate of the original. But if anyone can think of a way to use the original, I would definitly be interested to hear/read it :D

I'll make a simple sample file to clarify and illustrate the reflection problems, and attach it as soon as I can draw it.

Thanks for your help :D

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

Re: complicated reflection -- 2 problems

Postby brynn » Sat Jun 25, 2011 11:31 am

Ok, well I've solved both problems, as well as a previous related problem from 2 weeks ago!

Here's a link to the older one, and I'll explain why it solved these problems, although you probably can figure it out without my explanation.
viewtopic.php?f=5&t=9604

First, just for a learning experience for anyone who might be interested, here's the screenshot, and I'll attach a file below.

persptext.PNG
persptext.PNG (16.07 KiB) Viewed 3616 times


On the left shows a duplicate of the title flipped vertically (wrong angle along the line of the text). On the right, I've rotated it to fall along the same (similar) angle. But now along the height of the text, it's nearly at a right angle to the original, where it should be straight up and down (or close to it). I think if I were further away from the model book, it would appear at nearly the right angle to the original. But as I am right beside it, the reflection is almost identical, just upside-down. (Although I'm not positive about that explanation. Something about the near right-angle doesn't look wrong, but I'm looking right at the model and its reflection, so I can't argue with my eyes!)

Now after learning that I can apply Object to Path (after the applying the LPE and without affecting it adversely), I can select and rotate the individual letters, to where they're more like the original!

As for solving the 2nd problem, it's quite obvious, that now I can select and delete individual letters, without affecting the deformation, because they no longer are
"live", but unique regular paths!

Well, thanks for being there, even though I found a workable solution. If there would be some way to achieve this reflection with the original live-deformed path, it would still make a nice lesson to learn :D

persptext.svg
(153.2 KiB) Downloaded 179 times

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

Re: complicated reflection -- 2 problems

Postby druban » Sat Jun 25, 2011 12:32 pm

Hi Brynn, you should be using skew, not rotate, to preserve the vanishing point congruence of original and reflection, i.e. the two should have the same vp.
also, not to be nitpicky, but while the envelope extension is often close enough for most purposes, in cases like this, where you have several objects of the same size (letters bricks, etc) you don't really want the farthest to be the same width as the nearest, even though the height is scaled by the extension...
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: complicated reflection -- 2 problems

Postby brynn » Sat Jun 25, 2011 1:33 pm

Oh Image
Yeah, I just realized that actually Object to Path is not going to solve the 1st problem. If I duplicate, flip, rotate all the letters, then ungroup and rotate individually, the baseline of each character will be along the wrong angle.

persptext2.PNG
persptext2.PNG (32.8 KiB) Viewed 3601 times


The 'E' is upside-down, and straight up and down like it should. But you can see that the baseline is in the wrong direction. I think I'm going to have to use the live deformation (or perspective extension) separately for the reflected text. Unless anyone can come up with another solution?

thanks druban, I'll give it a try :D

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

Re: complicated reflection -- 2 problems

Postby druban » Sat Jun 25, 2011 2:03 pm

How about this?
rect61221.png
rect61221.png (117.42 KiB) Viewed 3597 times


And with some fiddly bits added:
book.png
book.png (119.96 KiB) Viewed 3577 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: complicated reflection -- 2 problems

Postby brynn » Sat Jun 25, 2011 8:34 pm

Wow, that's some nice work!
You've accomplished in a couple of hours, what I've already been working on for weeks :oops:

I didn't use the 3D box, because a while ago I was playing with it, and got it all out of whack, and now I can't get it back to anything resembling a default configuration. Every time I get it to look something close to appropriate, I move one handle, and it's completely whacko again! But I understand basic geometry quite well, and it wasn't very hard to draw.....except the perspective has been troubling. I've been trying to develop some skills as an artist, though, and have been hoping I could improve in that area, by drawing it just by finding a visiual balance. I do wish I could make the 3D box tool behave though....

Sigh! Image At my age, I will probably never become an artist, but I do hope trying is keeping my brain active, and staving off cognitive dyfunction, or worse, dementia. :lol: Plus, a body can't do without a good sense of humor Image

Anyway, thanks. I will definitely try the skewing, the next time I work on it :D

EDIT
Ok wait, I didn't understand this:
also, not to be nitpicky, but while the envelope extension is often close enough for most purposes, in cases like this, where you have several objects of the same size (letters bricks, etc) you don't really want the farthest to be the same width as the nearest, even though the height is scaled by the extension...

"....the farthest to be the same width as the nearest...." farthest and nearest "what"?

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: complicated reflection -- 2 problems

Postby prkos » Sat Jun 25, 2011 8:41 pm

Druban that is awesome!

Brynn try creating the box in the middle of the page to get a nice box perspective. The control points lie at the middle of the page sides, that's why you can get weird results when drawing outside of the page. You can always move the box to the place where you want it after you'd created it inside the page.
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

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: complicated reflection -- 2 problems

Postby flamingolady » Sun Jun 26, 2011 2:25 am

druban, nice job.
I'm having some issues with the flip and perspective on text too. Would love to follow a tut on the text manipulation.

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

Re: complicated reflection -- 2 problems

Postby druban » Sun Jun 26, 2011 6:22 am

brynn wrote:"....the farthest to be the same width as the nearest...." farthest and nearest "what"?

What I meant was that the envelope extension will scale the letters vertically to the right height, more or less, so the illusion that the height of things gets smaller as they get farther away will be preserved. But the width of things also shrinks with distance, and only the perspective extension calculates this. So a letter M for example will shrink in height AND get narrower as it recedes.
Here's a picture(worth a thousand words, perhaps):
Pathversusenvelope.png
Pathversusenvelope.png (92.57 KiB) Viewed 3529 times

Note the guide lines showing the width variation!

flamingolady wrote:druban, nice job.
I'm having some issues with the flip and perspective on text too. Would love to follow a tut on the text manipulation.

I am not sure if Text is supposed to be handled by the extensions, but I have always converted to paths before running any extension on text (except for the text extensions, natch.) There is also an issue with the paths from text being grouped after conversion, so if you moved it the transform is stored and the results are not optimal. Ungroup and regroup to fix this.

prkos wrote:Druban that is awesome!


Thanks, Prkos! It was fun and easy ... except for the fadeout part ... :|
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: complicated reflection -- 2 problems

Postby brynn » Sun Jun 26, 2011 9:43 am

But the width of things also shrinks with distance, and only the perspective extension calculates this.

Ooooohh, I see!! I never noticed (or learned) that before about perspective. Things get smaller in all dimensions, with distance, not just height! Yeah, that really makes sense, and I can see it now.

Well, I will just have to re-do my text. Now that I see it....I can't un-see or un-know it, lol!
Too bad there's not a LPE for perspective though. That extension has provided much frustration for me in the past.

I don't think I'll re-do the main book with the 3d box tool though, because that would be essentially starting over. But the next time I need such perspective, I'll try to get my 3D Box tool fixed. Yes, prkos, I'm drawing it right in the middle of a page. I did learn that having it off to the side can do funky things. But it's doing funky things right in the middle. Hhhm....I'm not sure if you open the file I provided above, if it will show the 3D Box tool as I experience it. I think your own prefs would take control when you open it, right? Maybe I'll have to delete the prefs file before my next upgrade, to get it back to default.

dee, I wouldn't mind writing a tutorial, once I finish my image. Goodness knows I should have the process down pat by then, lol! Although I would probably ask druban to proof it, if I did :D

Hhhhhhmmmm.....actually I'm having 2nd thoughts about the 3D Box.....maybe I will.....well, at least I might learn how close my "visual balance" came to the real perspective, even if I don't change the book. If it's only going to take a couple of tweaks, yes, maybe I will. What the heck, after all, the main reason I'm doing it is to learn :lol: 8-)

Anyway, thank you so much druban, prkos, and dee. I really appreciate your comments!
And especially nice illustrations, druban, thanks again Image

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

Re: complicated reflection -- 2 problems

Postby brynn » Sun Jun 26, 2011 12:56 pm

Well, as I feared, I can't get the Perspective extension to work right. Here's a screenshot, and I can provide the file itself if necessary.

persptext3.PNG
persptext3.PNG (9.37 KiB) Viewed 3509 times


The original text bottom left, converted using Object to Path. The perspective path in blue, with first node highlighted -- bottom left per instructions, then clockwise to top left, top right, bottom right, and back to bottom left. Select text/path/group first, select blue perspective path 2nd. Then Extensions > Modify Path > Perspective.

And you can see the result. It doesn't fit inside the quadrilateral. Isn't it supposed to?
It takes a longer than expected time to complete. I did expect it would take several seconds, maybe a minute or 2, but it takes like 5 minutes, and Windows 7 actually gives me a message box that says Inkscape has stopped working, and giving options to close or search for solution. I just close the message box and let Inkscape keep working. Over the 5 or more minutes, this happens twice (in the image I'm working on this is the scenario; but in this simple sample file, it still takes close to 5 minutes, but doesn't get the "stopped working" error).

I've read this: http://tavmjong.free.fr/INKSCAPE/MANUAL ... erspective 3 times, and still can't see any reason why it's not working right.

What am I missing?? Do you all have any ideas or tips?
Thanks again.

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

Re: complicated reflection -- 2 problems

Postby druban » Sun Jun 26, 2011 1:29 pm

check in the xml to see if the text group has a transform attribute. if it does then delete it and try again.
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: complicated reflection -- 2 problems

Postby brynn » Sun Jun 26, 2011 2:44 pm

This is a transform attribute?

"transform:
translate(12,-420)"

So I should not copy the same text again, but type some new text, right?
Oky-doke :D

Thanks again.

EDIT #1
Ok, not so simple. When I type new text, it also has a transform attribute. I suppose it would be too easy to just delete that attribute?
So maybe type it in a clean, fresh doc and copy it over to the image doc?

EDIT #2
Well, I can't say I understand this. The newly typed text has a transform attribute, as does new text in a new fresh doc. But somehow the newly typed text DOES behave properly for the Perspective extension! I know this is a well known bug that I've run into before, but is this consistent with that bug, that sometimes the transform attribute causes a problem and sometimes it doesn't??

Well, in any case, I think I'm good to go with this. Thank you all again for your help :D


Return to “Help with using Inkscape”