I think it is working as expected (albeit not how you would like it to work):
When using facets, the mesh bounding volume is subdivided into tiny cubes, depending on a number of parameters (partitioningBBoxRatio
, partitioningSubdivisions
, …).
When checking a point P for a closest facet, the function looks for the cube containing P and compute the distances between P and each facet of this cube and returns back the facet with the minimum distance to P.
So, there are two important things to note:
- P must be inside the bounding volume of the mesh (taking
partitioningBBoxRatio
into account - so you can inflate a bit the bounding volume used by the function by settingpartitioningBBoxRatio
greater than 1) for the function to (potentially) returns something other thannull
(see 2.) - if the cube that holds P does not contain any facts, the function returns
null
So, given that the center of the label plane you move stays inside the bounding volume, it’s 2. that explains that most of the time no facet is found.
You can circumvent 2. by lowering partitioningSubdivisions
(even setting it to 1), but that defeats the purpose of the subdivision process, which is to quickly find a match by checking only a subset of the facets…