當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。