public MyCircle(MyVector3 c, double r, MyVector3 n, int sample = 100)
 {
     center      = c;
     radius      = r;
     belongPlane = new MyPlane(c, n);
     normal      = belongPlane.Normal();
     ComputeArea();
     SampleCirclePoints3d(c, belongPlane.Normal(), r, sample);
 }
 public MyCircle(MyVector3 c, double r, MyPlane p, int sample = 100)
 {
     center      = c;
     radius      = r;
     normal      = p.Normal();
     belongPlane = p;
     ComputeArea();
     SampleCirclePoints3d(c, p.Normal(), r, sample);
 }
예제 #3
0
 public MyPolygon(MyVector3 v0, MyVector3 v1, MyPlane p)
 {
     normal      = p.Normal();
     belongPlane = p;
     cornerPoints3d.Add(v0);
     cornerPoints3d.Add(v1);
 }
 public MyCircle(MyVector3 c, double r, MyPlane p, List <MyVector3> cp)
 {
     center         = c;
     radius         = r;
     normal         = p.Normal();
     belongPlane    = p;
     circlePoints3d = cp;
     ComputeArea();
 }
예제 #5
0
        public MyPolygon(MyVector3 c, MyPlane p, List <MyVector3> corners)
        {
            normal      = p.Normal();
            origin      = corners.First();
            belongPlane = p;
            BuildLocalFrame();
            center = c;
            double width = (corners[3] - corners[0]).Length();
            double depth = (corners[1] - corners[0]).Length();

            cornerPoints3d.AddRange(corners);
            ComputeArea();
        }
        public static bool IsParallel(MyPlane p1, MyPlane p2, double angle = 5)
        {
            MyVector3 _v1 = p1.Normal();
            MyVector3 _v2 = p2.Normal();

            if (Math.Abs(_v1.Dot(_v2) / (_v1.Length() * _v2.Length())) >= Math.Cos(angle * Math.PI / 180))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #7
0
 public MyPolygon(MyPlane p, List <MyVector3> slice_points)
 {
     normal      = p.Normal();
     belongPlane = p;
     slicePoints3d.AddRange(slice_points);
 }
예제 #8
0
 public MyPolygon(MyPlane p)
 {
     normal      = p.Normal();
     belongPlane = p;
 }