Compare Match Geometry of Solids

Hello All,
I have a next challenge: as we have a good Revit engine to compare identify Assemblies. And if take a 2 same Parts but with different rotation and position and after create for each an Assembly - its find matches. Nodes AlmostEqualGeometry only works if geometry is completely the same and has the same location and direction in the model.
In this case I use next method to compare geometry of solids of Parts elements. Looks like works


Question - is it possible maybe make it easily by some another instruments, maybe use Python and some API methods? Thanks
Matches Engine.dyn (109.2 KB)



Hello @y.Petrenko ,

you can trigger your geometry by an identifier like Volume.

KR

Andreas

1 Like


Hello Andreas. No volume is not a way. See next pic

Hi @y.Petrenko ,

From a programming perspective, how would you approach this?
Using the volume of the objects, as @Draxl_Andreas suggested, sounds like a great start to me to group your objects by as starting point.

Also, maybe you could look into the code behind the AlmostEqualGeometry node.

1 Like

You could count surfaces :wink: @y.Petrenko

Hi @Daan
Volume is clear - I use it as a first filter for all parts in the model
I thinking about existing class of [GeometryObject Class ] - Equals Method. But, I do not have enough expirience to check it in Python

In terms of programming with nodes, I implement it like this:
Based on the obtained vertex, we determine the approximated line and plane (Best Fit method)
The idea is that if these lines should be identical for identical geometries.
Further, on the basis of this plane, we obtain a local CS and transform our geometry into a 0.0.0 CS.
Variants are as possible mirrorings.
And if at least one geometry coincides with the main geometry - true

AlmostEqualGeometry - as it use a same position I think based on Define new geometry when subtracting. If solids are same - volume will be 0,… almost 0 :slight_smile: depends on tolerance (why its calls as AlmostEqual)

Cant imagine how it helps. We already use the volume as first raw step filter. Its enough for prefiltering - next we have to exactly understand where is different


But thanks for your efforts!

If you have a way to exactly overlay 2 objects you could use the node Solid.Difference to see if there are any parts which do not match.

However, assuming that is probably your biggest problem, and also let’s say you have a vertical object and a horizontal object which are both the exact same, does that also count as the same object? In what context and with which borders are we talking?

1 Like

Yes, it’s the same geometry, just rotated 2 axes at any angle.
I’m just trying to replicate the assembly based algorithm, but I don’t know it, just my guesses.
You can Try to create 2 extrusions in different planes, and if you make parts from them and after make assembly from each, you will get - Identical

Okay let me ask another question too:

Why do you want to find unique objects? You are talking about assemblies, what is the problem you are finding when having multiple (in this case) triangles in a model?

There is a main assembly, which also consists of many parts.
We can’t create an assembly inside an assembly.
We cannot exclude a part from the assembly to identify it, as we need to mark this part and add it to the specification.
Creating every small detail as a separate nested family is difficult.

I need my own algorithm of Identification unique elements


you can compare locationpoints of your elements.
Edges f.e.

I use it. See script above

Hello, if you compare the centroid in 2nd filter, The direction proposed by Mr. @Draxl_Andreas should be possible

Cordially
christian.stan

I love complex geometric problems, so I gave it a go.
Let me know if this is what you are looking for.
The only condition with this script is that the family geometry outlines must be modelled in the same location relative to the family origin.
The script is quite geometry intensive which is not usually efficient with Dynamo.
Make sure to install the GeniusLoci package by @Alban_de_Chasteigner. I used the package to pull the base planes of the family instances.
ezgif.com-gif-maker (1)
See the Dynamo file attached.
Filter Solids.dyn (153.0 KB)

6 Likes

Hi, thanks for your effort! Appreciate!
But, unfortunately, In your script you work with the family (generic model) - But we have to use only Parts category. And Part - its element of DB do not have face orientation and reference position.
how we can obtain a result in another way than I do it on my script

hello, to follow up on the first post:
1st filter: by volume
2nd filter: then by centroid
distance between centroid and vertex points
it becomes a list
count list
intersection list
result count
if same count
same element normally

Cordially
christian.stan
after I do not know if less greedy in calculation time than your script

1 Like

Hello! Thanks
Your Idea is good, but if we look at the next example - we got the same Count List - but is a different parts


Add also check angles? Maybe its help, but part do not have a origin CS from where we can calculate the angle. We can as well get it from BestFitPlane this origin CS. as a result, looks like more greedy than my algorithm.

I think the algorithm in the standard tool for identifying assemblies - not like this.

weird,
not logical the centroid is off center in the left part of the figure,
some distances are necessarily different you can have equal distances with possible voids, just rotate them around the centroid.

but logically, if you have n distances for those on the left, you do not have the same n distances for the extreme points of the element on the right

but given that the calculation times are longer, we must forget this way then

Edit:
it is true that there are exceptions if the voids are placed symmetrically with respect to the x or y plane merged with the centroid.

Cordially
christian.stan

I see. I guess I didn’t understand your problem well enough. In that case I think @christian.stan solution would work.

2 Likes