darcshadow

Distortion Correction on Cup

Recommended Posts

I know how to account for the cone shape of a cup to get the image to go straight, my question is does anyone have a formula that accounts for how the image looks  on the vertical curve. For example, if you place a square on a cylinder and then look at it straight on, depending on the radius of the cylinder and the size of the square, it will look like a rectangle. It will appear to be taller than wide. Anyone have a calculation to compensate for this?

Share this post


Link to post
Share on other sites

ohh that makes my head hurt - you need sheldon cooper for sure for that equation :huh:

wish I had the answer for you though

 

Share this post


Link to post
Share on other sites

After a bit more thinking I don't think this is as complicated as I thought it might be. Dusting off my high school geometry I think the following will give the width you'd need to stretch an image to get it to appear at the correct aspect ratio.

Stretch Width = arcsin(image width/Diameter of cylinder)

Need to experiment, but I believe if I stretch the image as specified by the equation and then run it through the cone correction tool when applied to a glass it should be straight and have the desired appearance.

  • Like 2

Share this post


Link to post
Share on other sites

I generally just wrap a piece of copy paper around the thing and then draw a line where I want it to be straight. Unwrap and voila you have something you can scan in and use to warp/bend your text or graphic to meet the curve. sometimes takes some tweaking if there are compound curves. Every cup is different it seems. 

  • Like 2

Share this post


Link to post
Share on other sites

Getting is straight isn't my problem, The pattern along path in Inkscape takes care of that for me. The problem is say a 3" square when applied to a cylinder will not appear to be 3" wide anymore because of the curve, it'll appear to be slightly less. So you either have to make the image shorter or wider to keep the original aspect ratio. This is not usually an issue for most designs but I have one that is, at least it is to me, because I have noticed it, and now every time I look at it I see it.

Share this post


Link to post
Share on other sites

If you draw a straight line on that piece of paper and then unwrap it you will have the curve you are looking for. 

Share this post


Link to post
Share on other sites

I normally stretch the image about 10% to make it look right.  

I've never bothered to find a formula.   Just guess.    It's all an optical illusion anyway.  

Share this post


Link to post
Share on other sites

Wildgoose, I don't think we're talking about the same thing. Here's a diagram. In order to get the red square to appear square on the cylinder, it will need to be stretched to the size of the blue rectangle.

Capture.JPG

 

Go-C, after doing the math, 10% is pretty close to what the math comes back with. It'll vary some depending on size of cup/cylinder and size of image but 10% is a good ballpark.

After some more thinking I think I decided I want to shrink the height rather than change to width so here is my new equation.

H = h/w*D*sin(w/D)

  • h - height of image
  • w - width of image
  • D - diameter of cup
  • H - new height for image
  • Like 1

Share this post


Link to post
Share on other sites

Wild guess here.

Blue minus red = a

blue plus a = what you want.

Just a wild guess like I said. If it works, let me know.

 

Share this post


Link to post
Share on other sites

That'll get you close, but not exact, and there's the question of not knowing both blue and red, you only know one or the other. I edited my previous post so you might have missed my equation that I came up with.

Share this post


Link to post
Share on other sites

My way would be hold a string across for the red and measure that. I know, very accurate.

Share this post


Link to post
Share on other sites

A string and straight edge would work. Lay the straight edge across the top of the cup and set it for the width of your image, then take the string and wrap it around the cup to get the length of the arc. Then just stretch the image out to the length of the arc. That should work, I like knowing the math as well.

Share this post


Link to post
Share on other sites

It may actually be twice the difference. Not sure.

Draw on paper, cut it out and have a look.

if blue = a

red =b

difference =c

a-b=d

c x 2 + a   should be the answer. Unless it is not   d x 2. then just c + a.

Stretch proportionately to keep size.

Share this post


Link to post
Share on other sites

This only accounts for the cone shape and getting the design to be straight, does not account for the perceived width verses actual width of the image.

Share this post


Link to post
Share on other sites

Come to think about it, there is a lot more involved.

Not only does it look out of square, but it is also going to look shorter at the end of the square. Top to bottom. Not much, but it is there.

Now I got ya thinking.

I don't know if there is any math that can cover that part.

How about a strait on pic and use vertical lines to measure the difference for the height and the other stuff for the width?

 

Share this post


Link to post
Share on other sites

Gotcha. You will also have some extra fun if the glass tapers as it goes down. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now