I’m trying to adapt the example ObjectClash script - Rhino3d Object Methods - Object Clash - but the only geometry type that I can get to work are Extrusions. I’ve tried adjusting the geometry type filter, but with no success. Wondering if anyone has insight on how I can get this to work with closed polysurfaces or other geometry? Thanks.
Current script (i’ve left commented out lines to show a couple options i’ve tried):
'Const rhSurface = &h8
Const rhSurface = 8
'Const rhPolysrf = &h10
Const rhPolysrf = 16
'Const rhMesh = &h20
Const rhMesh = 32
'Const rhExtrusion = &h40000000
Const rhExtrusion = 1073741824
Dim arrObjects0, arrObjects1, intFilter, arrEvents, arrEvent, strClash1, strClash2
intFilter = rhSurface + rhPolysrf + rhMesh + rhExtrusion
'arrObjects0 = Rhino.GetObjects("Select first set for clash detection", 0)
arrObjects0 = Rhino.GetObjects("Select first set for clash detection", intFilter)
'arrObjects1 = Rhino.GetObjects("Select second set for clash detection", 0)
arrObjects1 = Rhino.GetObjects("Select second set for clash detection", intFilter)
arrEvents = Rhino.ObjectClash(arrObjects0, arrObjects1, 0.25)
If IsArray(arrEvents) Then
For Each arrEvent In arrEvents
strClash1 = arrEvent(0)
strClash2 = arrEvent(1)
'Rhino.MessageBox "Clash found between " & Rhino.ObjectName(strClash1) & " and " & Rhino.ObjectName(strClash2)
Rhino.Print "Clash found between " & Rhino.ObjectName(strClash1) & " and " & Rhino.ObjectName(strClash2)
Rhino.MessageBox "A problem occurred with the clash array, most likely you've selected and object type that the script doesn't like (ie closed solid polysurface)"
@dale not to compound the issue, but would it also be possible to allow for a negative clearance, meaning an acceptable amount of overlap between geometry? I can submit this as a separate request if that would be better. Thanks, Josh
Haven’t tried it using RhinoInside yet, but looks like we’re going to have some upcoming work where we can put this to good use, so I’ll keep you posted. The only additional functionality we’d be looking for right now is the ability to set a negative clearance - meaning that we know there may be some minor overlap between parts that we want to ignore in our clash testing. Is that possible?
At this point we do not have the negative clash. At this point the clash only tries to find some level of clash, it does not analyze the amount of clash. I will talk to some of our people and see what is possible.
This is what I was messing with in Revit. This definition makes a CSV clash report:
We just added in today’s Rhino 7 build, a negative clearance. This allows small interferences or just touching to be ignored. This is only in the clash command so far. I hope to see it in the Grasshopper component at some point.