Exemplo n.º 1
0
        //--------------------------------------------------------------------------------------------------

        bool _CreateProjectedPointList(List <Pnt> vertexList)
        {
            _PointList = new List <Pnt2d>(_IndexList.Count);

            // Build plane
            var pnts = new TColgp_HArray1OfPnt(1, _IndexList.Count);

            for (int i = 0; i < _IndexList.Count; i++)
            {
                pnts.SetValue(i + 1, vertexList[_IndexList[i]]);
            }

            var buildPlane = new GeomPlate_BuildAveragePlane(pnts, pnts.Length(), 0, 1, 1);

            if (!buildPlane.IsPlane())
            {
                return(false);
            }

            Pln plane = buildPlane.Plane().Pln();
            //plane.Location = Pnt.Origin;

            // Project points on plane
            double u = 0, v = 0;

            foreach (var i in _IndexList)
            {
                ElSLib.Parameters(plane, vertexList[i], ref u, ref v);
                _PointList.Add(new Pnt2d(u, v));
            }

            // Get winding order of polygon
            double area = 0;

            for (int i = 0; i < _PointList.Count - 1; i++)
            {
                area += _PointList[i].X * _PointList[i + 1].Y - _PointList[i + 1].X * _PointList[i].Y;
            }
            if (area < 0)
            {
                _PointList.Reverse();
                _IndexList.Reverse();
            }

            return(true);
        }
Exemplo n.º 2
0
 public bool Overlaps(TColgp_HArray1OfPnt theArrayOfPts, int theSensType, SelectBasics_PickResult thePickResult)
 {
     throw new NotImplementedException();
 }
 public GeomAPI_Interpolate(TColgp_HArray1OfPnt Points, TColStd_HArray1OfReal Parameters, bool PeriodicFlag,
                            double Tolerance)
     : base()
 {
     throw new NotImplementedException();
 }
 public GeomPlate_BuildAveragePlane(TColgp_SequenceOfVec Normals, TColgp_HArray1OfPnt Pts)
     : base()
 {
     throw new NotImplementedException();
 }
 public GeomPlate_BuildAveragePlane(TColgp_HArray1OfPnt Pts, int NbBoundPoints, double Tol, int POption,
                                    int NOption)
     : base()
 {
     throw new NotImplementedException();
 }
 public void CheckPoints(TColgp_HArray1OfPnt points, TColStd_HArray1OfReal _params, ref double preci)
 {
     throw new NotImplementedException();
 }
 public void PreparePolygon(TopoDS_Edge theE, TColgp_HArray1OfPnt thePolyg)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public void SetPoints(TColgp_HArray1OfPnt theCoords)
 {
     throw new NotImplementedException();
 }
 public Geom_Curve InterpolateCurve3d(int nbrPnt, TColgp_HArray1OfPnt points, TColStd_HArray1OfReal _params,
                                      Geom_Curve orig)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public void SetPoints(TColgp_HArray1OfPnt theCoords, Quantity_HArray1OfColor theColors,
                       TColgp_HArray1OfDir theNormals)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 public void Init(TColgp_HArray1OfPnt Poles, TColStd_HArray1OfReal Weights)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 public void Append(TColgp_HArray1OfPnt theItem)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 13
0
 public void SetValue(int theIndex, TColgp_HArray1OfPnt theItem)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
 public void InsertAfter(int theIndex, TColgp_HArray1OfPnt theItem)
 {
     throw new NotImplementedException();
 }