← Back to team overview

kicad-developers team mailing list archive

Re: 3D-Viewer new rendering and contributions.

 

>>  What do the models look like in another 3D viewer which correctly renders
>>  normals? It's hard to tell with 3DViewer because it looks to me like
> every
>>  facet is rendered on both sides (but that may be correct - the surface
>>  may have the 'solid' attribute). If a facet were rendered only on 1
> side it
>>  would be much easier to tell because the facet would be invisible from the
>>  wrong side.
>>
>>  - Cirilo
>>
> What viewer do you suggest? Does blender do it correctly?
>
> I would try 'view3dscene' or even 'whitedune' although whitedune has a
> frustrating interface. The VRML support in Blender is awful.
> - Cirilo

I tried FreeCad and view3dscene and it look the same bad looking normals and look the same as 3D-Viewer will render the embedded normals.
For me, this is because the embedded normals are simply bad.

I will remind you about the real propose of embedded normals with a model: As a mesh (tri or quad) model is a discreet representation of reality or something ideal (a circular shape, spherical.. etc) the normals when calculated over that "real / ideal" initial data, are some more visual hint representation to render the model.
So for example if you are generate a mesh with normals for a cylinder it must use the cylinder math formula to calculate the ideal normal in each vertex:
http://math.hws.edu/graphicsnotes/c2/FlatAndCurved.png
http://math.hws.edu/graphicsnotes/c2/Normals.png

So my guess, is that some of this 3d models files we get or convert from original (ideal CAD designed, with lines, curves, etc) have their normals not properly calculated and embedded in the file.

The way to go IMO is: or the bad normals (normals values and indexes) are removed from file and 3d-viewer will (very slowly) calculate it, or you can get some software that will recalculated good normals (in this case should be consider fake normals, since there are no "ideal" information from original model shape) and embedded it on model.

With that 5Mb files from Nick 3dViewer will take minutes to calculate the normals :( .. but they will look good! :)

Maybe in future, I should add a fast still good algorithm to calculate the normals for very large models.

Regards,
Mario Luzeiro


References