views:

973

answers:

3

Hello world.

Recently our team was facing the task to build the 2D slice between a plane and some set of 3D geometry (set of triangles). Google hasn't been as helpful as we have wanted it to be, so we turn our attention here to see if anyone has encountered this problem with a possible solution. Links are also wanted.

Finding the intersection points in itself isn't a hard task, but ensuring triangles being generated correctly with correct corner composition is playing a hard game with us. We simply lack the math/understanding of how triangle construction from an arbirtrary model is done.

If you have problems understanding what we're trying to do, imagine this scenario:

A bunny model is loaded into the program. Next a "laser" travels across space, cutting the bunny in half. That thin slice that the laser cut is the slice we want to generate. It should be a 2D triangle set. If laser doesn't cut it for you (no pun intended), think knife, plane, anything that slices something across a plane.

Thanks in advance.

+1  A: 

I don't really know what you mean by "corner composition", but I suppose this is to obtain triangles not too sharp.

I suppose also that your problem can then be abstracted to the triangulation of a contour?

If so, I am sure you can find plenty of methods on the net.

One method I would try would be:

  1. fill in your contour with points. The density of your points should reflect the density of the points on your contour. Even better, the density should decrease when you go away from the center.
  2. triangulate using the Delaunay triangulation (QHull provides an efficient implementation)

For the first point, a dart-throwing algorithm should do the trick, with variable density to optimize the second step. This means: you throw 'darts' to find your points, but if a dart end up too close from its neighbor, you remove it and throw a new one.

PierreBdR
Definitely try Delaunay first.
Greg Whitfield
A: 

The intersection of a plane and a triangle is a line segment or nothing (ignoring the degenerate case of the triangle being exactly in the plane).

So the result of your laser/knife scanning/slicing across the bunny model triangles is a collection of line segments. I'm not sure how/why you'd expect to get a "2D triangle set" out as a result.

If you want to take the (possibly non-convex) polygon(s) formed by those line segments and "fill them in" with triangles, CGAL's polygon tools might do the job (my guess is the couple of pictures on that page are something like what you're trying to achieve).

timday
A: 

If you're not tied to any particular software, open your data set in ParaView (paraview.org) or ParaViewGeo (paraviewgeo.mirarco.org).

Both have a filter called Slice that does excactly what you're talking about and both allow you to save your data back out.

ParaViewGeo supports data formats (GoCad, DataMine, and others) commonly used by the exploration/mining/geology industry and that is the only real difference between the two pieces of software.

There are also many other filters available in these software packages you may find interesting, such as Clip (cut your bunny in half and view one of the halves), and Threshold (say you assigned values to parts of your bunny, e.g. region id's like ears, nose, eyes, feet, etc you could "threshold" so that only those parts are left over to view)

Chris Cameron