WEMBoolOp

MLModule
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

Purpose

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.

Usage

Connect two WEMs to the inputs of the WEMBoolOp module and choose the Boolean operation.

Details

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.

Windows

Default Panel

../../../Modules/ML/MLWEMModules/mhelp/Images/Screenshots/WEMBoolOp._default.png

Input Fields

There are two inputs for a WEM for the Boolean operation.

inWEM

name: inWEM, type: MLBase

inWEM2

name: inWEM2, type: MLBase

Output Fields

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.

outWEM

name: outWEM, type: MLBase

outCSOList

name: outCSOList, type: MLBase

outDebugWEM

name: outDebugWEM, type: MLBase

Parameter Fields

Visible Fields

Auto Apply

name: autoApply, type: Bool, default: TRUE

If checked, all parameter changes lead to a new computation of the result.

Auto Update

name: autoUpdate, type: Bool, default: TRUE

If checked, all changes to the input WEMs lead to a new computation of the result.

Apply

name: apply, type: Trigger

If pressed, the chosen Boolean operation is performed.

Label

name: label, type: String

Sets a label string for a short description.

Description

name: description, type: String

Sets a description string for the output WEM.

Triangulation Mode

name: triangulationMode, type: Enum, default: Strip

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

Which Bool Op

name: whichBoolOp, type: Enum, default: Intersection

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

Which Cuts

name: whichCuts, type: Enum, default: None

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

Which Nodes

name: whichNodes, type: Enum, default: None

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

Which Output

name: whichOutput, type: Enum, default: Input WEM 1

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

Debug

name: debug, type: Bool, default: TRUE

Enable debugging. This also enables the Debug tab.

Steps

name: steps, type: Enum, default: Output inner and outer

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

Use Bounding Box Tree

name: useBoundingBoxTree, type: Bool, default: FALSE

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.

Skip Initial Bounding Box Test

name: skipInitialBoundingBoxTest, type: Bool, default: TRUE

Initially the bounding boxes of both input WEMs are intersected to determine whether further processing is required. This option skips this step.

Remove Open Cuts

name: removeOpenCuts, type: Bool, default: TRUE

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

name: generateCSOs, type: Bool, default: TRUE

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.

Creator Id

name: csoId, type: Integer, default: 0

Sets the creator ID to the CSOs to identify the creating module later on (should be unique but this is not tested anywhere).

Add To Group

name: addCSOToGroupWithLabel, type: String, default: WEMBoolOp Generated CSOs

A string for the group name where the CSOs are put into for an easy later reference.

Alpha (pathPointAlpha)

name: pathPointAlpha, type: Float, default: 1, minimum: 0, maximum: 1

The alpha value for the path points.

Color

name: markerColor, type: Color, default: 0 1 0

Color for the markers (seed points).

Alpha (markerAlpha)

name: markerAlpha, type: Float, default: 1, minimum: 0, maximum: 1

The alpha value for the CSO markers (seed points).

Hidden Fields

isProcessing

name: isProcessing, type: Bool, default: FALSE

elapsedTime

name: elapsedTime, type: Float, default: 0

id

name: id, type: Integer, default: 0

autoClear

name: autoClear, type: Bool, default: TRUE

removePreviousWEMs

name: removePreviousWEMs, type: Bool, default: TRUE

show

name: show, type: Bool, default: TRUE

editable

name: editable, type: Bool, default: TRUE

useFaceDiffuseColor

name: useFaceDiffuseColor, type: Bool, default: TRUE

usePolygonOffset

name: usePolygonOffset, type: Bool, default: FALSE

copyInputWEMs

name: copyInputWEMs, type: Bool, default: FALSE

listenToFinishNotifications

name: listenToFinishNotifications, type: Bool, default: TRUE

forwardRepaintNotifications

name: forwardRepaintNotifications, type: Bool, default: TRUE

forwardSelectionNotifications

name: forwardSelectionNotifications, type: Bool, default: TRUE

progress

name: progress, type: Float, default: 0

useInputWEMToCreateOutputWEM

name: useInputWEMToCreateOutputWEM, type: Bool, persistent: no

modifyAttributes

name: modifyAttributes, type: Bool, default: FALSE

generateEdges

name: generateEdges, type: Bool, default: TRUE

invalidPathPointColor

name: invalidPathPointColor, type: Color, default: 1 0.666670024394989 0

invalidMarkerColor

name: invalidMarkerColor, type: Color, default: 1 0 0