← Back to team overview

kicad-developers team mailing list archive

Re: Signal integrity simulation within Kicad

 

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 <andreas@xxxxxxxxxxxxxx>
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 <andreas@xxxxxxxxxxxxxx
> > <mailto:andreas@xxxxxxxxxxxxxx>> 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
> >     <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
> >     <https://launchpad.net/~kicad-developers>
> >     >> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     >> Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     >> More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >     >>
> >     >
> >     > _______________________________________________
> >     > Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     > Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >     >
> >
> >
> >
> >     _______________________________________________
> >     Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >
> >
>
>
>

References