JIG下使用正交的方法,考虑UCS
if (ORTHOMODE == 1)
{
Vector2d v1=new Vector2d (ptJigCenter.X-ptBase.X ,ptJigCenter.Y-ptBase.Y );
double angle=v1.GetAngleTo (vecX2d);
angle=Math.Abs (angle );//绝对值
if (angle<0.25*Math.PI||(angle >0.75*Math.PI&&angle <1.25*Math.PI)) //偏向ucs的x轴,则锁定在x轴上
{
Plane p=new Plane (ptBase,mtUCS.CoordinateSystem3d.Yaxis );
ptJigCenter=ptJigCenter .OrthoProject (p);
}
else//偏向ucs的Y轴,则锁定在Y轴上
{
Plane p=new Plane (ptBase,mtUCS.CoordinateSystem3d.Xaxis);
ptJigCenter=ptJigCenter .OrthoProject (p);
}
}
页:
[1]