Пример #1
0
 private Plane(IPlaneEntity entity, double size, bool display = false)
     : base(entity, false)
 {
     InitializeGuaranteedProperties();
     if (display && size>1)
         mDisplayPolygon = CreatePlaneVisuals(size,true);
 }
Пример #2
0
 private Plane(IPlaneEntity entity, double size, bool display = false)
     : base(entity, false)
 {
     InitializeGuaranteedProperties();
     if (display && size > 1)
     {
         mDisplayPolygon = CreatePlaneVisuals(size, true);
     }
 }
Пример #3
0
        private static ILineEntity GetPerpBisector(Point startPt, Point endPt,
                                                   IPlaneEntity planeOfCircle)
        {
            Vector dir = startPt.DirectionTo(endPt);

            dir = dir.Normalize();

            IPointEntity midPt = HostFactory.Factory.CreatePoint((startPt.X + endPt.X) / 2, (startPt.Y + endPt.Y) / 2, (startPt.Z + endPt.Z) / 2);

            //  get the perpendicular plane to plane of circle at mid point of segment[startPt, endPt]
            //
            IPlaneEntity perpPlane = HostFactory.Factory.PlaneByOriginNormal(midPt, dir.IVector);

            //  this intersection results in line perp to segment[startPt, endPt] & plane normal
            //  and happens to be the perpBisector of mentioned segment in planeOfCircle
            //
            ILineEntity perpBisector = planeOfCircle.IntersectWith(perpPlane);

            return(perpBisector);
        }
Пример #4
0
        private static Point GetCircumCenter(Point firstPt, Point secondPt, Point thirdPt, Vector normal)
        {
            var one = firstPt.PointEntity;
            var two = secondPt.PointEntity;
            var thr = thirdPt.PointEntity;

            using (IPlaneEntity planeOfCircle = HostFactory.Factory.PlaneByOriginNormal(one, normal.IVector))
            {
                using (ILineEntity perpBisector1 = GetPerpBisector(firstPt, secondPt, planeOfCircle))
                {
                    using (ILineEntity perpBisector2 = GetPerpBisector(secondPt, thirdPt, planeOfCircle))
                    {
                        IPointEntity[] circumCntr = perpBisector1.IntersectWith(perpBisector2);
                        if (circumCntr == null || circumCntr.Length < 1)
                        {
                            return(null);
                        }
                        return(circumCntr[0].ToPoint(false, null));
                    }
                }
            }
        }
Пример #5
0
        private static IPlaneEntity ByOriginNormalCore(Point origin, ref Vector normal, double size)
        {
            if (origin == null)
            {
                throw new ArgumentNullException("origin");
            }
            else if (normal == null)
            {
                throw new ArgumentNullException("normal");
            }
            else if (normal.IsZeroVector())
            {
                throw new ArgumentException(string.Format(Properties.Resources.IsZeroVector, normal), "normal");
            }

            normal = normal.IsNormalized ? normal : normal.Normalize();
            IPlaneEntity entity = HostFactory.Factory.PlaneByOriginNormal(origin.PointEntity, normal.IVector);

            if (null == entity)
            {
                throw new System.Exception(string.Format(Properties.Resources.OperationFailed, "Plane.ByOriginNormal"));
            }
            return(entity);
        }
Пример #6
0
 public ISolidEntity Trim(IPlaneEntity[] planes, ISurfaceEntity[] surfaces, ISolidEntity[] solids, IPointEntity point)
 {
     return new SolidEntity();
 }
Пример #7
0
 public IGeometryEntity[] SliceWithPlane(IPlaneEntity plane)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
Пример #8
0
 public ICoordinateSystemEntity Mirror(IPlaneEntity mirror_plane)
 {
     throw new NotImplementedException();
 }
Пример #9
0
 public void Split(IPlaneEntity plane, ref ISurfaceEntity[] negativeHalf, ref ISurfaceEntity[] positiveHalf)
 {
     //split complete
 }
Пример #10
0
 public ICircleEntity CircleByPlaneRadius(IPlaneEntity plane, double radius) { throw new NotImplementedException(); }
Пример #11
0
 public ILineEntity IntersectWith(IPlaneEntity perpPlane)
 {
     return(new LineEntity());
 }
Пример #12
0
 public virtual ICurveEntity ProjectOn(IPlaneEntity plane, IVector direction)
 {
     return new LineEntity();
 }
Пример #13
0
 public ILineEntity IntersectWith(IPlaneEntity perpPlane)
 {
     return new LineEntity();
 }
Пример #14
0
 public ISolidEntity NonRegularSliceWithPlane(IPlaneEntity plane)
 {
     return(new SolidEntity());
 }
Пример #15
0
 public IGeometryEntity[] IntersectWith(IPlaneEntity geometry)
 {
     return(new IGeometryEntity[2] {
         new GeometryEntity(), new GeometryEntity()
     });
 }
Пример #16
0
 public IGeometryEntity[] SliceWithPlane(IPlaneEntity plane)
 {
     return(new IGeometryEntity[2] {
         new GeometryEntity(), new GeometryEntity()
     });
 }
Пример #17
0
 public ICurveEntity PullOntoPlane(IPlaneEntity plane)
 {
     throw new NotImplementedException();
 }
Пример #18
0
 public ISurfaceEntity[] Split(IPlaneEntity plane)
 {
     return(new ISurfaceEntity[4] {
         new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity()
     });
 }
Пример #19
0
 public ISolidEntity NonRegularSliceWithPlane(IPlaneEntity plane)
 {
     return new SolidEntity();
 }
Пример #20
0
 public IRectangleEntity RectangleByWidthHeight(IPlaneEntity plane, double width, double length) { throw new NotImplementedException(); }
Пример #21
0
 public virtual ICurveEntity ProjectOn(IPlaneEntity plane, IVector direction)
 {
     return(new LineEntity());
 }
Пример #22
0
 public virtual IGeometryEntity[] IntersectWith(IPlaneEntity plane)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
Пример #23
0
 public ICoordinateSystemEntity Mirror(IPlaneEntity mirror_plane)
 {
     throw new NotImplementedException();
 }
Пример #24
0
 public ICoordinateSystemEntity CoordinateSystemByPlane(IPlaneEntity plane) { throw new NotImplementedException(); }
Пример #25
0
 internal static Plane ToPlane(this IPlaneEntity host, bool persist, Geometry context)
 {
     return(host.ToGeometry <Plane, IPlaneEntity>(persist, context));
 }
Пример #26
0
 public virtual IGeometryEntity[] IntersectWith(IPlaneEntity plane)
 {
     return(new IGeometryEntity[2] {
         new GeometryEntity(), new GeometryEntity()
     });
 }
Пример #27
0
 public ICurveEntity PullOntoPlane(IPlaneEntity plane)
 {
     throw new NotImplementedException();
 }
Пример #28
0
 public void Rotate(IPlaneEntity origin, double degrees)
 {
     throw new NotImplementedException();
 }
Пример #29
0
 public ICoordinateSystemEntity CoordinateSystemByPlane(IPlaneEntity plane)
 {
     throw new NotImplementedException();
 }
Пример #30
0
 public IEllipseEntity EllipseByPlaneRadii(IPlaneEntity plane, double xAxisRadius, double yAxisRadius)
 {
     throw new NotImplementedException();
 }
Пример #31
0
 public IRectangleEntity RectangleByWidthHeight(IPlaneEntity plane, double width, double length)
 {
     throw new NotImplementedException();
 }
Пример #32
0
 public IPolygonEntity Trim(IPlaneEntity[] halfSpaces)
 {
     return this;
 }
Пример #33
0
 public ICircleEntity CircleByPlaneRadius(IPlaneEntity plane, double radius)
 {
     throw new NotImplementedException();
 }
Пример #34
0
 public void Rotate(IPlaneEntity origin, double degrees)
 {
     throw new NotImplementedException();
 }
Пример #35
0
 public void Split(IPlaneEntity plane, ref ISurfaceEntity[] negativeHalf, ref ISurfaceEntity[] positiveHalf)
 {
     //split complete
 }
Пример #36
0
 public IGeometryEntity[] SliceWithPlanes(IPlaneEntity[] planeHosts)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
Пример #37
0
 public ISurfaceEntity[] Split(IPlaneEntity plane)
 {
     return new ISurfaceEntity[4] { new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity() };
 }
Пример #38
0
 public IGeometryEntity[] IntersectWith(IPlaneEntity geometry)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
Пример #39
0
 public ISurfaceEntity Trim(ICurveEntity[] curves, IPlaneEntity[] planes, ISurfaceEntity[] surfaces, ISolidEntity[] solids, IPointEntity point, bool bAutoExtend)
 {
     return this;
 }
Пример #40
0
 public ISolidEntity NonRegularSliceWithPlanes(IPlaneEntity[] planes)
 {
     return new SolidEntity();
 }
Пример #41
0
 public IEllipseEntity EllipseByPlaneRadii(IPlaneEntity plane, double xAxisRadius, double yAxisRadius) { throw new NotImplementedException(); }