Ejemplo n.º 1
0
 public static Rhino.Geometry.Point3f Lerp(Rhino.Geometry.Point3f p0, Rhino.Geometry.Point3f p1, double amount)
 {
     return(new Rhino.Geometry.Point3f(
                Lerp(p0.X, p1.X, (float)amount),
                Lerp(p0.Y, p1.Y, (float)amount),
                Lerp(p0.Z, p1.Z, (float)amount)
                ));
 }
Ejemplo n.º 2
0
        /***************************************************/

        public static bool IsEqual(this BHG.Point bhPoint, RHG.Point3f rhPoint, double tolerance = BHG.Tolerance.Distance)
        {
            if (bhPoint == null & rhPoint == default(RHG.Point3f))
            {
                return(true);
            }

            return(Math.Abs(bhPoint.X - rhPoint.X) < tolerance &&
                   Math.Abs(bhPoint.Y - rhPoint.Y) < tolerance &&
                   Math.Abs(bhPoint.Z - rhPoint.Z) < tolerance);
        }
Ejemplo n.º 3
0
 public static Vector3 ToVector3(this rg.Point3f pt)
 {
     return(new Vector3(pt.X, pt.Y, pt.Z));
 }
 public static Vector3 Point3fToVector3(Rhino.Geometry.Point3f pf)
 {
     return(new Vector3(pf.X, pf.Z, pf.Y));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns a Windows Point from a Rhino.Geometry.Point3f
 /// </summary>
 /// <param name="input">Rhinocommon Point3f</param>
 /// <returns>System Windows Point</returns>
 public static Sw.Point ToWindowsPoint(this Rg.Point3f input)
 {
     return(new Sw.Point(input.X, input.Y));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sums up a point and a vector, and returns a new point.
 /// <para>(Provided for languages that do not support operator overloading. You can use the + operator otherwise)</para>
 /// </summary>
 /// <param name="point">A point.</param>
 /// <param name="vector">A vector.</param>
 /// <returns>A new point that results from the addition of point and vector.</returns>
 public static Point3f Add(Point3f point, Vector3f vector)
 {
     return(new Point3f(point.m_x + vector.m_x, point.m_y + vector.m_y, point.m_z + vector.m_z));
 }
Ejemplo n.º 7
0
        /***************************************************/

        public static BHG.Point FromRhino(this RHG.Point3f rhinoPoint)
        {
            return(new BHG.Point {
                X = rhinoPoint.X, Y = rhinoPoint.Y, Z = rhinoPoint.Z
            });
        }