Difference between revisions of "Stretch"

From Evil Mad Scientist Wiki
Jump to: navigation, search
Line 5: Line 5:
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-01.png
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-01.png
  
When you draw in Inkscape, you are working with a flat, two-dimensional drawing surface.  But, when you plot your drawing on an egg or other round object, you subject your drawing to a transformation which will change its appearance.  For example, a horizontal line in your Inkscape drawing will have the same physical length when printed on paper regardless of it's vertical height in your drawing.  That is not the case when you plot horizontal lines onto a sphere or egg.  Horizontal lines in Inkscape becomes lines of latitude on a sphereThe circumference of a line of latitude decreases as you approach the poles. To demonstrate this, draw a horizontal line at the mid-height of your drawing and then make a copy of that line but raise it vertically a quarter of the drawing's heightNow plot this on an egg or sphere.  The off equator line will be shorter in length then the equatorial line [1].
+
In Inkscape, your drawing is flat.  But, when you plot your drawing on a round object, you subject your drawing to a transformation which changes its appearance.  A horizontal line in your drawing will have the same physical length when printed on paper regardless of where that line appears in your drawing.  That is not the case when you plot horizontal lines onto a sphere or egg.  A horizontal line in drawing becomes a line of latitude when plotted with the EggbotMoving this horizontal line up or down in your drawing (away from the midline of the page) moves the corresponding line of latitude towards one egg pole or the other.  But, something happens to lines of latitude as they approach either pole: their circumference decreases. And, any line segment along a line of latitude decreases in length as the line of latitude approaches either pole [1]The result of this effect is that if you put two identically sized figures in your drawing, the resulting egg plot will produce them with different sizes if one of the figures is closer to the equator than the other.  The object closer to the equator be larger than the one closer to a pole.  This effect of shrinking near the poles can be annoying when, for example, plotting several lines of text.  It can cause geometric object to appear bloated near the equator and shrunken near the poles.
  
This effect of shrinking near the poles can be annoying when, for example, plotting several lines of text.  It can cause geometric object to appear bloated near the equator and shrunken near the poles.  To combat this, it is possible to horizontally stretch elements of your drawing.  The amount of stretch increases the closer the object is to the pole.  Such stretching is what this extension does.  It will stretch the pattern,
+
To combat this effect, it is possible to horizontally stretch elements of your drawing.  The amount of stretch should increase the closer the object is to a pole.  Such stretching is what this extension does.  When applied to the drawing,
  
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-02.png
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-02.png
  
producing the result,
+
it produces the result,
  
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-03.png
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-03.png
  
Note how the closer a horizontal line is to either the top or bottom edge of the drawing -- the poles of your egg -- the more the lines are stretched.
+
Note how the closer a horizontal line is to either the top or bottom edge of the drawing -- the poles of your egg -- the more that line is stretched.
  
The stretching is done such that a vertical line passing through the geometric center is unchanged. Which geometric center? If nothing is selected when the extension is applied, then the geometric center of the drawing page is used.  If, however, one or more objects are selected, then the geometric center of the smallest rectangle containing the selected objects is used (i.e., the geometric center of the bounding box containing the objects).
+
The stretching is done such that a vertical line through the horizontal midpoint is unchanged.  If nothing is selected when the extension is applied, then the horizontal midpoint is at half the page's width.  If, however, one or more objects are selected, then the horizontal midpoint is the midpoint of the shortest horizontal line spanning all the selected objects (i.e., the horizontal midpoint of the bounding box containing all the selected objects) [2].  
  
The extension has two parameters.  The first value, vertical smoothing, is used to break long line segments into shorter segments before stretching.  To illustrate the effect of this setting, consider the following figure,
+
The Stretch extension has two adjustable settings.  The first setting, vertical smoothing, is used to break long line segments into shorter segments before stretching.  To illustrate the effect of this setting, consider the following figure,
  
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-04.png
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-04.png
Line 29: Line 29:
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-05.png
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-05.png
  
The box and text were stretched as a whole (i.e., they were not individually stretched).  The result of plotting the two on an egg is shown below.  The egg on the left is the unstretched box and text.  The egg on the right shows the stretched text and box.  The picture of the egg on the right does not clearly show the effect of the stretching -- in real life the box looks very rectilinear.  The results do not show well in a photograph: the photographic process is, by its very nature, producing yet another transformation as it maps a three-dimensional, spherical picture to a two-dimensional flat image.
+
The box and text were stretched as a whole (i.e., they were not individually stretched).  The result of plotting the two on an egg is shown below.  The egg on the left is the unstretched box and text.  The egg on the right shows the stretched text and box.  The picture of the egg on the right does not clearly show the effect of the stretching -- in real life the box looks very rectilinear.  The results do not show well in a photograph: the photographic process is, by its very nature, producing yet another transformation as it maps the three-dimensional, spherical egg plot to a two-dimensional flat image.
  
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-06.jpg
 
http://mtbaldy.us/~dnewman/tspart/extensions-stretch-06.jpg
Line 35: Line 35:
 
== Notes ==
 
== Notes ==
  
1. What is happening here is that the pixels in your Inkscape drawing are interpreted not as lengths by the Eggbot but rather as stepper motor steps.  Regardless of the latitude, each full circle around an egg has the same number of stepper motor steps: 3200 steps.  However, the surface distance spanned by each step decreases as you approach the poles.  To be more precise, an Inkscape line of length N pixels is interpreted as a line of "length" N stepper motor stepsIf a line segment in Inkscape has the endpoints (x1, y1) and (x2 y2) then the plotted result will turn the egg motor x2 - x1 steps and the pen arm motor y2 - y1 steps.
+
1. Note that the angular length of the line segment stays the same just as the angular length of a complete line of latitude -- 360&nbsp;degrees -- remains unchanged.<br/>
 +
2This spanning horizontal line or bounding box does not take into account the cylindrical nature of your drawing. I.e., it does not recognize that left and right edges of your drawing touch when plotted on an egg.  If you have such objects, drag them elsewhere in your drawing, stretch them and then drag them back to the edges.
  
 
----
 
----
  
 
[[Post process trace bitmap|<<< Post process trace bitmap]] | Stretch | [[Twist|Twist >>>]]
 
[[Post process trace bitmap|<<< Post process trace bitmap]] | Stretch | [[Twist|Twist >>>]]

Revision as of 18:52, 21 December 2010

<<< Post process trace bitmap | Stretch | Twist >>>


extensions-stretch-01.png

In Inkscape, your drawing is flat. But, when you plot your drawing on a round object, you subject your drawing to a transformation which changes its appearance. A horizontal line in your drawing will have the same physical length when printed on paper regardless of where that line appears in your drawing. That is not the case when you plot horizontal lines onto a sphere or egg. A horizontal line in drawing becomes a line of latitude when plotted with the Eggbot. Moving this horizontal line up or down in your drawing (away from the midline of the page) moves the corresponding line of latitude towards one egg pole or the other. But, something happens to lines of latitude as they approach either pole: their circumference decreases. And, any line segment along a line of latitude decreases in length as the line of latitude approaches either pole [1]. The result of this effect is that if you put two identically sized figures in your drawing, the resulting egg plot will produce them with different sizes if one of the figures is closer to the equator than the other. The object closer to the equator be larger than the one closer to a pole. This effect of shrinking near the poles can be annoying when, for example, plotting several lines of text. It can cause geometric object to appear bloated near the equator and shrunken near the poles.

To combat this effect, it is possible to horizontally stretch elements of your drawing. The amount of stretch should increase the closer the object is to a pole. Such stretching is what this extension does. When applied to the drawing,

extensions-stretch-02.png

it produces the result,

extensions-stretch-03.png

Note how the closer a horizontal line is to either the top or bottom edge of the drawing -- the poles of your egg -- the more that line is stretched.

The stretching is done such that a vertical line through the horizontal midpoint is unchanged. If nothing is selected when the extension is applied, then the horizontal midpoint is at half the page's width. If, however, one or more objects are selected, then the horizontal midpoint is the midpoint of the shortest horizontal line spanning all the selected objects (i.e., the horizontal midpoint of the bounding box containing all the selected objects) [2].

The Stretch extension has two adjustable settings. The first setting, vertical smoothing, is used to break long line segments into shorter segments before stretching. To illustrate the effect of this setting, consider the following figure,

extensions-stretch-04.png

From left to right, the vertical smoothing values were 200, 100, and 10. The smaller the value, the smoother the result will be. A value between 5 and 10 is generally sufficient. The second value you can set, curve smoothing, is the same value as in the Eggbot Control extension. It effects how smoothly arcs, circles, eliipses, and curves are rendered.

In the following example, text within a box is shown unstretched on the left and stretched on the right,

extensions-stretch-05.png

The box and text were stretched as a whole (i.e., they were not individually stretched). The result of plotting the two on an egg is shown below. The egg on the left is the unstretched box and text. The egg on the right shows the stretched text and box. The picture of the egg on the right does not clearly show the effect of the stretching -- in real life the box looks very rectilinear. The results do not show well in a photograph: the photographic process is, by its very nature, producing yet another transformation as it maps the three-dimensional, spherical egg plot to a two-dimensional flat image.

extensions-stretch-06.jpg

Notes

1. Note that the angular length of the line segment stays the same just as the angular length of a complete line of latitude -- 360 degrees -- remains unchanged.
2. This spanning horizontal line or bounding box does not take into account the cylindrical nature of your drawing. I.e., it does not recognize that left and right edges of your drawing touch when plotted on an egg. If you have such objects, drag them elsewhere in your drawing, stretch them and then drag them back to the edges.


<<< Post process trace bitmap | Stretch | Twist >>>