Forum Index > Projects > Egg-Bot
 order of drawing
 |  Printable Version
By: Anonymous: Stef () on Wednesday, May 04 2011 @ 07:54 PM PDT (Read 2956 times)  
Anonymous: Stef

Individual parts of a drawing are not necessarily drawn sensibly by the eggbot. Sometimes it will draw part of a drawing, then go somewhere else and draw something, then return to the original area and draw some more.

Is there any way to know how he eggbot interprets the svg file in terms of plotting sequence?

Also, individual pieces that are grouped are sometimes still drawn as individual pieces. For example two line segments grouped to form a single line in inkscape are then drawn by the eggbot in two motions. This results in an 'ink blob' where the eggbot pauses as it renders one line segment and then the other. Obviously, I would not draw two line segments and group them but am using this as an example. My goal is to take a complex drawing and transform it into a simple curve that the eggbot can draw without lifting the pen or pausing, The answer to this question ties into the first one above-how does the eggbot determine the sequence of what it wants to draw and when does it decide to lift the pen?





       
   
By: dnewman (offline) on Wednesday, May 04 2011 @ 09:04 PM PDT  
dnewman

Quote by: Stef

Individual parts of a drawing are not necessarily drawn sensibly by the eggbot. Sometimes it will draw part of a drawing, then go somewhere else and draw something, then return to the original area and draw some more.



The drawing is drawn in the precise order in which it appears in the underlying SVG file. As such the drawing order is the order you have left the elements of your drawing in. You can re-order the elements in the drawing by individually selecting them and pushing them to the top or bottom using the "Raise", "Lower", "Raise to Top", and "Lower to Bottom" items of the Object menu in Inkscape.

(Raise? Lower? This is an old graphics paradigm of using a third dimension to indicate drawing order. Think of it as a stack of tasks to do to draw something. You start with whatever is on the top of the stack do it, discard it, and then turn to what is now on the top of the stack.)

It is fairly typical, IMO, to go through a drawing selecting each element from left to right or right to left and doing this -- putting it to the top of the stack -- so as to produce a finished drawing which plots well on the Eggbot.

There is an extension which will do some re-ordering of paths in your document so as to try to plot in a more optimal order. Your mileage may vary with it. You can try it with Extensions > Eggbot > Reorder Paths for Speed.


Is there any way to know how he eggbot interprets the svg file in terms of plotting sequence?



From the start of the file, proceeding linearly until the file's end.


Also, individual pieces that are grouped are sometimes still drawn as individual pieces. For example two line segments grouped to form a single line in inkscape are then drawn by the eggbot in two motions. This results in an 'ink blob' where the eggbot pauses as it renders one line segment and then the other.



This indicates that those two lines are two distinct paths. Grouping is a convenience construct which allows you in Inkscape to manipulate those two paths as one entity. However, they stil remain as two distinct paths. And, since they are two distinct paths and since you are using Inkscape (I believe), you are pretty much guaranteed that Inkscape will generate SVG which says to lift the pen up and move to the start of the second path. (Specifically, each of those paths begin with an SVG "moveto" operation. That operation means moving without drawing and thus the pen has to be lifted.) You may be able to use some Inkscape commands to join the two paths into a single path. I've not tried doing such operations myself in Inkscape.


Obviously, I would not draw two line segments and group them but am using this as an example. My goal is to take a complex drawing and transform it into a simple curve that the eggbot can draw without lifting the pen or pausing,



Inkscape's Path > Simplify may do some of what you want.


The answer to this question ties into the first one above-how does the eggbot determine the sequence of what it wants to draw and when does it decide to lift the pen?



The Eggbot quite literally does whatever the SVG tells it to. If it's told to "moveto" a coordinate, then it moves there with the pen lifted (as a "moveto" means moving without drawing). If, OTOH, it is told to "lineto" a coordinate, then it moves the pen there drawing a line as the pen moves. The Eggbot itself makes absolutely no decisions here: it does exactly what is stated in the SVG file.
The SVG file is created by Inkscape and as such all of this is driven from Inkscape (or whatever you choose to use to produce your SVG file). You can pretty much assume that if Inkscape has put a line, curve, polygon, or whatever into a path then that path begins with a "moveto" operation. Paths can start with a "lineto" operation, but I've never seen Inkscape start a path with a "lineto". Thus, if you're using Inkscape expect each and every path to begin with a "moveto". (A "path" in SVG is a sequence of coordinates interspersed with drawing instructions of "move to here" or "draw a line to here". Paths can also contain directions for drawing curves and arcs. There's some other basic SVG drawing elements but they are short hands for special cases of paths: e.g., draw a rectangle here, draw an ellipse here, etc.)

Dan


Cow Canyon Saddle Clear Sky Chart


Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 09/08/10
Posts: 149
Mt. Baldy,
California

Profile Email    
   
By: Anonymous: Stef () on Thursday, May 05 2011 @ 07:24 PM PDT  
Anonymous: Stef

thank you for your clear, concise and helpful replies.

Now, if you could only help me understand why the force of gravity is so weak compared to electricity and magnetism...





       
   
By: dnewman (offline) on Thursday, May 05 2011 @ 08:02 PM PDT  
dnewman

Quote by: Stef

thank you for your clear, concise and helpful replies.


I'm curious to follow your progress in generating minimal numbers of paths for your drawings. My knee-jerk reaction would be to write some code to do curve fitting using Bezier cubic splines which are supported by SVG and Inkscape. I suspect that's what Inkscape's "simplify path" does, but I've not investigated.


Now, if you could only help me understand why the force of gravity is so weak compared to electricity and magnetism...


I once had an answer to this, but thanks to entropy I can no longer read my margin notes.

Dan


Cow Canyon Saddle Clear Sky Chart


Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 09/08/10
Posts: 149
Mt. Baldy,
California

Profile Email    
   
By: dnewman (offline) on Thursday, May 05 2011 @ 08:42 PM PDT  
dnewman

Quote by: Stef

thank you for your clear, concise and helpful replies...


You're quite welcome.

Dan


Cow Canyon Saddle Clear Sky Chart


Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 09/08/10
Posts: 149
Mt. Baldy,
California

Profile Email    
   



 All times are PDT. The time is now 10:16 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?