Is there an OBB version of the function “findPartOccurrencesInAABB” or another way to figure that out? I’ve been reading articles on how to determine if points are in an OBB, but honestly my trig skills are quite rusty.

Hey Steven,

There are no built-in ways to do that and computing OBBs intersections can be a little bit tricky.

One workaround is to find the transformation from the input OBB to a unit AABB, transform the whole scene using this transformation matrix and then call `scene.findPartOccurrencesInAABB`

using this unit AABB.

Here is a snippet:

```
from pxz import *
def getOBBMatrix(obb: geom.OBB):
return [[obb.xAxis.x, obb.yAxis.x, obb.zAxis.x, obb.corner.x],
[obb.xAxis.y, obb.yAxis.y, obb.zAxis.y, obb.corner.y],
[obb.xAxis.z, obb.yAxis.z, obb.zAxis.z, obb.corner.z],
[0, 0, 0, 1]]
# find part occurrences in obb
def findPartOccurrencesInOBB(obb: geom.OBB, strictlyIncluded: bool):
partOccurrences = scene.getPartOccurrences()
# find OBB to AABB transformation matrix
matrix = getOBBMatrix(obb)
matrixInv = geom.invertMatrix(matrix)
scene.applyTransformation(scene.getRoot(), matrixInv)
scene.resetTransform(scene.getRoot(), True) # reset otherwise find in aabb does not work
# find in unit box
found = scene.findPartOccurrencesInAABB(geom.AABB([0, 0, 0], [1, 1, 1]))
# reset scene transform
scene.applyTransformation(scene.getRoot(), matrix)
scene.resetTransform(scene.getRoot(), True)
return found
```

Although we could add a native `scene.findPartOccurrencesInOBB`

function, it’d be interesting for us to understand your use case. Do you want to find meshes intersecting each others? If so, we could add a more precise function not relying on OBBs but on actual geometries.