C#CAD 二次开发图案填充对象边界提取详解
近日拜读了“北辰之北灬”的《C#CAD 二次开发图案填充对象边界提取》一
文 ( 原 文 链 接 : https://blog.csdn.net/pp_fzp/article/details/
52992615),并在 Visual Studio 2012 版本中进行了反复的测试,或许因
版本的原因,也或许是变量声明的位置不当,当提取带孤岛的图案填充时只能
获取内部边界的坐标集合,无法获取外部边界的坐标集合。现修改并说明如下:
原代码中,下面这一段为无效的代码,如果单独测试这段代码,无论什么
样的图案填充 hatLoop.IsPolyline
均为非,
col_ver = hatLoop.Polyline; //
均出现系
统闪退。
1、//如果 HatchLoop 为 PolyLine
if (hatLoop.IsPolyline) //
均为非
{ col_ver = hatLoop.Polyline; //
均出现系统闪退
foreach (BulgeVertex vertex in col_ver)
{ col_point2d.Add(vertex.Vertex); }
}
2、无法获取外部边界的坐标集合。
3、参数("numSample">提取单位曲线中样本点的数目)使用不当。如
果 HatchLoop 为 Curves 时,Curves 中的每个子线为 Curve2d Class 对象,
其中包含下列对象类型:
Autodesk.AutoCAD.Geometry.CircularArc2d //
园及园弧
Autodesk.AutoCAD.Geometry.CompositeCurve2d //
复合曲线
Autodesk.AutoCAD.Geometry.EllipticalArc2d //
椭圆及椭圆弧
Autodesk.AutoCAD.Geometry.ExternalCurve2d //
外部曲线
评论1