← Back to team overview

kicad-developers team mailing list archive

Re: Import png, jpeg or svg or dxf ?

 

> Potrace is designed to convert these formats to a shape described by a 
> set of polygons, each polygon having edges that are lines and Bezier curves.
> The results are very good.
> So because Pcbnew (and Eeschema) already handles polygons, the best and 
> easier way to import png is to use Potrace, and
> add a new export format (this seems very easy) that use an existing 
> potrace format and approximates Bezier curves by a set of lines.
> Due to Bezier curves design, calculates some corners is obvious.
> The problem is just how many corner must be used to approximate a given 
> curve by segments.
> Due to the vectored description of the shape, it can be resized without 
> lost of quality.
> Cleary we *need* a volunteer to work on an adaptation of potrace able to 
> output a polygon description of a 1 bit per pixel png picture, using 
> lines only (not bezier curves) to do that.
> Later, this output (this set of usual polygons) will be *easily* 
> imported by kicad.

I've found this algorithm to approximate bezier curves, i'm not an expert of Computer Graphics but seem an acceptable way to reduce curves to segmentsto me.
What do you think about it ?

http://www.antigrain.com/research/adaptive_bezier/index.html

--
Marco







References