@@ -888,10 +888,15 @@ def calculateContactAreaBasedOnBoundaryBoxesForPair(objA, objB, sDistFallb, qNon
888
888
889
889
if not qAccurate or qSkipConnect or sDistFallb :
890
890
### Calculate simple overlap of boundary boxes for contact area calculation (project along all axis')
891
- overlapX = max (0 , min (bbAMax [0 ],bbBMax [0 ]) - max (bbAMin [0 ],bbBMin [0 ]))
892
- overlapY = max (0 , min (bbAMax [1 ],bbBMax [1 ]) - max (bbAMin [1 ],bbBMin [1 ]))
893
- overlapZ = max (0 , min (bbAMax [2 ],bbBMax [2 ]) - max (bbAMin [2 ],bbBMin [2 ]))
894
-
891
+ # Include minimumContactArea for rare cases of edge-to-edge contact where we don't want to get zero as result
892
+ bbAMin_ = Vector ((bbAMin [0 ]- minimumContactArea , bbAMin [1 ]- minimumContactArea , bbAMin [2 ]- minimumContactArea ))
893
+ bbAMax_ = Vector ((bbAMax [0 ]+ minimumContactArea , bbAMax [1 ]+ minimumContactArea , bbAMax [2 ]+ minimumContactArea ))
894
+ bbBMin_ = Vector ((bbBMin [0 ]- minimumContactArea , bbBMin [1 ]- minimumContactArea , bbBMin [2 ]- minimumContactArea ))
895
+ bbBMax_ = Vector ((bbBMax [0 ]+ minimumContactArea , bbBMax [1 ]+ minimumContactArea , bbBMax [2 ]+ minimumContactArea ))
896
+ overlapX = max (0 , min (bbAMax_ [0 ],bbBMax_ [0 ]) - max (bbAMin_ [0 ],bbBMin_ [0 ]))
897
+ overlapY = max (0 , min (bbAMax_ [1 ],bbBMax_ [1 ]) - max (bbAMin_ [1 ],bbBMin_ [1 ]))
898
+ overlapZ = max (0 , min (bbAMax_ [2 ],bbBMax_ [2 ]) - max (bbAMin_ [2 ],bbBMin_ [2 ]))
899
+
895
900
if not qSkipConnect or props .surfaceForced :
896
901
897
902
### Calculate area based on either the sum of all axis surfaces...
@@ -1877,15 +1882,14 @@ def calculateMass(scene, objs, objsEGrp, childObjs):
1877
1882
if obj != None :
1878
1883
if "bcb_child" in obj .keys ():
1879
1884
obj = scene .objects [obj ["bcb_child" ]]
1880
- if (props .surfaceForced == 0 or props .surfaceThickness == 0 ) and (props .surfaceThickness == 0 or obj not in objsNonMan ):
1881
- obj .select = 1
1882
- objsSelected .append (obj )
1883
- # Temporarily revert element scaling for mass calculation
1884
- if qScale :
1885
- if scale != 0 and scale != 1 :
1886
- obj .scale /= scale
1887
- objsTotal .append (obj )
1888
- objsScale .append (scale )
1885
+ obj .select = 1
1886
+ objsSelected .append (obj )
1887
+ # Temporarily revert element scaling for mass calculation
1888
+ if qScale :
1889
+ if scale != 0 and scale != 1 :
1890
+ obj .scale /= scale
1891
+ objsTotal .append (obj )
1892
+ objsScale .append (scale )
1889
1893
1890
1894
### Calculating and applying material masses based on volume
1891
1895
materialPreset = elemGrp [EGSidxMatP ]
0 commit comments