/you only need to know if it is left or right of the mtext.rotation.
adapting
//gile
public static int isLeft(Point3d p1, Point3d p2, Point3d p3, Vector3d normal)
{
const double pi = 3.141592653589793;
Vector3d v1 = p1.GetVectorTo(p2);
Vector3d v2 = p1.GetVectorTo(p3);
double angle = v1.GetAngleTo(v2, normal);
if (angle == 0.0 || angle == pi)
return 0;//aligned
else
{
if (v1.GetAngleTo(v2, normal) < pi)
return -1;//counterclockwise
else
return 1;//clockwise
}
}
I seems anglefromxpos(pos1,pos2)-tx1.rotation < 3.14159) should give you a left or right answer (And add the check for aligned)
So no need for && (pos1.Y > pos2.Y)) etc, maybe I missed something