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

    • Mesh3D

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

    • set

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

      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

      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

      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

      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

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

      public int getNumPoints()
    • getPoint

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

      public int getNumFaces()
    • getFace

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

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

      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

      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

      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

      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

      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

      public Point3D getCenterX(int order)
    • getCenterY

      public Point3D getCenterY(int order)
    • getCenterZ

      public Point3D getCenterZ(int order)
    • getLineX

      public Line3D getLineX()
    • getLineY

      public Line3D getLineY()
    • getLineZ

      public Line3D getLineZ()
    • box

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

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

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