Re: [Kicad-developers] Signal integrity simulation within Kicad

2017-12-08 Thread Andreas Buhr
On 11/29/2017 08:07 PM, Tomasz Wlostowski wrote:
> I've made a quick test program that prints most of the board's geometry
> as bare polygons. It's here:
> 
> https://github.com/twlostow/kicad-dev/tree/tom-polygon-gen/qa/polygon_generator

Hi Tom,

thanks a lot for your help extracting polygons from PCBs. I plotted the
polygons on top of the PCB, green lines are all polygons from all layers.

It works fine for tracks.
For some pads, it works correctly. Other pads are somehow enlarged.
For zones, the polygons I get are always smaller than what is visible.
Could you hint me at what I have to do to get the correct polygons for
zones?

See attached pictures for an example (Olimex A64 board).

Cheers,
Andreas
___
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] Signal integrity simulation within Kicad

2017-12-07 Thread Maciej Sumiński
Hi Andreas,

I am sorry for late response, I must have lost your e-mail. Still, the
answers may help you in the future.

On 12/05/2017 03:42 PM, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> I am browsing the Kicad source code to get an idea how to integrate a
> simulation tool.
> 
> I'd like the following:
> 
> 1. The plugin should be informed whenever something changes. It would be
> great to get a bounding box of the change.
> 2. The plugin should be able to draw on the canvas. I'd like to register
> a new layer (for example to show the triangle mesh). The user should
> then be able to enable/disable this layer.
> 
> These two requirements are in some sense similar to the requirements of
> "ratsnest", so I followed "ratsnest" through the code.
> 
> Concerning (1):
> I got the impression that it is not easy to be informed about all
> changes in a BOARD. Is this correct?

Unfortunately you are right. Most of the changes go through BOARD_COMMIT
class that takes care of creating undo entries, refreshing the view,
connectivity, etc. Recently Miles has been asking for a subscription
based observer model, perhaps BOARD_COMMIT would be a good spot to send
notifications to the observers.

Regards,
Orson

> Concerning (2):
> And I got the impression that there is not one way to draw to the
> canvas. I found two drawing methods for ratsnest, one in PCB_BASE_FRAME,
> the other in RATSNEST_VIEWITEM::ViewDraw. Is it necessary to implement
> two drawing methods for each feature?
> 
> And it seems that the layers are organized in an enum (GAL_LAYER_ID), so
> adding a layer at runtime seems impossible without larger infrastructure
> changes. Is this correct?
> 
> What would you propose? How can a plugin be informed about all changes
> to the board? And how could a plugin draw on the canvas?
> 
> thanks a lot in advance,
> Cheers,
> Andreas
> 
> 
> On 11/30/2017 12:18 AM, Wayne Stambaugh wrote:
>> Hi Andreas,
>>
>> Per our previous conversation, if you want to write your solver in C++,
>> then I would prefer that you do it as part of a solver plugin rather
>> than a command event handler in Pcbnew.  I image there would be other
>> uses for a solver plugin object such as a thermal mapping solver which
>> has been proposed in the past.  The other option would be to use the
>> Python action object and write the entire solver in Python rather than
>> C++.  That may make your life a bit easier.
>>
>> Cheers,
>>
>> Wayne
>>
>> On 11/29/2017 01:09 PM, Andreas Buhr wrote:
>>> Dear Kicad developers,
>>>
>>> I'm new to Kicad development. Maybe you could give me some starting tips?
>>>
>>> I am a 5th year PhD student at the university of Münster in Germany,
>>> website:
>>> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
>>>
>>> I am doing mathematical research targeted at developing solvers for 3D
>>> Maxwell's equations in highly complex structures, such as PCBs. While
>>> being in an early stage, the goal is to develop a signal integrity
>>> solver which does a full-wave simulation of the electromagnetic fields
>>> and calculates S-parameters within a very short time.
>>>
>>> I would love to develop and test my algorithms within KiCad.
>>>
>>> The input which my solver needs would be an array of polygons,
>>> representing the copper-filled areas on each layer.
>>> I then want to create a 2D triangle mesh and based on that a 3D prism
>>> mesh for finite element analysis.
>>>
>>> What would you recommend? How to I get polygons, representing the copper
>>> filled areas of each layer?
>>> I do have some experience developing C++.
>>>
>>> thanks a lot in advance,
>>> best regards,
>>>
>>> Andreas
>>>
>>>
>>>
>>> ___
>>> 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
>>
> 
> 
> 
> 
> ___
> 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
> 




signature.asc
Description: OpenPGP digital signature
___
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] Signal integrity simulation within Kicad

2017-12-06 Thread Jon Evans
Cool! I took a brief look at your code and looks like a good starting point
although I have not compiled it.

Unfortunately the legacy canvas cannot use the same draw call, as the
architecture is completely different.
To be honest, I would not worry about supporting the legacy canvas if I
were you -- we already have a number of features that are GAL-only, and I
think (project leaders can chime in here if I'm wrong) that it is fine to
propose GAL-only features (just not the other way around, meaning legacy
only).  The only reason the legacy canvas is still an option is because not
all features have been implemented in the GAL canvases yet.

Best,
Jon

On Wed, Dec 6, 2017 at 12:38 PM, Andreas Buhr 
wrote:

> Hi Jon,
>
> thanks a lot for your help.
>
> On 12/05/2017 03:51 PM, Jon Evans wrote:
> > For (2), the PCB_BASE_FRAME methods are for the legacy canvas, so I
> > wouldn't worry about implementing your feature there if I were you,
> > since it will eventually be removed.
> > The RATSNEST_VIEWITEM is what is used on the GAL (OpenGL/Cairo) canvases.
> >
> > Regarding the layer, you could use LAYER_GP_OVERLAY for prototyping, but
> > you are right that (at the moment) you can't add layers at runtime.
> > If you think that all of the simulation outputs can be drawn with a
> > single graphics layer, I think it is perfectly reasonable for you to
> > expand the enum with another layer definition.
> > You could use this new layer for your triangle mesh drawing, and then
> > use LAYER_GP_OVERLAY if you wanted to add any annotations to the
> > graphics perhaps? (meaning: measurements, etc, as is done with the
> > RULER_ITEM)
>
> Following the structure of the RATSNEST_VIEWITEM, I created a
> SI_MESH_VIEWITEM which should display the triangle mesh used in
> simulation. At the moment, my SI_MESH_VIEWITEM only displays a cross at
> position (0,0). It works fine for Cairo and OpenGL canvas.
> Is it possible to make the legacy canvas also use the
> VIEW_ITEM::ViewDraw() function?
>
> You can find my source code at
> https://github.com/andreasbuhr/kicad/commits/add_triangle_meshing
>
> thanks and best regards,
> Andreas
>
> >
> > -Jon
> >
> > On Tue, Dec 5, 2017 at 9:42 AM, Andreas Buhr  > > wrote:
> >
> > Dear Kicad developers,
> >
> > I am browsing the Kicad source code to get an idea how to integrate a
> > simulation tool.
> >
> > I'd like the following:
> >
> > 1. The plugin should be informed whenever something changes. It
> would be
> > great to get a bounding box of the change.
> > 2. The plugin should be able to draw on the canvas. I'd like to
> register
> > a new layer (for example to show the triangle mesh). The user should
> > then be able to enable/disable this layer.
> >
> > These two requirements are in some sense similar to the requirements
> of
> > "ratsnest", so I followed "ratsnest" through the code.
> >
> > Concerning (1):
> > I got the impression that it is not easy to be informed about all
> > changes in a BOARD. Is this correct?
> >
> > Concerning (2):
> > And I got the impression that there is not one way to draw to the
> > canvas. I found two drawing methods for ratsnest, one in
> PCB_BASE_FRAME,
> > the other in RATSNEST_VIEWITEM::ViewDraw. Is it necessary to
> implement
> > two drawing methods for each feature?
> >
> > And it seems that the layers are organized in an enum
> (GAL_LAYER_ID), so
> > adding a layer at runtime seems impossible without larger
> infrastructure
> > changes. Is this correct?
> >
> > What would you propose? How can a plugin be informed about all
> changes
> > to the board? And how could a plugin draw on the canvas?
> >
> > thanks a lot in advance,
> > Cheers,
> > Andreas
> >
> >
> > On 11/30/2017 12:18 AM, Wayne Stambaugh wrote:
> > > Hi Andreas,
> > >
> > > Per our previous conversation, if you want to write your solver in
> > C++,
> > > then I would prefer that you do it as part of a solver plugin
> rather
> > > than a command event handler in Pcbnew.  I image there would be
> other
> > > uses for a solver plugin object such as a thermal mapping solver
> which
> > > has been proposed in the past.  The other option would be to use
> the
> > > Python action object and write the entire solver in Python rather
> than
> > > C++.  That may make your life a bit easier.
> > >
> > > Cheers,
> > >
> > > Wayne
> > >
> > > On 11/29/2017 01:09 PM, Andreas Buhr wrote:
> > >> Dear Kicad developers,
> > >>
> > >> I'm new to Kicad development. Maybe you could give me some
> > starting tips?
> > >>
> > >> I am a 5th year PhD student at the university of Münster in
> Germany,
> > >> website:
> > >>
> > https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> >  buhr.shtml>

Re: [Kicad-developers] Signal integrity simulation within Kicad

2017-12-06 Thread Andreas Buhr
Hi Jon,

thanks a lot for your help.

On 12/05/2017 03:51 PM, Jon Evans wrote:
> For (2), the PCB_BASE_FRAME methods are for the legacy canvas, so I
> wouldn't worry about implementing your feature there if I were you,
> since it will eventually be removed.
> The RATSNEST_VIEWITEM is what is used on the GAL (OpenGL/Cairo) canvases.
> 
> Regarding the layer, you could use LAYER_GP_OVERLAY for prototyping, but
> you are right that (at the moment) you can't add layers at runtime.
> If you think that all of the simulation outputs can be drawn with a
> single graphics layer, I think it is perfectly reasonable for you to
> expand the enum with another layer definition.
> You could use this new layer for your triangle mesh drawing, and then
> use LAYER_GP_OVERLAY if you wanted to add any annotations to the
> graphics perhaps? (meaning: measurements, etc, as is done with the
> RULER_ITEM)

Following the structure of the RATSNEST_VIEWITEM, I created a
SI_MESH_VIEWITEM which should display the triangle mesh used in
simulation. At the moment, my SI_MESH_VIEWITEM only displays a cross at
position (0,0). It works fine for Cairo and OpenGL canvas.
Is it possible to make the legacy canvas also use the
VIEW_ITEM::ViewDraw() function?

You can find my source code at
https://github.com/andreasbuhr/kicad/commits/add_triangle_meshing

thanks and best regards,
Andreas

> 
> -Jon
> 
> On Tue, Dec 5, 2017 at 9:42 AM, Andreas Buhr  > wrote:
> 
> Dear Kicad developers,
> 
> I am browsing the Kicad source code to get an idea how to integrate a
> simulation tool.
> 
> I'd like the following:
> 
> 1. The plugin should be informed whenever something changes. It would be
> great to get a bounding box of the change.
> 2. The plugin should be able to draw on the canvas. I'd like to register
> a new layer (for example to show the triangle mesh). The user should
> then be able to enable/disable this layer.
> 
> These two requirements are in some sense similar to the requirements of
> "ratsnest", so I followed "ratsnest" through the code.
> 
> Concerning (1):
> I got the impression that it is not easy to be informed about all
> changes in a BOARD. Is this correct?
> 
> Concerning (2):
> And I got the impression that there is not one way to draw to the
> canvas. I found two drawing methods for ratsnest, one in PCB_BASE_FRAME,
> the other in RATSNEST_VIEWITEM::ViewDraw. Is it necessary to implement
> two drawing methods for each feature?
> 
> And it seems that the layers are organized in an enum (GAL_LAYER_ID), so
> adding a layer at runtime seems impossible without larger infrastructure
> changes. Is this correct?
> 
> What would you propose? How can a plugin be informed about all changes
> to the board? And how could a plugin draw on the canvas?
> 
> thanks a lot in advance,
> Cheers,
> Andreas
> 
> 
> On 11/30/2017 12:18 AM, Wayne Stambaugh wrote:
> > Hi Andreas,
> >
> > Per our previous conversation, if you want to write your solver in
> C++,
> > then I would prefer that you do it as part of a solver plugin rather
> > than a command event handler in Pcbnew.  I image there would be other
> > uses for a solver plugin object such as a thermal mapping solver which
> > has been proposed in the past.  The other option would be to use the
> > Python action object and write the entire solver in Python rather than
> > C++.  That may make your life a bit easier.
> >
> > Cheers,
> >
> > Wayne
> >
> > On 11/29/2017 01:09 PM, Andreas Buhr wrote:
> >> Dear Kicad developers,
> >>
> >> I'm new to Kicad development. Maybe you could give me some
> starting tips?
> >>
> >> I am a 5th year PhD student at the university of Münster in Germany,
> >> website:
> >>
> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> 
> >>
> >> I am doing mathematical research targeted at developing solvers
> for 3D
> >> Maxwell's equations in highly complex structures, such as PCBs. While
> >> being in an early stage, the goal is to develop a signal integrity
> >> solver which does a full-wave simulation of the electromagnetic
> fields
> >> and calculates S-parameters within a very short time.
> >>
> >> I would love to develop and test my algorithms within KiCad.
> >>
> >> The input which my solver needs would be an array of polygons,
> >> representing the copper-filled areas on each layer.
> >> I then want to create a 2D triangle mesh and based on that a 3D prism
> >> mesh for finite element analysis.
> >>
> >> What would you recommend? How to I get polygons, representing the
> copper
> >> filled areas of each layer?
> >> I do have some experience developing C++.
>

Re: [Kicad-developers] Signal integrity simulation within Kicad

2017-12-05 Thread Jon Evans
Hi Andreas,

For (1), I will defer to others who know more about this, I seem to
remember a conversation about this a while ago on the mailing list, with
the conclusion being that it is indeed hard to be notified when BOARD
changes, and fixing this could be a bit of work.

For (2), the PCB_BASE_FRAME methods are for the legacy canvas, so I
wouldn't worry about implementing your feature there if I were you, since
it will eventually be removed.
The RATSNEST_VIEWITEM is what is used on the GAL (OpenGL/Cairo) canvases.

Regarding the layer, you could use LAYER_GP_OVERLAY for prototyping, but
you are right that (at the moment) you can't add layers at runtime.
If you think that all of the simulation outputs can be drawn with a single
graphics layer, I think it is perfectly reasonable for you to expand the
enum with another layer definition.
You could use this new layer for your triangle mesh drawing, and then use
LAYER_GP_OVERLAY if you wanted to add any annotations to the graphics
perhaps? (meaning: measurements, etc, as is done with the RULER_ITEM)

-Jon

On Tue, Dec 5, 2017 at 9:42 AM, Andreas Buhr  wrote:

> Dear Kicad developers,
>
> I am browsing the Kicad source code to get an idea how to integrate a
> simulation tool.
>
> I'd like the following:
>
> 1. The plugin should be informed whenever something changes. It would be
> great to get a bounding box of the change.
> 2. The plugin should be able to draw on the canvas. I'd like to register
> a new layer (for example to show the triangle mesh). The user should
> then be able to enable/disable this layer.
>
> These two requirements are in some sense similar to the requirements of
> "ratsnest", so I followed "ratsnest" through the code.
>
> Concerning (1):
> I got the impression that it is not easy to be informed about all
> changes in a BOARD. Is this correct?
>
> Concerning (2):
> And I got the impression that there is not one way to draw to the
> canvas. I found two drawing methods for ratsnest, one in PCB_BASE_FRAME,
> the other in RATSNEST_VIEWITEM::ViewDraw. Is it necessary to implement
> two drawing methods for each feature?
>
> And it seems that the layers are organized in an enum (GAL_LAYER_ID), so
> adding a layer at runtime seems impossible without larger infrastructure
> changes. Is this correct?
>
> What would you propose? How can a plugin be informed about all changes
> to the board? And how could a plugin draw on the canvas?
>
> thanks a lot in advance,
> Cheers,
> Andreas
>
>
> On 11/30/2017 12:18 AM, Wayne Stambaugh wrote:
> > Hi Andreas,
> >
> > Per our previous conversation, if you want to write your solver in C++,
> > then I would prefer that you do it as part of a solver plugin rather
> > than a command event handler in Pcbnew.  I image there would be other
> > uses for a solver plugin object such as a thermal mapping solver which
> > has been proposed in the past.  The other option would be to use the
> > Python action object and write the entire solver in Python rather than
> > C++.  That may make your life a bit easier.
> >
> > Cheers,
> >
> > Wayne
> >
> > On 11/29/2017 01:09 PM, Andreas Buhr wrote:
> >> Dear Kicad developers,
> >>
> >> I'm new to Kicad development. Maybe you could give me some starting
> tips?
> >>
> >> I am a 5th year PhD student at the university of Münster in Germany,
> >> website:
> >> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> >>
> >> I am doing mathematical research targeted at developing solvers for 3D
> >> Maxwell's equations in highly complex structures, such as PCBs. While
> >> being in an early stage, the goal is to develop a signal integrity
> >> solver which does a full-wave simulation of the electromagnetic fields
> >> and calculates S-parameters within a very short time.
> >>
> >> I would love to develop and test my algorithms within KiCad.
> >>
> >> The input which my solver needs would be an array of polygons,
> >> representing the copper-filled areas on each layer.
> >> I then want to create a 2D triangle mesh and based on that a 3D prism
> >> mesh for finite element analysis.
> >>
> >> What would you recommend? How to I get polygons, representing the copper
> >> filled areas of each layer?
> >> I do have some experience developing C++.
> >>
> >> thanks a lot in advance,
> >> best regards,
> >>
> >> Andreas
> >>
> >>
> >>
> >> ___
> >> 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
> >
>
>
>
> ___
> Mailing list: https://launchpad

Re: [Kicad-developers] Signal integrity simulation within Kicad

2017-12-05 Thread Andreas Buhr
Dear Kicad developers,

I am browsing the Kicad source code to get an idea how to integrate a
simulation tool.

I'd like the following:

1. The plugin should be informed whenever something changes. It would be
great to get a bounding box of the change.
2. The plugin should be able to draw on the canvas. I'd like to register
a new layer (for example to show the triangle mesh). The user should
then be able to enable/disable this layer.

These two requirements are in some sense similar to the requirements of
"ratsnest", so I followed "ratsnest" through the code.

Concerning (1):
I got the impression that it is not easy to be informed about all
changes in a BOARD. Is this correct?

Concerning (2):
And I got the impression that there is not one way to draw to the
canvas. I found two drawing methods for ratsnest, one in PCB_BASE_FRAME,
the other in RATSNEST_VIEWITEM::ViewDraw. Is it necessary to implement
two drawing methods for each feature?

And it seems that the layers are organized in an enum (GAL_LAYER_ID), so
adding a layer at runtime seems impossible without larger infrastructure
changes. Is this correct?

What would you propose? How can a plugin be informed about all changes
to the board? And how could a plugin draw on the canvas?

thanks a lot in advance,
Cheers,
Andreas


On 11/30/2017 12:18 AM, Wayne Stambaugh wrote:
> Hi Andreas,
> 
> Per our previous conversation, if you want to write your solver in C++,
> then I would prefer that you do it as part of a solver plugin rather
> than a command event handler in Pcbnew.  I image there would be other
> uses for a solver plugin object such as a thermal mapping solver which
> has been proposed in the past.  The other option would be to use the
> Python action object and write the entire solver in Python rather than
> C++.  That may make your life a bit easier.
> 
> Cheers,
> 
> Wayne
> 
> On 11/29/2017 01:09 PM, Andreas Buhr wrote:
>> Dear Kicad developers,
>>
>> I'm new to Kicad development. Maybe you could give me some starting tips?
>>
>> I am a 5th year PhD student at the university of Münster in Germany,
>> website:
>> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
>>
>> I am doing mathematical research targeted at developing solvers for 3D
>> Maxwell's equations in highly complex structures, such as PCBs. While
>> being in an early stage, the goal is to develop a signal integrity
>> solver which does a full-wave simulation of the electromagnetic fields
>> and calculates S-parameters within a very short time.
>>
>> I would love to develop and test my algorithms within KiCad.
>>
>> The input which my solver needs would be an array of polygons,
>> representing the copper-filled areas on each layer.
>> I then want to create a 2D triangle mesh and based on that a 3D prism
>> mesh for finite element analysis.
>>
>> What would you recommend? How to I get polygons, representing the copper
>> filled areas of each layer?
>> I do have some experience developing C++.
>>
>> thanks a lot in advance,
>> best regards,
>>
>> Andreas
>>
>>
>>
>> ___
>> 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
> 




signature.asc
Description: OpenPGP digital signature
___
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] Signal integrity simulation within Kicad

2017-11-30 Thread Julius Schmidt
This may be a bit off-topic but it may be worth noting that this routine 
(or rather, D_PAD::TransformShapeWithClearanceToPolygon) produces 
slightly incorrect results for oval pads with positive aClearanceValue.


See https://bugs.launchpad.net/kicad/+bug/1665582.

On Wed, 29 Nov 2017, Tomasz Wlostowski wrote:


On 29/11/17 19:09, Andreas Buhr wrote:

Dear Kicad developers,

I'm new to Kicad development. Maybe you could give me some starting tips?

I am a 5th year PhD student at the university of Münster in Germany,
website:
https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml

I am doing mathematical research targeted at developing solvers for 3D
Maxwell's equations in highly complex structures, such as PCBs. While
being in an early stage, the goal is to develop a signal integrity
solver which does a full-wave simulation of the electromagnetic fields
and calculates S-parameters within a very short time.

I would love to develop and test my algorithms within KiCad.

The input which my solver needs would be an array of polygons,
representing the copper-filled areas on each layer.
I then want to create a 2D triangle mesh and based on that a 3D prism
mesh for finite element analysis.

What would you recommend? How to I get polygons, representing the copper
filled areas of each layer?
I do have some experience developing C++.

thanks a lot in advance,
best regards,


Hi Andreas,

It's absolutely fantastic to hear you're working on an SI solver and
that you want to develop it within KiCad!

For the moment, there's no one-liner way to get the entire board
geometry represented as polygons - the closest is to for each BOARD_ITEM:


BOARD_ITEM::TransformShapeWithClearanceToPolygonoid
TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
 int aClearanceValue,
 int aCircleToSegmentsCount,
 double aCorrectionFactor ) const;

with aClearanceValue = 0 or 1 (= 1nm) - I'm not 100% sure if a value of
0 will be accepted and aCircleToSegments count large enough to
approximate arcs correctly.

aCornerBuffer is a SHAPE_POLY_SET object which represents a set of
polygons with holes, see qa/geometry for some example/test code.

Let me know if you need any help!

Best,
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] Signal integrity simulation within Kicad

2017-11-30 Thread Kristoffer Ödmark
This is very interesting indeed! Would you keep us updated of your 
progress? :D


- Kristoffer

On 11/29/2017 10:55 PM, Andreas Buhr wrote:

On 11/29/2017 08:07 PM, Tomasz Wlostowski wrote:

On 29/11/17 19:09, Andreas Buhr wrote:


[snip]


The input which my solver needs would be an array of polygons,
representing the copper-filled areas on each layer.
I then want to create a 2D triangle mesh and based on that a 3D prism
mesh for finite element analysis.


I've made a quick test program that prints most of the board's geometry
as bare polygons. It's here:

https://github.com/twlostow/kicad-dev/tree/tom-polygon-gen/qa/polygon_generator

Hope it can serve you as a starting point.


Hi Tom,

wow, that's absolutely amazing. Thank you so much. I just generated 20
megabytes of polygons, running your test program on the A64 OLinuxino
board by Olimex :-)
I hope I can do some SI simulations of its DDR3 memory channel. :-)


Cheers,
Andreas



___
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



--
 -Kristoffer

___
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] Signal integrity simulation within Kicad

2017-11-29 Thread Wayne Stambaugh
On 11/29/2017 06:21 PM, Tomasz Wlostowski wrote:
> On 30/11/17 00:18, Wayne Stambaugh wrote:
>> Hi Andreas,
>>
>> Per our previous conversation, if you want to write your solver in C++,
>> then I would prefer that you do it as part of a solver plugin rather
>> than a command event handler in Pcbnew.  I image there would be other
>> uses for a solver plugin object such as a thermal mapping solver which
>> has been proposed in the past.  The other option would be to use the
>> Python action object and write the entire solver in Python rather than
>> C++.  That may make your life a bit easier.
>>
> Hi Wayne,
> 
> I fully agree about the C++ part, but I would object doing it in Python
> given the current state of pcbnew's Python support. It's not mature
> enough IMHO to allow development of large plugins.

I agree but something like a signal integrity solver would definitely
shake out any weaknesses in our python support.

> 
> BTW - I guess the plugin part is rather trivial compared to the actual
> solver, which I believe is not Kicad-dependent?

Besides the plugin loading and unloading, the only method I could think
of is Solve( const BOARD& aBoard ).  Maybe a rendering method to display
the results of the solver but that would outside the board rendering.
It will be interesting to see were this leads.

> 
> Cheers,
> 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] Signal integrity simulation within Kicad

2017-11-29 Thread Tomasz Wlostowski
On 30/11/17 00:18, Wayne Stambaugh wrote:
> Hi Andreas,
> 
> Per our previous conversation, if you want to write your solver in C++,
> then I would prefer that you do it as part of a solver plugin rather
> than a command event handler in Pcbnew.  I image there would be other
> uses for a solver plugin object such as a thermal mapping solver which
> has been proposed in the past.  The other option would be to use the
> Python action object and write the entire solver in Python rather than
> C++.  That may make your life a bit easier.
> 
Hi Wayne,

I fully agree about the C++ part, but I would object doing it in Python
given the current state of pcbnew's Python support. It's not mature
enough IMHO to allow development of large plugins.

BTW - I guess the plugin part is rather trivial compared to the actual
solver, which I believe is not Kicad-dependent?

Cheers,
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] Signal integrity simulation within Kicad

2017-11-29 Thread Wayne Stambaugh
Hi Andreas,

Per our previous conversation, if you want to write your solver in C++,
then I would prefer that you do it as part of a solver plugin rather
than a command event handler in Pcbnew.  I image there would be other
uses for a solver plugin object such as a thermal mapping solver which
has been proposed in the past.  The other option would be to use the
Python action object and write the entire solver in Python rather than
C++.  That may make your life a bit easier.

Cheers,

Wayne

On 11/29/2017 01:09 PM, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> I'm new to Kicad development. Maybe you could give me some starting tips?
> 
> I am a 5th year PhD student at the university of Münster in Germany,
> website:
> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> 
> I am doing mathematical research targeted at developing solvers for 3D
> Maxwell's equations in highly complex structures, such as PCBs. While
> being in an early stage, the goal is to develop a signal integrity
> solver which does a full-wave simulation of the electromagnetic fields
> and calculates S-parameters within a very short time.
> 
> I would love to develop and test my algorithms within KiCad.
> 
> The input which my solver needs would be an array of polygons,
> representing the copper-filled areas on each layer.
> I then want to create a 2D triangle mesh and based on that a 3D prism
> mesh for finite element analysis.
> 
> What would you recommend? How to I get polygons, representing the copper
> filled areas of each layer?
> I do have some experience developing C++.
> 
> thanks a lot in advance,
> best regards,
> 
> Andreas
> 
> 
> 
> ___
> 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] Signal integrity simulation within Kicad

2017-11-29 Thread Andreas Buhr
On 11/29/2017 08:07 PM, Tomasz Wlostowski wrote:
> On 29/11/17 19:09, Andreas Buhr wrote:

[snip]

>> The input which my solver needs would be an array of polygons,
>> representing the copper-filled areas on each layer.
>> I then want to create a 2D triangle mesh and based on that a 3D prism
>> mesh for finite element analysis.
> 
> I've made a quick test program that prints most of the board's geometry
> as bare polygons. It's here:
> 
> https://github.com/twlostow/kicad-dev/tree/tom-polygon-gen/qa/polygon_generator
> 
> Hope it can serve you as a starting point.

Hi Tom,

wow, that's absolutely amazing. Thank you so much. I just generated 20
megabytes of polygons, running your test program on the A64 OLinuxino
board by Olimex :-)
I hope I can do some SI simulations of its DDR3 memory channel. :-)


Cheers,
Andreas



signature.asc
Description: OpenPGP digital signature
___
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] Signal integrity simulation within Kicad

2017-11-29 Thread Tomasz Wlostowski
On 29/11/17 19:09, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> I'm new to Kicad development. Maybe you could give me some starting tips?
> 
> I am a 5th year PhD student at the university of Münster in Germany,
> website:
> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> 
> I am doing mathematical research targeted at developing solvers for 3D
> Maxwell's equations in highly complex structures, such as PCBs. While
> being in an early stage, the goal is to develop a signal integrity
> solver which does a full-wave simulation of the electromagnetic fields
> and calculates S-parameters within a very short time.
> 
> I would love to develop and test my algorithms within KiCad.
> 
> The input which my solver needs would be an array of polygons,
> representing the copper-filled areas on each layer.
> I then want to create a 2D triangle mesh and based on that a 3D prism
> mesh for finite element analysis.

Hi Andreas,

I've made a quick test program that prints most of the board's geometry
as bare polygons. It's here:

https://github.com/twlostow/kicad-dev/tree/tom-polygon-gen/qa/polygon_generator

Hope it can serve you as a starting point.

Cheers,
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] Signal integrity simulation within Kicad

2017-11-29 Thread Tomasz Wlostowski
On 29/11/17 19:09, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> I'm new to Kicad development. Maybe you could give me some starting tips?
> 
> I am a 5th year PhD student at the university of Münster in Germany,
> website:
> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
> 
> I am doing mathematical research targeted at developing solvers for 3D
> Maxwell's equations in highly complex structures, such as PCBs. While
> being in an early stage, the goal is to develop a signal integrity
> solver which does a full-wave simulation of the electromagnetic fields
> and calculates S-parameters within a very short time.
> 
> I would love to develop and test my algorithms within KiCad.
> 
> The input which my solver needs would be an array of polygons,
> representing the copper-filled areas on each layer.
> I then want to create a 2D triangle mesh and based on that a 3D prism
> mesh for finite element analysis.
> 
> What would you recommend? How to I get polygons, representing the copper
> filled areas of each layer?
> I do have some experience developing C++.
> 
> thanks a lot in advance,
> best regards,

Hi Andreas,

It's absolutely fantastic to hear you're working on an SI solver and
that you want to develop it within KiCad!

For the moment, there's no one-liner way to get the entire board
geometry represented as polygons - the closest is to for each BOARD_ITEM:


BOARD_ITEM::TransformShapeWithClearanceToPolygonoid
TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
  int aClearanceValue,
  int aCircleToSegmentsCount,
  double aCorrectionFactor ) const;

with aClearanceValue = 0 or 1 (= 1nm) - I'm not 100% sure if a value of
0 will be accepted and aCircleToSegments count large enough to
approximate arcs correctly.

aCornerBuffer is a SHAPE_POLY_SET object which represents a set of
polygons with holes, see qa/geometry for some example/test code.

Let me know if you need any help!

Best,
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] Signal integrity simulation within Kicad

2017-11-29 Thread Jon Evans
Hi Andreas,

This is a neat idea!  It would be great to have a nice open-source tool for
this, as all of the useful ones today are very expensive and proprietary.

As far as I know (others please correct me if I am wrong), there isn't
currently any functionality to generate polygons from the entire copper of
a layer.
Poured zones are represented as polygons, so those are easy, but tracks are
represented differently.
So, you would likely need to write some code to convert the copper items
other than zones (i.e. tracks, vias, pads, etc) to polygons so you can mesh
them.

You might want to look at the 3D viewer for inspiration, since it already
does a similar task of extracting all the design data in order to render it
in 3D.
You can see in ./3d-viewer/3d_canvas/create_layer_items.cpp some of the
code that does this, so it might be a good starting point.

Best,
Jon

On Wed, Nov 29, 2017 at 1:09 PM, Andreas Buhr 
wrote:

> Dear Kicad developers,
>
> I'm new to Kicad development. Maybe you could give me some starting tips?
>
> I am a 5th year PhD student at the university of Münster in Germany,
> website:
> https://www.uni-muenster.de/AMM/en/ohlberger/team/andreas_buhr.shtml
>
> I am doing mathematical research targeted at developing solvers for 3D
> Maxwell's equations in highly complex structures, such as PCBs. While
> being in an early stage, the goal is to develop a signal integrity
> solver which does a full-wave simulation of the electromagnetic fields
> and calculates S-parameters within a very short time.
>
> I would love to develop and test my algorithms within KiCad.
>
> The input which my solver needs would be an array of polygons,
> representing the copper-filled areas on each layer.
> I then want to create a 2D triangle mesh and based on that a 3D prism
> mesh for finite element analysis.
>
> What would you recommend? How to I get polygons, representing the copper
> filled areas of each layer?
> I do have some experience developing C++.
>
> thanks a lot in advance,
> best regards,
>
> Andreas
>
>
> ___
> 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