Chiplotle Compound Commands

class chiplotle.hpgl.compound.Bezier(control_points, xy=None, points_to_compute=None, weight=None, control_marks=False, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Bezier curve interpolation

class chiplotle.hpgl.compound.BusinessCard(xy, logo, texts, width=None, height=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

A class for making simple presentation/business cards.

  • logo: is a single _CompoundHPGL instance to be placed in the card.
  • texts: is a list of Label instances containing text for the card.
lower_left
lower_right
texts
upper_left
upper_right
class chiplotle.hpgl.compound.Catmull(control_points, xy=None, points_to_compute=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Catmull-Rom spline interpolation

class chiplotle.hpgl.compound.Circle(xy, radius, chord=None, filled=False, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Circle with absolute position.

class chiplotle.hpgl.compound.Container(xy, shapes=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Generic container for CompoundHPGL commands. Only _CompoundHPGL commands can be contained by this Container.

append(arg)
extend(arg)
insert(i, arg)
pop(indx=-1)
remove(arg)
class chiplotle.hpgl.compound.Cross(xy, width, height, rotation=0, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Cross. Can be rotated.

class chiplotle.hpgl.compound.Cube(xy, width, height, depth, rotation=(0, 0, 0), pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

A 3D Cube. Can be rotated on x, y, and z.

class chiplotle.hpgl.compound.DorkbotLabel(xy, text, cell_shape='square', pen=None, fill_pen=None, width=None, height=None, outline_jitter=None, fill_jitter=None)
Bases: chiplotle.hpgl.compound.compound._CompoundHPGL
class chiplotle.hpgl.compound.Fan(xy, radius, angle, width_angle, height, chord=None, filled=False, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

A Fan is a slice of a donut seen from above (the hole in the middle). Or think of it as bent rectangle.

  • xy is the ‘pole’ of the radial coordinate system used to compute

    the shape.

All angles are assumed to be in radians.

class chiplotle.hpgl.compound.FancyLabel(xy, text, font, cell_shape, pen=None, width=None, height=None, jitter=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

FancyLabel.

Write text with arbitrary Chiplotle-font and arbitrary cell shape.

  • xy: (x, y) position of the label.

  • text: a string of the text to be printer.

  • font: the Chiplotle-font to use. This should be a valid Chiplotle-font.

    Chiplotle-fonts live in chiplotle/fonts.

  • cell_shape : the Chiplotle-HPGL shape to use to draw each cell.

    These can be simple Chiplotle-HPGL commands or Compound commands.

  • pen: the pen to use [1 to 8].

  • width: the width of each character. May be a number or None.

  • height: the height of each character. May be a number or None.

  • jitter : an (x, y) tuple indicating the ammount of randomness added

    to each of the cells making up each character.

class chiplotle.hpgl.compound.Grid(xy, width, height, height_divisions, width_divisions, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Rectangular grid.

  • xy : tuple, (x, y) position.

  • width : int or float, width of the rectangle.

  • height : int or float, height of the rectangle.

  • width_divisions : int, number of horizontal equidistant partitions.

  • horizontal_divisions : int, number of vertical equidistant

    partitions.

  • pen : int, pen number.

class chiplotle.hpgl.compound.GroovyFrame(xy, w1, h1, w2, h2, lines_per_side, pen=None)
Bases: chiplotle.hpgl.compound.compound._CompoundHPGL
class chiplotle.hpgl.compound.HPGLContainer(xy, shapes=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Primitive HPGL commands can be contained in this container. The position of primitive absolute HPGL commands (e.g., PA, RA) is relative to the position of this container.

append(arg)
extend(arg)
insert(i, arg)
pop(indx=-1)
remove(arg)
class chiplotle.hpgl.compound.Label(xy, text, charsize=(1, 1), origin=None, charspace=None, linespace=None, slant=None, direction=None, vertical=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Text label.

  • xy: 2-tuple of coordinates pair for label location.

  • text: The actual text to be printed.

  • charsize: 2-tuple (w, h) pair defining the absolute character size

    in centimiters.

  • direction: 2-tuple. The inclination / angle of the text:

    run (direction on x axis), rise (direction on y axis).

  • charspace: Factor to set spacing between characters.

    Positive separates, negatives bring together.

  • linespace: Factor to set spacing between lines.

    Positive separates, negatives bring together.

  • origin: location of label relative to pen’s current location.

    Possible values:

    .

    Left

    Inside

    Right

    Above

    3

    6

    9

    Inside

    2

    5

    8

    Below

    1

    4

    7

    If 10 is added to the above-mentioned location number, positions (except 5) will be offset towards the center by 1/2 the character width and 1/2 the character height.

  • slant: slant of characters (italic). Possible values: [0-1).

    0 is vertical, 0.5 is 45 degs., ...

  • vertical: Print text from left to right (False) or top down (True).

charsize
class chiplotle.hpgl.compound.Line(xy1, xy2, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Line at absolute position.

class chiplotle.hpgl.compound.MayaNumber(xy, value, size=500)
Bases: chiplotle.hpgl.compound.compound._CompoundHPGL
class chiplotle.hpgl.compound.Path(points, xy=None, curvature=1.0, points_to_compute=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

draws a path given a list of waypoints

curvature
points
class chiplotle.hpgl.compound.Pen(number, velocity=None, force=None, acceleration=None, thickness=None)

Bases: object

The Pen class houses the following HPGL pen settable properties:
AS, FS, SP and VS.
  • number : int [1 to 8] pen number.
  • velocity : int [1 to 60] pen velocity.
  • force : int pen force.
  • acceleration : int [1 to 4] pen velocity.
  • thickness : float [0.1 to 5] mm.
format
class chiplotle.hpgl.compound.Polygon(xy, subshapes, filled=False, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

A Polygon that models the HPGL polygon definition via PM.

  • subshapes : a list of _CompoundHPGL commands that make up

    the totality of the polygon. Each subshape is ended with ‘PM1;’ in the HPGL returned by the formatter.

subshapes
class chiplotle.hpgl.compound.RadialHistogramLF(xy, min_radius, max_radius, data, fill=False, fillines_spacing=0.01, pen=None)

Bases: chiplotle.hpgl.compound.histograms.radialhistogram._RadialHistogram

A radial histogram with linear outward fill. The shape draws a circular histogram for the given list of relative frequencies. The bars of the histogram are filled ‘linearly’, i.e., with lines moving outwards from the center.

  • min_radius: a scalar of the smallest radius of the histogram.

  • max_radius: a scalar of the maximum radius of the histogram.

  • data: a list of relative frequencies [x, y, z, ...]. Values are

    assumed to be between 0 and 1.

  • fill: a boolean that indicated whether the bars should be filled or not.

  • fillines_spacing: a scalar indicating the angle between fill lines,

    in radians.

class chiplotle.hpgl.compound.RadialHistogramRF(xy, min_radius, max_radius, data, fill=False, fillines_spacing=50, chord=None, pen=None)

Bases: chiplotle.hpgl.compound.histograms.radialhistogram._RadialHistogram

A radial histogram with radial fill. The shape draws a circular histogram for the given list of relative frequencies. The bars of the histogram are filled ‘radially’, i.e., with arc shapes.

  • min_radius: a scalar of the smallest radius of the histogram.

  • max_radius: a scalar of the maximum radius of the histogram.

  • data: a list of relative frequencies [x, y, z, ...]. Values are

    assumed to be between 0 and 1.

  • fill: a boolean that indicated whether the bars should be filled or not.

  • fillines_spacing: a scalar indicating the spacing between fill lines.

  • chord: the chord tolerance of the arcs drawn.

class chiplotle.hpgl.compound.RandomWalk(xy, steps, step_size=500)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Random Walk.

class chiplotle.hpgl.compound.Rectangle(xy, width, height, rotation=0)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Compound Rectangle. Can be rotated. Cannot be filled

class chiplotle.hpgl.compound.Supershape(xy, w, h, m, n1, n2, n3, points=1000, percentage=1.0, a=1.0, b=1.0, range=None, pen=None)

Bases: chiplotle.hpgl.compound.compound._CompoundHPGL

Supershape, generated using the superformula first proposed by Johan Gielis. arguments are: w - width h - height a=b=1.0, m, n1, n2, n3 - controls of shape

Previous topic

Chiplotle-HPGL commands

Next topic

Chiplotle Known Plotters