Blender import export FBX, STP, STEP, IGES and 42

As you all know 42 is the final answer of life, the universe (and thus also all 3d file conversions).

If you ever did work for clients who gave you FBX or STEP or IGES files (while they claimed their superior file formats, (indeed STEP is an ISO certified format, but main industry lost interest for it.
And you had to work with it, for a render or animation or so, or to fix their meshes because their 3d printer couldnt handle it, as it looked terrible…

Today i noticed what is really going wrong each time with those files.
STP was designed for CAM (computer aided manufacturing), and thus a language with commands such as drill down drill up drill size etc. Its excelent in a sence that a drillhole is exactly round.
We blender users know that computers are digital and thus true roundness doesnt exist.
We get blamed for triangulated meshes, but at a lower lever its all a computer understands dot vertix positions. So the people who blame you might not understand digital drawings…
(PS i do understrand a robot arm drilling a hole is a perfect round hole, its just not a perfect drawing).

Thus while those programs show perfect shapes at all zoom levels in their editors.
Once they save it as mesh data, based upon their descriptions, ( ea at positions x,y,z drill a 8mm hole 20 mm down or make a rounded corners of radius 7 mm), those programs have to convert.
Before this point all they did was procedural (as modifier based in blender terms) drawing.
So when they do a conversion to a “real” mesh layout, they generate artifacts.
When they create a STL or OBJ or Collada, their exported drawings look bad…
Not a fault of those formats, most of the time fault of low level conversion ( fit level ), or errors in the converting code of those programs.

While it gives us work to do retopo (some bevel can fix a lot in thos drawings).
I always wondered why it is that they generated such a bad topology.
By the way if you want to go back from blender to collada to STP you have to watch this:
It explains how to convert an imported model (collada) to the other industry mesh format STP.

https://www.youtube.com/watch?v=x6ESAAfFT1A

And notice in the youtube link above at some point there is a talk about the fit setting when converting to STP, in here relies a holly grail of converting, that fit is about what to do with circle approximation, how much a line can be off, off a circle in the STP generation process, and this in general how the ‘other side’ formats handle circle objects, and free form objects during conversions.

Be also aware if you recieve some NGON circle from ‘other side’ 3d format, that it is most likely a approximation if you depend on it, for fitting parts, than remind yourself their NGON isnt round nor is your blender circle (but at least you knew that), and yes some CAM might prefer ‘other world’ 3d formats because they understan drill up and drill down, with complex 3D prints even they have problems. And then blender might be a luxery as your conversion to STL will not contain suprices its exactly a circle with amount of faces you considered smooth.

And now why did i post it in the Blender development discusion, well to straighten some missunderstanding but also because freecad is also an opensource drawing tool.
May i sugest someone to develop STP export import.
The code allready exits to convert it.
As the conversion blender => collada ==> STP works (although file size might explode)

When i go the other way FreeCad STP model ==> collada /STL ==> blender
I somehow endup with a lot of duplicated objects, though they can be removed manually.

(It requires a bit of knowledge and understanding, fix drawings, but having STP import/export in blender would surely be nice for those working in, or width people in the ‘other world’ side of the industry.

STEP/IGES and other CAD formats represent surfaces (“boundary representation”) mathematically. With planes, simple surfaces (sphere, cylinder) and more complex geometry with NURBS-patches.
Of course, once the data is used (for rendering on your monitor, or 3D-printing or CAM), then it is converted to triangles. But you still have the original infinitely precise data in the background. CAD programs use this for example to calculate the normals, so you see no rendering artifacts, even with a very coarse triangulation.
This is lost when converting to Blender (through STL for example). Most CAD programs output messy triangulation. The triangles are actually precise, in the sense that they keep a given maximal deviation from the original surface (the fit that you talk about). But they are still not optimal for rendering, as this fit sometimes lead to very long and very thin triangles, which lead to deviations of their face normals (compared to their neighbouring triangles). This leads to rendering artifacts in programs like Blender.
One way to solve this is if you have a program (usually $$$!) that can not only triangulate a STEP/IGES file, but also saves the proper normals for the triangles, into a format that can save custom normals data (FBX). Then Blender can import and show the data properly, as long as you don’t do any operation that destroys the custom normals in Blender (like editing the mesh).

Of course it would be much better if Blender could natively read and display NURBS data. Then it would always have access to the infinitely precise geometry, and could calculate the proper normals. There was a GSOC project a few years ago, which even had a functioning prototype at the end. It could load/convert/display proper boundary representation surfaces. Unfortunately, it was never merged, and was abandoned.
Unless there is interest (+ time + funding) from the Blender developers for such a feature, we will have to keep using workarounds for CAD-data.

1 Like

@Zsoft @Razorblade
if your using freecad, then you’notice its in the export triangulation takes place.
I tend to believe though its not that much a difference, in a sence.
If you do hardsurface modeling with mostly modifiers the situation is much the same.
Where autocad differs here is that it does an automatic segmentation based upon curve fit level, in blender we dont have that
(but it shouldnt be that hard either to program)

Its even kinda fun when talking to CAM people they go from CAD drawing and depend on vertex solving software and personal knowledge to get the best result
CAD isnt infinite precize just Double vertex precizion and a slightly different approuch to displaying shapes.