toxi.geom.mesh.subdiv
Class DualDisplacementSubdivision

java.lang.Object
  extended by toxi.geom.mesh.subdiv.SubdivisionStrategy
      extended by toxi.geom.mesh.subdiv.DualDisplacementSubdivision

public class DualDisplacementSubdivision
extends SubdivisionStrategy

This subdivision strategy splits an edge in three equal parts using two split points at 33% and 66% of the edge. The split points themselves are being displaced, however, in the direction of the vector going from the configured reference point (often the mesh centroid is used) towards each split point. The displacement amount is configurable as fraction of the original edge length. So given that:

 S = edge split point
 R = reference point
 l = edge length
 a = displacement amplification factor
 
 S' = S + (S-R) * a * l
 


Field Summary
 float ampA
           
 float ampB
           
 Vec3D centroid
           
 
Fields inherited from class toxi.geom.mesh.subdiv.SubdivisionStrategy
DEFAULT_ORDERING
 
Constructor Summary
DualDisplacementSubdivision(Vec3D centroid, float ampA, float ampB)
           
 
Method Summary
 java.util.List<Vec3D> computeSplitPoints(WingedEdge edge)
          Computes a number of points on (or near) the given edge which are used for splitting the edge in smaller segments.
 
Methods inherited from class toxi.geom.mesh.subdiv.SubdivisionStrategy
getEdgeOrdering, setEdgeOrdering
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centroid

public Vec3D centroid

ampA

public float ampA

ampB

public float ampB
Constructor Detail

DualDisplacementSubdivision

public DualDisplacementSubdivision(Vec3D centroid,
                                   float ampA,
                                   float ampB)
Method Detail

computeSplitPoints

public java.util.List<Vec3D> computeSplitPoints(WingedEdge edge)
Description copied from class: SubdivisionStrategy
Computes a number of points on (or near) the given edge which are used for splitting the edge in smaller segments.

Specified by:
computeSplitPoints in class SubdivisionStrategy
Parameters:
edge - edge to split
Returns:
list of split points