Say I want to determine what, if any, components live at, or near, a specfic location in UV Space.
Can I perform a selection through python/API/mel/pymel given only a location and a shape node?
In psuedo code:
def getComponentAtLocation(shape=None, location=None, space=‘uv’, expand=None)
# pad the location with the expand amount to create a selection bounding box
# find any faces that cross the bounding box
# find any uv coordinates contained within the box
# return found components
my first thought was to iterate over the uvs and test if the coordinates are inside the region. But i was hoping to avoid this route since it could be quite slow on large meshes/scenes.
I am hoping for some of function or node that wouldn’t need to iterate over the meshes.
Also, checking just the UV coordinates for inclusion with in the bounding region doesn’t find me polygons who cross the bounding region, but don’t contain any UVs with in it.
If you need to do poly-poly intersections look at GPC (there are python bindings in the cheeseshop) . This has C components so distribution may be tricky.
Planarhas a pure python version so it’s easy to package. It does not have a poly-poly intersection method. However you can use it to do half space tests and 2d - bounding box checks so it’s “easy” to make your own poly - poly intersection checker