Exemplo n.º 1
0
 public static bool IsPointInLineOrExtend(Line line, XYZ point)
 {
     if (GeomUtil.IsEqual(point, line.GetEndPoint(0)) || GeomUtil.IsEqual(point, line.GetEndPoint(1)))
     {
         return(true);
     }
     if (GeomUtil.IsSameOrOppositeDirection(GeomUtil.SubXYZ(point, line.GetEndPoint(0)), GeomUtil.SubXYZ(point, line.GetEndPoint(1))))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 private void GetPositionType()
 {
     if (GeomUtil.IsSameOrOppositeDirection(polygon.Normal, multiPolygon.Normal))
     {
         if (multiPolygon.SurfacePolygon.CheckXYZPointPosition(polygon.ListXYZPoint[0]) != PointComparePolygonResult.NonPlanar)
         {
             PositionType = PolygonCompareMultiPolygonPositionType.Planar;
             return;
         }
         PositionType = PolygonCompareMultiPolygonPositionType.Parallel; return;
     }
     PositionType = PolygonCompareMultiPolygonPositionType.NonPlarnar; return;
 }
Exemplo n.º 3
0
        public static void CreateModelLine(Document doc, SketchPlane sp, Curve c)
        {
            if (sp != null)
            {
                doc.Create.NewModelCurve(c, sp);
                return;
            }
            if (GeomUtil.IsSameOrOppositeDirection(GetDirection(c), XYZ.BasisZ))
            {
                sp = SketchPlane.Create(doc, Plane.CreateByOriginAndBasis(c.GetEndPoint(0), XYZ.BasisZ, XYZ.BasisX));
                CreateModelLine(doc, sp, c);
                return;
            }
            XYZ vecY = GetDirection(c).CrossProduct(XYZ.BasisZ);

            sp = SketchPlane.Create(doc, Plane.CreateByOriginAndBasis(c.GetEndPoint(0), GeomUtil.UnitVector(GetDirection(c)), GeomUtil.UnitVector(vecY)));
            CreateModelLine(doc, sp, c);
            return;
        }