AutoCAD中,文字的显示是通过文字位置,所在平面,以及文字对应的角度,来确定文字如何显示。 以下将文字所在的平面向量称为 normal,文字的角度称为 angle,文字实际显示的方向向量为 vt。 在二维平面中,即 normal==AcGeVector3d::kZAxis 时,angle为 X轴与文字方向的夹角,即 angle=AcGeVector3d::kXAxis.angleTo(vt); 在三维平面中,文字的角度如何确定呢? The rotation angle is relative to the X axis of the text's OCS, with positive angles going counterclockwise when looking down the Z axis toward the origin. The OCS X axis is determined by using the text's normal vector, the WCS Z axis, and the arbitrary axis algorithm. 看到这里,好像有点明白了,不过什么是任意轴算法?上AutoCAD的网站上查了一下,终于是彻底明白了。 任意轴算法是AutoCAD内部用于生成实体坐标系的一种算法。 如下是具体的算法: 这样就可以正确求出文字在OCX下的角度值了 |
|