Compute Mesh Intersecting Faces
Computes indices of intersecting faces between pairs of Meshes.
Compute Mesh Intersecting Faces is an:doc:Immediate Node </ext_physics/omnigraph-immediate-nodes> that tests if intersection exists on prims at corresponding indexes into the overlap pairs arrays.
In addition to Compute Geometry Overlaps this node will return also the actual faces in the mesh in overlapPair0
that intersect the corresponding mesh at the same index in the overlapPair1
For example given the following overlap pairs arrays:
overlapPairs0
= ['/Prim1'
,'/Prim2'
]overlapPairs1
= ['/Prim3'
,'/Prim4'
]
This node will test:
'/Prim1'
<–>'/Prim3'
'/Prim2'
<–>'/Prim4'
Such prims must exist in the prims bundle that passed to the primsBundle
input, otherwise an error will be thrown.
Prims can be supplied to primsBundle
connecting the output of a Read Prims node or Compute Geometry Bounds node.
The output is an array of booleans where every boolean at a given index returns true if the two prims at the same corresponding index in the overlapPairs0
and overlapPairs1
arrays do actually intersect.
So looking at the previous example if only '/Prim2'
overlaps with '/Prim4'
then the overlaps will be:
overlaps
= [false
,true
]
Specific output of this node is the Output Face Indices bundle. It’s possible to extract each child bundle output with the Extract Prim node with a prim path set to prim0
… primN
. Each child bundle has the faces0
and faces1
attributes.
Going back to the previous example, extracting the second output (prim1
) from the Output Face Indices with an Extract Prim node, the extracted child bundle will have two outputs, like for example:
faces0
= [0
,2
,4
]faces1
= [2
,5
,7
]
This output indicates that:
face at index
0
of'/Prim2'
intersects face at index2
of'/Prim4'
face at index
2
of'/Prim2'
intersects face at index5
of'/Prim4'
face at index
4
of'/Prim2'
intersects face at index7
of'/Prim4'
Installation
To use this Node, you must enable omni.physx.graph
in the Extension Manager.
Inputs
Name |
Type |
Description |
Default |
---|---|---|---|
execIn |
|
Input execution |
|
primsBundle |
|
The prims of interest. It must be a bundle with one or more prim children. Currently only meshes prim are supported (sourcePrimType == ‘Mesh’). From each Mesh prim child reads: - ‘sourcePrimPath’ - ‘sourcePrimType’ - ‘points’ - ‘faceVertexIndices’ - ‘faceVertexCounts’ - ‘worldMatrix’ - ‘sourcePrimPath’ (and optionally ‘holeIndices’, ‘orientation’, ‘meshKey’ and ‘physics:approximation’) attributes |
|
overlapsPair0 |
|
Path of the first geometry from the Prims Bundle to check for intesection with corresponding item at same index in overlapsPair1 input attribute. |
|
overlapsPair1 |
|
Path of the second geometry from the Prims Bundle to check for intesection with corresponding item at same index in overlapsPair0 input attribute |
Outputs
Name |
Type |
Description |
Default |
---|---|---|---|
execOut |
|
Output execution |
|
overlaps |
|
Array of booleans where ‘True’ value signals that a corresponding pair of meshes in overlapsPair0 and overlapsPair1 input arrays at the same index do actually overlap. |
|
faceIndices |
|
Bundle of child prims with faces0 / faces1 attributes containing indices of faces in source meshes that intersect each other |
Note
Connecting the output of Compute Geometry Bounds node is often a better choice because that node allows precompute mesh hash and cooking data structures at the start of a graph, avoiding such computation at every invocation of this node.
Note
You can use Bundle Inspector to print the content of the contacts bundle output to console to better understand its structure.