Class Vertex

java.lang.Object
eu.mihosoft.vrl.v3d.Vertex

public class Vertex extends Object
Represents a vertex of a polygon. This class provides normal so primitives like Cube can return a smooth vertex normal, but normal is not used anywhere else.
  • Field Details Link icon

    • pos Link icon

      public Vector3d pos
      Vertex position.
    • normal Link icon

      public Vector3d normal
      Normal.
  • Constructor Details Link icon

    • Vertex Link icon

      public Vertex(Vector3d pos, Vector3d normal)
      Constructor. Creates a vertex.
      Parameters:
      pos - position
      normal - normal
  • Method Details Link icon

    • clone Link icon

      public Vertex clone()
      Overrides:
      clone in class Object
    • flip Link icon

      public void flip()
      Inverts all orientation-specific data. (e.g. vertex normal).
    • interpolate Link icon

      public Vertex interpolate(Vertex other, double t)
      Create a new vertex between this vertex and the specified vertex by linearly interpolating all properties using a parameter t.
      Parameters:
      other - vertex
      t - interpolation parameter
      Returns:
      a new vertex between this and the specified vertex
    • toStlString Link icon

      public String toStlString()
      Returns this vertex in STL string format.
      Returns:
      this vertex in STL string format
    • toStlString Link icon

      public StringBuilder toStlString(StringBuilder sb)
      Returns this vertex in STL string format.
      Parameters:
      sb - string builder
      Returns:
      the specified string builder
    • toObjString Link icon

      public StringBuilder toObjString(StringBuilder sb)
      Returns this vertex in OBJ string format.
      Parameters:
      sb - string builder
      Returns:
      the specified string builder
    • toObjString Link icon

      public String toObjString()
      Returns this vertex in OBJ string format.
      Returns:
      this vertex in OBJ string format
    • transform Link icon

      public Vertex transform(Transform transform)
      Applies the specified transform to this vertex.
      Parameters:
      transform - the transform to apply
      Returns:
      this vertex
    • transformed Link icon

      public Vertex transformed(Transform transform)
      Applies the specified transform to a copy of this vertex.
      Parameters:
      transform - the transform to apply
      Returns:
      a copy of this transform
    • getWeight Link icon

      public double getWeight()
      Returns:
      the weight
    • setWeight Link icon

      public void setWeight(double weight)
      Parameters:
      weight - the weight to set
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object