Exemplo n.º 1
0
        public static SimpleGraph <Point3d> LinesToGraph(IEnumerable <Line> Lines, double Tolerance)
        {
            IEnumerator <Line> enumerator = null;

            List <Point3d> point3ds = new List <Point3d>();

            enumerator = Lines.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Line current = enumerator.Current;
                point3ds.Add(current.From);
                point3ds.Add(current.To);
            }


            DuplicateRemover duplicateRemover = new DuplicateRemover(point3ds, Tolerance, 123);

            duplicateRemover.Solve();

            SimpleGraph <Point3d> simpleGraph = new SimpleGraph <Point3d>(duplicateRemover.UniquePoints);
            int num = checked (Lines.Count <Line>() - 1);

            for (int i = 0; i <= num; i = checked (i + 1))
            {
                simpleGraph.Edges.Add(new GraphEdge(checked (i * 2), checked (checked (i * 2) + 1)));
            }
            return(simpleGraph);
        }
Exemplo n.º 2
0
        public DuplicateRemover Duplicate()
        {
            DuplicateRemover duplicateRemover = new DuplicateRemover((int)this._Points.Length);

            this._ChildA.CopyTo(duplicateRemover._ChildA, 0);
            this._ChildB.CopyTo(duplicateRemover._ChildB, 0);
            this._Map.CopyTo(duplicateRemover._Map, 0);
            this._Parent.CopyTo(duplicateRemover._Parent, 0);
            this._Points.CopyTo(duplicateRemover._Points, 0);
            this._SplitAxis.CopyTo(duplicateRemover._SplitAxis, 0);
            duplicateRemover._Tolerance = this._Tolerance;
            return(duplicateRemover);
        }