kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #02762
Re: Re: [PCBNEW] Import png, jpeg or svg or dxf ?
-
To:
kicad-devel@xxxxxxxxxxxxxxx
-
From:
jean-pierre charras - INPG <jean-pierre.charras@...>
-
Date:
Thu, 18 Jun 2009 17:05:14 +0200
-
In-reply-to:
<936b14d20906180056t54a41339j707db2b4fc292cea@...>
-
User-agent:
Thunderbird 2.0.0.21 (Windows/20090302)
We can assume the limitation of all imports is the GERBER constraints:
- Only one bit per "pixel"
- In fact GERBER does not know a pixel: shapes *must* be described only
by lines or polygons, i.e. vectored.
The main interest to png, jpeg import is the creation of logos in
eeschema and pcbnew.
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.
SVG format has not really a great interest because most of drawings have
no interest when converted to a binary picture.
For a logo, most of time potrace gives a good result from a png file
dxf import or export is an other problem.
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.
--
Jean-Pierre CHARRAS
Maître de conférences
Directeur d'études 2ieme année.
Génie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex
Recherche :
Grenoble Image Parole Signal Automatique (GIPSA - INPG)
Grenoble France
Follow ups
References