public class SolidPolygonCylinder extends AbstractCompositeShape
A solid cylinder defined by two end points.

The cylinder extends from startPoint to endPoint with circular caps at both ends. The number of segments determines the smoothness of the curved surface.

Usage example:


 // Create a vertical cylinder from Y=100 to Y=200
 SolidPolygonCylinder cylinder = new SolidPolygonCylinder(
     new Point3D(0, 100, 0),   // start point (bottom)
     new Point3D(0, 200, 0),   // end point (top)
     10,                        // radius
     16,                        // segments
     Color.RED                  // color
 );

 // Create a horizontal cylinder along X axis
 SolidPolygonCylinder pipe = new SolidPolygonCylinder(
     new Point3D(-50, 0, 0),
     new Point3D(50, 0, 0),
     5, 12, Color.BLUE
 );
 
See Also:
  • Constructor Details

    • SolidPolygonCylinder

      public SolidPolygonCylinder(Point3D startPoint, Point3D endPoint, double radius, int segments, Color color)
      Constructs a solid cylinder between two end points.

      The cylinder has circular caps at both startPoint and endPoint, connected by a curved side surface. The orientation is automatically calculated from the direction between the two points.

      Parameters:
      startPoint - the center of the first cap
      endPoint - the center of the second cap
      radius - the radius of the cylinder
      segments - the number of segments around the circumference. Higher values create smoother cylinders. Minimum is 3.
      color - the fill color applied to all polygons