Chiplotle Tools

HPGL Tools

chiplotle.tools.hpgltools.relativize(data)
Convert all absolute positions in to relative positions.
chiplotle.tools.hpgltools.scale(arg, val)
chiplotle.tools.hpgltools.transpose(arg, val)

Input-output tools

chiplotle.tools.io.export(expr, filename, format='eps')

Export Chiplotle-HPGL objects to an image file format via hp2xx.

  • expr can be an iterable (e.g., list) of Chiplotle-HPGL objects or a

    single Chiplotle-HPGL object.

  • filename the file name, including path but without extension.

  • format is a string describing the format of the file to which the

    Chiplotle-HPGL objects will be exported. Default is ‘eps’. Valid formats are: cad, dxf, em, epic, eps, esc2, fig, gpt, hpgl, img, jpg, mf, nc, pbm, pcl, pcx, png, pre, rgip, svg, tiff.

Note

You must have hp2xx installed before you can export Chiplote-HPGL objects to image files.

chiplotle.tools.io.import_hpgl_file(filename)

Reads a text HPGL file and “inflates” it by creating Chiplotle-HPGL class instances of the found HPGL commands.

Example:

chiplotle> square = import_hpgl_file('examples/square.hpgl')
chiplotle> square
[SP(pen=1), PU(xy=[ 100.  100.]), PD(xy=[ 200.  100.]), 
PD(xy=[ 200.  200.]), PD(xy=[ 100.  200.]), 
PD(xy=[ 100.  100.]), SP(pen=0)]
chiplotle.tools.io.save_hpgl(expr, filename)

Save text HPGL from Chiplotle-HPGL.

  • expr can be an iterable (e.g., list) or a Chiplotle-HPGL object.
  • filename the file name, including path but without extension.
chiplotle.tools.io.view(expr, format='eps')

Displays Chiplotle-HPGL objects for prevewing.

  • expr can be an iterable (e.g., list) or a Chiplotle-HPGL object.

  • format is the file format to which the given expr will be

    converted for viewing. The default is ‘eps’.

Table Of Contents

Previous topic

Chiplotle Known Plotters

Next topic

HPGL web resources