Hello,
I have two HFSS project files that are supposed to give the same analysis results.
I would like to compare the CAD solid objects of the two files to see if they are identical
Is there a way to do this in FreeCAD? The structures are quite complicated and I would like to have a script that does that.
Thank you
How to compare 3D solid CAD files?
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
How to compare 3D solid CAD files?
Last edited by Kunda1 on Thu Jun 30, 2022 2:02 pm, edited 1 time in total.
Reason: Removed shouting-case
Reason: Removed shouting-case
Re: HOW TO COMPARE 3D SOLID CAD FLES
If you can ensure their identical placement (position and rotation), you can try using boolean operations on them or comparing the center of mass and moments of inertia. Another way would be to check the area/volume.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: HOW TO COMPARE 3D SOLID CAD FLES
boolean operations can be rather computationally expensive and might be prone to failure given the multiple coplanar/coincident surfaces expected. I remember some CAD training exercises that gave you the resulting volume to validate your result but the objects were single parts so it might not be a good solution for complex stuff, moments of inertia and center of mass sound like good ideas too. Those are all available through python I think so it should be possible to make a macro.
Re: How to compare 3D solid CAD files?
I was thinking to simply subtract the corresponding objects, however when I did that I got errors which might be expected (since if the objects are the same I get a void object, or if some surfaces are identical I get a null surface), but I couldn't find another solution.
What I think might work is do the subtraction in a script and if the result is a void issue a message.
do that in a loop over all the objects.
Unfortunately scripting is not my forte.
What I think might work is do the subtraction in a script and if the result is a void issue a message.
do that in a loop over all the objects.
Unfortunately scripting is not my forte.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: How to compare 3D solid CAD files?
so volume + center of mass + moment of inertia is not valid for you? like I said boolean ops are a bad idea.
Re: How to compare 3D solid CAD files?
I guess that could work