Graphics – MGP – Create a profile

10 05 2010

The first thing we need to create our melting glass is … a glass … and the easiest way to get this is to use a Surface of Revolution with a profile curve. I don’t really intend to go into heaps of detail about this but basically you get a curve and rotate it around an axis, creating a surface. If anyone is interested the wikipedia article can be found over here: Surface of Revolution

To make the profile curve I used Adobe Illustrator and just drew what I thought looked like half the cross-section of a glass. The only limitation here is that to get a profile we can use one has to use the curve function. The image below shows the profile I drew:

The Profile Curve

By then opening the Illustrator file in a text editor we can find the bit we are looking for which, for the profile above, looks like this:

0.50 158.14 m
0.50 158.14 2.33 38.16 0.83 36.50 c
1.67 35.16 14.83 62.99 15.16 78.66 c
15.31 85.59 12.50 130.14 30.00 137.64 c
36.37 140.37 76.12 143.63 125.47 145.85 c
157.28 147.29 193.07 148.29 226.47 148.44 c
283.60 148.70 333.72 146.46 344.96 139.64 c
360.48 130.22 370.78 98.65 386.59 69.85 c
399.29 46.70 415.56 25.34 440.94 18.66 c
464.22 12.53 498.01 8.23 530.38 5.36 c
577.27 1.19 626.42 -0.92 626.42 6.50 c
626.42 10.83 577.96 12.20 532.32 16.33 c
488.25 20.31 443.14 25.75 432.95 32.66 c
416.74 43.63 387.09 90.07 387.02 90.53 c
386.95 90.99 367.43 137.96 366.95 158.48 c

What this is is the postscript description of the profile we made. You can read & understand this in the following way:

A line ending in:

  • m moves the pen to that location
  • c creates a curve using the current location and 3 points defined on the same line. The pen ends up at the last point

Of course this is all well and good but for our purposes we would much rather have these as sets of curves. So with a bit of re-arranging we have this:

0.50 158.14 0.50 158.14 2.33 38.16 0.83 36.50
0.83 36.50 1.67 35.16 14.83 62.99 15.16 78.66
15.16 78.66 15.31 85.59 12.50 130.14 30.00 137.64
30.00 137.64 36.37 140.37 76.12 143.63 125.47 145.85
125.47 145.85 157.28 147.29 193.07 148.29 226.47 148.44
226.47 148.44 283.60 148.70 333.72 146.46 344.96 139.64
344.96 139.64 360.48 130.22 370.78 98.65 386.59 69.85
386.59 69.85 399.29 46.70 415.56 25.34 440.94 18.66
440.94 18.66 464.22 12.53 498.01 8.23 530.38 5.36
530.38 5.36 577.27 1.19 626.42 -0.92 626.42 6.50
626.42 6.50 626.42 10.83 577.96 12.20 532.32 16.33
532.32 16.33 488.25 20.31 443.14 25.75 432.95 32.66
432.95 32.66 416.74 43.63 387.09 90.07 387.02 90.53
387.02 90.53 386.95 90.99 367.43 137.96 366.95 158.48

Each line of the above output defines a single ‘order-4’ bezier curve. And each curve is designed to flow into the next to create the profile we drew in Illustrator. With this information we can programatically recreate the curve and from there the surface of the wine glass… which is a job for next time.

NB: Unfortunately you can’t use these points because they aren’t normalized properly. If you do want to then each ‘y’ var needs to be made y = 160-y

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: