Bool.dll Library Logo

 

Execution Control Functions

These functions are used to control how the library will work in terms of processing polygons and creating the output. Any user of the library should understand the default behavior of the various settings and the available options and set them as needed prior to calling the actual boolean operation.





 

BoolClip_Union_MT

illustrates how output polygons cut by partition are unionized.

Syntax:

BoolClip_Union_MT (short mode, int bdll_handle);

Function:

If the input data was partitioned due to a large number of vertices, polygons which cross the partition boundaries will have been sliced for processing. This function tells the library to unionize polygons sliced by the partition upon output.

Inputs:

mode:
  ON - unionize polygons that cross a partition boundary
  OFF - do not unionize polygons that cross a partition line

bdll_handle: 
  thread handle
spacer6x6.gif



BoolSet_Maxpts_MT

polygons which exceed the max vertex count will be sliced.

Syntax:

void BoolSet_Maxpts_MT(int maxpts, int bdll_handle);

Function:

Used to define the maximum number of vertex points in any returned polygon. Any output polygon that has more than the max number of vertices will be "fractured" by slicing it.

Inputs:

maxpts: the maximum number of points for any non-Leonov polygon.

Notes

If not set, boolean will not fracture any output polygon.

Leonov output is not restricted with respect to vertex count.


Example

To set the maximum number of vertices per polygon to 4096 (for handle=1)

void BoolSet_Maxpts_MT(4096, 1);



BoolWindow_Init_MT

illustration of defining a window

Syntax:

void BoolWindow_Init_MT ( int Xmin, int Ymin, int Xmax, int Ymax, int bdll_handle );

Function:

defines a rectangular window that acts as a filter for all input polygons to Bool.dll functions; data completely outside the window is ignored. Data crossing the window is clipped to the window edge during boolean operations. Once this window is set, if you wish to remove the window filter for subsequent function calls, you must set Xmin,Ymin to -MAXINT and Xmax,Ymax to MAXINT. MAXINT = 2,147,483,647

Inputs:

Xmin - lowest X value of Window

Ymin - lowest Y value of Window

Xmax - highest X value of Window

Ymax - highest Y value of Window

bdll_handle - handle for this thread





BoolPartition_Init_MT

illustrates how nclipx and nclipy parameters are used to subdivide the area for boolean processing.

Syntax:

void BoolPartition_Init_MT ( int nclipx, int nclipy, int mode, int bdll_handle );

Function:

Used when processing large data sets to control how the bool library subdivides the problem to keep in the "linear" data space range. Except for special cases the automatic mode should be used.

Used in conjunction with SetPartioningThreshold_MT which determines, in automatic mode, the number of vertices per partition. In automatic mode, the stripes run horizontally.

Inputs:

nclipx - number of subdivisions along X

nclipy - number of subdivisions along y

partitioning mode

    Manifest constants are:

    BOOL_PART_MODE_NONE   0
    BOOL_PART_MODE_AUTO   1
    BOOL_PART_MODE_MANUAL 2
    

If partition mode is set to manual the parameters nclipx and nclipy are used. Otherwise they are ignored.

bdll_handle - handle for this thread

Default

BOOL_PART_MODE_NONE - no partitioning



BoolSetDoubleParm_MT

illustration for sizing, smoothing and sliver parameters.

Syntax:

void BoolSetDoubleParm_MT ( int type, double value, int bdll_handle );

Function:

Used to define certain parameters that affect the boolean: sizing, smoothing and sliver. Sizing is used to size up (or down) each polygon by a fixed amount. Smoothing is used to smooth out a polygon's boundary by removing closely spaced vertices (i.e. those more closely spaced than the smoothing parameter.) Sliver checks for tiny slivers (often generated due to computational noise or input data noise) and remove them entirely if their sliver parameter is less than the value specified.

Inputs:

int type

    SIZING_PARM
    SMOOTHING_PARM
    SLIVER_PARM
    CHORD_ERROR_PARM

double value - value for the parameter

bdll_handle - handle for this instance

Even though the parameters are doubles, this is just a convenience for the programmer; the values used by the library will be rounded to the nearest integer - i.e. a sliver of 1.56 will be converted to 2.


Example

You wish to size up all polygons by 0.5 um, smooth the output by 0.01 um and remove any slivers smaller than 0.005 um. The user units are in um and the resolution is set such that: 1 integer (bool.dll) = 0.001 um. Therefore the sizing = 500, the smoothing = 10 and the sliver = 5. The handle for this thread is assumed = 1

void BoolSetDoubleParm_MT ( SIZING_PARM, 500,  1 );
void BoolSetDoubleParm_MT ( SMOOTHING_PARM, 10, 1 );
void BoolSetDoubleParm_MT ( SLIVER_PARM, 5, 1 );

Related Functions

see functions: SizingMode_MT and RoundCorners_MT




BoolSetLogFileParm_MT

Syntax:

void BoolSetLogFileParm_MT ( int type, const char * value, int bdll_handle );

Function:

Used to re-define the name and location of the log file output from the default.

Inputs:

int type

    LOGFILENAME_PARM - changes the default log file name.
    REMLOGFILENAME_PARM - removes the log file when the instance is closed.

const char * value: string of path/name

bdll_handle: thread handle

Default Behavior

the default log file name is Results_N.txt where N is the handle of this instance. The default behavior is to not delete the log file when the instance is closed.





BoolSetNonIsotrSzParms_MT

Syntax:

void BoolSetNonIsotrSzParms_MT ( double szx, double szy, int bdll_handle );

Function:

Used to define sizing value when non isotropic sizing is requested. This allows independent sizing in X and Y.

Inputs:

szx - sizing in X direction (even though this is a double, the actual sizing value is rounded to the nearest integer.)

szy - sizing in Y direction (even though this is a double, the actual sizing value is rounded to the nearest integer.)

bdll_handle: thread handle


Related Functions

SizingMode_MT



SizingMode_MT

Syntax:

void SizingMode_MT ( int mode, int bdll_handle );

Function:

Used to turn on and set polygon sizing behaviour. See the sizing page for details.

Inputs:

mode

NO_SIZING        0  - no sizing
STD_SIZING       1  - standard mode;
ISOTR_SIZING     2  - see flavors
NONISOTR_SIZING  3  - see flavors

bdll_handle - thread handle


Related Functions

BoolSetDoubleParm_MT is used to set the actual sizing value and also the smoothing parameter and sliver removal parameter.

RoundCorners_MT sets the handling of corners for ISOTR_SIZING and NONISOTR_SIZING.

BoolSetNonIsotrSzParms_MT sets the sizing values when non-isotropic sizing is requested.

spacer6x6.gif


SetRtnEdgesFlag_MT

Syntax:

void SetRtnEdgesFlag_MT(int flag, int bdll_handle);

Function:

Activates a mode such that when polygons are modified (sliced) to accomodate the maximum vertex count restriction AND the output type for polygons has been set to "butting" then the slice edges will be returned in a call to RtnEdges_MT. A memory leak will occur if this mode is set and RtnEdges_MT is not called and followed with a call to BoolRelease_memory.

Inputs:

int flag - 0 off, 1 on

bdll_handle: thread handle


Related Functions

RtnEdges_MT




RoundCorners_MT

rounding corners ...

Syntax:

void RoundCorners_MT( int mode, int bdll_handle );

Function:

Controls the sizing behavior at corners of the polgyon when the sizing mode = Incremental. Typically this is only necessary when polygons exhibit "sharp" corners. If the input data is known to be Manhattan then one would normally select the RIGHT_ANGLE_CORNER mode. See the sizing page for details.

Inputs:

mode

    RIGHT_ANGLE_CORNER
    THREE_POINT_CORNER
    FIVE_POINT_CORNER

bdll_handle: thread handle

Related Functions

SizingMode_MT




SetPartioningThreshold_MT

the partition threshold defines the maximum number of vertices in any single partition.

Syntax:

void SetPartioningThreshold_MT( int N, int bdll_handle );

Function:

If data partioning is set to automatic, then this parameter determines the number of vertices per partition. If not explicitly set by the calling program, the default value = 100,000. This parameter need only be set when Bool_Partitition_Mode = AUTO

Inputs:

int N - value, which if exceeded will trigger partioning

bdll_handle: thread handle


Related Functions

BoolPartition_Init_MT

spacer6x6.gif


Set_L_Input_MT

illustration of leonov polygon

Syntax:

void
Set_L_Input_MT
(short operand_flag,short mode, int bdll_handle );

Function:

tells the boolean whether the input polygon arrays (A and B) are in standard or in Leonov format. A Leonov polygon consists of a single parent polygon followed by one or more children. The children are completely contained within the parent and represent cutout's of the parents interior.

Inputs:

operand_flag

   LEONOV_OPERAND_A         
   LEONOV_OPERAND_B         
   LEONOV_OPERAND_BOTH      

bdll_handle: thread handle

mode
   ON
   OFF


Notes

For Leonov polygons, to differentiate the parent polygon from its children, the vertex count of the parent is a negative integer and the vertex count for each child polygon is a positive integer.


Related Function



Set_L_Output_MT

Syntax:

void Set_L_Output_MT( short mode, int bdll_handle );

Function:

instructs the library how to output polygons. This affects polygons with "islands" or "holes." There are three options: Leonov, in which there is a single parent polygon followed by one or more children (representig the holes), butting, where a polygon with holes is sliced until there are no more holes, or cut lines (STD), where a polygon with holes is represented by using one or more cut lines that flow into and out of the polygon.

Inputs:

mode

OUTPUT_MODE_STD
OUTPUT_MODE_LEONOV
OUTPUT_MODE_BUTTING

bdll_handle: thread handle

Notes

In order to differentiate the parent from its children in Leonov polygons, the vertex count of the parent is a negative integer and the vertex count for each child polygon is a positive integer.




Set_Cnv_Output_MT

breaking output polygons into convex ones

Syntax:

void Set_Cnv_Output_MT(short cnv, int bdll_handle);

Function:

this parameter determines whether the output polygons should be tested for, and made convex: fully convex or convex-in-x only.

Inputs:

cnv

 BOOL_NO_CONVEX   
 BOOL_CONVEX_IN_X 
 BOOL_FULLY_CONVEX 

bdll_handle: thread handle

Notes

If you select this option you cannot also select output Leonov polygons.




SetManhFlag_MT

Manhattan polygons vs. All Angle Polygons

Syntax:

void SetManhFlag_MT(short ismanh, int bdll_handle);

Function:

this parameter tells the boolean library that the input data should be tested to determine whether or not they are Manhattan.(i.e all 90 degree data) Certain algorithmic efficiencies are possible when the library knows it is processing Manhattan data.

Inputs:

ismanh:

  NOTEST4MANHATTAN
  TEST4MANHATTAN

bdll_handle: thread handle


Notes

This function impacts the return code for Boolean_MT. If TEST4MANHATTAN is set, the Boolean_MT returns 2 if in fact the input set is all Manhattan and no illegally crossing polygons are found; The Boolean_MT returns 0 if the input polygon list contains non-Manhattan polygons but no illegal polygons; it returns the number of illegal polygons as a negative number.



SetEdgePtComp_MT

Syntax:

void SetEdgePtComp_MT(int width, int bdll_handle);

Function:

Compensates the coordinates returned by RtnEdges_MT to account for the "width" of a so called patch line that a calling program will use later to cover up any butting edges. The user defines a "width" and the end points of the edges are "pulled back" based on the line width. See illustration.

illustration of edge point compensation for cut line

Inputs:

width - the width of the round draw used to "patch" the cut line or slice line

bdll_handle - the thread's handle


Related Functions

RtnEdges_MT