I want the trace to hit the back of the mesh to measure the thickness of the object. How can I do this? There is a way to measure from the outside, but I want to measure the thickness of only a specific object without being obstructed by other objects.
Here’s what I would try:
After tracing from outside and finding the first edge, do a new trace from the endpoint of that first one, in the opposite direction.
If the 2nd trace’s hit position is the same as its starting position, then you’re still inside the object. So go back to step one but use a longer trace. If it’s not the same, then the hit position is the outer edge, and now you can calculate the distance from the first trace’s hit position to the second trace’s hit position, which should be the thickness at the trace’s angle.
All a bit theoretical though, I haven’t tried it myself.
If the object is rather uniform (for instance a wall) then you could get it’s locally aligned bounding box and get the dimensions from there