OCCT Visualization performance

As we know, FreeCAD decided to use Coin3D (OpenInventor) to increase visualization performance. So what about OCCT Visualization in 2021 ? Equal performance? may be better? or still worse?

Kirill Gavrilov's picture

From FreeCAD documentation:

Coin3D (Open Inventor) is used as the 3D viewer in FreeCAD because the OpenCASCADE viewer (AIS and Graphics3D) has limitations and performance bottlenecks, especially with large-scale engineering rendering; other things like textures or volumetric rendering are not entirely supported by the OpenCASCADE viewer.

and from here:

The geometry that appears in the 3D views of FreeCAD is rendered by the Coin3D library. Coin3D is an implementation of the OpenInventor standard. The OpenCASCADE software also provides the same functionality, but it was decided at the very early stages of FreeCAD not to use the built-in OpenCASCADE viewer, but rather switch to the more performant Coin3D software. A

FreeCAD 0.1 was published in '2003 which was probably based on Open CASCADE 4.0. From another post:

Since that time, Werner Meyer is a very active developer of FreeCAD. In 2005, after one year of struggle, I decided to rip of the OpenCascade document framework and replace it with an own implementation. So, at the end, we only use the CAD kernel of OpenCascade and not the rest of its Framework.

I may consider that even if FreeCAD has been using AIS for visualization at the very beginning, most likely this was before '2005 corresponding to Open CASCADE Technology 5.2 the latest.

At that time OCCT intensively used legacy OpenGL API for drawing arrays, and shifted to use VBO (Vertex Buffer Object) since OCCT 6.4.0 ('2010), which was a big jump in performance. Since that, a lot of work has been put into further improvements of OCCT Viewer performance and functionality.

So I may guess that indeed at the early FreeCAD development stages OCCT Viewer may suffered from performance issues, although I'm not familiar with Coin3D and FreeCAD evolution to confirm that - what I've seen in FreeCAD source code circa 5 years ago looked like suboptimal usage of OpenGL having a good potential for improvements. Original complains might be also related not to OCCT Viewer performance at all, but to OCAF document bindings (TPrsStd) or to counter-efficient usage of AIS functionality at application level.

Anyway, I believe that this very old experience is not applicable to up-to-date OCCT Visualization. There is no simple way comparing performance in equal conditions, because it highly depends on application context and application-level optimizations, but you may try opening some large STEP files in FreeCAD and CAD Assistant to see some numbers, which OCCT 3D Viewer (CAD Assistant) may show in good conditions.

Sathiya nathan's picture

I tried to create polygon like line with thickness between every mouse click on the screen dynamically and while mouse move I create a new polygon with
current mouse point on the screen and calls ReDisplay function of AIS context. But unfortunately after few segment. It starts to flickering and the rendering seems very slow. I have added the image for reference.

Kirill Gavrilov's picture

Every framework could show performance issues, especially when it is used in unexpected ways. One may only imagine how presentation on screenshot has been constructed, but while using AIS (and I guess any other graphics engine) dynamic elements shown on mouse movement / mouse clicks are normally displayed using temporary preview presentations to avoid expensive operations being called at each small step - a final shape is computed at the end of operation.