当前位置: 首页>>代码示例>>C#>>正文


C# Edge.Tessellate方法代码示例

本文整理汇总了C#中System.Edge.Tessellate方法的典型用法代码示例。如果您正苦于以下问题:C# Edge.Tessellate方法的具体用法?C# Edge.Tessellate怎么用?C# Edge.Tessellate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Edge的用法示例。


在下文中一共展示了Edge.Tessellate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Stream

        private void Stream(ArrayList data, Edge edge)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(Edge)));

             // Curve Type
             {
            string curveType = "None";
            if (edge.AsCurve() != null)
            {
               Curve crv = edge.AsCurve();
               if (crv is Arc)
                  curveType = "Arc";
               else if (crv is CylindricalHelix)
                  curveType = "CylindricalHelix";
               else if (crv is Ellipse)
                  curveType = "Ellipse";
               else if (crv is HermiteSpline)
                  curveType = "HermiteSpline";
               else if (crv is Line)
                  curveType = "Line";
               else if (crv is NurbSpline)
                  curveType = "NurbSpline";
            }
            data.Add(new Snoop.Data.String("Curve Type", curveType));
             }

             try
             {
            data.Add(new Snoop.Data.Object("Curve", edge.AsCurve()));
             }
             catch (System.Exception ex)
             {
            data.Add(new Snoop.Data.Exception("Curve", ex));
             }

             try
             {
               data.Add(new Snoop.Data.Object("Start point reference", edge.GetEndPointReference(0)));
             }
             catch (System.Exception ex)
             {
            data.Add(new Snoop.Data.Exception("Start point reference", ex));
             }

            try
            {
                data.Add(new Snoop.Data.Object("End point reference", edge.GetEndPointReference(1)));
            }
            catch (System.Exception ex)
            {
                data.Add(new Snoop.Data.Exception("End point reference", ex));
            }

            data.Add(new Snoop.Data.Object("Reference", edge.Reference));
            data.Add(new Snoop.Data.Double("Approximate length", edge.ApproximateLength));
            data.Add(new Snoop.Data.Object("Face [0]", edge.GetFace(0)));
            data.Add(new Snoop.Data.Object("Face [1]", edge.GetFace(1)));

            data.Add(new Snoop.Data.CategorySeparator("Tesselated Points"));

            System.Collections.Generic.IList<XYZ> pts = edge.Tessellate();
            int i = 0;
            foreach (XYZ pt in pts)
            {
                data.Add(new Snoop.Data.Xyz(string.Format("PT [{0:d}]", i++), pt));
            }

            // TBD: not sure how to use these yet...
            // TesselateOnFace ??
        }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:70,代码来源:CollectorExtGeom.cs

示例2: IsVerticalEdge

        /// <summary>
        /// Determines whether a edge is vertical.
        /// </summary>
        /// <param name="edge">The edge to be determined.</param>
        /// <returns>Return true if this edge is vertical, or else return false.</returns>
        public static bool IsVerticalEdge(Edge edge)
        {
            List<XYZ> polyline = edge.Tessellate() as List<XYZ>;
            Autodesk.Revit.DB.XYZ verticalVct = new Autodesk.Revit.DB.XYZ (0, 0, 1);
            Autodesk.Revit.DB.XYZ pointBuffer = polyline[0];

            for (int i = 1; i < polyline.Count; i = i + 1)
            {
                Autodesk.Revit.DB.XYZ temp = polyline[i];
                Autodesk.Revit.DB.XYZ vector = GetVector(pointBuffer, temp);
                if (Equal(vector, verticalVct))
                {
                    return true;
                }
                else
                {
                    continue;
                }
            }
            return false;
        }
开发者ID:AMEE,项目名称:revit,代码行数:26,代码来源:GeoHelper.cs

示例3: EdgeBinding

 /// <summary>
 /// Constructor takes Edge as parameter.
 /// </summary>
 /// <param name="edge">Edge</param>
 public EdgeBinding(Edge edge)
 {
     m_points = edge.Tessellate();
     m_pen = new Pen(System.Drawing.Color.White);
     Reset();
 }
开发者ID:AMEE,项目名称:revit,代码行数:10,代码来源:ElementGeometry.cs

示例4: Stream

        public virtual void Stream(Edge edge)
        {
            IList<XYZ> ptArray = edge.Tessellate();

            int len = ptArray.Count;
            for (int i=0; i < (len - 1); i++) {
                Stream(ptArray[i], ptArray[i + 1]);
            }
        }
开发者ID:halad,项目名称:RevitLookup,代码行数:9,代码来源:GraphicsStream.cs

示例5: IsLinesParallel

 /// <summary>
 /// check whether 2 edges are parallel
 /// </summary>
 /// <param name="edgeA">
 /// the edge to be checked
 /// </param>
 /// <param name="edgeB">
 /// the edge to be checked
 /// </param>
 /// <returns>
 /// if they're parallel, return true; otherwise false
 /// </returns>
 private bool IsLinesParallel(Edge edgeA, Edge edgeB)
 {
     List<XYZ> pointsA = edgeA.Tessellate() as List<XYZ>;
      List<XYZ> pointsB = edgeB.Tessellate() as List<XYZ>;
      Autodesk.Revit.DB.XYZ vectorA = pointsA[1] - pointsA[0];
      Autodesk.Revit.DB.XYZ vectorB = pointsB[1] - pointsB[0];
      Utility.Vector4 vec4A = new Utility.Vector4(vectorA);
      Utility.Vector4 vec4B = new Utility.Vector4(vectorB);
      return IsLinesParallel(vec4A, vec4B);
 }
开发者ID:AMEE,项目名称:revit,代码行数:22,代码来源:MassChecker.cs

示例6: ComputeCrossProduct

 /// <summary>
 /// compute the cross product of 2 edges
 /// </summary>
 /// <param name="edgeA">
 /// the edge for the cross product
 /// </param>
 /// <param name="edgeB">
 /// the edge for the cross product
 /// </param>
 /// <returns>
 /// the cross product of 2 edges
 /// </returns>
 private Utility.Vector4 ComputeCrossProduct(Edge edgeA, Edge edgeB)
 {
     List<XYZ> pointsA = edgeA.Tessellate() as List<XYZ>;
      List<XYZ> pointsB = edgeB.Tessellate() as List<XYZ>;
      Autodesk.Revit.DB.XYZ vectorA = pointsA[1] - pointsA[0];
      Autodesk.Revit.DB.XYZ vectorB = pointsB[1] - pointsB[0];
      Utility.Vector4 vec4A = new Utility.Vector4(vectorA);
      Utility.Vector4 vec4B = new Utility.Vector4(vectorB);
      return Utility.Vector4.CrossProduct(vec4A, vec4B);
 }
开发者ID:AMEE,项目名称:revit,代码行数:22,代码来源:MassChecker.cs


注:本文中的System.Edge.Tessellate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。