Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## toxi.geom.mesh.subdiv
Class MidpointDisplacementSubdivision

    java.lang.Object
      toxi.geom.mesh.subdiv.SubdivisionStrategy
          toxi.geom.mesh.subdiv.DisplacementSubdivision
              toxi.geom.mesh.subdiv.MidpointDisplacementSubdivision

    public class MidpointDisplacementSubdivision

extends DisplacementSubdivision

This subdivision strategy splits an edge in two equal halves at its mid point. The midpoint itself is being displaced, however, in the direction of the vector going from the configured reference point (often the mesh centroid is used) towards the edge midpoint. The displacement amount is configurable as fraction of the original edge length. So given that:

     M = edge midpoint
     R = reference point
     l = edge length
     a = displacement amplification factor

     D  = normalized(M-R)
     M' = M + D * a * l

Field Summary
`Vec3D` | `centroid`

Fields inherited from class toxi.geom.mesh.subdiv.SubdivisionStrategy
`DEFAULT_ORDERING`

Constructor Summary
`MidpointDisplacementSubdivision(Vec3D centroid, float amount)`

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.DisplacementSubdivision
`getAmp, invertAmp, scaleAmp, setAmp`

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

Constructor Detail

### MidpointDisplacementSubdivision

    public MidpointDisplacementSubdivision(Vec3D centroid,
                                           float amount)

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD