SketchPlane NewSketchPlanePassLine(
            Line line)
        {
            XYZ p = line.GetEndPoint( 0 );
              XYZ q = line.GetEndPoint( 1 );
              XYZ norm;
              if( p.X == q.X )
              {
            norm = XYZ.BasisX;
              }
              else if( p.Y == q.Y )
              {
            norm = XYZ.BasisY;
              }
              else
              {
            norm = XYZ.BasisZ;
              }
              Plane plane = _creapp.NewPlane( norm, p );

              //return _credoc.NewSketchPlane( plane ); // 2013

              return SketchPlane.Create( _doc, plane ); // 2014
        }
Example #2
0
        public virtual void StreamWcs(Line line)
        {
            if (line.IsBound == false) {
                Debug.Assert(false);
                return;
            }

            StreamWcs(line.GetEndPoint(0), line.GetEndPoint(1));
        }
Example #3
0
        private bool AreLinesEqual(Line line1, Line line2)
        {
            for (int ii = 0; ii < 2; ii++)
            {
                if (line1.GetEndPoint(0).IsAlmostEqualTo(line2.GetEndPoint(ii)) &&
                    line1.GetEndPoint(1).IsAlmostEqualTo(line2.GetEndPoint(1-ii)))
                    return true;
            }

            return false;
        }
        Stream(Line line)
        {
            if (line.IsBound == false) {
                Debug.Assert(false);
                return;
            }

            Stream(line.GetEndPoint(0), line.GetEndPoint(1));
        }
      private bool AreLinesEqual(Line line1, Line line2)
      {
         if (!line1.IsBound || !line2.IsBound)
         {
            // Two unbound lines are equal if they are going in the same direction and the origin
            // of one lies on the other one.
            return line1.Direction.IsAlmostEqualTo(line2.Direction) &&
               MathUtil.IsAlmostZero(line1.Project(line2.Origin).Distance);
         }

         for (int ii = 0; ii < 2; ii++)
         {
            if (line1.GetEndPoint(0).IsAlmostEqualTo(line2.GetEndPoint(ii)) &&
                line1.GetEndPoint(1).IsAlmostEqualTo(line2.GetEndPoint(1 - ii)))
               return true;
         }

         return false;
      }