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$
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, privacy policy and cookie policy

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