Community digest series #01
Our forum slowly but surely becomes what it was supposed to be and what this blog failed to become: a knowledge database for CAD software engineers. Let’s call these people “engineers” (although there is a different point of view on that matter) because it’s not that much about programming and more about problem-solving. That’s what new generations of project managers fail to understand about our business. While programming languages are essential, they are just programming languages, and one does not need to keep track of trendy frameworks and new language features to be successful in our niche. But I digress.
This message starts a new series of articles aimed at digesting the recent forum topics that deserve particular attention. On behalf of CAD devs, I’d like to thank all the folks who have actively contributed their time to growing the volume of content which would definitely help CAD software engineers in their work. These are my favorite (take it as a sort of “editorial note”):
- Natalia and her how-to on AIS: drawing oriented glyphs using AIS in OpenCascade.
- Alexander with the getting started guide for PythonOCC.
- Jojain with the translation of technical spec for OpenCascade constraint filling algorithm.
- Adam (A-U) provided useful hints and links for the Geometric Constraint Solver implementation.
Here are some other topics that might bring value:
- OpenCascade 7.6 is released with (?) kinematics.
- Here is how to plug in the NetGen mesher to your OpenCascade-based app.
- Fast point-face classifier.
- A simple slicing algorithm.
Much more is yet to come. Now let’s touch on each topic in some more detail. Btw, if you’re interested in this CAD development business, it’s probably the right time to join the forum unless you’re already there.
Arrow glyphs in AIS
OpenCascade is known to contain its in-house visualization framework named AIS (Application Interactive Services). We are lucky to have Natalia who is excited enough with this framework to share her experience and pieces of advice that are impossible to get otherwise. If you wanna customize AIS for visualizing oriented glyphs, here’s the topic to read.
To get as much as possible from the provided info, you might want to familiarize yourself with the Draw console of OpenCascade and look through the test scripts shipped with the library.
OpenCascade in Python
Prototyping with OpenCascade was supposed to be driven by the Tcl console named Draw Test Harness. At the same time, it has never actually worked that way for the community. Non-programmers prefer using Python, like it or not. Personally, I do not use Python a lot, but I can definitely appreciate the simplicity of this whole Python business and how much you can get from it without investing days and weeks of work. Read this topic if you want to get started with PythonOCC.
The instruction assumes that you will use Conda package manager. If you are curious about what Conda is, the following topic at the FreeCAD forum can be interesting supplementary reading: Let’s talk about Conda.
The constrained filling remains a largely unresolved problem in OpenCascade. Still, there are tools that might be of some help. One of such is the Plate algorithm: a pinnacle of scientific research conducted in Matra/Cisigraph back in the glory days of the library. Jojain translated the technical spec for the Plate algorithm which helps us better understand the principles behind this computation.
The Plate algorithm has found such applications as gap-filling or merging several surfaces into a single one. Somehow this tool became a universal solution for a variety of modeling problems and that is not exactly surprising as the surfacing API of OpenCascade is limited.
It seems to me that the Plate algorithm and all its variations are kinda done to death. Despite all the efforts by Jojain, it’s still a challenge to fill all white spots in the theory behind this computation. Decades passed, and this whole surface modeling topic has to be revisited based on the recent state-of-the-art papers, also considering the existing commercial tools, such as xNURBS for example.
Geometric constraint solver
Geometric constraint solvers are primarily used to solve sketches, i.e., satisfy all the constraints imposed by the user. In OpenCascade, such solvers do not exist. For example, to develop the SHAPER module of Salome, OCC borrowed the PlaneGCS solver from FreeCAD. Adam shared the Python code that is used for sketch solving in CadQuery. He used NLopt to solve the optimization problem.