Class Mesh3D

java.lang.Object
org.jlab.geom.prim.Mesh3D
All Implemented Interfaces:
Transformable, Showable

public class Mesh3D extends Object implements Transformable, Showable
Author:
gavalian
  • Constructor Details Link icon

    • Mesh3D Link icon

      public Mesh3D(float[] points, int[] faces)
  • Method Details Link icon

    • set Link icon

      public final void set(float[] points, int[] faces)
    • translateXYZ Link icon

      public void translateXYZ(double dx, double dy, double dz)
      Description copied from interface: Transformable
      Translates this object linearly by the amounts specified.
      Specified by:
      translateXYZ in interface Transformable
      Parameters:
      dx - amount to translate along the x axis
      dy - amount to translate along the y axis
      dz - amount to translate along the z axis
    • rotateX Link icon

      public void rotateX(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the x axis.
      Specified by:
      rotateX in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateY Link icon

      public void rotateY(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the y axis.
      Specified by:
      rotateY in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateZ Link icon

      public void rotateZ(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the z axis.
      Specified by:
      rotateZ in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • show Link icon

      public void show()
      Specified by:
      show in interface Showable
    • getNumPoints Link icon

      public int getNumPoints()
    • getPoint Link icon

      public void getPoint(int n, Point3D point)
    • getNumFaces Link icon

      public int getNumFaces()
    • getFace Link icon

      public void getFace(int face, Triangle3D tri)
    • intersectionPath Link icon

      public void intersectionPath(Path3D path, List<Point3D> intersections)
    • intersectionRay Link icon

      public int intersectionRay(Line3D line, List<Point3D> intersections)
      Finds intersections of the given ray with this shape. Intersection points will be appended to the given list.
      Parameters:
      line - the ray
      intersections - the list of intersections
      Returns:
      the number of intersections that were found
    • intersectionSegment Link icon

      public int intersectionSegment(Line3D line, List<Point3D> intersections)
      Finds intersections of the given line segment with this shape. Intersection points will be appended to the given list.
      Parameters:
      line - the line segment
      intersections - the list of intersections
      Returns:
      the number of intersections that were found
    • hasIntersection Link icon

      public boolean hasIntersection(Line3D line)
      Returns true if the infinite line intersects this shape.
      Parameters:
      line - the infinite line
      Returns:
      true if the line intersects the shape
    • hasIntersectionRay Link icon

      public boolean hasIntersectionRay(Line3D line)
      Returns true if the ray intersects this shape.
      Parameters:
      line - the ray
      Returns:
      true if the line intersects the shape
    • hasIntersectionSegment Link icon

      public boolean hasIntersectionSegment(Line3D line)
      Returns true if the line segment intersects this shape.
      Parameters:
      line - the line segment
      Returns:
      true if the line intersects the shape
    • getCenterX Link icon

      public Point3D getCenterX(int order)
    • getCenterY Link icon

      public Point3D getCenterY(int order)
    • getCenterZ Link icon

      public Point3D getCenterZ(int order)
    • getLineX Link icon

      public Line3D getLineX()
    • getLineY Link icon

      public Line3D getLineY()
    • getLineZ Link icon

      public Line3D getLineZ()
    • box Link icon

      public static Mesh3D box(float dx, float dy, float dz)
    • getMeshView Link icon

      public javafx.scene.shape.MeshView getMeshView()
    • main Link icon

      public static void main(String[] args)
      Main program for tests
      Parameters:
      args -