2011-09-30 18:15:37 +00:00
|
|
|
/**
|
|
|
|
* @file common_plotDXF_functions.cpp
|
|
|
|
* @brief KiCad: Common plot DXF Routines.
|
|
|
|
*/
|
2009-06-30 10:43:20 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <gr_basic.h>
|
|
|
|
#include <trigo.h>
|
|
|
|
#include <wxstruct.h>
|
|
|
|
#include <base_struct.h>
|
|
|
|
#include <plot_common.h>
|
|
|
|
#include <macros.h>
|
|
|
|
#include <kicad_string.h>
|
2009-06-30 10:43:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Set the plot offset for the current plotting
|
|
|
|
*/
|
2010-12-11 18:40:39 +00:00
|
|
|
void DXF_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( !output_file );
|
2010-12-11 18:40:39 +00:00
|
|
|
plot_offset = aOffset;
|
2009-06-30 10:43:20 +00:00
|
|
|
plot_scale = aScale;
|
|
|
|
device_scale = 1;
|
|
|
|
set_default_line_width( 0 ); /* No line width on DXF */
|
2010-12-11 18:40:39 +00:00
|
|
|
plotMirror = false; /* No mirroring on DXF */
|
2009-06-30 10:43:20 +00:00
|
|
|
current_color = BLACK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-31 16:59:32 +00:00
|
|
|
bool DXF_PLOTTER::start_plot( FILE* fout )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( !output_file );
|
|
|
|
output_file = fout;
|
|
|
|
/* DXF HEADER - Boilerplate */
|
2009-11-23 15:16:50 +00:00
|
|
|
fputs( "0\nSECTION\n2\nHEADER\n9\n$ANGBASE\n50\n0.0\n9\n$ANGDIR\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nLTYPE\n70\n1\n0\nLTYPE\n2\nCONTINUOUS\n70\n0\n3\nSolid line\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n",
|
|
|
|
output_file );
|
2009-06-30 10:43:20 +00:00
|
|
|
/* Layer table - one layer per color */
|
|
|
|
fprintf( output_file, "0\nTABLE\n2\nLAYER\n70\n%d\n", NBCOLOR );
|
|
|
|
for( int i = 0; i<NBCOLOR; i++ )
|
|
|
|
{
|
2009-07-01 05:20:11 +00:00
|
|
|
wxString cname = ColorRefs[i].m_Name;
|
2009-06-30 10:43:20 +00:00
|
|
|
fprintf( output_file, "0\nLAYER\n2\n%s\n70\n0\n62\n%d\n6\nCONTINUOUS\n",
|
2011-02-28 18:36:19 +00:00
|
|
|
TO_UTF8( cname ), i + 1 );
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* End of layer table, begin entities */
|
|
|
|
fputs( "0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nENTITIES\n", output_file );
|
2010-03-31 16:59:32 +00:00
|
|
|
|
|
|
|
return true;
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-31 16:59:32 +00:00
|
|
|
bool DXF_PLOTTER::end_plot()
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
/* DXF FOOTER */
|
|
|
|
fputs( "0\nENDSEC\n0\nEOF\n", output_file );
|
|
|
|
fclose( output_file );
|
2010-03-31 16:59:32 +00:00
|
|
|
output_file = NULL;
|
|
|
|
|
|
|
|
return true;
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* color = color index in ColorRefs[]
|
|
|
|
*/
|
2009-11-23 15:16:50 +00:00
|
|
|
void DXF_PLOTTER::set_color( int color )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
2009-11-23 15:16:50 +00:00
|
|
|
if( ( color >= 0 && color_mode )
|
|
|
|
|| ( color == BLACK )
|
|
|
|
|| ( color == WHITE ) )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
current_color = color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-29 10:20:48 +00:00
|
|
|
void DXF_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
move_to( p1 );
|
|
|
|
line_to( wxPoint( p1.x, p2.y ) );
|
|
|
|
line_to( wxPoint( p2.x, p2.y ) );
|
|
|
|
line_to( wxPoint( p2.x, p1.y ) );
|
|
|
|
finish_to( wxPoint( p1.x, p1.y ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-29 10:20:48 +00:00
|
|
|
void DXF_PLOTTER::circle( wxPoint centre, int diameter, FILL_T fill, int width )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
2009-11-23 15:16:50 +00:00
|
|
|
double radius = user_to_device_size( diameter / 2 );
|
2009-06-30 10:43:20 +00:00
|
|
|
user_to_device_coordinates( centre );
|
2009-11-23 15:16:50 +00:00
|
|
|
if( radius > 0 )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
2009-07-01 05:20:11 +00:00
|
|
|
wxString cname = ColorRefs[current_color].m_Name;
|
2010-02-10 17:27:45 +00:00
|
|
|
if (!fill) {
|
|
|
|
fprintf( output_file, "0\nCIRCLE\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%g\n",
|
2011-02-28 18:36:19 +00:00
|
|
|
TO_UTF8( cname ),
|
2010-02-10 17:27:45 +00:00
|
|
|
centre.x, centre.y, radius );
|
|
|
|
}
|
|
|
|
if (fill == FILLED_SHAPE) {
|
|
|
|
int r = (int)(radius*0.5);
|
|
|
|
fprintf( output_file, "0\nPOLYLINE\n");
|
2011-02-28 18:36:19 +00:00
|
|
|
fprintf( output_file, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
|
2010-02-10 17:27:45 +00:00
|
|
|
fprintf( output_file, "40\n%g\n41\n%g\n", radius,radius);
|
2011-02-28 18:36:19 +00:00
|
|
|
fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
2010-02-10 17:27:45 +00:00
|
|
|
fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x-r,centre.y);
|
2011-02-28 18:36:19 +00:00
|
|
|
fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
2010-02-10 17:27:45 +00:00
|
|
|
fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x+r,centre.y);
|
|
|
|
fprintf( output_file, "0\nSEQEND\n");
|
2010-11-12 16:36:43 +00:00
|
|
|
}
|
2010-02-10 17:27:45 +00:00
|
|
|
}
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-20 08:13:21 +00:00
|
|
|
/* Draw a polygon (closed if filled) in DXF format
|
2009-11-23 15:16:50 +00:00
|
|
|
* nb = number of coord (coord 1 = 2 elements: X and Y table)
|
2011-04-20 08:13:21 +00:00
|
|
|
* aFill: if != 0 filled polygon
|
2009-06-30 10:43:20 +00:00
|
|
|
*/
|
2011-04-20 08:13:21 +00:00
|
|
|
void DXF_PLOTTER::PlotPoly( std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth)
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
2011-04-20 08:13:21 +00:00
|
|
|
if( aCornerList.size() <= 1 )
|
2009-06-30 10:43:20 +00:00
|
|
|
return;
|
|
|
|
|
2011-04-20 08:13:21 +00:00
|
|
|
move_to( aCornerList[0] );
|
|
|
|
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
|
|
|
line_to( aCornerList[ii] );
|
2009-06-30 10:43:20 +00:00
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* Close polygon. */
|
2011-04-20 08:13:21 +00:00
|
|
|
if( aFill )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
2011-04-20 08:13:21 +00:00
|
|
|
unsigned ii = aCornerList.size() - 1;
|
|
|
|
if( aCornerList[ii] != aCornerList[0] )
|
|
|
|
line_to( aCornerList[0] );
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
pen_finish();
|
|
|
|
}
|
|
|
|
|
2011-08-31 14:59:20 +00:00
|
|
|
/*
|
|
|
|
* Function PlotImage
|
|
|
|
* Only Postscript plotters can plot bitmaps
|
|
|
|
* for plotters that cannot plot a bitmap, a rectangle is plotted
|
|
|
|
* For DXF_PLOTTER, currently: draws a rectangle
|
|
|
|
* param aImage = the bitmap
|
|
|
|
* param aPos = position of the center of the bitmap
|
|
|
|
* param aScaleFactor = the scale factor to apply to the bitmap size
|
|
|
|
* (this is not the plot scale factor)
|
|
|
|
*/
|
|
|
|
void DXF_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor )
|
|
|
|
{
|
|
|
|
wxSize size;
|
|
|
|
size.x = aImage.GetWidth();
|
|
|
|
size.y = aImage.GetHeight();
|
|
|
|
|
|
|
|
size.x = wxRound( size.x * aScaleFactor );
|
|
|
|
size.y = wxRound( size.y * aScaleFactor );
|
|
|
|
|
|
|
|
wxPoint start = aPos;
|
|
|
|
start.x -= size.x / 2;
|
|
|
|
start.y -= size.y / 2;
|
|
|
|
|
|
|
|
wxPoint end = start;
|
|
|
|
end.x += size.x;
|
|
|
|
end.y += size.y;
|
|
|
|
|
|
|
|
rect( start, end, NO_FILL );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-30 10:43:20 +00:00
|
|
|
|
|
|
|
/*
|
2009-11-23 15:16:50 +00:00
|
|
|
* Move the pen up (pen = 'U') or down (feather = 'D') at position x, y
|
|
|
|
* Unit to unit DRAWING
|
|
|
|
* If pen = 'Z' without lifting pen displacement
|
2009-06-30 10:43:20 +00:00
|
|
|
*/
|
2009-11-23 15:16:50 +00:00
|
|
|
void DXF_PLOTTER::pen_to( wxPoint pos, char plume )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
if( plume == 'Z' )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
user_to_device_coordinates( pos );
|
|
|
|
|
|
|
|
if( pen_lastpos != pos && plume == 'D' )
|
|
|
|
{
|
|
|
|
/* DXF LINE */
|
2009-07-01 05:20:11 +00:00
|
|
|
wxString cname = ColorRefs[current_color].m_Name;
|
2009-06-30 10:43:20 +00:00
|
|
|
fprintf( output_file, "0\nLINE\n8\n%s\n10\n%d.0\n20\n%d.0\n11\n%d.0\n21\n%d.0\n",
|
2011-02-28 18:36:19 +00:00
|
|
|
TO_UTF8( cname ),
|
2009-06-30 10:43:20 +00:00
|
|
|
pen_lastpos.x, pen_lastpos.y, pos.x, pos.y );
|
|
|
|
}
|
|
|
|
pen_lastpos = pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-29 10:20:48 +00:00
|
|
|
void DXF_PLOTTER::set_dash( bool dashed )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
/* NOP for now */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
2010-12-28 11:24:42 +00:00
|
|
|
* Function thick_segment
|
|
|
|
* Plot a filled segment (track)
|
|
|
|
* @param aStart = starting point
|
|
|
|
* @param aEnd = ending point
|
2009-06-30 10:43:20 +00:00
|
|
|
* @param aWidth = segment width (thickness)
|
|
|
|
* @param aPlotMode = FILLED, SKETCH ..
|
|
|
|
*/
|
2010-12-28 11:24:42 +00:00
|
|
|
void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth,
|
2012-01-03 17:14:17 +00:00
|
|
|
EDA_DRAW_MODE_T aPlotMode )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
2012-01-03 17:14:17 +00:00
|
|
|
if( aPlotMode == LINE ) /* just a line is Ok */
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
2010-12-28 11:24:42 +00:00
|
|
|
move_to( aStart );
|
|
|
|
finish_to( aEnd );
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
else
|
2012-01-03 17:14:17 +00:00
|
|
|
{
|
2010-12-28 11:24:42 +00:00
|
|
|
segment_as_oval( aStart, aEnd, aWidth, aPlotMode );
|
2012-01-03 17:14:17 +00:00
|
|
|
}
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* Plot an arc in DXF format.
|
|
|
|
* center = center coord
|
|
|
|
* StAngle, EndAngle = angle of beginning and end
|
|
|
|
* Radius = radius of the arc
|
2009-06-30 10:43:20 +00:00
|
|
|
*/
|
2009-11-23 15:16:50 +00:00
|
|
|
void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
|
|
|
|
FILL_T fill, int width )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
if( radius <= 0 )
|
2009-06-30 10:43:20 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
user_to_device_coordinates( centre );
|
2009-12-02 21:44:03 +00:00
|
|
|
radius = wxRound( user_to_device_size( radius ) );
|
2009-06-30 10:43:20 +00:00
|
|
|
|
|
|
|
/* DXF ARC */
|
2009-07-01 05:20:11 +00:00
|
|
|
wxString cname = ColorRefs[current_color].m_Name;
|
2009-11-23 15:16:50 +00:00
|
|
|
fprintf( output_file,
|
|
|
|
"0\nARC\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%d.0\n50\n%d.0\n51\n%d.0\n",
|
2011-02-28 18:36:19 +00:00
|
|
|
TO_UTF8( cname ),
|
2009-11-23 15:16:50 +00:00
|
|
|
centre.x, centre.y, radius,
|
2012-02-01 09:36:43 +00:00
|
|
|
EndAngle / 10, StAngle / 10 );
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* Plot oval pad at position. */
|
2009-08-29 10:20:48 +00:00
|
|
|
void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
2012-01-03 17:14:17 +00:00
|
|
|
EDA_DRAW_MODE_T trace_mode )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* The chip is reduced to an oval tablet with size.y > size.x
|
|
|
|
* (Oval vertical orientation 0) */
|
2009-06-30 10:43:20 +00:00
|
|
|
if( size.x > size.y )
|
|
|
|
{
|
2009-11-23 15:16:50 +00:00
|
|
|
EXCHG( size.x, size.y );
|
|
|
|
orient += 900;
|
2009-06-30 10:43:20 +00:00
|
|
|
if( orient >= 3600 )
|
|
|
|
orient -= 3600;
|
|
|
|
}
|
|
|
|
sketch_oval( pos, size, orient, -1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* Plot round pad or via. */
|
2009-08-29 10:20:48 +00:00
|
|
|
void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
|
2012-01-03 17:14:17 +00:00
|
|
|
EDA_DRAW_MODE_T trace_mode )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
circle( pos, diametre, NO_FILL );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2009-11-23 15:16:50 +00:00
|
|
|
* Plot rectangular pad vertical or horizontal (rectangular Pad)
|
2009-06-30 10:43:20 +00:00
|
|
|
*/
|
2009-11-23 15:16:50 +00:00
|
|
|
void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
2012-01-03 17:14:17 +00:00
|
|
|
int orient, EDA_DRAW_MODE_T trace_mode )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
|
|
|
wxSize size;
|
|
|
|
int ox, oy, fx, fy;
|
|
|
|
|
|
|
|
size.x = padsize.x / 2; size.y = padsize.y / 2;
|
|
|
|
|
|
|
|
if( size.x < 0 )
|
|
|
|
size.x = 0;
|
|
|
|
if( size.y < 0 )
|
|
|
|
size.y = 0;
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
/* If a dimension is zero, the trace is reduced to 1 line. */
|
2009-06-30 10:43:20 +00:00
|
|
|
if( size.x == 0 )
|
|
|
|
{
|
2009-11-23 15:16:50 +00:00
|
|
|
ox = pos.x;
|
|
|
|
oy = pos.y - size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
2009-11-23 15:16:50 +00:00
|
|
|
fx = pos.x;
|
|
|
|
fy = pos.y + size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
|
|
|
move_to( wxPoint( ox, oy ) );
|
|
|
|
finish_to( wxPoint( fx, fy ) );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if( size.y == 0 )
|
|
|
|
{
|
2009-11-23 15:16:50 +00:00
|
|
|
ox = pos.x - size.x;
|
|
|
|
oy = pos.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
2009-11-23 15:16:50 +00:00
|
|
|
fx = pos.x + size.x;
|
|
|
|
fy = pos.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
|
|
|
move_to( wxPoint( ox, oy ) );
|
|
|
|
finish_to( wxPoint( fx, fy ) );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
ox = pos.x - size.x;
|
|
|
|
oy = pos.y - size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
|
|
|
move_to( wxPoint( ox, oy ) );
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
fx = pos.x - size.x;
|
|
|
|
fy = pos.y + size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
|
|
|
line_to( wxPoint( fx, fy ) );
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
fx = pos.x + size.x;
|
|
|
|
fy = pos.y + size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
|
|
|
line_to( wxPoint( fx, fy ) );
|
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
fx = pos.x + size.x;
|
|
|
|
fy = pos.y - size.y;
|
2009-06-30 10:43:20 +00:00
|
|
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
|
|
|
line_to( wxPoint( fx, fy ) );
|
|
|
|
|
|
|
|
finish_to( wxPoint( ox, oy ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2009-11-23 15:16:50 +00:00
|
|
|
* Plot trapezoidal pad.
|
2010-09-13 11:51:09 +00:00
|
|
|
* aPadPos is pad position, aCorners the corners position of the basic shape
|
|
|
|
* Orientation aPadOrient in 0.1 degrees
|
|
|
|
* Plot mode = FILLED, SKETCH (unused)
|
2009-06-30 10:43:20 +00:00
|
|
|
*/
|
2010-09-13 11:51:09 +00:00
|
|
|
void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
2012-01-03 17:14:17 +00:00
|
|
|
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
2009-06-30 10:43:20 +00:00
|
|
|
{
|
|
|
|
wxASSERT( output_file );
|
2009-11-23 15:16:50 +00:00
|
|
|
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
|
2009-06-30 10:43:20 +00:00
|
|
|
|
|
|
|
for( int ii = 0; ii < 4; ii++ )
|
|
|
|
{
|
2010-09-13 11:51:09 +00:00
|
|
|
coord[ii] = aCorners[ii];
|
|
|
|
RotatePoint( &coord[ii], aPadOrient );
|
|
|
|
coord[ii] += aPadPos;
|
2009-06-30 10:43:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Plot edge:
|
|
|
|
move_to( coord[0] );
|
|
|
|
line_to( coord[1] );
|
|
|
|
line_to( coord[2] );
|
|
|
|
line_to( coord[3] );
|
|
|
|
finish_to( coord[0] );
|
|
|
|
}
|