(7)POLYLINE和ARC相互转换的ARX,C#代码
Converting polyline arc to AcDbArc and vice-versaHere is a way to convert an AcDbPolyline arc to an AcDbArc. The easiest procedure is to create an AcGeCircArc2d by calling AcDbPolyline::getArcSegAt(). You can then use "acutAngle" method to calculate the start and end angles using the center point of the AcGeCircArc2d and the start and end points of the polyline arc. Then create an AcDbArc with the AcGeCircArc2d center point, the polyline's normal, the AcGeCircArc2d's radius, and the start and end angles you just calculated. It is very important to call AcGeCircArc2d::isClockwise() to find out which way the bulge leans; if the arc is clockwise, construct the AcDbArc with the start and end points reversed in the AcDbArc constructor.
To convert AcDbArcs back to AcDbPolyline is somewhat simpler if you remember that bulge is the 1/4 of the tangent of the included angle. The included angle is easily calculated with the AcDbArc member functions startAngle() and endAngle().
The following sample illustrates how to convert AcDbPolyline arc segments to AcDbArcs.
**** Hidden Message *****
回复看看:lol 看看
看看
学习学习,支持感谢 看看!学习! xue学习下! 学习,大力学习
我也过来学习学习的……
POLYLINE和ARC相互转换 dd好,学习了 回复看看哈 学习!!!!!!!!!!!
看看!学习!
看看!学习!