proj home

Files   Classes   Functions   Hierarchy  

d3clipping Class Reference

2D simplex mesh subtraction. More...

#include <d3clipping.h>

Collaboration diagram for d3clipping:

List of all members.

Public Member Functions

 d3clipping (d3tess &tess_, partitionspace< pt3, double > const &H_)
 Clip the tessellation against the line.
void eval ()
 Clip the tessellation against the partition.

Public Attributes

vector< boolbv
 Short for black value it is true if the associated point is black in color.
double zero
 Client configures zero for isOnBoundary routine.


Detailed Description

2D simplex mesh subtraction.

The partition is used to find the intersection between the mesh and itself. It then clips the mesh. So the partition is subtracted from the mesh.

The algorithm works by classifying points as either white or black. Points with all white points are discarded and points with all black points are accepted.

Triangles with white and black points are reclassified as a black point on the boundary is different from a black point not one the boundary. For example two white points and one black on the boundary is discarded as it is equivalent to three white points.

Example
#include <point.h>
#include <d3tess.h>
#include <d3clipping.h>
...
<TODO>

Definition at line 38 of file d3clipping.h.


Constructor & Destructor Documentation

d3clipping::d3clipping ( d3tess tess_,
partitionspace< pt3, double > const &  H_ 
)

Clip the tessellation against the line.

Definition at line 46 of file d3clipping.cpp.

00050   : tess(tess_), vi(tess.vi), pt(tess.pt), H(H_)
00051 {
00052 }


Member Function Documentation

void d3clipping::eval (  ) 

Clip the tessellation against the partition.

Definition at line 243 of file d3clipping.cpp.

References bv, and partitionspace< PT >::isInside().

00244 {
00245   uint ptsz = pt.size();
00246   bv.resize(ptsz);
00247   // Ignore the first element as point 0 is defined as no point.
00248   bv[0]=true;
00249   // Because the partition H is subtracting from the mesh its
00250   // balls are white.  So the H.isInside function has to be
00251   // inverted.  If the point is on H's boundary there is a possibiliby
00252   // that it could be classified wrongly.  In this case I believe
00253   // the algorithm is robust enough to handle it by re interpreting any
00254   // 2 black 1 white cases to 3 black again because such cases are 
00255   // re processed anyway.
00256   for (uint i=1; i<ptsz; ++i)
00257     bv[i] = ! H.isInside( pt[i] );
00258 
00259   for (uint i=1; i<vi.size(); ++i )
00260     processSimplex(i);
00261 }


Member Data Documentation

Short for black value it is true if the associated point is black in color.

Definition at line 85 of file d3clipping.h.

Referenced by eval().

Client configures zero for isOnBoundary routine.

eg zero = 1.0e-10

Definition at line 99 of file d3clipping.h.

Referenced by test01obj< P, PD >::test01obj().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:53 2011 for Chelton Evans Source by  doxygen 1.5.8