de.javagl.simplemesh.utils
Class Vertices

java.lang.Object
  extended by de.javagl.simplemesh.utils.Vertices

public class Vertices
extends java.lang.Object

Utility methods for modifying and obtaining information about vertices


Method Summary
static float computeMaxX(java.lang.Iterable<? extends Vertex> vertices)
          Compute the maximum x-coordinate of the given vertices
static float computeMaxY(java.lang.Iterable<? extends Vertex> vertices)
          Compute the maximum y-coordinate of the given vertices
static float computeMaxZ(java.lang.Iterable<? extends Vertex> vertices)
          Compute the maximum z-coordinate of the given vertices
static float computeMinX(java.lang.Iterable<? extends Vertex> vertices)
          Compute the minimum x-coordinate of the given vertices
static float computeMinY(java.lang.Iterable<? extends Vertex> vertices)
          Compute the minimum y-coordinate of the given vertices
static float computeMinZ(java.lang.Iterable<? extends Vertex> vertices)
          Compute the minimum z-coordinate of the given vertices
static float distance(Vertex v0, Vertex v1)
          Returns the distance between the given vertices
static float distanceSquared(Vertex v0, Vertex v1)
          Returns the squared distance between the given vertices
static void scale(java.lang.Iterable<? extends Vertex> vertices, float scale)
          Scale the given vertices with the given factor
static void translate(java.lang.Iterable<? extends Vertex> vertices, float dx, float dy, float dz)
          Translate the given vertices by the given amount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

scale

public static void scale(java.lang.Iterable<? extends Vertex> vertices,
                         float scale)
Scale the given vertices with the given factor

Parameters:
vertices - The vertices
scale - The scale factor

translate

public static void translate(java.lang.Iterable<? extends Vertex> vertices,
                             float dx,
                             float dy,
                             float dz)
Translate the given vertices by the given amount

Parameters:
vertices - The vertices
dx - The x movement
dy - The y movement
dz - The z movement

distanceSquared

public static float distanceSquared(Vertex v0,
                                    Vertex v1)
Returns the squared distance between the given vertices

Parameters:
v0 - The first vertex
v1 - The second vertex
Returns:
The squared distance

distance

public static float distance(Vertex v0,
                             Vertex v1)
Returns the distance between the given vertices

Parameters:
v0 - The first vertex
v1 - The second vertex
Returns:
The distance

computeMinX

public static float computeMinX(java.lang.Iterable<? extends Vertex> vertices)
Compute the minimum x-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result

computeMinY

public static float computeMinY(java.lang.Iterable<? extends Vertex> vertices)
Compute the minimum y-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result

computeMinZ

public static float computeMinZ(java.lang.Iterable<? extends Vertex> vertices)
Compute the minimum z-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result

computeMaxX

public static float computeMaxX(java.lang.Iterable<? extends Vertex> vertices)
Compute the maximum x-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result

computeMaxY

public static float computeMaxY(java.lang.Iterable<? extends Vertex> vertices)
Compute the maximum y-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result

computeMaxZ

public static float computeMaxZ(java.lang.Iterable<? extends Vertex> vertices)
Compute the maximum z-coordinate of the given vertices

Parameters:
vertices - The vertices
Returns:
The result