public override bool shoot(Hare.Geometry.Ray R, int top_id, out Hare.Geometry.X_Event X)
 {
     if (SP.Shoot(R, top_id, out X))
     {
         return(true);
     }
     return(false);
 }
            public override bool shoot(Hare.Geometry.Ray R, out double u, out double v, out int Poly_ID, out List <Hare.Geometry.Point> X_PT, out List <double> t, out List <int> code)
            {
                ///////////////////////
                //double L2 = (R.direction.x * R.direction.x + R.direction.y * R.direction.y + R.direction.z *R.direction.z);
                //if (L2 > 1.05 || L2 < 0.95)
                //{
                //    Rhino.RhinoApp.Write("Vectors have lost normalization...");
                //}
                ///////////////////////
                //R.direction.Normalize();
                ///////////////////////
                Hare.Geometry.X_Event X = new Hare.Geometry.X_Event();
                if (SP.Shoot(R, 0, out X))
                {
                    Poly_ID = X.Poly_id;
                    X_Event_NH XNH = X as X_Event_NH;
                    if (XNH != null)
                    {
                        X_PT = XNH.P_Points;
                        t    = XNH.t_trav;
                        code = XNH.SPCode;
                    }
                    else
                    {
                        X_PT = new List <Hare.Geometry.Point> {
                            X.X_Point
                        };
                        t = new List <double> {
                            X.t
                        };
                        code = new List <int> {
                            0
                        };
                    }

                    u = 0;
                    v = 0;
                    return(true);
                }
                Poly_ID = 0;
                X_PT    = new List <Hare.Geometry.Point>();
                //Rhino.RhinoDoc.ActiveDoc.Objects.Add(new Rhino.Geometry.LineCurve(Utilities.PachTools.HPttoRPt(R.origin), Utilities.PachTools.HPttoRPt(R.origin + R.direction)));
                t    = new List <double>();
                u    = 0;
                v    = 0;
                code = new List <int>()
                {
                    0
                };
                return(false);
            }
 public override bool shoot(Hare.Geometry.Ray R, out double u, out double v, out int Poly_ID, out Hare.Geometry.Point X_PT, out double t)
 {
     Hare.Geometry.X_Event X = new Hare.Geometry.X_Event();
     if (SP.Shoot(R, 0, out X))
     {
         Poly_ID = X.Poly_id;
         X_PT    = X.X_Point;
         t       = X.t;
         u       = 0;
         v       = 0;
         return(true);
     }
     Poly_ID = 0;
     X_PT    = new Hare.Geometry.Point();
     //Rhino.RhinoDoc.ActiveDoc.Objects.Add(new Rhino.Geometry.LineCurve(Utilities.PachTools.HPttoRPt(R.origin), Utilities.PachTools.HPttoRPt(R.origin + R.direction)));
     t = 0;
     u = 0;
     v = 0;
     return(false);
 }
 /// <summary>
 /// cast a ray within the model.
 /// </summary>
 /// <param name="R">A ray, complete with origin point and direction...</param>
 /// <param name="u">optional surface coordinate</param>
 /// <param name="v">optional surface coordinate</param>
 /// <param name="Poly_ID">the polygon of intersection</param>
 /// <param name="X_PT">the point of intersection</param>
 /// <param name="t">the distance traveled by the ray</param>
 /// <returns>true if successful, false if no hit</returns>
 public abstract bool shoot(Hare.Geometry.Ray R, out double u, out double v, out int Poly_ID, out Hare.Geometry.Point X_PT, out double t);