pcb 4.1.1
An interactive printed circuit board layout editor.

polygon.c File Reference

Special polygon editing routines. More...

#include <assert.h>
#include <math.h>
#include <memory.h>
#include <setjmp.h>
#include "global.h"
#include "box.h"
#include "create.h"
#include "crosshair.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "find.h"
#include "misc.h"
#include "move.h"
#include "pcb-printf.h"
#include "polygon.h"
#include "remove.h"
#include "rtree.h"
#include "search.h"
#include "set.h"
#include "thermal.h"
#include "undo.h"
Include dependency graph for polygon.c:

Go to the source code of this file.

Data Structures

struct  cpInfo
struct  plow_info

Defines

#define ROUND(x)   ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5)))
#define UNSUBTRACT_BLOAT   10
#define SUBTRACT_PIN_VIA_BATCH_SIZE   100
#define SUBTRACT_LINE_BATCH_SIZE   20
#define ARC_ANGLE   5
#define MIN_CLEARANCE_BEFORE_BISECT   10.

Functions

void polygon_init (void)
Cardinal polygon_point_idx (PolygonType *polygon, PointType *point)
Cardinal polygon_point_contour (PolygonType *polygon, Cardinal point)
 Find contour number.
Cardinal next_contour_point (PolygonType *polygon, Cardinal point)
Cardinal prev_contour_point (PolygonType *polygon, Cardinal point)
static void add_noholes_polyarea (PLINE *pline, void *user_data)
void ComputeNoHoles (PolygonType *poly)
static POLYAREAbiggest (POLYAREA *p)
POLYAREAContourToPoly (PLINE *contour)
static POLYAREAoriginal_poly (PolygonType *p)
POLYAREAPolygonToPoly (PolygonType *p)
POLYAREARectPoly (Coord x1, Coord x2, Coord y1, Coord y2)
POLYAREAOctagonPoly (Coord x, Coord y, Coord radius)
void frac_circle (PLINE *c, Coord X, Coord Y, Vector v, int fraction)
 Add vertices in a fractional-circle starting from v centered at X, Y and going counter-clockwise.
POLYAREACirclePoly (Coord x, Coord y, Coord radius)
 Create a circle approximation from lines.
POLYAREARoundRect (Coord x1, Coord x2, Coord y1, Coord y2, Coord t)
 Make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle.
static POLYAREAArcPolyNoIntersect (ArcType *a, Coord thick)
POLYAREAArcPoly (ArcType *a, Coord thick)
POLYAREALinePoly (LineType *L, Coord thick)
POLYAREASquarePadPoly (PadType *pad, Coord clear)
 Make a rounded-corner rectangle.
static int Subtract (POLYAREA *np1, PolygonType *p, bool fnp)
 Clear np1 from the polygon.
POLYAREAPinPoly (PinType *pin, Coord thick, Coord clear)
 Create a polygon of the pin clearance.
POLYAREABoxPolyBloated (BoxType *box, Coord bloat)
static int SubtractPin (DataType *d, PinType *pin, LayerType *l, PolygonType *p)
 Remove the pin clearance from the polygon.
static int SubtractLine (LineType *line, PolygonType *p)
static int SubtractArc (ArcType *arc, PolygonType *p)
static int SubtractText (TextType *text, PolygonType *p)
static int SubtractPad (PadType *pad, PolygonType *p)
static void subtract_accumulated (struct cpInfo *info, PolygonType *polygon)
static int pin_sub_callback (const BoxType *b, void *cl)
static int arc_sub_callback (const BoxType *b, void *cl)
static int pad_sub_callback (const BoxType *b, void *cl)
static int line_sub_callback (const BoxType *b, void *cl)
static int text_sub_callback (const BoxType *b, void *cl)
static int Group (DataType *Data, Cardinal layer)
static int clearPoly (DataType *Data, LayerType *Layer, PolygonType *polygon, const BoxType *here, Coord expand)
static int Unsubtract (POLYAREA *np1, PolygonType *p)
static int UnsubtractPin (PinType *pin, LayerType *l, PolygonType *p)
static int UnsubtractArc (ArcType *arc, LayerType *l, PolygonType *p)
static int UnsubtractLine (LineType *line, LayerType *l, PolygonType *p)
static int UnsubtractText (TextType *text, LayerType *l, PolygonType *p)
static int UnsubtractPad (PadType *pad, LayerType *l, PolygonType *p)
int InitClip (DataType *Data, LayerType *layer, PolygonType *p)
bool RemoveExcessPolygonPoints (LayerType *Layer, PolygonType *Polygon)
 Remove redundant polygon points.
Cardinal GetLowestDistancePolygonPoint (PolygonType *Polygon, Coord X, Coord Y)
 
void GoToPreviousPoint (void)
 Go back to the previous point of the polygon.
void ClosePolygon (void)
 Close polygon if possible.
void CopyAttachedPolygonToLayer (void)
 Moves the data of the attached (new) polygon to the current layer.
int PolygonHoles (PolygonType *polygon, const BoxType *range, int(*callback)(PLINE *contour, void *user_data), void *user_data)
 Find polygon holes in range, then call the callback function for each hole.
static int subtract_plow (DataType *Data, LayerType *Layer, PolygonType *Polygon, int type, void *ptr1, void *ptr2, void *userdata)
static int add_plow (DataType *Data, LayerType *Layer, PolygonType *Polygon, int type, void *ptr1, void *ptr2, void *userdata)
static int plow_callback (const BoxType *b, void *cl)
int PlowsPolygon (DataType *Data, int type, void *ptr1, void *ptr2, int(*call_back)(DataType *data, LayerType *lay, PolygonType *poly, int type, void *ptr1, void *ptr2, void *userdata), void *userdata)
void RestoreToPolygon (DataType *Data, int type, void *ptr1, void *ptr2)
void ClearFromPolygon (DataType *Data, int type, void *ptr1, void *ptr2)
bool isects (POLYAREA *a, PolygonType *p, bool fr)
bool IsPointInPolygon (Coord X, Coord Y, Coord r, PolygonType *p)
bool IsPointInPolygonIgnoreHoles (Coord X, Coord Y, PolygonType *p)
bool IsRectangleInPolygon (Coord X1, Coord Y1, Coord X2, Coord Y2, PolygonType *p)
static void r_NoHolesPolygonDicer (POLYAREA *pa, void(*emit)(PLINE *, void *), void *user_data)
 
void NoHolesPolygonDicer (PolygonType *p, const BoxType *clip, void(*emit)(PLINE *, void *), void *user_data)
bool MorphPolygon (LayerType *layer, PolygonType *poly)
 Make a polygon split into multiple parts into multiple polygons.
void debug_pline (PLINE *pl)
void debug_polyarea (POLYAREA *p)
void debug_polygon (PolygonType *p)
void PolyToPolygonsOnLayer (DataType *Destination, LayerType *Layer, POLYAREA *Input, FlagType Flags)
 Convert a POLYAREA (and all linked POLYAREA) to raw PCB polygons on the given layer.

Variables

static double rotate_circle_seg [4]
static bool inhibit = false

Detailed Description

Special polygon editing routines.

Here's a brief tour of the data and life of a polygon, courtesy of Ben Jackson:

A PCB PolygonType contains an array of points outlining the polygon. This is what is manipulated by the UI and stored in the saved PCB.

A PolygonType also contains a POLYAREA called 'Clipped' which is computed dynamically by InitClip every time a board is loaded. The point array is coverted to a POLYAREA by original_poly and then holes are cut in it by clearPoly. After that it is maintained dynamically as parts are added, moved or removed (this is why sometimes bugs can be fixed by just re-loading the board).

A POLYAREA consists of a linked list of PLINE structures. The head of that list is POLYAREA.contours. The first contour is an outline of a filled region. All of the subsequent PLINEs are holes cut out of that first contour. POLYAREAs are in a doubly-linked list and each member of the list is an independent (non-overlapping) area with its own outline and holes. The function biggest() finds the largest POLYAREA so that PolygonType.Clipped points to that shape. The rest of the polygon still exists, it's just ignored when turning the polygon into copper.

The first POLYAREA in PolygonType.Clipped is what is used for the vast majority of Polygon related tests. The basic logic for an intersection is "is the target shape inside POLYAREA.contours and NOT fully enclosed in any of POLYAREA.contours.next... (the holes)".

The polygon dicer (NoHolesPolygonDicer and r_NoHolesPolygonDicer) emits a series of "simple" PLINE shapes. That is, the PLINE isn't linked to any other "holes" oulines. That's the meaning of the first test in r_NoHolesPolygonDicer. It is testing to see if the PLINE contour (the first, making it a solid outline) has a valid next pointer (which would point to one or more holes). The dicer works by recursively chopping the polygon in half through the first hole it sees (which is guaranteed to eliminate at least that one hole). The dicer output is used for HIDs which cannot render things with holes (which would require erasure).


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996,2010 Thomas Nau

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email:

Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany

Thomas.Nau@rz.uni-ulm.de

Definition in file polygon.c.


Define Documentation

#define ARC_ANGLE   5

Definition at line 489 of file polygon.c.

Referenced by ArcPolyNoIntersect().

#define MIN_CLEARANCE_BEFORE_BISECT   10.

Definition at line 563 of file polygon.c.

Referenced by ArcPoly().

#define ROUND (   x)    ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5)))

Definition at line 111 of file polygon.c.

#define SUBTRACT_LINE_BATCH_SIZE   20

Definition at line 115 of file polygon.c.

Referenced by line_sub_callback().

#define SUBTRACT_PIN_VIA_BATCH_SIZE   100

Definition at line 114 of file polygon.c.

Referenced by pin_sub_callback().

#define UNSUBTRACT_BLOAT   10

Function Documentation

static void add_noholes_polyarea ( PLINE pline,
void *  user_data 
) [static]

Definition at line 203 of file polygon.c.

References PLINE::next, polygon_st::NoHoles, and poly.

Referenced by ComputeNoHoles().

static int add_plow ( DataType Data,
LayerType Layer,
PolygonType Polygon,
int  type,
void *  ptr1,
void *  ptr2,
void *  userdata 
) [static]

Definition at line 1543 of file polygon.c.

References GetLayerNumber(), UnsubtractArc(), UnsubtractLine(), UnsubtractPad(), UnsubtractPin(), UnsubtractText(), VIA_IS_BURIED, and VIA_ON_LAYER.

Referenced by RestoreToPolygon().

Here is the call graph for this function:

static int arc_sub_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 961 of file polygon.c.

References cpInfo::env, cpInfo::other, cpInfo::polygon, SubtractArc(), and TEST_FLAG.

Referenced by clearPoly().

Here is the call graph for this function:

POLYAREA* ArcPoly ( ArcType a,
Coord  thick 
)

Definition at line 565 of file polygon.c.

References ArcPolyNoIntersect(), ArcType::Delta, M_PI, MIN_CLEARANCE_BEFORE_BISECT, PBO_UNITE, poly_Boolean_free(), ArcType::StartAngle, and ArcType::Width.

Referenced by IsArcInPolygon(), SubtractArc(), and ThermPoly().

Here is the call graph for this function:

static POLYAREA* biggest ( POLYAREA p) [static]

Definition at line 224 of file polygon.c.

References PLINE::area, POLYAREA::b, POLYAREA::contour_tree, POLYAREA::contours, POLYAREA::f, PCBType::IsleArea, n, PCB, and poly_DelContour().

Referenced by original_poly(), Subtract(), and Unsubtract().

Here is the call graph for this function:

POLYAREA* BoxPolyBloated ( BoxType box,
Coord  bloat 
)

Definition at line 799 of file polygon.c.

References RectPoly(), BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by UnsubtractArc(), UnsubtractLine(), UnsubtractPad(), UnsubtractPin(), and UnsubtractText().

Here is the call graph for this function:

POLYAREA* CirclePoly ( Coord  x,
Coord  y,
Coord  radius 
)

Create a circle approximation from lines.

Definition at line 438 of file polygon.c.

References ContourToPoly(), PLINE::cx, PLINE::cy, frac_circle(), PLINE::is_round, poly_NewContour(), PLINE::radius, TRUE, x, and y.

Referenced by IsPointInPolygon(), LinePoly(), PinPoly(), and ThermPoly().

Here is the call graph for this function:

void ClosePolygon ( void  )

Close polygon if possible.

Definition at line 1386 of file polygon.c.

References _, abs, CrosshairType::AttachedPolygon, CopyAttachedPolygonToLayer(), Crosshair, Draw(), Message(), n, PCB, polygon_st::PointN, polygon_st::Points, TEST_FLAG, PointType::X, and PointType::Y.

Referenced by ActionPolygon().

Here is the call graph for this function:

void ComputeNoHoles ( PolygonType poly)

Definition at line 213 of file polygon.c.

References add_noholes_polyarea(), polygon_st::Clipped, polygon_st::NoHoles, NoHolesPolygonDicer(), polygon_st::NoHolesValid, and poly_FreeContours().

Referenced by common_fill_pcb_polygon().

Here is the call graph for this function:

POLYAREA* ContourToPoly ( PLINE contour)
void CopyAttachedPolygonToLayer ( void  )
void debug_pline ( PLINE pl)

Definition at line 1918 of file polygon.c.

References PLINE::head, VNODE::next, pcb_fprintf(), VNODE::point, PLINE::xmax, PLINE::xmin, PLINE::ymax, and PLINE::ymin.

Referenced by debug_polyarea().

Here is the call graph for this function:

void debug_polyarea ( POLYAREA p)

Definition at line 1934 of file polygon.c.

References POLYAREA::contours, debug_pline(), and PLINE::next.

Referenced by debug_polygon().

Here is the call graph for this function:

void debug_polygon ( PolygonType p)
void frac_circle ( PLINE c,
Coord  X,
Coord  Y,
Vector  v,
int  fraction 
)

Add vertices in a fractional-circle starting from v centered at X, Y and going counter-clockwise.

Does not include the first point. last argument is 1 for a full circle. 2 for a half circle. or 4 for a quarter circle.

Definition at line 410 of file polygon.c.

References PLINE::head, POLY_CIRC_RADIUS_ADJ, POLY_CIRC_SEGS, poly_CreateNode(), poly_InclVertex(), VNODE::prev, rotate_circle_seg, ROUND, X, and Y.

Referenced by ArcPolyNoIntersect(), CirclePoly(), LinePoly(), RoundRect(), square_therm(), and SquarePadPoly().

Here is the call graph for this function:

Cardinal GetLowestDistancePolygonPoint ( PolygonType Polygon,
Coord  X,
Coord  Y 
)

Returns:
The index of the polygon point which is the end point of the segment with the lowest distance to the passed coordinates.

Definition at line 1300 of file polygon.c.

References n, polygon_st::PointN, polygon_st::Points, prev_contour_point(), ptr1, ptr2, SQUARE, u(), PointType::X, and PointType::Y.

Referenced by NotifyMode().

Here is the call graph for this function:

void GoToPreviousPoint ( void  )
static int Group ( DataType Data,
Cardinal  layer 
) [static]

Definition at line 1048 of file polygon.c.

References max_group, and DataType::pcb.

Referenced by clearPoly().

bool isects ( POLYAREA a,
PolygonType p,
bool  fr 
)

Definition at line 1708 of file polygon.c.

References polygon_st::Clipped, poly_Free(), Touching(), and x.

Referenced by IsArcInPolygon(), IsLineInPolygon(), IsPointInPolygon(), IsPolygonInPolygon(), IsRectangleInPolygon(), LOCtoPVpoly_callback(), and pv_poly_callback().

Here is the call graph for this function:

bool IsPointInPolygon ( Coord  X,
Coord  Y,
Coord  r,
PolygonType p 
)

Definition at line 1722 of file polygon.c.

References c, CirclePoly(), polygon_st::Clipped, isects(), poly_CheckInside(), X, and Y.

Referenced by CheckPolygonForRubberbandConnection(), LOCtoPVpoly_callback(), mptl_pin_callback(), polygon_callback(), and pv_poly_callback().

Here is the call graph for this function:

bool IsPointInPolygonIgnoreHoles ( Coord  X,
Coord  Y,
PolygonType p 
)

Definition at line 1739 of file polygon.c.

References polygon_st::Clipped, POLYAREA::contours, poly_InsideContour(), X, and Y.

Referenced by DrawShortestRats().

Here is the call graph for this function:

bool IsRectangleInPolygon ( Coord  X1,
Coord  Y1,
Coord  X2,
Coord  Y2,
PolygonType p 
)

Definition at line 1748 of file polygon.c.

References isects(), max, min, RectPoly(), and s.

Referenced by IsLineInPolygon(), LOCtoPVpoly_callback(), and pv_poly_callback().

Here is the call graph for this function:

static int line_sub_callback ( const BoxType b,
void *  cl 
) [static]
POLYAREA* LinePoly ( LineType L,
Coord  thick 
)
Cardinal next_contour_point ( PolygonType polygon,
Cardinal  point 
)

Definition at line 157 of file polygon.c.

References polygon_st::HoleIndex, polygon_st::HoleIndexN, polygon_st::PointN, and polygon_point_contour().

Referenced by RemoveExcessPolygonPoints(), XORDrawMoveOrCopyObject(), and XORPolygon().

Here is the call graph for this function:

void NoHolesPolygonDicer ( PolygonType p,
const BoxType clip,
void(*)(PLINE *, void *)  emit,
void *  user_data 
)
POLYAREA* OctagonPoly ( Coord  x,
Coord  y,
Coord  radius 
)

Definition at line 370 of file polygon.c.

References ContourToPoly(), PLINE::head, poly_CreateNode(), poly_InclVertex(), poly_NewContour(), VNODE::prev, ROUND, TAN_22_5_DEGREE_2, x, and y.

Referenced by LOCtoPVpoly_callback(), oct_therm(), PinPoly(), and pv_poly_callback().

Here is the call graph for this function:

static int pad_sub_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 979 of file polygon.c.

References cpInfo::bottom, cpInfo::env, cpInfo::other, cpInfo::polygon, SubtractPad(), TEST_FLAG, and XOR.

Referenced by clearPoly().

Here is the call graph for this function:

static int pin_sub_callback ( const BoxType b,
void *  cl 
) [static]
POLYAREA* PinPoly ( PinType pin,
Coord  thick,
Coord  clear 
)

Create a polygon of the pin clearance.

Definition at line 777 of file polygon.c.

References CirclePoly(), OctagonPoly(), RoundRect(), TEST_FLAG, pin_st::X, and pin_st::Y.

Referenced by pin_sub_callback(), and SubtractPin().

Here is the call graph for this function:

static int plow_callback ( const BoxType b,
void *  cl 
) [static]
int PlowsPolygon ( DataType Data,
int  type,
void *  ptr1,
void *  ptr2,
int(*)(DataType *data, LayerType *lay, PolygonType *poly, int type, void *ptr1, void *ptr2, void *userdata)  call_back,
void *  userdata 
)
void polygon_init ( void  )

Definition at line 120 of file polygon.c.

References M_PI, POLY_CIRC_SEGS_F, and rotate_circle_seg.

Referenced by main().

Cardinal polygon_point_contour ( PolygonType polygon,
Cardinal  point 
)

Find contour number.

0 for outer,

1 for first hole etc..

Definition at line 145 of file polygon.c.

References polygon_st::HoleIndex, and polygon_st::HoleIndexN.

Referenced by DestroyPolygonPoint(), next_contour_point(), prev_contour_point(), and RemovePolygonPoint().

Cardinal polygon_point_idx ( PolygonType polygon,
PointType point 
)
int PolygonHoles ( PolygonType polygon,
const BoxType range,
int(*)(PLINE *contour, void *user_data)  callback,
void *  user_data 
)

Find polygon holes in range, then call the callback function for each hole.

If the callback returns non-zero, stop the search.

Definition at line 1462 of file polygon.c.

References callback(), polygon_st::Clipped, POLYAREA::contours, PLINE::next, BoxType::X1, BoxType::X2, PLINE::xmax, PLINE::xmin, BoxType::Y1, BoxType::Y2, PLINE::ymax, and PLINE::ymin.

Referenced by common_thindraw_pcb_polygon().

Here is the call graph for this function:

POLYAREA* PolygonToPoly ( PolygonType p)

Definition at line 338 of file polygon.c.

References original_poly().

Referenced by NotifyMode().

Here is the call graph for this function:

void PolyToPolygonsOnLayer ( DataType Destination,
LayerType Layer,
POLYAREA Input,
FlagType  Flags 
)
Cardinal prev_contour_point ( PolygonType polygon,
Cardinal  point 
)
static void r_NoHolesPolygonDicer ( POLYAREA pa,
void(*)(PLINE *, void *)  emit,
void *  user_data 
) [static]

Note:
This function will free the passed POLYAREA. It must only be passed a single POLYAREA (pa->f == pa->b == pa).

Definition at line 1764 of file polygon.c.

References POLYAREA::b, POLYAREA::contours, POLYAREA::f, PLINE::next, poly_AndSubtract_free(), poly_Free(), RectPoly(), PLINE::xmax, PLINE::xmin, PLINE::ymax, and PLINE::ymin.

Referenced by NoHolesPolygonDicer().

Here is the call graph for this function:

POLYAREA* RectPoly ( Coord  x1,
Coord  x2,
Coord  y1,
Coord  y2 
)
bool RemoveExcessPolygonPoints ( LayerType Layer,
PolygonType Polygon 
)

Remove redundant polygon points.

Any point that lies on the straight line between the points on either side of it is redundant.

Returns:
True if any points are removed.

Definition at line 1265 of file polygon.c.

References IsPointOnLine(), line, n, next_contour_point(), polygon_st::PointN, polygon_st::Points, prev_contour_point(), RemoveObject(), Undoing(), PointType::X, and PointType::Y.

Referenced by InsertPointIntoPolygon(), MovePolygonPoint(), and RemovePolygonPoint().

Here is the call graph for this function:

POLYAREA* RoundRect ( Coord  x1,
Coord  x2,
Coord  y1,
Coord  y2,
Coord  t 
)

Make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle.

Definition at line 462 of file polygon.c.

References ContourToPoly(), frac_circle(), PLINE::head, poly_CreateNode(), poly_InclVertex(), poly_NewContour(), and VNODE::prev.

Referenced by PinPoly(), and SubtractText().

Here is the call graph for this function:

POLYAREA* SquarePadPoly ( PadType pad,
Coord  clear 
)

Make a rounded-corner rectangle.

Definition at line 657 of file polygon.c.

References c, ContourToPoly(), cx, cy, frac_circle(), PLINE::head, poly_CreateNode(), poly_InclVertex(), poly_NewContour(), and VNODE::prev.

Referenced by SubtractPad().

Here is the call graph for this function:

static int Subtract ( POLYAREA np1,
PolygonType p,
bool  fnp 
) [static]

Clear np1 from the polygon.

Definition at line 733 of file polygon.c.

References biggest(), polygon_st::Clipped, err_ok, Message(), polygon_st::NoHoles, PBO_SUB, poly_Boolean(), poly_Boolean_free(), poly_Free(), poly_Valid(), and x.

Referenced by subtract_accumulated(), SubtractArc(), SubtractLine(), SubtractPad(), SubtractPin(), and SubtractText().

Here is the call graph for this function:

static void subtract_accumulated ( struct cpInfo info,
PolygonType polygon 
) [static]

Definition at line 905 of file polygon.c.

References cpInfo::accumulate, cpInfo::batch_size, and Subtract().

Referenced by clearPoly(), line_sub_callback(), and pin_sub_callback().

Here is the call graph for this function:

static int subtract_plow ( DataType Data,
LayerType Layer,
PolygonType Polygon,
int  type,
void *  ptr1,
void *  ptr2,
void *  userdata 
) [static]

Definition at line 1499 of file polygon.c.

References polygon_st::Clipped, GetLayerNumber(), polygon_st::NoHolesValid, SubtractArc(), SubtractLine(), SubtractPad(), SubtractPin(), SubtractText(), VIA_IS_BURIED, and VIA_ON_LAYER.

Referenced by ClearFromPolygon().

Here is the call graph for this function:

static int SubtractArc ( ArcType arc,
PolygonType p 
) [static]

Definition at line 845 of file polygon.c.

References ArcPoly(), ArcType::Clearance, Subtract(), TEST_FLAG, and ArcType::Thickness.

Referenced by arc_sub_callback(), and subtract_plow().

Here is the call graph for this function:

static int SubtractLine ( LineType line,
PolygonType p 
) [static]

Definition at line 833 of file polygon.c.

References LinePoly(), Subtract(), and TEST_FLAG.

Referenced by subtract_plow().

Here is the call graph for this function:

static int SubtractPad ( PadType pad,
PolygonType p 
) [static]

Definition at line 871 of file polygon.c.

References LinePoly(), SquarePadPoly(), Subtract(), and TEST_FLAG.

Referenced by pad_sub_callback(), and subtract_plow().

Here is the call graph for this function:

static int SubtractPin ( DataType d,
PinType pin,
LayerType l,
PolygonType p 
) [static]

Remove the pin clearance from the polygon.

Definition at line 809 of file polygon.c.

References pin_st::Clearance, GetLayerNumber(), DataType::pcb, PIN_SIZE, PinPoly(), Subtract(), TEST_THERM, ThermPoly(), and TRUE.

Referenced by subtract_plow().

Here is the call graph for this function:

static int SubtractText ( TextType text,
PolygonType p 
) [static]

Definition at line 857 of file polygon.c.

References PCBType::Bloat, PCB, RoundRect(), Subtract(), TEST_FLAG, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by subtract_plow(), and text_sub_callback().

Here is the call graph for this function:

static int text_sub_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 1030 of file polygon.c.

References cpInfo::env, cpInfo::other, cpInfo::polygon, SubtractText(), and TEST_FLAG.

Referenced by clearPoly().

Here is the call graph for this function:

static int Unsubtract ( POLYAREA np1,
PolygonType p 
) [static]
static int UnsubtractArc ( ArcType arc,
LayerType l,
PolygonType p 
) [static]

Definition at line 1163 of file polygon.c.

References BoxPolyBloated(), clearPoly(), PCBType::Data, PCB, TEST_FLAG, Unsubtract(), and UNSUBTRACT_BLOAT.

Referenced by add_plow().

Here is the call graph for this function:

static int UnsubtractLine ( LineType line,
LayerType l,
PolygonType p 
) [static]

Definition at line 1182 of file polygon.c.

References BoxPolyBloated(), clearPoly(), PCBType::Data, PCB, TEST_FLAG, Unsubtract(), and UNSUBTRACT_BLOAT.

Referenced by add_plow().

Here is the call graph for this function:

static int UnsubtractPad ( PadType pad,
LayerType l,
PolygonType p 
) [static]

Definition at line 1220 of file polygon.c.

References BoxPolyBloated(), clearPoly(), PCBType::Data, PCB, Unsubtract(), and UNSUBTRACT_BLOAT.

Referenced by add_plow().

Here is the call graph for this function:

static int UnsubtractPin ( PinType pin,
LayerType l,
PolygonType p 
) [static]

Definition at line 1147 of file polygon.c.

References BoxPolyBloated(), clearPoly(), PCBType::Data, PCB, Unsubtract(), and UNSUBTRACT_BLOAT.

Referenced by add_plow().

Here is the call graph for this function:

static int UnsubtractText ( TextType text,
LayerType l,
PolygonType p 
) [static]

Definition at line 1201 of file polygon.c.

References BoxPolyBloated(), clearPoly(), PCBType::Data, PCB, TEST_FLAG, Unsubtract(), and UNSUBTRACT_BLOAT.

Referenced by add_plow().

Here is the call graph for this function:


Variable Documentation

bool inhibit = false [static]

Definition at line 1235 of file polygon.c.

Referenced by InitClip(), and MorphPolygon().

double rotate_circle_seg[4] [static]

Definition at line 117 of file polygon.c.

Referenced by frac_circle(), and polygon_init().