Package toxi.geom.mesh.subdiv
Class NormalDisplacementSubdivision
java.lang.Object
toxi.geom.mesh.subdiv.SubdivisionStrategy
toxi.geom.mesh.subdiv.DisplacementSubdivision
toxi.geom.mesh.subdiv.NormalDisplacementSubdivision
This subdivision strategy splits an edge in two equal halves at its mid
point. The midpoint itself is being displaced, however, in the average
direction of face normals associated with this edge. The displacement amount
is configurable as fraction of the original edge length. So given that:
M = edge midpoint N = averaged normal vector l = edge length a = displacement amplification factor M' = M + N * a * l
-
Field Summary
Fields inherited from class toxi.geom.mesh.subdiv.SubdivisionStrategy
DEFAULT_ORDERING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeSplitPoints
(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.DisplacementSubdivision
getAmp, invertAmp, scaleAmp, setAmp
Methods inherited from class toxi.geom.mesh.subdiv.SubdivisionStrategy
getEdgeOrdering, setEdgeOrdering
-
Constructor Details
-
NormalDisplacementSubdivision
public NormalDisplacementSubdivision(float amp)
-
-
Method Details
-
computeSplitPoints
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 classSubdivisionStrategy
- Parameters:
edge
- edge to split- Returns:
- list of split points
-