bi
By: a guest | Feb 9th, 2010 | Syntax:
None | Size: 0.59 KB | Hits: 71 | Expires: Never
proc float getPointPlaneDistance(string $planeName, string $nameLoc)
{
float $planeEq[] = `getPlaneEquation($planeName)`;
float $loc[] = `xform -ws -q -t $nameLoc`;
float $dividend = ( ($planeEq[0] * $loc[0]) + ($planeEq[1] * $loc[1]) + ($planeEq[2] * $loc[2]) + $planeEq[3]);
print ("\n dividend \n");
print $dividend;
float $divisor = (sqrt(($planeEq[0]*$planeEq[0]) + ($planeEq[1]*$planeEq[1]) + ($planeEq[2]*$planeEq[2])));
float $dist = ($dividend)/($divisor);
print ("\n distance from point to plane \n");
print $dist;
//returns float distance
return $dist;
}