Colored STEP model in OCCT Viewer

Visual materials are an essential part in games. In a CAD world, however, geometry definition is the most important component, which CAD algorithms are dealing with. Colors and visual properties are often put into a somewhat auxiliary, optional category here.

Colors might help to highlight important details, features or to just separate parts of different types in an assembly structure. Multicolored model looks perceptually much more attractive than a boring single-colored geometry. 

In this short tutorial, we will pass through reading a colorful STEP model into an XCAF document and displaying it in the AIS viewer with colors using the XCAFPrs_AISObject presentation.

Continue reading
Advertisement

Draw Harness – custom plugin

Draw Harness is a powerful interactive and Tcl-scriptable interface to the Open CASCADE Technology. Many OCCT learners go directly to learning C++ interface and don’t notice the DRAWEXE application at all, which I believe is a great loss.

At first glance, Draw Harness might look like an old-fashioned internal tool. But it is widely used by OCCT developers for learning, testing and prototyping algorithms, and there are no reasons why other users couldn’t use it as well. Basic functionality includes commands for modeling, data exchange, displaying models in 3d viewer, and tools for automated regression testing.

Furthermore, Draw Harness supports dynamic loading of custom plugins with project-specific extensions, bringing up a flexible scriptable interface for development and testing application algorithms. In this tutorial we will write a hello-world Draw Harness plugin.

Continue reading

WebAssembly and multi-threading

Previous publication described first steps in running Draw Harness in a Browser as a WebAssembly module. As a result, the project was able to run complex Tcl scripts, to be embedded into web-site, to display objects in 3D Viewer and to run smooth animations.

The gallery of samples still has rough edges like ugly 3D Viewer layout, but even in its current state the project looks helpful to demonstrate OCCT usage and capabilities. The gallery is being slowly extended with new samples when I get some new question or idea about OCCT usage that I could demonstrate in Draw Harness.

Previous article indicated some further directions for improvements, and now we will experiment with multi-threading.

Continue reading

AIS object – computing presentation

Previous article provided an introduction into AIS (Application Interactive Services) from the high-level point of view. OCCT provides a strong set of built-in Interactive Objects for rapid application development, but the real power and flexibility of AIS could be revealed by subclassing and implementing custom presentations.

In this article we will focus on the development of a custom AIS_InteractiveObject and show the basics step by step. So that it will look more like a tutorial and you are encouraged to try to follow the described steps and repeat the experiment on your own.

Continue reading

Application Interactive Services or AIS

The previous article has given a short introduction to the Open CASCADE 3D Viewer with a Hello World C++ sample showing viewer initialization. Let’s now take a deeper look into AIS (Application Interactive Services) classes and its basic concepts.

The article could be useful to beginners to complement or strengthen understanding of terms from Visualization User’s Guide.

Continue reading