Brief Index      Full Index      I.M. Reference

KCompute_Boolean_Shell


Functions

HC_KEY KCompute_Boolean_Shell (int targetpcount, const HC_POINT *targetpoints, const HC_POINT *targetnormals, int targetflist_length, const int *targetface_list, int toolpcount, const HC_POINT *toolpoints, const HC_POINT *toolnormals, int toolflist_length, const int *toolface_list, const char *options)
HC_KEY DKCompute_Boolean_Shell (int targetpcount, const HTD_POINT *targetpoints, const HC_POINT *targetnormals, int targetflist_length, const int *targetface_list, int toolpcount, const HTD_POINT *toolpoints, const HC_POINT *toolnormals, int toolflist_length, const int *toolface_list, const char *options, Point const *in_color1, Point const *in_color2, unsigned short const *in_vis1, unsigned short const *in_vis2)

Function Documentation

HC_KEY KCompute_Boolean_Shell ( int  targetpcount,
const HC_POINT *  targetpoints,
const HC_POINT *  targetnormals,
int  targetflist_length,
const int *  targetface_list,
int  toolpcount,
const HC_POINT *  toolpoints,
const HC_POINT *  toolnormals,
int  toolflist_length,
const int *  toolface_list,
const char *  options 
)

Performs one of several boolean operations on two shells.

Parameters:
targetpcount - Number of valid points in targetpoints.
targetpoints - Vector of x-y-z triplets for the coordinates of the vertices that could be used to build the target shell. (A simple N = 3 array can also be used) Passed by reference always.
targetnormals - Sequential list of vertex normals of the target shell, x-y-z triplets. It is legal to pass NULL for this parameter, in which case normal information will be ignored. Passed by reference always.
targetflist_length - Total number of integers in targetface_list
targetface_list - Encoded description of how to connect the points to build the faces of the target shell. Passed by reference always.
toolpcount - Number of valid points in toolpoints.
toolpoints - Vector of x-y-z triplets for the coordinates of the vertices that could be used to build the tool shell. (A simple N = 3 array can also be used) Passed by reference always.
toolnormals - Sequential list of vertex normals of the tool shell, x-y-z triplets. It is legal to pass NULL for this parameter, in which case normal information will be ignored. Passed by reference always.
toolflist_length - Total number of integers in toolface_list.
toolface_list - Encoded description of how to connect the points to build the faces of the tool shell. Passed by reference always.
options - A quoted string or a string variable containing a list of desired options. Passed by reference always.
Returns:
key

DETAILS

This function takes the definitions for two manifold shells and performs one of three boolean operations on those shells. The result is a new shell that gets inserted into the currently open segment. Valid choices for options include the following:

boolean type = [subtract | union | intersect]

Tells 3dGS which specific type of boolean operation to perform on the supplied shells. In the event of a union or an intersection, the order of target and tool does not matter. However, in the case of a subtraction the tool will be subtracted from the target shell.

plane coefficient = [float]

This value is used in the internal logic for determining the boolean result. Changing the value based on the scale of the object can give better results. For both the single and double precision version, the default setting is "plane coefficient = 0.000001".

plane tolerance = [float]

This value is used in the internal logic for determining the boolean result. Changing the value based on the scale of the object can give better results. The default setting is "plane tolerance = 0.0003" for the single precision version. For the double precision version, the default setting is "plane tolerance = 0.000001".

plane merge tolerance = [float]

This value is used in the internal logic for determining the boolean result. Changing the value based on the scale of the object can give better results. The default setting is "plane merge tolerance = 0.0003" for the single precision version. For the double precision version, the default setting is "plane merge tolerance = 0.000001".

target handedness = [left|right]

The polygon handedness of the target shell. If not specified, "left" handedness is assumed.

tool handedness = [left|right]

The polygon handedness of the tool shell. If not specified, "left" handedness is assumed.

NOTES

This function will perform a Compute_Optimized_Shell() on the resulting boolean shell data before placing it in the currently open segment. The shell will have left polygon handedness. The user may need to delete the tools and target in their scene depending on the intended behavior.

The two shells that participate in the boolean operation should be closed and manifold bodies. There should be no overlapping facets or other inconsistencies in the data. You must have consistent handedness in each input shell (though each shell can have it's own handedness, e.g., the target can have right handedness and the tool can have left handedness) and you should specify the handedness in the options if it differs from the defaults, otherwise one can get unexpected results. This function may also produce incorrect results if the input shells contain (mathematically) non-convex (i.e., concave) faces.

RESTRICTIONS

The resulting shell of the KCompute_Boolean_Shell function may contain an excessive number of triangles in the region where the target and tool meet. If the boolean functionality is used for continuous surface removal (for example, recursive use of the boolean operation result as the input value for a subsequent boolean operation), this effect may become exacerbated.

Due to the nature of the algorithm occasionally very small triangles will be produced which can lead to precision problems, such as missing faces or faces with wrong handedness. In extreme cases, these precision problems can lead to the creation of extraneous triangles.

See also:
Insert_Shell

HC_KEY DKCompute_Boolean_Shell ( int  targetpcount,
const HTD_POINT *  targetpoints,
const HC_POINT *  targetnormals,
int  targetflist_length,
const int *  targetface_list,
int  toolpcount,
const HTD_POINT *  toolpoints,
const HC_POINT *  toolnormals,
int  toolflist_length,
const int *  toolface_list,
const char *  options,
Point const *  in_color1,
Point const *  in_color2,
unsigned short const *  in_vis1,
unsigned short const *  in_vis2 
)

Similar to KCompute_Boolean_Shell(), but accepts and returns double-precision values. This call can be used only when using the HOOPS double-precision module.

Parameters:
targetpcount - Number of valid points in targetpoints.
targetpoints - Vector of x-y-z triplets for the coordinates of the vertices that could be used to build the target shell. (A simple N = 3 array can also be used) Passed by reference always.
targetnormals - Sequential list of vertex normals of the target shell, x-y-z triplets. It is legal to pass NULL for this parameter, in which case normal information will be ignored. Passed by reference always.
targetflist_length - Total number of integers in targetface_list
targetface_list - Encoded description of how to connect the points to build the faces of the target shell. Passed by reference always.
toolpcount - Number of valid points in toolpoints.
toolpoints - Vector of x-y-z triplets for the coordinates of the vertices that could be used to build the tool shell. (A simple N = 3 array can also be used) Passed by reference always.
toolnormals - Sequential list of vertex normals of the tool shell, x-y-z triplets. It is legal to pass NULL for this parameter, in which case normal information will be ignored. Passed by reference always.
toolflist_length - Total number of integers in toolface_list.
toolface_list - Encoded description of how to connect the points to build the faces of the tool shell. Passed by reference always.
options - A quoted string or a string variable containing a list of desired options. Passed by reference always.
in_color1 -
in_color2 -
in_vis1 -
in_vis2 -
Returns:
key

DETAILS

No additional details. See KCompute_Boolean_Shell().

Main Index
Brief Index      Full Index      I.M. Functions