public class WireframeDrawing extends AbstractCompositeShape
A freeform polyline drawing tool that connects sequential points with line segments. Points are added one at a time via addPoint(Point3D); each new point is connected to the previously added point by a line.

The first point added establishes the starting position without drawing a line. Each subsequent point creates a new line segment from the previous point to the new one.

This shape is useful for drawing paths, trails, trajectories, or arbitrary wireframe shapes that are defined as a sequence of vertices.

Usage example:


 LineAppearance appearance = new LineAppearance(2, Color.YELLOW);
 WireframeDrawing drawing = new WireframeDrawing(appearance);
 drawing.addPoint(new Point3D(0, 0, 0));
 drawing.addPoint(new Point3D(100, 50, 0));
 drawing.addPoint(new Point3D(200, 0, 0));
 shapeCollection.addShape(drawing);
 
See Also:
  • Constructor Details

    • WireframeDrawing

      public WireframeDrawing(LineAppearance lineAppearance)
      Constructs a new empty wireframe drawing with the given line appearance.
      Parameters:
      lineAppearance - the line appearance (color, width) used for all line segments added to this drawing
  • Method Details

    • addPoint

      public void addPoint(Point3D point3d)
      Adds a new point to the drawing. If this is the first point, it sets the starting position. Otherwise, a line segment is created from the previous point to this new point.

      The point is defensively copied, so subsequent modifications to the passed point3d object will not affect the drawing.

      Parameters:
      point3d - the point to add to the polyline