Silhouette
Description
Computes silhouette edges for a given view direction or view point of a soup of loosely connected triangular faces.
To build a silhouette, perform the following steps:
-
Create a new instance of Silhouette.
-
Add triangular faces with Face, which populates Edges, Faces and Vertices.
-
Optionally call Finish, to free the internal data structures for face specification.
-
Optionally call Prepare, to warm up the spatial acceleration data structures.
-
Call Compute (repeatedly) to build the silhouette edges, see Contour.
-
To start from scratch, call Clear and go to to step 2.
Public / Methods
Compute
Computes the silhouette for the given vector.
This method (re-)builds the whole content of Contour.
- See also
Edge
Specifies a single edge.
Edges that are not connected to at least one face will always be included in Contour.
- See also
Face
Specifies a triangular face.
First, the given points a in, b in, c in are mapped to unique vertices, which may add new elements to Vertices. Then, the vertex indices are used to build one face tuple and three edge tuples, which may add new elements to Faces resp. Edges. Finally, the front-facing normal-vector of the triangle is computed as follows:
normal = cross(b - a, c - a)
Public / Attributes
Vertices
The unique vertices that have been added with Face.
Adding points with identical coordinates will create only a single unique vertex.