// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Description: // Returns the mid point between two 3D points, p1 and p2. // global proc float [] midPoint2Pts( float $p1[], float $p2[] ) { if( size($p1) != 3 ) warning((uiRes("m_midPoint2Pts.kWarningNeed3Values1")) ); if( size($p2) != 3 ) warning((uiRes("m_midPoint2Pts.kWarningNeed3Values2")) ); float $midPt[3]; $midPt[0] = ($p1[0]+$p2[0])/2.0; $midPt[1] = ($p1[1]+$p2[1])/2.0; $midPt[2] = ($p1[2]+$p2[2])/2.0; return $midPt; }