
翻译:
该.NET类包装AcGeBoundBlock2d ObjectARX类。
此类提供了二维边界体积实现。
边界块可以以两种形式存在:作为普通的坐标对齐的边界框和平行四边形。
测试:
var pl = new Polyline();
pl.Closed = true;
pl.AddVertexAt(0, new Point2d(0, 0), 0, 0, 0);
pl.AddVertexAt(1, new Point2d(1, 1), 0, 0, 0);
pl.AddVertexAt(2, new Point2d(0.5, 2), 0, 0, 0);
pl.AddVertexAt(3, new Point2d(0.1, 0.5), 0, 0, 0);
tr.AddEntity(pl);
var box = pl.GetGeCurve().BoundBlock;
var cir1 = new Circle(box.BasePoint, Vector3d.ZAxis, 0.2);
cir1.ColorIndex = 1;
var cir2 = new Circle(box.GetMaximumPoint(), Vector3d.ZAxis, 0.2);
cir2.ColorIndex = 2;
var cir3 = new Circle(box.GetMinimumPoint(), Vector3d.ZAxis, 0.2);
cir3.ColorIndex = 3;
tr.AddEntity(cir3, cir2, cir1);
tr.Editor.WriteMessage(box.Direction1.ToString()+”\n”);
tr.Editor.WriteMessage(box.Direction2.ToString() + “\n”);
tr.Editor.WriteMessage(box.Direction3.ToString() + “\n”);
结果:
