Class GRSModel


  • public class GRSModel
    extends Model
    Create a wirefram model from a GRS file.

    GRS files are a simple file format for describing two-dimensional drawings made up of "polylines". The format was created for the textbook "Computer Graphics Using OpenGL", 3rd Ed, by Francis S Hill and Stephen M Kelley (see pages 61-63).

    See https://en.wikipedia.org/wiki/Polyline

    The structure of a GRS file is:

    1. A number of comment lines followed by a line starting with an asterisk, '*'.
    2. A line containing the "extent" (bounding box) of the drawing given as four doubles in model coordinates (left, top, right, bottom).
    3. The number of line-strips (i.e., polylines) in the drawing.
    4. The list of line-strips. Each line-strip starts with the number of vertices in the line-strip, followed by the (x, y) model coordinates for each vertex.
    • Constructor Detail

      • GRSModel

        public GRSModel​(File grsFile)
        Create a wireframe model from the contents of an GRS file.
        Parameters:
        grsFile - File object for the GRS data file