Hershey Text and tracing
  • This discussion was created from comments split from: "Writing" with AxiDraw.
  • Maybe I'm just not understanding the Hershey Text extension correctly but I am still getting outlines.  I am trying to take line drawings similar to the examples seen in the Axidraw videos and download examples like the Iron Man, Wiresphere, and signatures and draw them with the Axidraw but I'm not getting single line drawings.  I'm still getting multi-line drawings as if it's drawing an outline of the image.  I have .jpg images that are black and white line drawings.  I import those into Inkscape and then I have tried the Path -> Trace Bitmap and still get multi line drawings instead of a single stroke.  When I import a .jpg image and try the Hershey Text to obtain a single stroke I still get the same results.  How do I import a .jpg line drawing and use the Axidraw to draw that image using a single line stroke?  I thought this would be easier or thought there would at least be better, straightforward, tutorials to obtain the results shown in the videos or examples that are downloaded.
  • I've split this from the previous discussion that you were replying to. You are asking many unrelated questions, which touch on a lot of different topics -- some actual tech support questions, but also some about typography and artificial intelligence that are well beyond our capabilities.


    If you start with one of our examples such as wiresphere.svg or (better) signatures.svg, you should be able to download one of those example files and plot it directly without any changes. If you cannot, let's start there and try to solve one problem at a time. (I'm not sure what "Iron Man" example you are referring to.) The signatures example is a very good one to start with, as it prints quickly and has a simple set of paths to follow. If you watch it closely, do you really see it printing multiple lines?


    If you use the Trace Bitmap tool on an image (jpg or otherwise), it will produce one or more outlines around the things that you are tracing. That is its function.


    Hershey Text is a text typesetting (rendering) tool. It generates stroke-based text that you type into it-- it does not convert images into text. If you are generating text with Hershey Text (and have selected one of the single-line variants), please let us know more about the exact circumstances, and we should be able to help you get that working.


    You ask: "How do I import a .jpg line drawing and use the Axidraw to draw that image using a single line stroke?"
    This does not really make sense. A JPG image is not a line drawing -- it is a bitmap; a set of pixels that are in a rectangular grid, and colored differently.


    Converting an image into a line drawing is a thing that can be done in several different ways, none of which is easy. You've learned about outline tracing (it produces outlines), there is also center-line tracing (which tries to draw where center lines would be, typically with results of similar quality), and there is tracing by hand. These are the technologies that are available to us, if you wish to convert from an image into a line drawing. (In an ideal world, or perhaps another decade, we will hopefully have one additional tool: artificial intelligence that guesses at the intent of the person who wrote the lines, and creates a line drawing from a bitmap. This is called "trajectory reconstruction", and is a longstanding AI problem. We do not know of any presently-existing software that can do this reliably, at any price.)


    All of the text shown in our videos and example files was produced in one of three ways:


    1. Using regular fonts on the computer and converting them to outlines. The vast majority of our examples are done this way. Narrow-width fonts tend to look very good this way, and fatter fonts typically get filled. This is how the text in (to name a few) the birthday card, the wedding invitation, and the envelope are done.


    2. Using Hershey Text to generate the lettering. The small lettering on the AxiDraw_First.svg file is done this way ("If you can read this, AxiDraw is working.")


    3. Hand tracing a scan in a vector illustration program. That is to say, starting with a scan, and then using the Pencil tool ("Draw freehand lines") to trace over the lines by hand. This is tedious, but possible for certain types of input that justify it. We have used this technique only in one place: on the signatures example file.


    You will note that none of the examples that we show, anywhere, is made by using automatic tracing tools.


    A fourth method -- which we have not used anywhere in our video or example files -- is to record handwriting live as you are creating it. There is a program that can record (for example) your signature as you write it (by mouse or tablet) and save it as an SVG file.