Package toxi.geom

Class AxisAlignedCylinder

java.lang.Object
toxi.geom.AxisAlignedCylinder
All Implemented Interfaces:
Shape3D
Direct Known Subclasses:
XAxisCylinder, YAxisCylinder, ZAxisCylinder

public abstract class AxisAlignedCylinder extends Object implements Shape3D
  • Method Details

    • containsPoint

      public abstract boolean containsPoint(ReadonlyVec3D p)
      Checks if the given point is inside the cylinder.
      Specified by:
      containsPoint in interface Shape3D
      Parameters:
      p -
      Returns:
      true, if inside
    • getLength

      public float getLength()
      Returns:
      the length
    • getMajorAxis

      public abstract Vec3D.Axis getMajorAxis()
      Returns:
      the cylinder's orientation axis
    • getPosition

      public Vec3D getPosition()
      Returns the cylinder's position (centroid).
      Returns:
      the pos
    • getRadius

      public float getRadius()
      Returns:
      the cylinder radius
    • setLength

      public void setLength(float length)
      Parameters:
      length - the length to set
    • setPosition

      public void setPosition(Vec3D pos)
      Parameters:
      pos - the pos to set
    • setRadius

      public void setRadius(float radius)
      Parameters:
      radius -
    • toMesh

      public Mesh3D toMesh()
      Builds a TriangleMesh representation of the cylinder at a default resolution 30 degrees.
      Returns:
      mesh instance
    • toMesh

      public Mesh3D toMesh(int steps, float thetaOffset)
      Builds a TriangleMesh representation of the cylinder using the given number of steps and start angle offset.
      Parameters:
      steps -
      thetaOffset -
      Returns:
      mesh
    • toMesh

      public Mesh3D toMesh(Mesh3D mesh, int steps, float thetaOffset)