Let’s Understand the Scenegraph in FreeCAD

Lets Explore Basics Of The Freecad

What makes FreeCAD different from other software is its powerful libraries. FreeCAD is a collage of powerful libraries that are easy to use. In FreeCAD construction geometry managed by OpenCascade and Coin3D is used to display the created geometry at last Qt framework pull all this in a nice Graphical UI.

Also Read-:

Model Shifter in FreeCAD
Model Feed Guide in FreeCAD
Model Control Bracket in FreeCAD

Coin3D is most powerful library which does the main job to render the geometry created inside the 3D view of FreeCAD. In fact, OpenCascade viewer offers the same functionality, but FreeCAD developers had long term vision therefore they decided to use Coin3D which is implementation of the OpenInventor standard and more performant software.

As we learned that Coin3D is Implementation of OpenInventor standard. Now let’s understand that OpenInventor which is a 3D scene description language. The scene described in OpenInventor is then rendered in OpenGL on your screen. Coin3D takes care of doing this, so the programmer doesn’t need to deal with complex OpenGL calls, Programmer just has to provide it with valid OpenInventor code. The big advantage is that OpenInventor is a very well-known and well documented standard.

Rather than using OpenCascade viewer inside the FreeCAD job is to translate OpenCascade geometry information into OpenInventor language.

Scene Graph

If we look at the above image, we can see that how shape is created in FreeCAD with the help of Open Inventor. In OpenInventor not only shape but also colors, materials, lights, etc. and organizes all that data in a convenient and clear structure. Everything can be grouped into sub-structures, allowing you to organize your scene.

While using FreeCAD we do not interact directly with OpenInventor FreeCAD do it for us In general FreeCAD document, being a mesh, a part shape or anything else, gets automatically converted to OpenInventor code and inserted in the main Scenegraph that you see in a 3D view.

If you a Mechanical engineer you might be thinking what is its use but if you are a FreeCAD advance user and have the knowledge of programming, then there are many advantages to be able to access the Scenegraph directly. For example, we can temporarily change the appearance of an object, or we can add objects to the scene that have no real existence in the FreeCAD document. If you are familiar with the Python scripting in FreeCAD then following python code will show the OpenInventor representation of a selected object:

obj = FreeCAD.ActiveDocument.ActiveObject 
viewprovider = obj.ViewObject 
print viewprovider.toString()

“Thank you for reading! If you found this article insightful and valuable, consider sharing it with your friends and followers on social media. Your share can help others discover this content too. Let’s spread knowledge together. Your support is greatly appreciated!”

Amar Patel
About Amar Patel 138 Articles
Hi, I am Amar Patel from India. Founder, Author and Administrator of mechnexus.com. I am a Simple Average Man who Loves life and Love living life. Professionally I am a Mechanical Engineer with Solid command over CAD software like FreeCAD, SolidWorks, Autodesk Inventor and AutoCAD Mechanical. I’m here to share my knowledge to help you accomplish your design and engineering tasks quicker and easier. I am Passionate about learning new things especially about Open-Source Software. I love teaching therefore I started my YouTube Channel on FreeCAD and I believe FreeCAD have lots of potential than traditional 3D software. contact me - [email protected]