polygon class
The polygon class is derived from a shape. This class is normally created in a cellView using the dbCreatePoly() function. Note that dbCreatePoly() will create a square or a rectangle if the polygon has 4 points. A polygon is represented by a series of points, which represent the vertices of the polygon. There is an implicit edge between the first and last point.
Rect polygon::bBox()
Get the bounding box of this polygon.
polygon::bBox(Rect b)
Set the bounding box of this polygon. Not useful and will throw an exception if called.
db_Type polygon::objType()
Returns the object type of this polygon as POLYGON.
const char * = polygon::objName()
Returns the object name of this polygon as "POLYGON".
int32_t polygon::nPoints()
Returns the number of points of the polygon's boundary. Note that polygons are not closed as they are in GDS2.
Point * polygon::ptlist()
Returns the point list of this polygon as a C array of Points.
Point polygon::[index]
Returns the Point p at the index into the list of points.
polygon::bias(int32_t bias, float64_t grid)
Bias this polygon by bias, snapping to the grid grid.
p.scale(float64_t scale, float64_t grid)
Scale this polygon by scale, snapping to the grid grid.
int32_t polygon::getNearestEdge(Point p, segment &s)
Get the distance of the nearest segment s of this polygon to the point p;
int32_t polygon::getNearestVertex(Point p, vertex &s)
Get the distance of the nearest vertex s of this polygon to the point p;
bool polygon::ptInPoly(Point p)
Returns true if the point in inside or on the edge of the polygon.
float64_t polygon::area()
Get the area of this polygon.
int32_t polygon::perimeter()
Get the perimeter of this polygon.
polygon::transform(transform trans)
Transform this polygon using trans.
polygon::Move(cellView *cv, Point delta, bool opt = true)
Move this polygon by distance delta. If opt is true then the database is re-optimised for the new polygon position. If there are a lot of objects to move it makes sense to turn this off and instead use the cellView update() function after moving them all.
dbObj *obj = polygon::Copy(cellView *cv, Point delta, int layer = -1)
Copy this polygon to cellView cv, with offset delta. If layerNum is non-negative the polygon will be copied to the new layer number.
dbObj *obj = polygon::Flatten(cellView *cv, transform trans)
Flatten this polygon into cellView cv with transformation trans.
polygon::Stretch(Point delta, segment seg)
Stretch segment seg of this polygon by delta.
polygon::Stretch(Point delta, vertex v)
Stretch vertex v of this polygon by delta.
polygon::compressPoints()
Removes colinear points, sets the point order to be counterclockwise and sets the first point to be the smallest in X and Y.
bool polygon::selfIntersecting()
Returns true if the polygon is self-intersecting.