Idea: convert the pixel lines into Grease pencil

I would like the line that draws on paper to become a line of Blender, but it becomes a surface of and cannot be easily corrected.

I have an idea how you could turn into a line in a line of Blender, using autotrace and Potrace.
At Potrace make a surface with two lines per line drawn and autotrace that creates a central line both enters.

As I could analyze with the “GP clipboard” addons, Grease Pencil lines are saved as points with an array and sizes as another complementary array, so I thought of the following:

I just need a simple line like the one that generates “autotrace -centerline” and get the size similar to what is now used in blender, as I understand the vector of images is made with potrace.

I convert a multicolored image in black and white (1bit):

convert capi.png -background white -transparent none -alpha remove -threshold 10% -colorspace rgb capiBN.ppm

Generates the central line:

autotrace capiBN.ppm -centerline -output-format svg -despeckle-tightness 1 -corner-surround 0 -despeckle-level 1 -output-file a.svg

Generates the width of the line (surface):

potrace capiBN.ppm -b svg -o capiBN.svg

The idea is to generate a blender line using the autotrace line and give the width of each stitch the thickness of each stitch obtained from potrace.

For each autotrace point you have to look for close points generated by potrace so that you calculate the width of the line at that point.

Some of the problems I see is that potrace is quite efficient so few points per line, you have to look for a visual way to detect the edges.

I still can’t put me in writing a program, but it certainly does the attempt.

Posted in Experiment and tagged , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *