← Back to team overview

kicad-developers team mailing list archive

Re: Plugin plans (post-stable release)

 

Hi Tom,


> - a cleanup of the 3D model loading/storage code: a clean mesh class
> (holding the geometry/assembly info) and refactoring of the 3d-viewer

Ya, I started already thinking/working on some ideas for a future 3d-viewer (not only the model parsers) [3].
As I explained before [1][2], I am not thinking to contribute more to the current 3d-viewer as it is. Instead, I would like to spend time develop this new version.



> (and further on, exporter code) to use it.

3d-viewer is something a bit aside from the rest of the kicad.
The only thing 3d-viewer is exporting are .png and .jpg files :) The "model exporters" ("supported by Cirilo") is related with pcbnew.
One of my ideas is that the "3d-viewer model parsers library" could be used in the future by the other parts of the code (eg: the importers / exporters... of the pcbnew).
So we could have something like:
3dmodel = modelparser.Load( "full path file name" );
3dmodel.GetBBox(); ...
3dmodel.MeshTriList()...

Probably something like that could be possible now or not (I don't remember :| ) but I remember that all that code (I mean .. the architecture) is ugly and I dont like to look on that :)
(well.. I believe that thankfully this is an opensource project and I can have the option to choose not do it :) )

I found useful this discussion so I can get a more clear view for a future design.



> I see you made the S3D_MESH class, which is already quite clean and could be easily integrated with the STEP mesher.

S3D_MESH was already there when I started, I don't remember exactly what I changed.. but added more support and capabilities. However, that is still very ugly.

Any way, It should be easier to add some importer, if you have a library that gives you a list of triangles already magically processed.
It should be just fill the (not elegant) S3D_MESH data.



> One thing that might be needed is storing same
> sub-meshes with different transforms (imagine a BGA footprint with 1000
> identical balls - the current design of the class requires copying the
> mesh data 1000 times, correct me if I'm wrong please).

I don't remember the details, however I believe that it not an issue *see note below..
The issue, that I will also try to address properly in the future, is the loading and processing of the model files.
Right now there is already a simple mechanism that will load just once a model that repeats in the board (per reload).
What I plan is to have a cache between "reloads" so that cache can be reused if you are opening (or maybe using) different boards.
Right now, the model loader spend some time to calculate the normals of the files (ideally we have cache files) so keep the cache (at least between refresh / reloads of the board) will help speed up the things.

*note: "the 1000 BGA balls"
That could lead to a bigger discussion, but I believe it doesn't matter much.
It should depend more on the engine that is rendering the model.
Lets say an example this two situations:
1. use one instance of the BGA ball and send it to the (memory of the) GPU. Then ask the GPU (passing all transformations every time it need to redraw) to render all the BGA balls one by one.
2. use one instance of the BGA ball, transform (on loading time) all the 1000 BGA balls and send it already transformed to GPU. Then ask the GPU to render "all balls".

So.. I am not sure which will be faster, but, I believe both options are faster so we shouldn't care much now.



> - improved way to associate a STEP/IGES/VRML/whatever with the PCB footprints.

What do you mean? You mean the "pcbnew footprint 3d library association UI" ?
That is related with pcbnew :)
However, as I discuss before, I plan (for a future version) that it will be possible then to "instantiate" (by a widget / canvas...) a 3d-viewer so it will be possible to add it to the UI and adjust "in real time" the module to the footprint.
So user will get immediately the feedback.


[1] https://lists.launchpad.net/kicad-developers/msg17605.html
[2] https://lists.launchpad.net/kicad-developers/msg17618.html
[3] https://lists.launchpad.net/kicad-developers/msg17861.html


Let me know anything else!

Mario Luzeiro
________________________________________
From: Tomasz Wlostowski [tomasz.wlostowski@xxxxxxx]
Sent: 16 June 2015 17:58
To: Mário Luzeiro; kicad-developers@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Kicad-developers] Plugin plans (post-stable release)

Basically, we need (just a brain dump below):
- a cleanup of the 3D model loading/storage code: a clean mesh class
(holding the geometry/assembly info) and refactoring of the 3d-viewer
(and further on, exporter code) to use it. I see you made the S3D_MESH
class, which is already quite clean and could be easily integrated with
the STEP mesher. One thing that might be needed is storing same
sub-meshes with different transforms (imagine a BGA footprint with 1000
identical balls - the current design of the class requires copying the
mesh data 1000 times, correct me if I'm wrong please).
- improved way to associate a STEP/IGES/VRML/whatever with the PCB
footprints.
- @Wayne - anything else?

Regards,
Tom




Follow ups

References