I am trying to look for an automatic way to determin whether or not objects are in each others way. In other words, I try to detect object clashes, but I don’t succeed
I have two arrays with objects. When I try to detect a clash using a macro in Rhino script, this returns a result:
For intIndex = 0 To UBound(arrTemp1)
Rhino.Command("_SelNone")
Rhino.Command("_Clash _SelID " & arrTemp1(intIndex) & " _Enter _SelID " & arrTemp2(0) & " _Enter 25 _Enter")
Next
However, doing what I thought was equivalent in Rhinoscript does not work:
For intIndex = 0 To UBound(arrTemp1)
Rhino.Command("_SelNone")
arrTemp = Rhino.ObjectClash(array(arrTemp1(intIndex)), array(arrTemp2(0)), 25)
Next
Resulting arrTemp always is null, even with the objects that caused a clash using the macro call. I also tried calling the method with both arrays of objects first instead of calling the array objects one by one, placing them again in an array
Don’t have an answer for your post just an FYI. The RhinoBIM plug-in already has a clash detection function built in and it works on any Rhino object. It has the ability to set clearances for objects, and reports hard, touch or soft clash.
Same here. Always Null.
RS Help file also says:
see the Rhino help file for details on the Clash command.
I don’t have a Clash command (in Rhino Help or Rhino in general…)
Actually, just run the command Clash and follow command-line instructions, it’s an unconventional command UI wise and as you can see it does do some interesting clash detection with probably not a lot of overhead.
@dale, can you or someone else elaborate on Clash and if it can be exposed in rhinocommon. I remember getting info in the past about Clash not being very accurate or reliable in all cases, is that so? I see at least one issue with extrusions that seem to catch only clash points(see images below)
Oh I see now. It does not Autocomplete (Rh 5.12), and not present in Help file, but you are right, works quite nicely. Can you get the scripted version to wotk? (RS). ?
AFAIK:
Clash is not supposed to calculate intersection geometry but merely if the input clashes and as such it’s only indicating where a clash was found.
Setting a higher clearance distance shows this:
We added a Clash detector in Grasshopper component in addition to the RhinoCommon method for Clash. Here is some evolving documentation on the feature.
We are looking for feedback on the methods:
Does it find the clashes you need?
Is it fast enough?
Another really fun part about Clash is that it will work on Revit elements using Rhino.Inside.Revit
this would be very useful i was searching for this last time i tried to optimize bridge wifth until clearance limit is reached. of course you can use halapagos but this loop could be done in one single component without any macrooptimization loop
I discontinued to elaborate that script some time ago. There is nothing to show.
It was just an idea how some things would be nicer to get done.
I am thinking of a component where you would assign geometry to move then collision geometry as another input, then allowable directions of motion (list of vectors), some options like tolerancies and the component would move the geometry just according to those rules which would be the output.
lets say you have railing as geometry to move, some polysurface which represents train clearance corridor. you want to move that railing to be exactly 10cm off the corridor in desired direction (for example perpendicular to railing dir and parralel to wxy).
There are many possibilities what to do, there could even be rotation included to satisfy conditions of clash. It gets complex very quickly you start to think about it :d