| genre | WEMProcessing |
| status | stable |
| author | Bart De Dobbelaer |
| package | MeVisLab/Standard |
| dll | MLWEMModules |
| definition | MLWEMModules.def |
| see also | SoWEMRenderer, WEMClip |
| keywords | WEM, boolean, operation, intersect, difference, union |
The module WEMBoolOp performs a Boolean operation on two WEM surfaces.
This operation can either be an intersection, a difference, a union or a merge.
Connect two WEMs to the inputs of the WEMBoolOp module and choose the Boolean operation.
To perform a Boolean operation on WEMs, each face of a WEM has to be intersected with each face of the other WEM. It is clear this operation has to be optimized. This is done by intersecting the bounding boxes of both input WEMs. This smaller set of faces is then intersected resulting in face cuts. Using those cuts, faces are split into multiple pieces.
However at this point it is not clear where each piece belongs. Some pieces are classified as outside (not belonging to the output WEM), others as inside (belonging to the output WEM). Therefor all nodes of both input WEMs have to be classified in these two categories. It has been noticed that this step is the most error prone: if the output is wrong, the error can always be traced to a wrong classification of nodes (some node is considered as belonging to the output WEM while this is not the case or vice versa).
Intersections which cause multiple holes in one face are not yet supported. Those faces will not be processed. In very rare cases the classification of the nodes can go wrong. This is always related to the input WEMs and in order to fix the bug it is important to also include the network and the input WEMs in your bug report.
There are two inputs for a WEM for the Boolean operation.
The output is a WEM which is the result of the Boolean operation.
A CSO is also provided which shows the place where the input WEMs connect. The last output is a debug WEM which visually outputs debug information.
| Add To Group: String | forwardRepaintNotifications: Bool | show: Bool |
| Alpha (pathPointAlpha): Float | forwardSelectionNotifications: Bool | Skip Initial Bounding Box Test: Bool |
| Alpha (markerAlpha): Float | Generate CSOs: Bool | Steps: Enum |
| Apply: Trigger | generateEdges: Bool | Triangulation Mode: Enum |
| Auto Apply: Bool | id: Integer | Use Bounding Box Tree: Bool |
| Auto Update: Bool | invalidMarkerColor: Color | useFaceDiffuseColor: Bool |
| autoClear: Bool | invalidPathPointColor: Color | useInputWEMToCreateOutputWEM: Bool |
| Color: Color | isProcessing: Bool | usePolygonOffset: Bool |
| copyInputWEMs: Bool | Label: String | Which Bool Op: Enum |
| Creator Id: Integer | listenToFinishNotifications: Bool | Which Cuts: Enum |
| Debug: Bool | modifyAttributes: Bool | Which Nodes: Enum |
| Description: String | progress: Float | Which Output: Enum |
| editable: Bool | Remove Open Cuts: Bool | |
| elapsedTime: Float | removePreviousWEMs: Bool |
If checked, all parameter changes lead to a new computation of the result.
If checked, all changes to the input WEMs lead to a new computation of the result.
Possible values are Center Node, Fan and Strip. In the first case a center node is calculated for the polygon which is then shared by all triangles making up the polygon. In the other cases a triangle fan or triangle strip is created.
Values:
| Title | Name |
|---|---|
| Center node | Center node |
| Fan | Fan |
| Strip | Strip |
Boolean operation: Intersection, Difference, Union or Merge.
Both Intersection and Union are indepenent of the order of the input WEMs.
Difference takes the first WEM and substracts the second WEM. By changing the order of the inputs one can perform the Difference on the other WEM.
Merge simply adds both input WEMs to the output without performing any intersecting operation.
Values:
| Title | Name |
|---|---|
| Intersection | Intersection |
| Union | Union |
| Difference | Difference |
Output face cuts to the debug output WEM. Possible values are: None, Parts, Full and non-Merged. For each option the color of the cuts reflects the type. 'Parts' shows the different partial cuts on each face. Combined those parts for the Full cut. To be valid this cut has to start and end at some point on one of the edges. Non-merged cuts only appear with open cuts (see Remove Open Cuts).
Values:
| Title | Name |
|---|---|
| None | None |
| Parts | Parts |
| Full | Full |
| Non-merged | Non-merged |
Output input nodes to the debug output WEM. Possible values are: None, Outer, Intersecting, Ray Casting/Spider Web and All. Again the color of the nodes reflects their type or purpose.
Values:
| Title | Name |
|---|---|
| None | None |
| Outer | Outer |
| Intersecting | Intersecting |
| All | All |
The resulting WEM of the boolean operation consists of two parts: a part from the first input WEM and a part of the second input WEM. Either one or both parts can be selected to be outputted. Only when both parts are used as ouput, is the output WEM closed.
Values:
| Title | Name |
|---|---|
| Input WEM 1 | Input WEM 1 |
| Input WEM 2 | Input WEM 2 |
| Both Input WEMs | Both Input WEMs |
The different steps in the processing pipeline. Use this to locate bugs together with the Which Cuts and Which Nodes parameters.
Values:
| Title | Name |
|---|---|
| Initial classification | Initial classification |
| Intersect faces | Intersect faces |
| Merge partial face cuts | Merge partial face cuts |
| Update classifications | Update classifications |
| Cut faces | Cut faces |
| Output inner and outer | Output inner and outer |
The actual intersection of the faces can be done brute force or through a bounding box tree. For now the first option is so optimized that the performance of both methods is the same. So, by default this option is disabled.
Initially the bounding boxes of both input WEMs are intersected to determine whether further processing is required. This option skips this step.
If one of the input WEMs is not closed, the Boolean operation can yield open cuts across the WEM. As a consequence the resulting WEM is invalid. By default those cuts are removed to make sure the output WEM is always closed and without errors.
Generate CSOs at the intersection of both input WEMs. This also enables the CSO tab. This is mostly a visual aid to see where exactly both input WEMs intersect each other.
Sets the creator ID to the CSOs to identify the creating module later on (should be unique but this is not tested anywhere).
A string for the group name where the CSOs are put into for an easy later reference.