← Back to team overview

kicad-developers team mailing list archive

Re: proposed future changes for 3D model handling

 

Hi Cirilo,

> I'm not very happy with the 3D manager being inside BOARD either; 
> I think the model parser should be completely separate from the display data.
> The parser should read the file and put the display data into a structure;
> the instance of the parser can be destroyed after that

In my ideas, (what I describe before and have in the UML diagrams), that structures are complete independent of the 3d viewer/display.
So if you think they should placed in a more convenient part I think it is OK. (since I expect that this structures could also be used by other pcbnew modules)

The parser will just run once you need to parse a file that is not in cache.

The 3dviewer display, will convert that structure for a whatever it needs (ex: to a vertex arrays.. or something else)


> Model manager sounds better. I would not associate it with 3DViewer though;
> for me the manager should also do the work of selecting and previewing
> models and setting the scale, rotation, and offset. 

I had not that idea. What I call model manager, is just a simple module that will return you a model by given a file name.

I guess that the Scale,rotation, offset, are set by each information in the footprint module.

> The manager may also be
> invoked by any 3D exporters such as the existing VRML and IDF exporters.

I think that should be splited. You can have another manager (if you want) that will get a 3d module structure and will convert it in something else.
I would prefer to have things in more small pieces (that can be reused in different forms latter) than have a complex module with lots of features.

> I'll pull in your branch and see what changes you've made so far.

In my branch, there are still no source code related with models or any 3d structures for models. You can only see it in the UML diagram that are in that other post.

> With the work I planned I think
> it is possible to write large parts of it without integrating with
> pcbnew,

You can have a look in my branch at:
http://bazaar.launchpad.net/~mrluzeiro/kicad/kicad_new3d-viewer/view/head:/pcbnew/s3d_master.cpp
http://bazaar.launchpad.net/~mrluzeiro/kicad/kicad_new3d-viewer/view/head:/pcbnew/s3d_master.h

That is where I put all "legacy" dependencies of the old 3d_viewer. The work I did so far are not using it.
That files are the ones I told that I think need to be reviewed, and I guess is what you propose with your work with "S3D_ENTRY" in 1. proposal.

> We will undoubtedly have some different ideas about things and I think
> it can be very difficult collaborating on a task like this when we are
> in very different timezones.

What I have in mind, is to try to make the things simpler, but well structured with classes etc. with parts that can be easily reused or integrated in other modules.
For example, I was looking for the "io_mgr" suggestion and I found it too complex for this propose.
What I have designed was a class that you give a model file name and it returns a data structure. That is the simple thing I need: give the filename, return a structure.
So just need to see the file extension to switch between the parser class that will read the file and import it to the structure.

I don't oppose then if you then want/need some "super module" that will do other more complex or fancy things.

>different timezones
Not a problem for me, I am only away from the PC about 6..8h per day :)

Mario Luzeiro

References