예제 #1
0
        public static SimPe.Geometry.Vectors3i GetUsingFaces(SimPe.Geometry.Vectors3i faces, int vertexid)
        {
            SimPe.Geometry.Vectors3i ret = new SimPe.Geometry.Vectors3i();
            foreach (SimPe.Geometry.Vector3i v in faces)
            {
                if (v.X == vertexid || v.Y == vertexid || v.Z == vertexid)
                {
                    ret.Add(v);
                }
            }

            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Returns the Face Indices
        /// </summary>
        /// <returns></returns>
        public SimPe.Geometry.Vectors3i GetFaces()
        {
            SimPe.Geometry.Vectors3i ret = new SimPe.Geometry.Vectors3i();
            SimPe.Geometry.Vector3i  v   = null;
            for (int i = 0; i < Faces.Count; i++)
            {
                if (i % 3 == 0)
                {
                    v   = new SimPe.Geometry.Vector3i();
                    v.X = Faces[i];
                }
                else if (i % 3 == 2)
                {
                    ret.Add(v);
                    v.Z = Faces[i];
                }
                else
                {
                    v.Y = Faces[i];
                }
            }

            return(ret);
        }