Exemplo n.º 1
0
        /***************************************************/

        public static oM.Geometry.ICurve FromRevit(this Arc curve)
        {
            if (curve == null)
            {
                return(null);
            }

            if (!curve.IsBound)
            {
                return(new oM.Geometry.Circle {
                    Centre = curve.Center.PointFromRevit(), Normal = curve.Normal.VectorFromRevit().Normalise(), Radius = curve.Radius.ToSI(UnitType.UT_Length)
                });
            }

            BH.oM.Geometry.CoordinateSystem.Cartesian cs = BH.Engine.Geometry.Create.CartesianCoordinateSystem(curve.Center.PointFromRevit(), curve.XDirection.VectorFromRevit(), curve.YDirection.VectorFromRevit());

            double startAngle = curve.XDirection.AngleOnPlaneTo(curve.GetEndPoint(0) - curve.Center, curve.Normal);
            double endAngle   = curve.XDirection.AngleOnPlaneTo(curve.GetEndPoint(1) - curve.Center, curve.Normal);

            if (startAngle > endAngle)
            {
                startAngle -= 2 * Math.PI;
            }

            return(new oM.Geometry.Arc {
                CoordinateSystem = cs, Radius = curve.Radius.ToSI(UnitType.UT_Length), StartAngle = startAngle, EndAngle = endAngle
            });
        }
Exemplo n.º 2
0
        /***************************************************/

        public static void RenderWires(BHG.CoordinateSystem.Cartesian coordinateSystem, Rhino.Display.DisplayPipeline pipeline, Color bhColour)
        {
            pipeline.DrawConstructionPlane(new Rhino.DocObjects.ConstructionPlane()
            {
                Plane = (coordinateSystem.ToRhino()), ThickLineColor = bhColour, ThinLineColor = Color.Black, GridLineCount = 10
            });
        }
Exemplo n.º 3
0
        /***************************************************/
        /**** Public Methods  - Curves                  ****/
        /***************************************************/

        public static BHG.Arc FromRhino(this RHG.Arc arc)
        {
            BHG.CoordinateSystem.Cartesian system = arc.Plane.FromRhino();

            return(new BHG.Arc {
                CoordinateSystem = system, StartAngle = arc.StartAngle, EndAngle = arc.EndAngle, Radius = arc.Radius
            });
        }
Exemplo n.º 4
0
        /***************************************************/

        public static RHG.Plane ToRhino(this BHG.CoordinateSystem.Cartesian coordinateSystem)
        {
            if (coordinateSystem == null)
            {
                return(default(RHG.Plane));
            }

            return(new RHG.Plane(coordinateSystem.Origin.ToRhino(), coordinateSystem.X.ToRhino(), coordinateSystem.Y.ToRhino()));
        }
Exemplo n.º 5
0
        /***************************************************/

        public static bool IsEqual(this BHG.CoordinateSystem.Cartesian bhCoordinates, RHG.Plane rhPlane, double tolerance = BHG.Tolerance.Distance)
        {
            if (bhCoordinates == null & rhPlane == default(RHG.Plane))
            {
                return(true);
            }

            return(bhCoordinates.Origin.IsEqual(rhPlane.Origin, tolerance) &&
                   bhCoordinates.X.IsEqual(rhPlane.XAxis) &&
                   bhCoordinates.Y.IsEqual(rhPlane.YAxis) &&
                   bhCoordinates.Z.IsEqual(rhPlane.ZAxis));
        }
Exemplo n.º 6
0
        /***************************************************/

        public static void RenderMeshes(BHG.CoordinateSystem.Cartesian coordinateSystem, Rhino.Display.DisplayPipeline pipeline, DisplayMaterial material)
        {
            return;
        }