Announcement

Collapse
No announcement yet.

Mesh intersection

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mesh intersection

    Hi guys,

    Could anyone comment if it is possible to intersect two meshes (generated based on the same method, let's say tri-meshes) and get a 3D polyline as a result using Open Inventor API?

    Thank you!

  • #2
    Originally posted by adragoner View Post
    Could anyone comment if it is possible to intersect two meshes (generated based on the same method, let's say tri-meshes) and get a 3D polyline as a result using Open Inventor API?
    Hi,
    There is not currently a built-in class for this operation.
    However it's not too difficult to implement using the SoCallbackAction, the addTriangleCallback() method and a triangle intersection function. This is a particularly tedious operation since you effectively have to compare each triangle in mesh1 with each triangle in mesh2, but if the meshes are not too large or don't need to be intersected very often, then it's probably easier to implement a brute force solution. After doing the traversals and collecting the intersection line segments, if you only need to render the intersection, you're done. Just put the line segments into an SoLineSet and render them as a "bag of segments". Order doesn't matter. If you need a real connected polyline then you have to post-process the segments (sort and match end-points). To see an example implementation of a similar (but simpler) problem look at the PlaneGeometryIntersection class in the Open Inventor Medical Edition examples.

    Comment


    • #3
      Thank you very much! I'll give it a try.

      Comment

      Working...
      X