Class Reference booleanHandler

A module to perform boolean operations. More...

Member

void aExorB()
void aExorBDel()
void aExorBDelA()
void aExorBDelB()
void aMinusB()
void aMinusBDel()
void aMinusBDelA()
void aMinusBDelB()
void aMultiB()
void aMultiBDel()
void aMultiBDelA()
void aMultiBDelB()
void aPlusB()
void aPlusBDel()
void aPlusBDelA()
void aPlusBDelB()
void addA(pointArray pointarray)
void addA(rect rectangle)
void addA(element * e)
void addB(pointArray pointarray)
void addB(rect rectangle)
void addB(element * e)
void addLayerA(int layer)
void addLayerB(int layer)
void bMinusA()
void bMinusADel()
void bMinusADelA()
void bMinusADelB()
void boolOnLayer(int layerA,int layerB,int layerResult,string operation,int nx=0,int ny=0, int borderMerge=0)
void clear()
pointArray getResultingPolygon()
void mergeSelect(int layer)
void performAEorB()
void performAMinusB()
void performAMultiB()
void performAPlusB()
void performBMinusA()
void setA()
void setB()
void setResultToA()
void setResultToB()

Detailed Description

graph LR la(layout)--booleanTool-->bo(booleanHandler) click la "/layoutscript/api/layout" click ne "/layoutscript/api/netlistmodule" click bo "/layoutscript/api/booleanhandler" click br "/layoutscript/api/barcodemodule" click ba "/layoutscript/api/backgroundmodule" click drc "/layoutscript/api/drc" click dr "/layoutscript/api/drawingfield" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class bo thisClas class cl,la,dr,el,ne,bo,br,ba,drc clas

Via this class it is possible to access the Boolean utility. All operation between two set of shapes can be performed. The result of the Boolean operation is added to the currentCell in the drawing to the active layer unless otherwise specified. The result is selected. After any Boolean operation the two sets of shapes will be reset. The source shapes may remain in the design or will be deleted depending on the called Boolean operation..

layout->drawing->currentCell->fSelect(rect1);
layout->booleanTool->setA();
layout->drawing->currentCell->fSelect(rect2);
layout->booleanTool->setB();
layout->drawing->activeLayer=1;
layout->booleanTool->aPlusB();

Member Function Documentation


void booleanHandler::aExorB()

The exor of A and B is added on the active Layer.


void booleanHandler::aExorBDel()

The exor of A and B is added on the active Layer. Shapes belonging to group A and group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aExorBDelA()

The exor of A and B is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aExorBDelB()

The exor of A and B is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMinusB()

The difference of A and B is added on the active Layer.


void booleanHandler::aMinusBDel()

The difference of A and B is added on the active Layer. Shapes belonging to group A and group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMinusBDelA()

The difference of A and B is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMinusBDelB()

The difference of A and B is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMultiB()

The intersection of A and B is added on the active Layer.


void booleanHandler::aMultiBDel()

The intersection of A and B is added on the active Layer. Shapes belonging to group A and group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMultiBDelA()

The intersection of A and B is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aMultiBDelB()

The intersection of A and B is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aPlusB()

The sum of A and B is added on the active Layer.


void booleanHandler::aPlusBDel()

The sum of A and B is added on the active Layer. Shapes belonging to group A and B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aPlusBDelA()

The sum of A and B is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell.


void booleanHandler::aPlusBDelB()

The sum of A and B is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::addA(pointArray pointarray)

adds the polygon to group A.


void booleanHandler::addA(rect rectangle)

adds the rectangle to group A. (introduced with releases 20190324)


void booleanHandler::addA(element * e)

adds the e to group A. e can be a path, polygon or rect. Any references and array references will be ignored. (introduced with releases 20190324)


void booleanHandler::addB(pointArray pointarray)

adds the polygon to group B.


void booleanHandler::addB(rect rectangle)

adds the rectangle to group B. (introduced with releases 20190324)


void booleanHandler::addB(element * e)

adds the e to group B. e can be a path, polygon or rect. Any references and array references will be ignored. (introduced with releases 20190324)


void booleanHandler::addLayerA(int layer)

adds all element including hierarchical element on layer in the current cell to group A. Added shapes will never be deleted after the boolean operation.


void booleanHandler::addLayerB(int layer)

adds all element including hierarchical element on layer in the current cell to group B. Added shapes will never be deleted after the boolean operation.


void booleanHandler::bMinusA()

The difference of group B and group A is added on the active Layer.


void booleanHandler::bMinusADel()

The difference of B and A is added on the active Layer. Shapes belonging to group A and group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::bMinusADelA()

The difference of B and A is added on the active Layer. Shapes belonging to group A are deleted, if it still exists unmodified in the current cell.


void booleanHandler::bMinusADelB()

The difference of B and A is added on the active Layer. Shapes belonging to group B are deleted, if it still exists unmodified in the current cell.


void booleanHandler::boolOnLayer(int layerA,int layerB,int layerResult,string operation,int nx=0,int ny=0, int borderMerge=0)

Performs a boolean operation between layerA and layerB. The result is added to layerResult. The boolean operation is set by operation Valid parameters are: "A+B", "A-B", "B-A", "A*B", "AeorB", AxorB", "A merge", A xor", "A invert". The boolean operation is splitten into frames. The number of frames is calculated automaticly, if nx and ny is set to 0. Otherwise nx times ny frames are used. This operation will reset a previous setA, setB, etc. to the boolean engine. Previous set shapes are ignored.

operation description
A+B a merge of shapes on both layers
A-B shapes on layer B are subtracted from layer A
B-A shapes on layer A are subtracted from layer B
A*B area that exists on both layers
AxorB area that exists on just one layer
A merge a merge of all shapes on layer A
A xor area that is within an uneven number of shapes, so a shape will be output at location with 3 shapes over it, but not for location with 2 shapes over it
A invert an inversion of layer A, the bounding box of the cell will be used as outer boundry
A Invert (hierarchical) an inversion of layer A, the bounding box of the cell will be used as outer boundry, refered cells will be modified in a way that a minimum area in the main cell needs to be created
A-B (multi-shape) similar to 'A-B' but it respect the number of shape at one location. So it will out a shape at a location with two shapes on layer A and 1 shape on layer B, but it will not output at a location with two shapes on layer A and two shapes on layer B (introduced with release 20220416)

borderMerge will define how the borders of the frames are handled:

value boder handling
0 only small shapes are merged at the border
1 shapes at frame border are not merged
2 all border shapes are merged

void booleanHandler::clear()

Remove any previous set shapes from the handler. This method is only required when incorrect shapes were set. Any previous Boolean operation will remove any shape from the handler as well. (introduced with release 20221031)


pointArray booleanHandler::getResultingPolygon()

Returns: one pointarray of the previous boolean operation, if it was made with performAEorB(), performAMinusB(), performAMultiB(), performAPlusB(), performBMinusA(). If the boolean operation result in more polygons, consequent call will return the next pointarray. A empty pointarray is return, if no more pointarray are available or a other boolean operation as mentioned before was made.


void booleanHandler::mergeSelect(int layer)

Selected elements will be merged and added to layer.


void booleanHandler::performAEorB()

The operation A exclusive or B is performed. Use the result with getResultingPolygon(), setResultToA() or setResultToB().


void booleanHandler::performAMinusB()

The operation A minus B is performed. Use the result with getResultingPolygon(), setResultToA() or setResultToB().


void booleanHandler::performAMultiB()

The intersection of A nad B is performed. Use the result with getResultingPolygon(), setResultToA() or setResultToB().


void booleanHandler::performAPlusB()

The operation A and B is performed. Use the result with getResultingPolygon(), setResultToA() or setResultToB().


void booleanHandler::performBMinusA()

The operation B minus A is performed. Use the result with getResultingPolygon(), setResultToA() or setResultToB().


void booleanHandler::setA()

Selected elements will be added to the group A. All elements will be deselected.


void booleanHandler::setB()

Selected elements will be added to the group B. All elements will be deselected.


void booleanHandler::setResultToA()

The result of the previous boolean operation, if it was made with performAEorB(), performAMinusB(), performAMultiB(), performAPlusB(), performBMinusA(), is set to group A for a following operation.


void booleanHandler::setResultToB()

The resultof the previous boolean operation, if it was made with performAEorB(), performAMinusB(), performAMultiB(), performAPlusB(), performBMinusA(), is set to group B for a following operation.