Ejemplo n.º 1
0
        public static Vector3dList Vector3dListFromMp(List <MpVector3d_v1002> list)
        {
            Vector3dList ret = new Vector3dList(list.Count);

            for (int i = 0; i < list.Count; i++)
            {
                ret.Add(list[i].Restore());
            }

            return(ret);
        }
Ejemplo n.º 2
0
        public void RecreateNormals()
        {
            Vector3dList newNormalStore = new Vector3dList(VertexStore.Count);

            int i;

            for (i = 0; i < FaceStore.Count; i++)
            {
                HeFace face = FaceStore[i];

                HalfEdge head = FaceStore[i].Head;
                HalfEdge c    = head;

                Vector3d n = CadMath.Normal(
                    VertexStore[c.Vertex].vector,
                    VertexStore[c.Next.Vertex].vector,
                    VertexStore[c.Next.Next.Vertex].vector
                    );

                face.Normal = newNormalStore.Add(n);

                for (; ;)
                {
                    c.Normal = newNormalStore.Add(n);

                    c = c.Next;

                    if (c == head)
                    {
                        break;
                    }
                }
            }

            NormalStore = newNormalStore;
        }