Exemplo n.º 1
0
        public static Rhino.Geometry.Mesh ToRhinoGeo(this SketchUpNET.Mesh mesh, Transform t = null)
        {
            Rhino.Geometry.Mesh m = new Rhino.Geometry.Mesh();

            foreach (var v in mesh.Vertices)
            {
                m.Vertices.Add(v.ToRhinoGeo(t));
            }

            foreach (var v in mesh.Faces)
            {
                m.Faces.AddFace(v.A, v.B, v.C);
            }

            m.Normals.ComputeNormals();
            m.Compact();
            return(m);
        }
Exemplo n.º 2
0
        public static Autodesk.DesignScript.Geometry.Mesh ToDSGeo(this SketchUpNET.Mesh mesh, Transform t = null)
        {
            List <Autodesk.DesignScript.Geometry.Point> points = new List <Autodesk.DesignScript.Geometry.Point>();

            foreach (var v in mesh.Vertices)
            {
                points.Add(v.ToDSGeo(t));
            }

            List <Autodesk.DesignScript.Geometry.IndexGroup> faces = new List <Autodesk.DesignScript.Geometry.IndexGroup>();

            foreach (var v in mesh.Faces)
            {
                faces.Add(Autodesk.DesignScript.Geometry.IndexGroup.ByIndices(Convert.ToUInt32(v.A), Convert.ToUInt32(v.B), Convert.ToUInt32(v.C)));
            }


            Autodesk.DesignScript.Geometry.Mesh m = Autodesk.DesignScript.Geometry.Mesh.ByPointsFaceIndices(points, faces);

            return(m);
        }