Author Topic: AcDbMPolygon - isPointInsideMPolygon Reliable ?  (Read 9132 times)

0 Members and 1 Guest are viewing this topic.

LE

  • Guest
Re: AcDbMPolygon - isPointInsideMPolygon Reliable ?
« Reply #15 on: June 29, 2007, 10:51:55 pm »
Here is the function ported to C#, HTH

Includes some functions taken from the MgdDbg SLN by Jim Awe from AutoDesk.


Oops... forgot to include this:

Code: [Select]
const Double pi = Math.PI;
public static Double dVal = 0.2;
public static readonly Point3d kOrigin = new Point3d(0.0, 0.0, 0.0);
public static readonly Vector3d kXAxis = new Vector3d(1.0, 0.0, 0.0);
public static readonly Vector3d kYAxis = new Vector3d(0.0, 1.0, 0.0);
public static readonly Vector3d kZAxis = new Vector3d(0.0, 0.0, 1.0);

static Double delta(Double a1, Double a2)
{
    Double ang;
    if (a1 > a2 + pi)
        ang = (a2 + pi + pi) - a1;
    else if (a2 > a1 + pi)
        ang = a2 - a1 - pi - pi;
    else
        ang = a2 - a1;
    return ang;
}
« Last Edit: June 29, 2007, 11:27:10 pm by LE »

bikelink

  • Newt
  • Posts: 98
Re: AcDbMPolygon - isPointInsideMPolygon Reliable ?
« Reply #16 on: June 11, 2010, 05:01:17 am »
very very good.

davidwkj

  • Mosquito
  • Posts: 1
Re: AcDbMPolygon - isPointInsideMPolygon Reliable ?
« Reply #17 on: August 18, 2015, 07:02:00 am »
And after doing the previous function, now I have being able to come up with my own boundary/bpoly command named GETPOLY, if you can, have a look the in progress results... Now I need to know how to pass this new function for C#...

wonderful work! It is really helpful~