Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="v0"></param>
        /// <param name="v1"></param>
        private static void Set(HeMesh3d.Halfedge he0, HeMesh3d.Halfedge he1)
        {
            Set(he0.Start, he1.Start);
            Set(he0.End, he1.End);

            void Set(HeMesh3d.Vertex v0, HeMesh3d.Vertex v1)
            {
                v0.Position = v1.Position;
                v0.Normal   = v1.Normal;
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        private void AddTetrahedron(HeMesh3d.Halfedge hedge)
        {
            var v3 = hedge.Twin.Previous.Start;

            var v0 = hedge.Start;

            hedge = hedge.Next;
            var v1 = hedge.Start;

            hedge = hedge.Next;
            var v2 = hedge.Start;

            _tetrahedra.Add(new Tetra(v3, v2, v1, v0));
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="heMesh"></param>
        /// <returns></returns>

        static PolylineCurve GetBoundaryPolyline(HeMesh3d heMesh)
        {
            PolylineCurve poly_out;

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

            HeMesh3d.Halfedge start_he = new HeMesh3d.Halfedge();

            //get Halfedge on boundary
            if (heMesh.Vertices[0].First.Face == null)
            {
                start_he = heMesh.Vertices[0].First;
            }
            else
            {
                start_he = heMesh.Vertices[0].First.Twin;
            }

            pts.Add((Point3d)heMesh.Vertices[0].Position);

            bool exit = false;

            HeMesh3d.Halfedge temp = new HeMesh3d.Halfedge();
            temp = start_he;
            do
            {
                pts.Add((Point3d)temp.End.Position);
                temp = temp.Next;
                if (temp == start_he)
                {
                    exit = true;
                }
            }while (!exit);

            poly_out = new PolylineCurve(pts);

            return(poly_out);
        }