|
@@ -131,22 +131,28 @@ namespace SAGA.MBI
|
|
|
newPoints.Add(new Geometry2D.PointD(200, 200));
|
|
|
newPoints.Add(new Geometry2D.PointD(0, 400));
|
|
|
|
|
|
- //外点
|
|
|
+ //外点 ==2
|
|
|
var testPoint = new Geometry2D.PointD(-100, 200);
|
|
|
- int flag = Geometry2D.InSidePolygon( newPoints.ToArray(),testPoint ); ;
|
|
|
-
|
|
|
+ int flag = Geometry2D.InSidePolygon( newPoints.ToArray(),testPoint );
|
|
|
+ //==0
|
|
|
var testPoint2 = new Geometry2D.PointD(50, 200);
|
|
|
int flag2 = Geometry2D.InSidePolygon(newPoints.ToArray(), testPoint2);
|
|
|
|
|
|
- List<Geometry2D.PointD> newPoints2 = new List<Geometry2D.PointD>();
|
|
|
- newPoints.Add(new Geometry2D.PointD(0, 0));
|
|
|
- newPoints.Add(new Geometry2D.PointD(400, 0));
|
|
|
- newPoints.Add(new Geometry2D.PointD(400, 400));
|
|
|
- newPoints.Add(new Geometry2D.PointD(200, 600));
|
|
|
- newPoints.Add(new Geometry2D.PointD(0, 400));
|
|
|
- //外点
|
|
|
- var testPoint3 = new Geometry2D.PointD(-100, 600);
|
|
|
- int flag3 = Geometry2D.InSidePolygon(newPoints.ToArray(), testPoint); ;
|
|
|
+ List<Geometry2D.PointD> newPoints3 = new List<Geometry2D.PointD>();
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(0, 0));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(400, 0));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(400, 200));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(200, 200));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(150, 200));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(100, 200));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(50, 200));
|
|
|
+ newPoints3.Add(new Geometry2D.PointD(0, 400));
|
|
|
+ //内点==0
|
|
|
+ var testPointI3 = new Geometry2D.PointD(25, 200);
|
|
|
+ int flagI3 = Geometry2D.InSidePolygon(newPoints3.ToArray(), testPointI3);
|
|
|
+ //外点==2
|
|
|
+ var testPointO3 = new Geometry2D.PointD(-25, 200);
|
|
|
+ int flagO3 = Geometry2D.InSidePolygon(newPoints3.ToArray(), testPointO3);
|
|
|
|
|
|
var fi = commandData.Application.PickElement("请选择图元") as FamilyInstance;
|
|
|
if (fi == null) return Result.Succeeded;
|