KiCad PCB EDA Suite
HPGL_plotter.cpp File Reference

KiCad plotter for HPGL file format. More...

#include <cstdio>
#include <string_utils.h>
#include <convert_basic_shapes_to_polygon.h>
#include <math/util.h>
#include <trigo.h>
#include <plotters/plotter_hpgl.h>

Go to the source code of this file.

Functions

static double dpoint_dist (const DPOINT &a, const DPOINT &b)
 Compute the distance between two DPOINT points. More...
 

Variables

static const char hpgl_end_polygon_cmd [] = "PM 2; FP; EP;\n"
 
static const double PLUsPERDECIMIL = 0.1016
 

Detailed Description

KiCad plotter for HPGL file format.

Since this plot engine is mostly intended for import in external programs, sadly HPGL/2 isn't supported a lot... some of the primitives use overlapped strokes to fill the shape.

Definition in file HPGL_plotter.cpp.

Function Documentation

◆ dpoint_dist()

static double dpoint_dist ( const DPOINT a,
const DPOINT b 
)
static

Compute the distance between two DPOINT points.

Definition at line 942 of file HPGL_plotter.cpp.

943 {
944  DPOINT diff = a - b;
945  return sqrt( diff.x * diff.x + diff.y * diff.y );
946 }

References VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by HPGL_PLOTTER::sortItems().

Variable Documentation

◆ hpgl_end_polygon_cmd

const char hpgl_end_polygon_cmd[] = "PM 2; FP; EP;\n"
static

◆ PLUsPERDECIMIL

const double PLUsPERDECIMIL = 0.1016
static

Definition at line 219 of file HPGL_plotter.cpp.

Referenced by HPGL_PLOTTER::SetViewport().