9
$\begingroup$

Consider the situation in which I have a cuboid:

Cuboid[{0,0,0},{1,1,1}]

and a point in the cubiod

{0.9,0.4,0.6}

How do I find the distance from the closest surface of the cuboid?

$\endgroup$

1 Answer 1

12
$\begingroup$

How about:

SignedRegionDistance[Cuboid[{0, 0, 0}, {1, 1, 1}], {0.9, 0.4, 0.6}]
-0.1

the negative sign tells you that the query point is inside the region.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.