Strange behaviour - GetIdenticalBodies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
(sorry I'm not native english speaker)
When I use the GetIdenticalBodies command it returns as many ObjectCollections, as many identical solids have been found (and each ObjectCollection contain the SurfaceBody object and a Matrix object )
I made an example,I draw 3 solids and mirrored them (picture included), and run my code and here is the output I got
Case#1 Red boxes
They are in the same collection ->OK
(the determinant of result matrix equals +1)
Case#2 Green bodies
They are in the same collection, but they are not identical (mirror-symetric)
the determinant of result matrix equals -1 <- I think this value means they are mirror-symetric??
Case#3 Blue cylinders
They are in the same collection, and they are identical
the determinant of result matrix equals -1 <- WHY???
According to my experiences, this function recognizes the mirror-symetric bodies as identical, and in this case the determinant of result matrix is -1.
But this logic fails with the 3rd case, because these cylinders are identical, however, the determinant is -1
Does anyone have more experience with this function? And can explain the Results
Thank you
Sub testIdentical()
Dim oObjColl As ObjectCollection
Set oObjColl = ThisApplication.TransientObjects.CreateObjectCollection
Dim oPart As PartDocument
Set oPart = ThisApplication.ActiveDocument
Dim oPartDef As PartComponentDefinition
Set oPartDef = oPart.ComponentDefinition
Dim oSolid As SurfaceBody
For Each oSolid In oPartDef.SurfaceBodies
Call oObjColl.Add(oSolid)
Next
Dim identicalBodies As ObjectCollection
Set identicalBodies = ThisApplication.TransientBRep.GetIdenticalBodies(oObjColl)
'//Print Output
For Each el In identicalBodies
i = i + 1
Debug.Print "------------"
Debug.Print "GROUP #" & i
For Each el2 In el
Debug.Print " " & el2.Item(1).Name & " # Determinant = " & el2.Item(2).Determinant
Next
Next
End Sub
my results
------------
GROUP #1
Solid1 # Determinant = 1
Solid4 # Determinant = 1
------------
GROUP #2
Solid2 # Determinant = 1
Solid5 # Determinant = -1
------------
GROUP #3
Solid3 # Determinant = 1
Solid6 # Determinant = -1