← Back to team overview

kicad-developers team mailing list archive

Re: 3d-viewer patches

 

----- Original Message -----

> From: Martin Janitschke <imp@xxxxxxxxxxxxxxx>
> To: kicad-developers@xxxxxxxxxxxxxxxxxxx
> Cc: 
> Sent: Sunday, February 23, 2014 9:53 AM
> Subject: [Kicad-developers] 3d-viewer patches
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Heyho,
> there are currently two reports with different wrl files causing the
> 3d-viewer to crash at different places.
> The reports are:
> https://bugs.launchpad.net/kicad/+bug/673603 and
> https://bugs.launchpad.net/kicad/+bug/804778 .
> 
> The patch
> https://bugs.launchpad.net/kicad/+bug/804778/+attachment/3991942/+files/fix-3d-viewer-parsing-segfault-v2.patch
> avoids both crashes. I would be happy if it will be reviewed and applied.
> 
> It does not fix the rendering problem with what has been parsed (the
> wrl from the second report can be opened in firefox as reference).
> Are there plans to support the complete wrl syntax?
> Or should the 3d-viewer display an error that it encountered some
> models which might not have been parsed correctly and an note how to
> convert those files to simpler, understood, files? (This would save us
> from new reports about incorrect display of 3d models).
> 
> Bye,
> imp


Hi Martin,

 Thanks for finding those null dereference bugs. VRML support is tricky;
one of the biggest general problems I find with VRML2 is the support in
each viewer implementation.

I've spent some time recently trying to work out what command set I can
use which is compatible with KiCad and also with Blender, whitedune,
and view3dscene as viewers. I also have a few notes on a basic set of
VRML constructs which are safe to use with KiCad and a few limitations
of KiCad; the notes can be found here:

http://sourceforge.net/projects/kicad3dmodels/files/source_v0.5/


A very brief summary of my more recent investigation of VRML:

Viewer      Construct    Notes
blender     extrusion    not supported
            USE          OK

view3dscene extrusion    supported
            USE          OK

whitedune   extrusion    supported
            USE          OK

Since Blender is one of the few free tools people are likely to use for
viewing VRML files, I'm afraid we're stuck with not supporting extrusions
for now. This is probably not a bad thing since they involve so many more
calculations. :)

I played around with USE a lot because it would be nice to define a repeated
object such as an IC pin and simply use Transform + USE to define all the
other instances. I plan to make use of such a thing in the IDF->VRML
converter I am planning. It would be nice if KiCad supported this because it
makes some model files much more compact - BUT I have looked into this and
it seems to me the best way to support that in KiCad is to do a major rewrite
of the 3d viewer's 3D data model. This is not a small job so I have decided
to simply continue using what I'm familiar with. One possible approach is
to look at the code for view3dscene to see what license it has and how
easy it might be to take sections and modify to work with KiCad.

- Cirilo


References