修复 RotateAndMove 平移项缺失旋转分量导致落点错位
平移量应为 ptDist - R*ptOrig,原实现写成 ptDist - ptOrig, 仅在 ptOrig 位于旋转轴上(含原点)时才成立。 DrawTydf 台体分支传入的 ptBottom 非原点,vtMove 倾斜时 实体整体偏移 |R*ptOrig - ptOrig|,本次一并修正。
This commit is contained in:
1 parent
ed996c10bc
commit
938edc0204
1 file changed
+5
-1
@@ -183,7 +183,11 @@ AECDLLIMPEXP AcGeMatrix3d GiDrawUtility::RotateAndMove(const AcGeVector3d &vtOri
|
||||
AcGeMatrix3d mat(AcGeMatrix3d::kIdentity);
|
||||
//mat = _vtDist.rotateTo(_vtOrig);
|
||||
mat = _vtOrig.rotateTo(_vtDist);
|
||||
mat.setTranslation(ptDist - ptOrig);
|
||||
// 平移量须为 ptDist - R*ptOrig:先求旋转后的 ptOrig 落点,再算差值。
|
||||
// 原来写成 ptDist - ptOrig,仅在 ptOrig 位于旋转轴上(含原点)时才正确。
|
||||
AcGePoint3d ptTmp(ptOrig);
|
||||
ptTmp.transformBy(mat);
|
||||
mat.setTranslation(ptDist - ptTmp);
|
||||
return mat;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user