diff --git a/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp b/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp index 59c5931..931cb3e 100644 --- a/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp +++ b/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp @@ -223,27 +223,20 @@ AECDLLIMPEXP void GiDrawUtility::transfromRegion(AcDbRegion *pRegion { AcGePlane plan; plan.set(ptOnPlan, vtNormal); - AcGePoint3d pt0, pt1, pt2; - plan.get(pt0, pt1, pt2); AcGeMatrix3d xform; xform.setToPlaneToWorld(plan); - // 把region转到此面上 - pRegion->transformBy(xform); - - // 把 region 上的点也转到面上 + // 先把 region 上的点转到面上,求出还需要平移多少 AcGePoint3d pt(ptOnRegion); pt.transformBy(xform); - // 再把region在面上平移 - AcGeVector3d vtm = ptOnPlan - pt; - if (!vtm.isZeroLength()) - { - xform.setToIdentity(); - xform.setToTranslation(ptOnPlan - pt); - pRegion->transformBy(xform); - } + // 旋转与平移合成一个矩阵,region 只做一次 ACIS 变换 + AcGeMatrix3d matMove; + matMove.setToTranslation(ptOnPlan - pt); + xform.preMultBy(matMove); + + pRegion->transformBy(xform); } AECDLLIMPEXP AcGeMatrix3d GiDrawUtility::RotateAndMove(const AcGeVector3d &vtOrig