XDSoft 发表于 2014-12-9 12:41:08

(7)POLYLINE和ARC相互转换的ARX,C#代码

Converting polyline arc to AcDbArc and vice-versa

Here 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 *****

dnbcgrass 发表于 2014-12-9 13:16:07

回复看看:lol

牢固 发表于 2014-12-9 15:04:26

看看

牢固 发表于 2014-12-9 15:09:37

看看

QiaoCheng 发表于 2014-12-9 16:56:43

学习学习,支持感谢

yfy2003 发表于 2014-12-10 09:43:30

看看!学习!

why1025 发表于 2014-12-23 09:29:17

xue学习下!

819534890 发表于 2015-2-2 16:14:28

学习,大力学习

1425361224 发表于 2015-5-8 13:01:12

我也过来学习学习的……

llq_78 发表于 2015-5-10 11:42:54

POLYLINE和ARC相互转换

ggosgg 发表于 2015-6-15 21:17:05

dd好,学习了

cqbibby 发表于 2015-6-29 14:31:05

回复看看哈

zjy2999 发表于 2016-2-3 16:17:46

学习!!!!!!!!!!!

buleant 发表于 2017-4-27 21:46:27


看看!学习!

lw5297590 发表于 2017-4-27 21:56:34


看看!学习!
页: [1] 2 3
查看完整版本: (7)POLYLINE和ARC相互转换的ARX,C#代码