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


C# XYZ.Equals方法代码示例

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


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

示例1: GetEdgesOnPlane

 /// <summary>
 /// Given an array of edges, weeds out any edges
 /// not present on the desired plane
 /// </summary>
 /// <param name="xyzArray">the array of edges </param>
 /// <param name="normal">normal to the desired plane</param>
 /// <returns>edges on the desired plane</returns>
 public static EdgeArray GetEdgesOnPlane(EdgeArray edgeArray, XYZ normal)
 {
     EdgeArray edgesOnPlane = new EdgeArray();
     for (int i = 0; i < edgeArray.Size; i++) {
         IList<XYZ> xyzArray = edgeArray.get_Item(i).Tessellate();
         if (normal.Equals(GeomUtils.kXAxis)) {
             if (xyzArray[0].X == xyzArray[1].X) {
                 edgesOnPlane.Append(edgeArray.get_Item(i));
             }
         }
         if (normal.Equals(GeomUtils.kYAxis)) {
             if (xyzArray[0].Y == xyzArray[1].Y) {
                 edgesOnPlane.Append(edgeArray.get_Item(i));
             }
         }
         if (normal.Equals(GeomUtils.kZAxis)) {
             if (xyzArray[0].Z == xyzArray[1].Z) {
                 edgesOnPlane.Append(edgeArray.get_Item(i));
             }
         }
     }
     return edgesOnPlane;
 }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:30,代码来源:Geometry.cs

示例2: GetEdgesOnPlaneAtOffset

 /// <summary>
 /// Given an array of edges, weeds out any edges
 /// not present at the given offset
 /// </summary>
 /// <param name="edgeArray">the array of edges </param>
 /// <param name="normal">normal to the desired plane</param>
 /// <param name="offset">offset from the plane</param>
 /// <returns>edges on a plane at given offset</returns>
 public static EdgeArray GetEdgesOnPlaneAtOffset(EdgeArray edgeArray, XYZ normal, double offset)
 {
     EdgeArray edgesAtOffset = new EdgeArray();
     edgeArray = GetEdgesOnPlane(edgeArray, normal);
     for (int i = 0; i < edgeArray.Size; i++) {
         IList<XYZ> xyzArray = edgeArray.get_Item(i).Tessellate();
         if (normal.Equals(GeomUtils.kXAxis)) {
             if ((xyzArray[0].X == offset)) {
                 edgesAtOffset.Append(edgeArray.get_Item(i));
             }
         }
         if (normal.Equals(GeomUtils.kYAxis)) {
             if (xyzArray[0].Y == offset) {
                 edgesAtOffset.Append(edgeArray.get_Item(i));
             }
         }
         if (normal.Equals(GeomUtils.kZAxis)) {
             if (xyzArray[0].Z == offset) {
                 edgesAtOffset.Append(edgeArray.get_Item(i));
             }
         }
     }
     return edgesAtOffset;
 }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:32,代码来源:Geometry.cs

示例3: Mirror

        /// <summary>
        /// Given a point, mirrors it along the given axis
        /// </summary>
        /// <param name="point">point to mirror</param>
        /// <param name="axiz">axis to mirror along</param>
        /// <returns>a mirrored point</returns>
        public static XYZ Mirror(XYZ point, XYZ axis)
        {
            XYZ Point = null;
            if (axis.Equals(GeomUtils.kXAxis)) {
                Point = new XYZ(point.X, -point.Y, point.Z);
            }
            if (axis.Equals(GeomUtils.kYAxis)) {
                Point = new XYZ(-point.X, point.Y, point.Z);

            }
            if (axis.Equals(GeomUtils.kZAxis)) {
                Point = new XYZ(point.X, point.Y, -point.Z);

            }
            return Point;
        }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:22,代码来源:Geometry.cs

示例4: GetClosestPt

        /// <summary>
        /// given an array of pts, find the closest
        /// pt to a given pt
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="pts"></param>
        /// <returns></returns>
        public static XYZ GetClosestPt(XYZ pt, System.Collections.Generic.IList<XYZ> pts)
        {
            XYZ closestPt = new XYZ();
            Double closestDist = 0.0;

            foreach( XYZ ptTemp in pts )
            {
                /// don't consider the pt itself
                if (pt.Equals(ptTemp))
                    continue;

                Double dist = Math.Sqrt(Math.Pow((pt.X - ptTemp.X), 2.0) +
                    Math.Pow((pt.Y - ptTemp.Y), 2.0) +
                    Math.Pow((pt.Z - ptTemp.Z), 2.0));

                if (closestPt.IsZeroLength()) {
                    closestDist = dist;
                    closestPt = ptTemp;
                }
                else {
                    if (dist < closestDist) {
                        closestDist = dist;
                        closestPt = ptTemp;
                    }
                }
            }
            return closestPt;
        }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:35,代码来源:GeomUtils.cs

示例5: Greater

        /// <summary>
        /// Given two points and an axis, returns the 
        /// point with the greater value along the axis
        /// </summary>
        /// <param name="pt1">point 1 to compare</param>
        /// <param name="pt2">point 2 to compare</param>
        /// <param name="axis">axis to compare along</param>
        /// <returns></returns>
        public static XYZ Greater(XYZ pt1, XYZ pt2, XYZ axis)
        {
            XYZ pt = new XYZ();

            if(axis.Equals(kXAxis)){
                if (pt1.X > pt2.X)
                    pt = pt1;
                else
                    pt = pt2;
            }
            if (axis.Equals(kYAxis)) {
                if (pt1.Y > pt2.Y)
                    pt = pt1;
                else
                    pt = pt2;
            }
            if (axis.Equals(kZAxis)) {
                if (pt1.Z > pt2.Z)
                    pt = pt1;
                else
                    pt = pt2;
            }

            return pt;
        }
开发者ID:jeremytammik,项目名称:RevitLookup,代码行数:33,代码来源:GeomUtils.cs


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