コード例 #1
0
ファイル: Plane.cs プロジェクト: samuto/designscript
 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
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public ISolidEntity Trim(IPlaneEntity[] planes, ISurfaceEntity[] surfaces, ISolidEntity[] solids, IPointEntity point)
 {
     return new SolidEntity();
 }
コード例 #7
0
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public IGeometryEntity[] SliceWithPlane(IPlaneEntity plane)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
コード例 #8
0
ファイル: CoordinateHost.cs プロジェクト: RobertiF/Dynamo
 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
ファイル: GeometryFactory.cs プロジェクト: RobertiF/Dynamo
 public ICircleEntity CircleByPlaneRadius(IPlaneEntity plane, double radius) { throw new NotImplementedException(); }
コード例 #11
0
ファイル: PlaneHost.cs プロジェクト: hipigod/Dynamo
 public ILineEntity IntersectWith(IPlaneEntity perpPlane)
 {
     return(new LineEntity());
 }
コード例 #12
0
ファイル: CurveHost.cs プロジェクト: samuto/designscript
 public virtual ICurveEntity ProjectOn(IPlaneEntity plane, IVector direction)
 {
     return new LineEntity();
 }
コード例 #13
0
ファイル: PlaneHost.cs プロジェクト: RobertiF/Dynamo
 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
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public ISolidEntity NonRegularSliceWithPlane(IPlaneEntity plane)
 {
     return new SolidEntity();
 }
コード例 #20
0
ファイル: GeometryFactory.cs プロジェクト: RobertiF/Dynamo
 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
ファイル: CurveHost.cs プロジェクト: samuto/designscript
 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
ファイル: GeometryFactory.cs プロジェクト: RobertiF/Dynamo
 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
ファイル: CurveHost.cs プロジェクト: RobertiF/Dynamo
 public ICurveEntity PullOntoPlane(IPlaneEntity plane)
 {
     throw new NotImplementedException();
 }
コード例 #28
0
 public void Rotate(IPlaneEntity origin, double degrees)
 {
     throw new NotImplementedException();
 }
コード例 #29
0
ファイル: GeometryFactory.cs プロジェクト: hipigod/Dynamo
 public ICoordinateSystemEntity CoordinateSystemByPlane(IPlaneEntity plane)
 {
     throw new NotImplementedException();
 }
コード例 #30
0
ファイル: GeometryFactory.cs プロジェクト: hipigod/Dynamo
 public IEllipseEntity EllipseByPlaneRadii(IPlaneEntity plane, double xAxisRadius, double yAxisRadius)
 {
     throw new NotImplementedException();
 }
コード例 #31
0
ファイル: GeometryFactory.cs プロジェクト: hipigod/Dynamo
 public IRectangleEntity RectangleByWidthHeight(IPlaneEntity plane, double width, double length)
 {
     throw new NotImplementedException();
 }
コード例 #32
0
ファイル: PolygonHost.cs プロジェクト: samuto/designscript
 public IPolygonEntity Trim(IPlaneEntity[] halfSpaces)
 {
     return this;
 }
コード例 #33
0
ファイル: GeometryFactory.cs プロジェクト: hipigod/Dynamo
 public ICircleEntity CircleByPlaneRadius(IPlaneEntity plane, double radius)
 {
     throw new NotImplementedException();
 }
コード例 #34
0
ファイル: CoordinateHost.cs プロジェクト: RobertiF/Dynamo
 public void Rotate(IPlaneEntity origin, double degrees)
 {
     throw new NotImplementedException();
 }
コード例 #35
0
ファイル: SurfaceHost.cs プロジェクト: RobertiF/Dynamo
 public void Split(IPlaneEntity plane, ref ISurfaceEntity[] negativeHalf, ref ISurfaceEntity[] positiveHalf)
 {
     //split complete
 }
コード例 #36
0
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public IGeometryEntity[] SliceWithPlanes(IPlaneEntity[] planeHosts)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
コード例 #37
0
ファイル: SurfaceHost.cs プロジェクト: RobertiF/Dynamo
 public ISurfaceEntity[] Split(IPlaneEntity plane)
 {
     return new ISurfaceEntity[4] { new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity(), new SurfaceEntity() };
 }
コード例 #38
0
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public IGeometryEntity[] IntersectWith(IPlaneEntity geometry)
 {
     return new IGeometryEntity[2] { new GeometryEntity(), new GeometryEntity() };
 }
コード例 #39
0
ファイル: SurfaceHost.cs プロジェクト: RobertiF/Dynamo
 public ISurfaceEntity Trim(ICurveEntity[] curves, IPlaneEntity[] planes, ISurfaceEntity[] surfaces, ISolidEntity[] solids, IPointEntity point, bool bAutoExtend)
 {
     return this;
 }
コード例 #40
0
ファイル: SolidHost.cs プロジェクト: RobertiF/Dynamo
 public ISolidEntity NonRegularSliceWithPlanes(IPlaneEntity[] planes)
 {
     return new SolidEntity();
 }
コード例 #41
0
ファイル: GeometryFactory.cs プロジェクト: RobertiF/Dynamo
 public IEllipseEntity EllipseByPlaneRadii(IPlaneEntity plane, double xAxisRadius, double yAxisRadius) { throw new NotImplementedException(); }