Skip to content

Commit

Permalink
Add line styles to the HPGL library.
Browse files Browse the repository at this point in the history
Not used by any of the drawings yet though.
  • Loading branch information
anachrocomputer committed Apr 23, 2024
1 parent 72d69f8 commit 9b7fc85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ the library and/or command line (we just use 9600 baud).
SIGINT has stopped a plot.
* Make 'plotcancel()' work properly. Install a signal handler in 'plotbegin()'
to call it if/when we get a signal.
* Add support for line styles. We could use dotted and dashed lines
for some of the plots, e.g. fold lines, centre lines.
* Add support for read-back commands when the interface allows them.
E.g. 'OS', 'OA' and 'OI'.
* Add support for automatic paper feed on HP 7550 and any other plotters
Expand Down Expand Up @@ -97,6 +95,7 @@ command-line arguments and low-level driver code.
* Add new drawings! Especially colouring-in drawings, all-over patterns,
3D perspective drawings, maps and even slow-to-draw drawings!
* Add colour (pen changes) to drawings.
* Add line styles (dotted, dashed) to drawings.
* Add drawings that can be folded like Origami.
* Add drawings that can be cut out and assembled, e.g. geodesic dome,
packaging such as cake boxes, decorations such as snowflakes.
Expand Down
11 changes: 11 additions & 0 deletions hpgllib.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,17 @@ void pencolr(int c)
}


/**
* @brief Set the line type
*
* @param t The line type to be set
*/
void linetype(const int t)
{
fprintf(Plt, "LT%d;\n", t);
}


/**
* @brief Draw a text label vertically
*
Expand Down
1 change: 1 addition & 0 deletions hpgllib.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void arc(const double x, const double y, const double a);
void ellipse(const double x0, const double y0, const double a, const double b, const double theta);
void roundrect(const double x1, const double y1, const double x2, const double y2, const double radius);
void pencolr(int c);
void linetype(const int t);
void vlabel(const double x, const double y, const double siz, const char *const str);
void hlabel(const double x, const double y, const double siz, const char *const str);
int writedisplay(const char *const str);

0 comments on commit 9b7fc85

Please sign in to comment.