Intersection WHILE rotating mesh

rhinocommon
mesh
rotate
intersecion

#1

So here is the scenario: I have a bunch of meshes and then I rotate one of them, and after rotating I check for intersections between the rotated mesh (new position) and the other ones.

But even if the intersection detection returns the result that there is none, that doesn’t necessarily mean that there won’t be intersections “on the way of rotating” the mesh if you really wanted to do it in the physical world. It might be that in order to get to the new position, the rotated mesh needs to go through / collides with other meshes although the final destination is intersection-free. I hope you get what I mean.

So my question is: Is there a way to detect this? I thought of calculating the volume that the mesh “leaves behind” while rotating and then checking for intersection between this bigger mesh/brep/volume. Can I do this with RhinoCommon-methods?


(David Rutten) #2
  1. If you implement your own rotate command then yes, you can for each mouse move event run the intersection routine and detect whether or not at any point stuff intersects.

  2. Of you could create a command which performs the rotation itself, using correctly spaced increments. This is probably safer since you’re not potentially skipping large parts of the rotate process.

  3. Finally, although I do not recommend this approach, you can try and figure out the transformation of your mesh before and after you rotate (or move, or scale, or whatever). Then you can run the transformation using lots of intermediate steps and check for intersections each time. However it is difficult and can be impossible to reverse engineer the exact transformation just by looking at the geometry before and after.


(Nathan 'jesterKing' Letwory) #3

I wonder if Kangaroo could be used to do collision detection for this kind of scenarios…


#4

Is Kangaroo a library? I don’t know it, can you provide a link? I am new to this field ^^


(Nathan 'jesterKing' Letwory) #5

Kangaroo is a physics engine available with integration into Grasshopper. Maybe @DanielPiker can tell more about the possibilities wrt your problem.


(Daniel Piker) #6

I don’t think Kangaroo would be of any help here, since it would essentially be doing the same thing as David’s option 2 above - rotating in small increments and checking for intersections, but with a lot more overhead to set up.
Alternatively, since it sounds like the check is between a static and a moving mesh, your idea of sweeping out the path of the rotating one could work. I guess you’d have to extract the mesh edges, then for each of them create a revolve surface around the rotation axis, then check all these surfaces for intersection with your static mesh.