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


C# Line.MinimumDistanceTo方法代码示例

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


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

示例1: Planeness

 public double Planeness(Point3d p1, Point3d p2, Point3d p3, Point3d p4)
 {
     Line l1 = new Line(p1, p3);
     Line l2 = new Line(p2, p4);
     return l1.MinimumDistanceTo(l2);
 }
开发者ID:panhao4812,项目名称:MeshClassLibrary,代码行数:6,代码来源:MeshCreation.cs

示例2: Reduce_RecursiveComponent

    private static void Reduce_RecursiveComponent(Point3d[] P, bool[] vertex_map, double tolerance, int A, int B)
    {
      //Abort if there is nothing left to collapse.
      if (B <= (A + 1)) { return; }

      // Create basis segment.E
      Line segment = new Line(P[A], P[B]);

      double max_d = 0.0;
      int max_i = A;

      // Iterate over remaining points in subset and find furthest point.
      for (int i = A + 1; i < B; i++)
      {
        double loc_d = segment.MinimumDistanceTo(P[i]);
        if (loc_d > max_d)
        {
          max_d = loc_d;
          max_i = i;
        }
      }

      if (max_d > tolerance)
      {
        vertex_map[max_i] = true;

        Reduce_RecursiveComponent(P, vertex_map, tolerance, A, max_i);
        Reduce_RecursiveComponent(P, vertex_map, tolerance, max_i, B);
      }
    }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:30,代码来源:opennurbs_polyline.cs

示例3: checkCoplanarity

        public List<double> checkCoplanarity(SpringMesh sMesh, double thickness, List<Line> linesUp, List<Line> linesDown)
        {
            List<double> coplanarity = new List<double>();

            foreach (Edge edge in sMesh.Edges)
            {
                if (edge.SecondTriangleIndex >= 0)
                {
                    int triLeft = edge.FirstTriangleIndex;
                    int triRight = edge.SecondTriangleIndex;

                    //Point3d centreLeft = sMesh.ComputeTriangleCenter(triLeft);
                    //Point3d centreRight = sMesh.ComputeTriangleCenter(triRight);

                    Point3d centreLeft = sMesh.ComputeCircumscribedCircleCenter(triLeft);
                    Point3d centreRight = sMesh.ComputeCircumscribedCircleCenter(triRight);

                    Vector3d normalLeft = sMesh.ComputeTriangleNormal(triLeft);
                    Vector3d normalRight = sMesh.ComputeTriangleNormal(triRight);

                    Point3d centreLeftUp = centreLeft + normalLeft * thickness;
                    Point3d centreRightUp = centreRight + normalRight * thickness;

                    Point3d centreLeftDown = centreLeft - normalLeft * thickness;
                    Point3d centreRightDown = centreRight - normalRight * thickness;

                    linesUp.Add(new Line(centreLeftUp, centreRightUp));
                    linesDown.Add(new Line(centreLeftDown, centreRightDown));

                    Line planarCheckLine01 = new Line(centreLeftUp, centreRightDown);
                    Line planarCheckLine02 = new Line(centreRightUp, centreLeftDown);

                    double dist = planarCheckLine01.MinimumDistanceTo(planarCheckLine02);
                    coplanarity.Add(dist);
                }
            }
            return coplanarity;
        }
开发者ID:GeneKao,项目名称:Pavilion2015_ITECH,代码行数:38,代码来源:GHC_DualLoopDoubleLayerExperimental.cs


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