predictable geometry on an egg

214 views
Skip to first unread message

John D

unread,
Jan 10, 2011, 8:58:21 PM1/10/11
to EggBotUser
I have seen geometric designs nicely printed on eggs. They were done
with the EggBot.

I'm having a bit of trouble with this on my bot. For example, I was
working on a design that involves simple circles that form a band
around the middle (the waist? the equator?) of the egg. The circles
are circles on the drawing, but ellipses when printed on the egg;
elongated vertically.

So, I guess my question is this: What are the factors that affect
distortion in printing on eggs? I'm looking for ways to get
predictable results.

Thanks,
John D

Chuck McManis

unread,
Jan 10, 2011, 9:14:31 PM1/10/11
to eggbo...@googlegroups.com
Hi John,

Eggs are taller than the are wide. Eggs are oblong. Drawings are "flat".

Inkscape drawings assumes that distances are equivalent, which is to say that moving "left" or "right" 10 steps is the same distance, regardless of where you are on the Egg, however as you can see that isn't the case.

Quite simply the diameter of the egg is smaller the more 'north' or 'south' of the equator (waist) you go, so a motion of 'x' steps in the X direction will not move as far 20 steps north of the equator as it does at the equator. The actual difference is x = distance(x) * (Radius(y)/Radius(equator)) (or in english, the distance 'x' that is travelled in one step is a function of where you are on the egg in the y direction. The distance is the ratio of the egg at point Y over the radius at the equator. We assume the equator is the widest point of the egg so all ratios will be <= 1.0.

You can 'pre-warp' your drawing to accomodate that and make the output look more like you expect.

The simplest is to assume that the egg is a sphere (this is wrong of course but its better than assuming its a flat sheet of paper) and using the cos(rads(y)) as the ratio (rads(y) is the y position converted into radians.

The next better approximation is to assume the egg is an ellipse and using the formula for an ellipse compute the distortion of x based on Y.

The best approximation is to model the egg as two half elliipses because the top or "pointy end" would have different parameters than the bottom or "roundy end".

To completely nail it one would have to first scan the egg in some way to determine its actual geometry and then use that information to create an inverse projection.

You will discover of course the same thing that map makers discovered which is that you can't really represent a round surface on a flat one. You have to cut it up some how. And conversely you can't really take something that looks good in the flat and then wrap it around a sphere and expect it to look the same.

--Chuck


--
You received this message because you are subscribed to the Google Groups "EggBotUser" group.
To post to this group, send email to eggbo...@googlegroups.com.
To unsubscribe from this group, send email to eggbotuser+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/eggbotuser?hl=en.


Dan Newman

unread,
Jan 10, 2011, 11:04:18 PM1/10/11
to eggbo...@googlegroups.com
> The simplest is to assume that the egg is a sphere (this is wrong of course
> but its better than assuming its a flat sheet of paper) and using the
> cos(rads(y)) as the ratio (rads(y) is the y position converted into radians.

This is what the "Stretch" extension does in the v2.1 Eggbot software
release. See

http://wiki.evilmadscience.com/Stretch

BTW, there's another distortion going on as well. Namely, eggs are longer
than they are wide. This also causes eggbot "pixels" to not be square on
eggs. (On spheres, you're okay -- they're square.)

When the egg motor rotates the egg 1 step, the surface distance covered
by the pen tip is shorter than when the pen motor moves the pen 1 step.
Put differently, the equatorial circumference of the egg is significantly
smaller than the polar circumference. Call the equatorial circumference
E and the polar circumference P. We know that E is considerably smaller
than P. (For a sphere E equals P.) Now, one egg motor step - one step
in the X direction - at the equator is E / 3200. But, one pen motor
step - one step in the Y direction - is P / 3200. So, the pixel at the
equator has width E/3200 and height P/3200. Since P > E, this pixel is
not square: it's rectangular.

To counter this distortion, stretching your entire picture horizontally by
around 140 to 150% is needed. I find that I use the Stretch extension first
to counter the distortion Chuck described AND then I do a further horizontal
stretch of 140 to 150% to deal with the pixels not being square.

Regards,
Dan

John D

unread,
Jan 11, 2011, 9:55:49 AM1/11/11
to EggBotUser
Uhhh, if you take a quick look at my website you'll see that I am an
artist. I became one of those reviled creatures of necessity because
I couldn't get anything but a barely passing grade in any course which
had numbers in it. You know; all those "ic" courses. Starting with
arithmetic and going all the way up to algebric and geometric. (I
never got as far as calculic) So, thank you for your reply but I'm
going to have to think about this for a while to try to figure out
which branch of the English language you're working with.
My immediate thought is that the stretching extension is ok if you are
working on one side of the egg, but I'm trying to work all the way
around the egg. Imagine a series of columns that lie vertically on
the egg then shift to tops of those columns right and shift the
bottoms of those columns left and you have a spiral effect. Exchange
one of those columns with a childs name and cut out a square in the
middle of each column and insert a band of circles in the interstices
such that the top of a column comes down and breaks off in the middle,
then "plop" there is a perfect circle" then the bottom of the column
continues to the south pole in it's sprially curving fashion.
Now, I used to do stuff like this by drawing a grid by hand and
painting it in by hand. I was hoping the eggbot would save me some
time. Now I'm going to have to take an evening course in celestial
navigation at the local community college just to come to grips with
getting this machine to draw a bunny. Oh Noes!
For examples, please see http://www.johndeckert.com/artist/eggbot.html

bruce shapiro

unread,
Jan 11, 2011, 10:26:10 AM1/11/11
to eggbo...@googlegroups.com
Hi John,

I'm a fellow artist, though my medium is motion control-- Eggbot
being my first "piece," twenty years ago. While my background
trained me in lots of "-ics" (including the Calculics), my favorite
by far is the bas-ic. I completely understand what you want to do
(thank you for providing links to pics!), and you definitely do not
want to use Dan's STRETCH extension for that. You are correct-- it's
for patterns that do not tile all the way round.

There are two distortions at play here-- but both are easy to
understand, and one is "correctable." The first comes from mapping a
rectangular drawing (on the Inkscape screen) to a spherical
geometry. Just as a grid of parallel vertical lines in Inkscape will
map to the egg like longitude lines on the globe (converging as they
approach the poles), all geometry gets crunched the more polar it
gets. This, as far as I'm concerned, is a plus for geometric designs
that seamlessly tile the egg. The most common question I hear: "how
did you figure out how to fit the drawing on the egg?" Of course, I
didn't. It's automatic-- a by product of the geometrical
transformation (done mechanically by Eggbot) from Cartesion (flat
X/Y) to spherical (lat/long). There's nothing you can do about this
distortion, with regard to tiling the egg. STRETCH attempts to
counter this distortion, but it cannot do it seamlessly all the way round.

The second distortion is really just an aspect ratio issue, and is
easy to correct-- that from the pen-axis's circumference being
greater than the motor-axis's in real eggs. Simply widen your
drawing by ~150% (less for rounder eggs, more for longer eggs), or if
you have, say, a repeated tiling pattern, that already fits
horizontally on your 3200 pixel wide Inkscape template, squash it
vertically ~67%. Try it with some simple shapes to convince yourself
how *basic* the cause and correction of this second distortion
is. The first time I discovered this was when I tried plotting faces
I had traced (using trace bitmap) on eggs. They had looked great on
bulbs, but on eggs looked way too skinny. What the?? Took me a good
while to grasp the simple reason.

b

Dan Newman

unread,
Jan 11, 2011, 11:59:11 AM1/11/11
to eggbo...@googlegroups.com

> There's nothing you can do about this distortion, with regard to tiling the egg.
> STRETCH attempts to counter this distortion, but it cannot do it seamlessly all the way round.

In general, I agree. If however, the goal is to have a column which spirals around the
egg and appears to have constant width, then what I would experiment with is the following:

1. Draw a vertical column.
2. Apply the "stretch" extension.
3. Skew (shear) the result to then get a column which spirals around the egg.

If, however, you want the columns to actually reach the poles, then the stretch extension
will not be useful. See the attached images for pictures of steps 1, 2, amd 3 applied
to a vertical column on the left and just steps 1 and 3 applied to the vertical column on
the right. The fourth and final image is the result drawn on an egg. The extension helps
to counter the pinching or tapering near the poles which occurs in the column's width.
What the extension does is somewhat off for an egg as the extension applies the math
applicable for a sphere and not for an egg. I could modify the extension to also support
eggs. (However, I first wanted to see just how useful the extension is to other people
before putting any further work into it.)

Regards,
Dan

1.png
2.png
3.png
4.png

Windell H. Oskay

unread,
Jan 11, 2011, 3:58:39 PM1/11/11
to eggbo...@googlegroups.com
Hi John,
While some of us are happy to volunteer detailed technical explanations,
you don't actually need anything past about fourth grade math class
(along with a little patience) to get a firm grasp on the issues here.
Please let me walk you through this. If anything here still feels like
"celestial navigation," please let me know, and I'll try to rephrase.


You wrote: "The circles are circles on the drawing, but ellipses when


printed on the egg; elongated vertically."

A good example of this would be the "Garish_overkill.svg" file from the
Eggbot example set. The band around the middle of the egg is made of
circles, but when we plot it, we get something like this:
http://www.flickr.com/photos/oskay/4820280418/

All of the "circles" that were drawn on the egg actually have plotted as
ellipses, elongated vertically.


Why is this? The core reason is that eggbot units-- as drawn on your
screen --refer to *angle,* not *distance* on the printed object.

In more detail: The units on the screen are such that 1 pixel up or down
corresponds to one step of one of the pen motor, where it takes 3200
steps to make a revolution. And 1 pixel left or right corresponds to one
step of one of the egg motor, where it takes 3200 steps to make one
complete revolution. If you remember (and here's the fourth grade part)
that there are 360 degrees in a circle, each pixel on the screen
corresponds to exactly 360/3200 = 0.1125 degrees of angle. For example,
800 pixels corresponds to 90 degrees of motion-- 1/4 of a full turn.


So how does the fact that the screen shows *angle,* not *distance* lead
to elongated circles on on eggs? This is a consequence of the fact that
larger circles have larger circumference (i.e., perimeter).

Let me elaborate. Suppose that you have a compass (the drawing kind, not
the directional kind) and are drawing some pencil arcs on a piece of
paper. You draw two 90-degree arcs (1/4 circle arcs) from the same
center point. You draw one of them with a radius (distance from pivot to
pencil tip) of one inch, and the other with a radius of two inches. Both
arcs span the same angle, 90 degrees. But the total length of the two
pencil marks is *very different*-- the arc that was drawn with the larger
radius is much longer.

Now suppose that you go back to the Eggbot, and you plot on two spherical
glass christmas ornaments: one with one inch radius (i.e., two inch
diameter) and the other with two inch radius (i.e, four inch diameter).
On each ornament, you draw a single straight black sharpie line along the
equator, but 800 pixels wide. Since 800 pixels corresponds to 90
degrees, each ball will have an arc drawn on its surface that covers 90
degrees.

Viewing each ornament along its poles (or using a flexible tape measure
or ruler), you would see that the arc lengths drawn on the ornaments are
exactly the same as those drawn with the compass on paper, and that's
because they are just the same type of thing: 1/4 circle arcs with radius
of one inch or two inches. These arcs are also fundamentally made in the
same way as the compass: The distance between the pivot (the axis that
the egg-motor turns along) and the pen tip is again one inch or two
inches, only this time it is the paper, not the compass, that moves in a
1/4 circle.


Now, suppose that you put the small ornament back in the Eggbot, and draw
a second 800 pixel wide line, but this time perpendicular to the equator
(i.e., along a longitude line, not along a latitude line). If you
checked with the tape measure, you would find that the two arcs on the
ornament are both the same length, because both of them are 1/4 circle
arcs with radius of one inch. This is again because we're essentially
doing the same thing as the compass: the distance between the pivot (the
axis that the *pen motor* turns along in this case) is one inch, so it's
exactly the same situation.

Likewise, if you repeated that procedure with the large ornament, you
would find that the two arcs on its surface are both the same length,
because both of them are 1/4 circle arcs with radius of two inches.


Finally, what if you want to draw on an egg-shaped object? The problem
is that there is no longer a single radius that defines the shape.
Instead, there are two effective radii (or radiuses if you prefer). These
effective radii are (as before) given by the distance between the pen tip
and the pivot point-- only this time, those two distances are *not the
same.*

Suppose that when the eggbot is set up correctly to draw on the object,
the distance from the egg-motor axis to the pen tip is one inch, and that
the distance from the pen-motor axis to the pen tip is two inches. In
that case, an 800 pixel wide line drawn horizontally-- where the radius
is smaller -- will give a much shorter line than an 800 pixel line drawn
vertically --where the radius is larger. The two different arc lengths
will be the same as the two different-radius arcs drawn with the compass,
because they are just the same thing: 1/4 circle arcs drawn with a radius
of one or two inches.


How do you correct for this particular sort of egg-borne distortion? As
Bruce points out, "just an aspect ratio issue, and is easy to correct."
Just stretch everything horizontally, or (for a wrap-around pattern like
mine) compress it vertically. Exactly how much to compress it can be
determined by measuring the two effective radii for your actual setup
(with the pen down!), and will actually depend on the particular egg.
Arc length is directly proportional to radius, so if you did have an egg
with twice the radius in one direction (like our hypothetical example),
you'd want your circles to be twice as wide as they are tall. For garden
variety chicken eggs, a ratio of about 2/3 as wide as tall is a good
starting point.

As far as the rest of the distortion, there are many possible sources.
Some can be due to misalignment in your Eggbot, and some are fundamental.

The big, "bad" one is that flat planes and curved surfaces are
fundamentally different beasts. There are hundreds of possible ways to
represent a map of the earth on a flat sheet of paper; there's a whole
science of "map projections" built around it. The particular projection
that we use is called the "equirectangular projection" -- which means
that flat distance units correspond to angles, as we've discussed. You
can read more about it here:

http://en.wikipedia.org/wiki/Equirectangular_projection

There is a graphic on that page that shows the sort of polar distortion
that comes from unwrapping a sphere onto a flat plane in this way:
http://en.wikipedia.org/wiki/File:Tissot_indicatrix_world_map_equirectangular_proj.svg

Dan's Stretch extension can compensate for this distortion for relatively
small objects-- for a single point of view -- and that's genuinely the
best that *can be done* if starting with a flat drawing. If you really
want to draw on a sphere without distortion, there's exactly one way to do
it, and that's to begin with your drawing on a sphere. For computer
graphics, that would mean a drawing program that represents your canvas,
as you draw, by a 3D sphere. Could be done, but it wouldn't be easy.

-Windell

John D

unread,
Jan 12, 2011, 1:56:57 AM1/12/11
to EggBotUser
I could run a bunch of tests and use up a bunch of eggs to answer
this, but maybe you guys already know the answer. Maybe you've
already answered it, I don't know. The question I have in my mind has
to do with how to place the egg under the pen arm.

Should the pen start out centered over the point of widest
circumference on the egg? Or should the pen start out in the middle
of the egg? On a sphere they would be the same location, on an egg not
so much.

If you've already answered this question, let me apologize right now.
You have all been very kind with my questions and very generous with
your time in explanations. Not only am I not so great with numbers,
but I'm not so great with words either and although your explanations
are quite thorough I'm sure, they are also a little daunting too.
Remember, you're dealing with an audience of one who is used to eye-
balling the center of an egg to mark it and then eye balling the
center of the remaining areas and marking those and then eye balling
the center of those and marking them. Voila! You've made a grid. No
numbers, no words. and no one, not even dummies, has any need to feel
like a dummy.

John D

unread,
Jan 12, 2011, 3:56:32 AM1/12/11
to EggBotUser
OK, so I measured the circumference of a goose egg at the top (of an
800 px drawing) as 4.5 inches.
I measured the distance from there to the largest circumference as
1.75 inches.
I measured the largest circumference as 8 inches.
I measured the distance from there to the circumference of the drawing
at the bottom of the egg as 1.25 inches.
I measured the circumference of the bottom of the drawing as 4.5
inches.

So now I have partial information that could lead me to an
understanding of the distortion of a grid on an egg.

Dan Newman

unread,
Jan 12, 2011, 11:37:28 AM1/12/11
to eggbo...@googlegroups.com
John,

If you're running v2.1 or later of the Eggbot extensions, then there's
a really easy answer. At the end of this message, I'll tell you how
to check the version if you are unsure.

Before plotting, make sure that the option "Start with pen centered"
is checked in the Eggbot Control extension. Look at the "Options"
tab. If it is not checked, then check it and click the "Apply"
button.

With "Start with pen centered", wherever you park the pen at the
start of your plot will correspond to the center of your Inkscape
drawing page (template if you prefer). So, the upper half of your
page will then be drawn above where the pen is parked and the lower
half of the page below.

In the above, I was careful to write "page" and not "drawing". If
all of your drawing is in the upper half of the page, then all of your
drawing will then be drawn above where the pen was parked. To get
the drawing centered, just center the drawing in the Inkscape page
and then "center" the pen over the egg at the point YOU envision
as being the center for your drawing on the egg.

Regards,
Dan

P.S. To check the Eggbot version, just pull up the Eggbot Control
extension. Click on that far right tab with " * " as its label.
The info shown by that tab includes the version number. It's probably
something like 2.1.4 which means that you have "2.1".

John D

unread,
Jan 12, 2011, 5:57:01 PM1/12/11
to EggBotUser
reference photos at this link: www.johnd.com/eggbot

I made a grid. In the drawing the grid forms cells of 100 px square.
On the egg, not so much. I made, in the top picture, perfect circles
using Illustrator’s ellipse tool. Each 100 px diameter.

I wanted to see how much vertical compression passes for a circle at
each range of longitude.(?)

I made duplicates of the circles, progressively copying and
compressing them by a consistent percentage.

This gave me a large range of elliptical shapes to select from. Hence
to determine, on my eggs, what degree of vertical compression passes
for a circle when printed on the egg. The row of ellipses most
resembling a circle when printed on the egg turns out to be 60%
vertical compression.

There’s a problem though. The first circle/ellipses are drawn
seamlessly. The subsequent circle/ellipses are drawn almost as though
they are a tightening spiral. You can see in the photographs that the
starting point of the drawn circle/ellipse does not meet up with the
ending point of same.

This happened in a previous attempt at this exercise and I though I
was being sloppy. So I went back and did that epoxy thing to my
bushings and shifted the frame so the egg was centered better. I also
double checked that the left side of the frame was tightened down on
the same markings as the right side of the frame. I also adjusted the
pen arm to make the pen sit exactly over the axis of rotation.

So what would cause this shift in rotation as a shape is being drawn?

Chuck McManis

unread,
Jan 12, 2011, 7:51:53 PM1/12/11
to eggbo...@googlegroups.com
So what would cause this shift in rotation as a shape is being drawn?

I have found two things that can cause this; one is that the there isn't enough delay in the 'pen up' so the egg starts moving before the pen has gone up, the other is that the egg slips on the headstock which messes up the alignment. Since your swirls are all along the same longitude I'm guessing pen delay isn't long enough.

--Chuck


Windell H. Oskay

unread,
Jan 13, 2011, 5:07:54 AM1/13/11
to eggbo...@googlegroups.com

On Jan 12, 2011, at 2:57 PM, John D wrote:
 
There’s a problem though.  The first circle/ellipses are drawn
seamlessly.  The subsequent circle/ellipses are drawn almost as though
they are a tightening spiral.  You can see in the photographs that the
starting point of the drawn circle/ellipse does not meet up with the
ending point of same.

This happened in a previous attempt at this exercise and I though I
was being sloppy.  So I went back and did that epoxy thing to my
bushings and shifted the frame so the egg was centered better.  I also
double checked that the left side of the frame was tightened down on
the same markings as the right side of the frame.  I also adjusted the
pen arm to make the pen sit exactly over the axis of rotation.

So what would cause this shift in rotation as a shape is being drawn?

It looks like you haven't made a consistent connection between the egg and the egg motor.  

There is both a "local" distortion, where the circles don't seem to meet (what we've referred to as "pseudo backlash") and a more subtle gradual loss of registration over the full rotation of the egg.  Both have the same root cause, which is that the egg can *twist* a fairly large amount with respect to the egg cups.  You should be able to significantly reduce that degree of twist.   

It may help to clean and dry the egg cups, and to increase the tension.  But the most important thing is to be able to *feel* that twist, and then to "wobble" the egg into place so that it makes a really firm contact with minimal twist.

John D

unread,
Jan 13, 2011, 2:52:13 PM1/13/11
to EggBotUser
Thank you once again for taking the time to answer my questions.

Reference is made to photos you can see at www.johnd.com/eggbot

You are exactly right. I re-plotted the circle/ellipse test with a
tighter set up. Before attempting this egg plot, I made two changes
in an attempt to correct the creep. I cleaned the egg holder cups and
applied a little UHU tac to each, making them super grippy. Then I
made certain there was plenty of tension holding the egg in place.
You can see the compression spring in one of the photos. Any further
and I worry I’d start breaking eggs.

Now the circle/ellipses don’t look like spirals (what you refer to as
"local" distortion). The best circle-looking-ellipse on my eggs comes
in at about 54% vertical compression. Which is to say that I make a
perfect circle and then squash it to 54% of its height. When printed,
it looks pretty much like a circle.

I then made another design, one element of which you see to the left
above. That same unit repeats around the egg. I call it surfboard
stars for lack of a better description, and it gives me a little
vocabulary to talk about each element. The star is 54% of its
original height and it comes out looking alright. So I’ve made some
progress there.

There still seems to be some rotational creep. Despite my efforts at
eliminating is. The result is that the stars no longer center on the
surfboards and the stripes no longer center on the stars.

All the surfboards printed first. Then all the stars. Then all the
stripes. I think I have to remake the original drawing so that each
unit, -- surfboard, star and stripe -- prints complete before moving
on to print the next unit.

Firdaus Dastoor

unread,
Jan 13, 2011, 4:18:39 PM1/13/11
to eggbo...@googlegroups.com
"All the surfboards printed first.  Then all the stars.  Then all the
stripes.  I think I have to remake the original drawing so that each
unit, -- surfboard, star and stripe -- prints complete before moving
on to print the next unit."

The above statement is intriguing to me. Other than drawing in separate layers - what other techniques are there that one can use to make the egg-bot plot in a particular order

Phil

Windell H. Oskay

unread,
Jan 13, 2011, 4:22:50 PM1/13/11
to eggbo...@googlegroups.com

> The above statement is intriguing to me. Other than drawing in separate
> layers - what other techniques are there that one can use to make the
> egg-bot plot in a particular order
>
> Phil

Within a layer, the Eggbot plots items "back to front" -- where items
drawn first are in the back, and items drawn subsequently are in front of
those. You can also ask Inkscape to move things forward or backward, as
needed.

Alternately, we have a "Reorder paths" extension that tries to re-order
items to reduce the amount of "air time" -- movement with the pen up.

John D

unread,
Jan 14, 2011, 1:12:40 AM1/14/11
to EggBotUser
Reference the photos at www.johnd.com/eggbot

Hey, this worked out pretty well! Not perfect, but I'm happy to have
some success after all this trying.

I’m going to fill it in by hand with watercolor and a brush just to
see how it might look.

I haven’t figured out yet how to put art on separate layers in
InkScape. (Anyone know of a good tutorial for layers? Or do I have to
buy the book?)

I do see how you can print layers separately in the Egg-Bot control
extension, so I know it’s possible.

Thanks for ALL the help from ALL you guys!

len...@oskay.net

unread,
Jan 14, 2011, 1:30:58 AM1/14/11
to eggbo...@googlegroups.com
As far as books go, I like this free one:
http://en.flossmanuals.net/Inkscape/

It has an entire section on layers:
http://en.flossmanuals.net/Inkscape/Layers

Best,
Lenore

John D

unread,
Jan 14, 2011, 11:36:41 PM1/14/11
to EggBotUser
Reference the photo at www.johnd.com/eggbot

Hand painted in watercolor.
A friend said it looks like toy trucks.
Perfect for a little boy at Easter, don't you think?

Thank you one and all for your help.
Reply all
Reply to author
Forward
0 new messages