Coin3d snippets

From FreeCAD Documentation
Other languages:

Description of this list

Complex libraries like COIN3D need good documentation and good tutorials. Unfortunately, there aren't many tutorials for the COIN library. After much research, the code examples listed below were found. They have been modified so that they can be loaded in FreeCAD. But some code may fail as these examples were created for other environments. You will find warnings for those problems in the code.

Users can run these scripts either as a macro or directly in the Python console. Please notice that many of the functions have 'Exe' or 'Execu', short for 'Execute', in their name.

These files are also mentioned in the Inventor Mentor tutorial for the C language.

List of the files and their screenshot (Python scripts)

Source code

You can find the source code of these scripts on GitHub: COIN3D examples.

Software for learning COIN3D library

CoinDesigner, although old, is a useful program if you want to understand how the Coin3D library can be used, and how you can write your own code both in the Inventor 2.x format or for FreeCAD.

No installation is required. Thanks go to the author of the program.

Notes

  1. Click the names of the scripts to see the screenshot. The scripts that do not have a link probably cannot be executed under FreeCAD. But even so, please try to look at the code. These scripts may still give you some ideas.
  2. There are many other drawing files (Inventor 2.x format) that can be loaded in FreeCAD and saved as a python script. The formatting will not be great, but such a script can still help you understand the COIN3D library.
  3. Generally, COIN3D doesn't provide good primitive drawings. The widget system Design456 does provide some: some basic shapes, and also some complex shapes. The arrow widget and the line widget used by the Design456 Workbench are examples.