Class ConeFrustum

    • Field Detail

      • r1

        public final double r1
      • r2

        public final double r2
      • h

        public final double h
      • n

        public final int n
      • k

        public final int k
    • Constructor Detail

      • ConeFrustum

        public ConeFrustum()
        Create a frustum of a right circular cone with its base in the xz-plane, a base radius of 1, top radius of 1/2, and height 1/2.
      • ConeFrustum

        public ConeFrustum​(int n,
                           int k,
                           double r,
                           double h,
                           double a)
        Create a frustum of a right circular cone with its base in the xz-plane, a base radius of r, top of the frustum at height h, and with the cone's apex on the y-axis at height a.

        There must be at least three lines of longitude and at least two circles of latitude.

        Parameters:
        n - number of circles of latitude
        k - number of lines of longitude
        r - radius of the base in the xz-plane
        h - height of the frustum
        a - height of the apex of the cone
        Throws:
        IllegalArgumentException - if n is less than 2
        IllegalArgumentException - if k is less than 3
      • ConeFrustum

        public ConeFrustum​(double r1,
                           double h,
                           double r2,
                           int n,
                           int k)
        Create a frustum of a right circular cone with its base in the xz-plane, a base radius of r1, top radius of r2, and height h.

        This model works with either r1 > r2 or r1 < r2. In other words, the frustum can have its "apex" either above or below the xz-plane.

        There must be at least three lines of longitude and at least two circles of latitude.

        Parameters:
        r1 - radius of the base of the frustum
        h - height of the frustum
        r2 - radius of the top of the frustum
        n - number of circles of latitude
        k - number of lines of longitude
        Throws:
        IllegalArgumentException - if n is less than 2
        IllegalArgumentException - if k is less than 3
    • Method Detail

      • remake

        public ConeFrustum remake​(int n,
                                  int k)
        Description copied from interface: MeshMaker
        Build an instance of the Model with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
        Specified by:
        remake in interface MeshMaker
        Parameters:
        n - number of lines of latitude for the returned Model
        k - number of lines of longitude for the returned Model
        Returns:
        a new instance of the Model with the updated parameters