Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread Cirilo Bernardo
Another more recent application for the bitmap conversion tool is to help
recreate a board design using a scanned image of a plot such as a scan of
some pages from a magazine or an old Gerber plot printed on paper for
documentation. An image is created on one of the ECO layers and this image
can be included in the project, tracks and pads can be drawn, and then the
image deleted. I made small changes to the tool a long time ago since a
number of people asked for the feature, but as typical I never received any
feedback.

Personally I think we should maintain a bitmap conversion tool; I don't
believe that using another vectorization tool will be a good idea because
people don't want to install many other support tools and expect the EDA
package to provide all the tools they would need. If that were not the case
we wouldn't even be talking about features like the MCAD exports, we'd
simply tell users "use this other external software and follow these
complicated procedures." We would have to change the name to 'EDNA' for
Electronic Design Non-Automation.

Going back to the topic of rebuilding boards from bitmap images, my
personal preference (if I had the time for it) would be to have an
intelligent program which uses feature recognition to create the PCB data
with a little help from the user, but since such reengineering work is rare
and it would take a year or more full time to get to a usable state, such a
tool never made it into my list of things to do.

- Cirilo


On Sat, Jul 11, 2015 at 2:42 AM, Tomasz Wlostowski <
tomasz.wlostow...@cern.ch> wrote:

> On 10.07.2015 18:31, jp charras wrote:
>
> > AFAIK, boost::polygon is used only to cleanup and mainly to fracture the
> > polygons which are created by potrace, and which are outlines and holes
> > inside outlines.
>
> Indeed, maybe the custom types (KPolygon) made me think it's more
> complicated.
> >
> > The main application of bitmap2component is creating logos which can be
> > printed on a silkscreen layer.
>
> Most logos come nowadays in a vector format (e.g. SVG). An ability to
> import a vector logo directly (without having to convert from vector to
> bitmap and back) would be quite useful IMHO and may supersede the
> functionality of bitmap2component.
>
> Tom
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread jp charras
Le 10/07/2015 20:56, Matthew Beckler a écrit :
> Very interesting, thank you JP. The Pcbnew file format only supports the
> second representation (main outline with all its holes connected to the
> main outline), correct?
> 
> -Matthew

If you are talking about filled polygons in footprints, yes.

In zones, the first description is used for the zone outline (which are
never drawn as filled polygons), and the second for filled areas (which
are never edited)
the zone outline itself is a set of polygons, the first is the main
outline, the others are holes.

> 
> On Fri, Jul 10, 2015 at 1:05 PM, jp charras  wrote:
> 
>> Le 10/07/2015 19:17, Matthew Beckler a écrit :
>>> I have some python code to convert an SVG image to a Kicad pcb module
>>> silkscreen, however it doesn't work great for polygons that contain
>> cutouts
>>> (such as the holes in the characters A, B, Q, etc). It seems like pcbnew
>>> does not support having cutouts inside a filled region. I've noticed that
>>> bitmap2component works around this by creating infinitely-thin
>> connections
>>> from a polygon's outside edge to each of the cutouts, effectively
>>> connecting each cutout with the exterior.
>>>
>>> The code isn't great, but here's what I've got so far. It's based on the
>>> Egg-Bot code (used for driving a two-axis plotter based on SVG files),
>> and
>>> I need to figure out what sort of licensing is needed for it based on all
>>> the library files used.
>>> https://github.com/wayneandlayne/svg2kicadmod
>>>
>>> Right now you need to pick the desired width and/or height in mm when you
>>> run the script, so if you need different sizes of your logo then you need
>>> to create several .kicad_mod files. Eventually it would be really great
>> to
>>> have support for changing the scaling of the rasterized logo right within
>>> pcbnew, so I perhaps having a python plugin for fancy SVG-based board
>>> graphics would be neat.
>>>
>>> -Matthew Beckler
>>> Co-founder and Engineer
>>> W&L
>>>
>>
>> Generally speaking, about polygons with holes, there are 2 dual
>> representations, and they are both used in Kicad:
>>
>> - The first is (obviously) "polygon with holes", which handles a set of
>> polygons: the main outline and its holes.
>> It is very useful to edit a complex polygon shape, but not usable to
>> draw/plot it.
>>
>> - The second is to use only one polygon which is the main outline with
>> all its holes "connected" to the main outline by overlapping segments
>> (what you are calling "infinitely-thin connections").
>> It is very useful to draw/plot a complex polygon shape, but not very
>> usable to edit it.
>>
>> When you want to handle complex polygons, many times you have to change
>> the polygon description from the first to the second, and from the
>> second to the first representation.
>>
>> --
>> Jean-Pierre CHARRAS
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread Matthew Beckler
Very interesting, thank you JP. The Pcbnew file format only supports the
second representation (main outline with all its holes connected to the
main outline), correct?

-Matthew

On Fri, Jul 10, 2015 at 1:05 PM, jp charras  wrote:

> Le 10/07/2015 19:17, Matthew Beckler a écrit :
> > I have some python code to convert an SVG image to a Kicad pcb module
> > silkscreen, however it doesn't work great for polygons that contain
> cutouts
> > (such as the holes in the characters A, B, Q, etc). It seems like pcbnew
> > does not support having cutouts inside a filled region. I've noticed that
> > bitmap2component works around this by creating infinitely-thin
> connections
> > from a polygon's outside edge to each of the cutouts, effectively
> > connecting each cutout with the exterior.
> >
> > The code isn't great, but here's what I've got so far. It's based on the
> > Egg-Bot code (used for driving a two-axis plotter based on SVG files),
> and
> > I need to figure out what sort of licensing is needed for it based on all
> > the library files used.
> > https://github.com/wayneandlayne/svg2kicadmod
> >
> > Right now you need to pick the desired width and/or height in mm when you
> > run the script, so if you need different sizes of your logo then you need
> > to create several .kicad_mod files. Eventually it would be really great
> to
> > have support for changing the scaling of the rasterized logo right within
> > pcbnew, so I perhaps having a python plugin for fancy SVG-based board
> > graphics would be neat.
> >
> > -Matthew Beckler
> > Co-founder and Engineer
> > W&L
> >
>
> Generally speaking, about polygons with holes, there are 2 dual
> representations, and they are both used in Kicad:
>
> - The first is (obviously) "polygon with holes", which handles a set of
> polygons: the main outline and its holes.
> It is very useful to edit a complex polygon shape, but not usable to
> draw/plot it.
>
> - The second is to use only one polygon which is the main outline with
> all its holes "connected" to the main outline by overlapping segments
> (what you are calling "infinitely-thin connections").
> It is very useful to draw/plot a complex polygon shape, but not very
> usable to edit it.
>
> When you want to handle complex polygons, many times you have to change
> the polygon description from the first to the second, and from the
> second to the first representation.
>
> --
> Jean-Pierre CHARRAS
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread jp charras
Le 10/07/2015 19:17, Matthew Beckler a écrit :
> I have some python code to convert an SVG image to a Kicad pcb module
> silkscreen, however it doesn't work great for polygons that contain cutouts
> (such as the holes in the characters A, B, Q, etc). It seems like pcbnew
> does not support having cutouts inside a filled region. I've noticed that
> bitmap2component works around this by creating infinitely-thin connections
> from a polygon's outside edge to each of the cutouts, effectively
> connecting each cutout with the exterior.
> 
> The code isn't great, but here's what I've got so far. It's based on the
> Egg-Bot code (used for driving a two-axis plotter based on SVG files), and
> I need to figure out what sort of licensing is needed for it based on all
> the library files used.
> https://github.com/wayneandlayne/svg2kicadmod
> 
> Right now you need to pick the desired width and/or height in mm when you
> run the script, so if you need different sizes of your logo then you need
> to create several .kicad_mod files. Eventually it would be really great to
> have support for changing the scaling of the rasterized logo right within
> pcbnew, so I perhaps having a python plugin for fancy SVG-based board
> graphics would be neat.
> 
> -Matthew Beckler
> Co-founder and Engineer
> W&L
> 

Generally speaking, about polygons with holes, there are 2 dual
representations, and they are both used in Kicad:

- The first is (obviously) "polygon with holes", which handles a set of
polygons: the main outline and its holes.
It is very useful to edit a complex polygon shape, but not usable to
draw/plot it.

- The second is to use only one polygon which is the main outline with
all its holes "connected" to the main outline by overlapping segments
(what you are calling "infinitely-thin connections").
It is very useful to draw/plot a complex polygon shape, but not very
usable to edit it.

When you want to handle complex polygons, many times you have to change
the polygon description from the first to the second, and from the
second to the first representation.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread LordBlick

In response to a message written on 10.07.2015, 18:03, from Tomasz Wlostowski:

PS. LordBlick, you once mentioned you had some code for importing SVG as
polygons in Kicad. Would you be willing to share it?


Most of my PC programming works are in python + gtk2, so I have no idea whether 
it will be useful in KiCad.

All I done is on:
https://github.com/LordBlick/svgImportKiCAD
Warrning: it's not completeted from lack of time.
--
Best Regards,
LordBlick

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread Matthew Beckler
I have some python code to convert an SVG image to a Kicad pcb module
silkscreen, however it doesn't work great for polygons that contain cutouts
(such as the holes in the characters A, B, Q, etc). It seems like pcbnew
does not support having cutouts inside a filled region. I've noticed that
bitmap2component works around this by creating infinitely-thin connections
from a polygon's outside edge to each of the cutouts, effectively
connecting each cutout with the exterior.

The code isn't great, but here's what I've got so far. It's based on the
Egg-Bot code (used for driving a two-axis plotter based on SVG files), and
I need to figure out what sort of licensing is needed for it based on all
the library files used.
https://github.com/wayneandlayne/svg2kicadmod

Right now you need to pick the desired width and/or height in mm when you
run the script, so if you need different sizes of your logo then you need
to create several .kicad_mod files. Eventually it would be really great to
have support for changing the scaling of the rasterized logo right within
pcbnew, so I perhaps having a python plugin for fancy SVG-based board
graphics would be neat.

-Matthew Beckler
Co-founder and Engineer
W&L


On Fri, Jul 10, 2015 at 11:42 AM, Tomasz Wlostowski <
tomasz.wlostow...@cern.ch> wrote:

> On 10.07.2015 18:31, jp charras wrote:
>
> > AFAIK, boost::polygon is used only to cleanup and mainly to fracture the
> > polygons which are created by potrace, and which are outlines and holes
> > inside outlines.
>
> Indeed, maybe the custom types (KPolygon) made me think it's more
> complicated.
> >
> > The main application of bitmap2component is creating logos which can be
> > printed on a silkscreen layer.
>
> Most logos come nowadays in a vector format (e.g. SVG). An ability to
> import a vector logo directly (without having to convert from vector to
> bitmap and back) would be quite useful IMHO and may supersede the
> functionality of bitmap2component.
>
> Tom
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread Tomasz Wlostowski
On 10.07.2015 18:31, jp charras wrote:

> AFAIK, boost::polygon is used only to cleanup and mainly to fracture the
> polygons which are created by potrace, and which are outlines and holes
> inside outlines.

Indeed, maybe the custom types (KPolygon) made me think it's more
complicated.
> 
> The main application of bitmap2component is creating logos which can be
> printed on a silkscreen layer.

Most logos come nowadays in a vector format (e.g. SVG). An ability to
import a vector logo directly (without having to convert from vector to
bitmap and back) would be quite useful IMHO and may supersede the
functionality of bitmap2component.

Tom

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] future of bitmap2component?

2015-07-10 Thread jp charras
Le 10/07/2015 18:03, Tomasz Wlostowski a écrit :
> Hi all,
> 
> I'm in the process of removing remaining dependencies on boost::polygon.
> There's one quite big obstacle though - the bitmap2component program,
> which uses BPL quite extensively.
> 
> For the near future: I would keep BPL just for bitmap2component.
> 
> For the further future: What do you think of replacing bitmap2component
> by a proper SVG importer and leaving the bitmap vectorization to
> external, more advanced tools?
> 
> Best,
> Tom

The bitmap vectorization is made by potrace, which is used by most of
other tools to convert a bitmap to a polygon, not by boost.

AFAIK, boost::polygon is used only to cleanup and mainly to fracture the
polygons which are created by potrace, and which are outlines and holes
inside outlines.

The main application of bitmap2component is creating logos which can be
printed on a silkscreen layer.


> 
> PS. LordBlick, you once mentioned you had some code for importing SVG as
> polygons in Kicad. Would you be willing to share it?
> 


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] future of bitmap2component?

2015-07-10 Thread Tomasz Wlostowski
Hi all,

I'm in the process of removing remaining dependencies on boost::polygon.
There's one quite big obstacle though - the bitmap2component program,
which uses BPL quite extensively.

For the near future: I would keep BPL just for bitmap2component.

For the further future: What do you think of replacing bitmap2component
by a proper SVG importer and leaving the bitmap vectorization to
external, more advanced tools?

Best,
Tom

PS. LordBlick, you once mentioned you had some code for importing SVG as
polygons in Kicad. Would you be willing to share it?



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp