corrected some simple warning and avoided collapse of edges of triangular faces for polygons

This commit is contained in:
nico 2021-08-31 21:38:59 +10:00
parent bd05cf0932
commit 4e3f08e134
3 changed files with 10 additions and 2 deletions

View File

@ -624,7 +624,7 @@ public:
do
{
std::vector<int> new_queue;
for (int i=0; i<queue.size(); i++)
for (size_t i=0; i<queue.size(); i++)
{
FaceType *f0=&(mesh.face[queue[i]]);
assert(!f0->IsD());

View File

@ -1181,6 +1181,14 @@ public:
for (int j=0;j<poly_m.face[i].VN();j++)
valenceVertH[poly_m.face[i].V(j)]++;
//cannot collapse triangular vertices otherwise will collapse to a segment
for (size_t i=0;i<poly_m.face.size();i++)
{
if (poly_m.face[i].VN()>3)continue;
for (int j=0;j<poly_m.face[i].VN();j++)
valenceVertH[poly_m.face[i].V(j)]=3;
}
//then re-elaborate the faces
for (size_t i=0;i<poly_m.face.size();i++)
{

View File

@ -82,7 +82,7 @@ public:
void resize(size_t sz)
{
int oldDatasize = datasize;
if (sz <= oldDatasize)
if ((int)sz <= oldDatasize)
return;
if (sz > datareserve)
reserve(sz);