Exemple #1
0
        public bool IsInclude(sg_Vector3 pt, out double pathlength)
        {
            pathlength = 0;
            if (!(_box.contain(pt)))
            {
                return(false);
            }

            double l1 = sg_math.getDist(_pt1, pt);
            double l2 = sg_math.getDist(pt, _pt2);

            double d = getDistToPoint(l1, l2);

            if (sg_math.isZero(d))
            {
                if ((_l > l1 && _l > l2) ||
                    (sg_math.isEquel(l1, _l) && sg_math.isEquel(0.0, l2)) ||
                    (sg_math.isEquel(l2, _l) && sg_math.isEquel(0.0, l1)))
                {
                    pathlength = l1;
                    return(true);
                }
            }
            return(false);
        }
Exemple #2
0
        public bool IsInclude(sg_Vector3 pt, out double pathlength)
        {
            pathlength = 0;
            if (!_box.contain(pt))
            {
                return(false);
            }
            double l = 0;


            for (int i = 0; i < _lines.Count; i++)
            {
                sg_line line = _lines[i];
                if (line.IsInclude(pt, out l))
                {
                    pathlength = pathlength + l;
                    return(true);
                }
                else
                {
                    pathlength = pathlength + line.getLength();
                }
            }
            return(false);
        }