Proper Vertex Normals on Meshes

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
SteffenD
Posts: 1
Joined: Fri May 06, 2022 10:59 am

Proper Vertex Normals on Meshes

Post by SteffenD »

Hi there,

I'm trying to use FreeCAD to convert CAD data (mostly STEP files) to polygons / meshes for rendering and visualizations.
I still haven't found a way to get proper clean vertex normals on these meshes. I found an 8 year old and no longer working macro ( https://github.com/andreasBihlmaier/Fre ... ls.FCMacro ) and that's about all I could find about this topic.

All the meshing algorithms in "Mesh Design" don't calculate or output normals based on the surfaces they were generated from. Shading these meshes in polygon based 3D software looks faceted and ugly. And I'm not talking about nice quads or edge loops and other cosmetic stuff: Only proper vertex normals.

If I use e.g. Rhino, MOI or even the free "CAD Assistant" software the polygons look rather messy as well BUT they output vertex normals that give me proper and clean shading in a renderer afterwards.

Even the shading in FreeCAD's viewport looks perfect and these are already polygons, right? Can I somehow just export these polygons without losing the vertex normal data? If I just use Export to get an e.g. OBJ file, I get the mesh from the viewport but not the normals. It looks garbled and / or facetted.

Am I missing something or is noone else here using the mesh export for rendering?

Thanks :)
Post Reply