Utility to inspect OpenCascade models

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Post by triplus »

What i am guessing the main problem is you two aren't using OCCT from the official repositories. When i took a quick look Meson will use the CMake detection logic from AnalysisSitus repo. Hence the CMake detection logic needs to get fixed over there, after Meson should find OCCT. We could try to resolve this in different ways, but i feel the the best approach is for @Quaoar to simply install the dependencies from the official (Debian/Ubuntu) Linux repositories and until the CMake step won't complete successfully on his side, issues will get reported anyway.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Post by triplus »

As FreeCAD needs to do the same, maybe some hints can be found here:

https://github.com/FreeCAD/FreeCAD/blob ... Cade.cmake

Taking a quick look (at FindOpenCasCade.cmake):
Quaoar wrote: Tue Feb 11, 2020 10:33 am current finder of OpenCascade simply looks for libs/includes
Likely this is missing for Debian/Ubuntu:

Code: Select all

/usr/include/opencascade
This one was likely added for OCCT installed from the PPA:

Code: Select all

/usr/include/occt
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Utility to inspect OpenCascade models

Post by freecad-heini-1 »

Quaoar wrote:Ping
Hi Quaoar,
thank you very much for programming Analysis Situs and making it available free of charge.
I installed it under PlayOnLinux and was able to repair one Step part from a surface model to a solid model by auto repair.

Please have a look at the following two Step files:
https://github.com/ValveSoftware/IndexH ... nk.stp.zip

https://forum.freecadweb.org/download/f ... ?id=104027

I was able to repair the second part with the free step viewer Varicad. I imported and exported the file. After the data export the model arrived in Freecad as a solid model, boolean operations work.

Unfortunately I had no success with Analysis Situs. In the first part the program even hangs itself.

Please have a look at the data.
Maybe they are suitable as demo test data.

Many thanks and many greetings
Wilfred

Translated with www.DeepL.com/Translator (free version)
User avatar
Quaoar
Posts: 106
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: Utility to inspect OpenCascade models

Post by Quaoar »

Dear Wilfred,

Thank you for posting the shapes, I am having a look at them now. Your second shape seems to be healed already, at least it arrives at Analysis Situs as a formally correct solid. Do you have a broken version of the second shape?

For the first shape, it is a compound of many solids. The checker reports BRepCheck_SubshapeNotInShape error code, not completely clear why. I am going to check that deeper.

Kind regards,
Sergey.
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
User avatar
Quaoar
Posts: 106
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: Utility to inspect OpenCascade models

Post by Quaoar »

freecad-heini-1 wrote: Thu Feb 20, 2020 7:51 am Ping
The first shape (the bigger one) cannot be auto-healed because it contains a solid with the incorrect configuration of shells. Have a look at the following screenshot:
freecad-shape1.png
freecad-shape1.png (65.33 KiB) Viewed 3153 times
All these small round features intersect the bigger shell, so there is a self-interference in the model. The worst thing is that all these shells (the bigger one and all the rounds) are put inside a SOLID object. This should not happen with a solid. Such a shape should be either a compound or, alternatively, all these small round features should have been fused with (or cut from) the main solid. How have you obtained this model? Is this a result of some unsuccessful fuse in FreeCAD?
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Utility to inspect OpenCascade models

Post by freecad-heini-1 »

Hi Quaoar,
thanks a lot for your help.
The original step file:
https://github.com/ValveSoftware/IndexH ... nk.stp.zip

Please let's have a look into the header:

Code: Select all

ISO-10303-21;
HEADER;
FILE_DESCRIPTION((''),'2;1');
FILE_NAME('01_V002006_ASM_CORE_ASM','2019-05-21T16:28:02',('ivanm'),(''),
'CREO PARAMETRIC BY PTC INC, 2017260','CREO PARAMETRIC BY PTC INC, 2017260','');
FILE_SCHEMA(('CONFIG_CONTROL_DESIGN'));
ENDSEC;
It's from Creo 2017 / 260.
Normally Creo gives good results.
But - you can also mess around with it.

I imported it to Varicad viewer as Step, exported it and after import to Freecad I was able to create a boolean cut with a cube:
Image
But not at every position in the part. If you move the cube further to the left, the boolean cut fails.

Here the exported step file from Varicad:
https://send.firefox.com/download/3c799 ... HxYtxgKjBA

Varicad has a costfree Step Viewer, available for Linux and Windows.
https://www.varicad.com/en/home/products/download/

It looks to me as if they have built in a repair function, which in some cases gives useful results.

I always find such practical examples quite good to experiment with.

Best regards

Wilfried
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Utility to inspect OpenCascade models

Post by saso »

Analysis Situs 1.0 is out
http://quaoar.su/blog/page/analysis-situs-100

asitus_mini.png
asitus_mini.png (189.62 KiB) Viewed 2918 times

What is Analysis Situs?
Analysis Situs is an open-source, extensible software which assists in the development of CAD geometric algorithms based on Boundary Representation (B-Rep) data structures. The software is coupled with OpenCascade library which is an open-source geometric modeling kernel offering a broad range of modeling operators for the development of multipurpose CAD systems and utilities. Analysis Situs serves as a framework for constructing geometric modeling algorithms. Additionally, Analysis Situs offers some advanced facilities for inspection of geometric and topological structures of existing CAD parts (hence the name "Analysis Situs") which can be imported from any popular CAD system.

Quaoar's Workshop videos
https://www.youtube.com/channel/UCc0exK ... fBQ/videos
User avatar
Quaoar
Posts: 106
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: Utility to inspect OpenCascade models

Post by Quaoar »

@saso, thanks for keeping an eye on this. I actually left OCC and now concentrate more on AnalysisSitus and the open-source things around. The plan is to add more feature recognition tools for the imported CAD models this year.
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Utility to inspect OpenCascade models

Post by Jee-Bee »

Quaoar wrote: Sat Apr 10, 2021 9:29 pm I actually left OCC and now concentrate more on AnalysisSitus and the open-source things around. The plan is to add more feature recognition tools for the imported CAD models this year.
That's a pity! it's good to have at least one OCC human being around here. That OCC have a clue what problems exist in the OCC library and tips / tricks how to resolve
User avatar
Quaoar
Posts: 106
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: Utility to inspect OpenCascade models

Post by Quaoar »

That's true, and I'm still involved as a sort of "advocate" in the community because OpenCascade is a hell of fun, and, my credits to the company, they understand they need to cultivate the community in all possible ways. This year they (and me on behalf of them) applied to GSoC but our application was rejected for some obscure reason. In my opinion, what is really missing is the capacity of OCC to improve and develop the features that are demanded by FC. But if FC is willing to contribute a patch, the joy begins, and a patch (there should be a materialized piece of code coming from FC) will likely be integrated. But all this get us back to this CLA discussion, as nobody wants to sign that sort of paper. And its hardly going to change in the observable future.
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
Post Reply