Analysis Situs 2024.2 is out

Analysis Situs
10 min readNov 24, 2024

--

We are glad to announce that Analysis Situs has collected a significant number of changes and improvements, and it felt like it was time to release, so here we are.

  • You can download the Windows x64 installer here.
  • Visit the official website of Analysis Situs at www.analysissitus.org.
  • All changes logged: CHANGELOG.
  • The corresponding Git tag is “v2024.2”

Contributors

As usual, let me thank all the contributors who made this version see the light of day.

  • Elizaveta Krylova contributed AppImage, ported Analysis Situs to OpenCascade 7.8.1 (it’s a development branch occt-7_8_1_1) and gave a new breath to some old (and mostly abandoned) features related to reverse engineering.
  • Julia Slyadneva fixed a bunch of problems related to glTF export and sanitized the code base here and there.
  • Michal Mrozek cleaned up some segfaults in asiAlgo_Utils.
  • Sergey Kiselev contributed assembly clean-up functionality for getting rid of “dirty” parts.

Configuration

AppImage for Analysis Situs has been fixed. This was a long-awaited patch, and now we should have consistent documentation on how to build AppImage from scratch. Continue reading from the dedicated blog here.

Interoperability

In the new release, a couple of things have been fixed in our in-house data exchange interfaces:

  • Introduce the possibility of SVG scaling on export.
  • Fix #310: OBJ file reader confuses vertex indices.
  • Make drawings aligned smartly in DXF export.
  • Get rid of slow STL reader from Mobius.

As for the very core formats like STEP, we can see that something meaningful has been added to the underlying OpenCascade library (for example, support for tessellated geometries). However, the overall benefit of those modifications does not appear to outweigh the inevitable regressions, hence porting our SDK to newer versions of OpenCascade does not appear justifiable (yet). As a result, this release remains compatible with OpenCascade version 7.6, which is just good enough.

Recognition of shafts

Analysis Situs now comes with a dedicated Tcl command and a novel algorithm for the identification of cylindrical shafts in a solid CAD part.

> recognize-shafts

A cylindrical shaft is a kind of “hole-inverted” geometry, which might be interesting to recognize for milled (and not turned) parts.

You may want to read more about this improvement in the corresponding blog: “Recognition of shafts has been open-sourced.”

AAG to AI

We developed a deterministic feature recognition SDK from day one, which allowed every bug in the detection logic to be effectively debugged and the whole SDK to be continuously improved (as expected from any computational geometry library). Still, we recognized that some people prefer using AI-based algorithms for feature detection, especially where accuracy is less of a problem and coarser approximations can be employed. One such use case is automatic quotation, which is rapidly becoming the holy grail of MaaS (Manufacturing-as-a-Service) platforms. People working in AI often employ Python and its specialized modules to play around with neural networks. DGL is one such example.

For the sake of richer visualization abilities, we added AAG rendering together with the active part as an option (#317).

What we also did in Analysis Situs is we presented a binary format for our AAG (#320). This format is, of course, open and can be read from whatever language, including good old Python. As a consequence, the AAG data structure with all its serializable attributes becomes transmittable across various programming ecosystems and can now be used as a shape descriptor for machine learning.

With the help of AAG serialization/deserialization, it is now possible to use Analysis Situs feature recognition results outside of the Analysis Situs environment. E.g., you can pass the recognized features to your machine learning workbench.

We dedicated a comprehensive blog to this matter, so you may want to jump into it for more details: “Interfacing rule-based feature recognition with machine learning (AI) methods”.

The following Tcl functions serve as the entry points to serialization and deserialization logic for AAG:

> serialize-aag

> deserialize-aag

We also published an example of a Python routine to read AAG binary files: readBinaryGraph.py. This one can be used as a starting point, while more details on the format can be found in the dedicated blog “On AAG serialization to a binary file”.

Arc attributes in AAG

With the new release, it is now possible to set custom attributes to the AAG graph links. Previously, only graph nodes could have been assigned to the user-defined attributes. Trying to bridge the feature recognition framework of Analysis Situs with deep learning tools (such as DGL), we came to the necessity of extending the AAG interfaces a little (#318).

For example, arc attributes can be used to communicate the discretization points over CAD edges. This information is employed, for example, in UV-Net feature recognition toolset.

More improvement in feature recognition framework

Here is a list of smaller improvements in the AAG core class and related services:

  • Introduce asiAlgo_AAG::RemoveNodeAttributes() with the collection of GUIDs to keep.
  • Fix #307: “Numerical properties should not be dumped as string values in AAG.”
  • Introduce asiAlgo_AAG::GetNeighbors() for a feature as an argument.
  • Improve performance of the AAG arc attribute accessor.
  • Add caching technique (a specific AAG attribute) for outer wires.
  • Rework asiAlgo_AAG::GetConnectedComponentsNb() for better performance.
  • Change std::stack to std::vector to be able to freely access the stacked states of AAG.
  • Fix #329: “Bad result of `recognize-cavities` command: too many faces get reported.”

Optimal part orientation

Choosing the appropriate alignment is often the first step in recognizing the features of a CAD part. Although the detected surface features are normally invariant to affine transformations, the situation changes when a stock shape is taken into account. For example, when assessing rough milling volumes, we cannot ignore the part’s position relative to its stock volume. As a result, we intended to create a practical and quick method for repositioning a part so that it becomes aligned with the primary axes.

Read on about the optimal part orientation algorithm in the corresponding blog article: “Optimal part orientation.”

Refactoring UV bounds

Another fix has been introduced for the issue #328: “Refactor the logic behind outer wire computation.” This problem is quite fundamental as it is related to the geometric core. Read more in the corresponding blog: “OuterWire problem of OpenCascade.”

More fixes in modeling

  • Fix #315: “Canonical conversion freezes for endlessly long when attempting to fix pcurves for a periodic surface of linear extrusion.”
  • Protect asiAlgo_Utils::GetFaceNorm() from crashing on irregularities.
  • Add transformation parameters for the Triangulation Node.
  • Forcibly raise the construction-time exception in the BVH iterator if NodeInfoBuffer() is empty.

Find “junk” assembly items

Assemblies and even single CAD parts sometimes contain “junk” geometry. These could include dangling annotation lines, construction curves, sketches, or simply broken B-rep elements that did not survive export and import. Here’s what it might look like:

Analysis Situs now contains a recipe for cleaning up such artifacts at the assembly level in XDE documents. Here is the script:

> asm-xde-load -model M -filename MyProduct.stp

> asm-xde-xcompounds -model M

> set pids [asm-xde-find-dirty-parts -model M]

> asm-xde-remove-parts -model M -parts {*}$pids

As a result, only clean geometries (solids, shells, individual faces) remain in the product structure:

Transform assemblies

It is now possible to transform the entire assembly by the asm-xde-transform Tcl command.

HLR with a timeout

HLR projections are now performed in a separate thread with a timeout. It’s been quite a struggle to make this function responsive enough so that our users don’t have to wait forever while complex models are projected. If the precise HLR fails to converge within the time “budget”, the discrete HLR is used to get the results. DHLR usually runs way faster, and its polygonal projections are still good enough for technical drawings.

While we were attempting to make HLR quicker for a better user experience, the main objective was to prepare the SDK for a more important use case of generating production drawings automatically upon part processing. For automatic drawing creation, we need a fast and reliable method for creating hidden-line removal views of a part. Our published investigation of HLR in OpenCascade revealed that while the ultimate accuracy of the resulting projections is usually good enough, the main concern is the performance, and we used every trick to make it better without rewriting the core.

Wall thickness analysis

Thickness inspection has been fixed for the case when a user specifies a custom range of interest (#304). We currently utilize a spherical glyph for interactive cursoring over the thickness field; however, straight line segments would be slightly more appropriate. We do this on purpose to tease out the sphere-based thickness analysis that will be implemented in future Analysis Situs releases.

Break down assemblies

To break down an assembly into a plain list of parts, there is now a dedicated UI dialog. To invoke it, execute the asm-xde-unload Tcl command without arguments.

> asm-xde-unload

In the pop-up window, you have to enter the assembly’s input filename and the destination location where all individual parts will be dumped as STEP files. The “expand compound parts” checkbox allows you to turn on and off automatic conversion of compound-type parts into subassemblies. The “use filename prefix” checkbox instructs the algorithm to automatically add the input file’s “base name” as a prefix to each result filename.

Fix re-topologize

It took several years for Analysis Situs to come up with the right architecture for feature recognition, and we did not invest in plenty of other use cases in the meantime. With small improvements #310 and #311, we started to reclaim basic functionality with the goal of developing a set of practical surface modeling techniques. One of these is automatic surfacing, which is powered by Instant Meshes. The latter software is employed to topologize triangle meshes by quad remeshing. This functionality was added quite some time ago and became broken at some point. We were able to bring it back with just a small effort.

Normalize slashes

Analysis Situs requires path slashes to be forward. On Windows, use the <Ctrl>+<Space> key combination to instantly transform all backslashes to forward slashes (#316). It affects the current command line.

More on UI and visualization

  • Introduce “black box HLR” mode activated by “B” or “Alt + B” keys.
  • Disable mesh links visualization for a better FPS.
  • Add BVH source and pipeline for visualization.
  • Introduce BVH construction strategy in the Part Node.
  • Introduce ADD_LEGEND() imperative drawing call.
  • Add ERASE_PART() function to IV (imperative plotter) interface.

Miscellaneous

  • Add eval-iso-u and eval-iso-v Tcl commands.
  • #326: Introduce the misc-convert-curves-poly command.
  • Fix add-subshape command to avoid “frozen shape” crashes.
  • Fix OBB construction logic: the build-obb command worked incorrectly.
  • Add suppress-features command to work like the “Delete” button in the UI.
  • Add a set of convenience macros for fast parameter access.
  • Add DeepCopy() method to the ActData_Mesh class for making complete copies of meshes.
  • Fix #336: Set naming history forcibly to the Part Node on defeaturing from UI and CLI.

What’s next?

We plan to continue the rapid development of Analysis Situs, particularly its SDK engine, which does all useful job. While the application’s UI remains important we have never claimed it is user-friendly, and we appear to be rather consistent in not improving it over time. Having said that, we are seeing increasing interest in the program among professionals who perform feature recognition and other types of CAD inspection on a daily basis. This encourages us to research further into usability.

Another concern is probably the configuration and build. It is not as smooth as it could be, most likely because we do not utilize the most recent CMake and Git functions and practices. A configuration process that implies “one button click” is still just a dream.

Historically, Analysis Situs has been based on open formats, but we have bridged it with native formats (SolidWorks, Catia, etc.) with the support of our partners and their SDKs. In the future releases, we will continue our investigation of external data connectors with the aim of providing seamless integration with the most popular CAD systems for our paying clients.

Another significant element of our business is the development of commercial extensions for Analysis Situs. We have no sponsors, investors, or other external funds, so staying financially viable is crucial to keeping the party continuing. Nothing that has previously been open-sourced will be closed. Furthermore, we intend to publish some more advanced algorithms and tools in source code and under permissive license, because this is how we see innovations in the FOSS CAD field. However, particular algorithms for feature recognition in sheet metal, CNC, and 3D printing will be licensed on a commercial basis. Still, anyone with an in-depth knowledge of geometric modeling, OpenCascade, our SDK, and C++ should be able to build any feature recognizer with the open source SDK that Analysis Situs provides. Updates on commercial “Extensions” for Analysis Situs will be published regularly, but it still needs some time to set things up properly.

Want to discuss this? Jump in to our forum.

--

--

No responses yet