mirror of
				https://github.com/jhasse/poly2tri.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	fixed SweepContext::MeshClean
This commit is contained in:
		
				
					committed by
					
						
						Jan Niklas Hasse
					
				
			
			
				
	
			
			
			
						parent
						
							47a9c6e038
						
					
				
				
					commit
					d5b79b043b
				
			@@ -159,12 +159,20 @@ void SweepContext::RemoveFromMap(Triangle* triangle)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void SweepContext::MeshClean(Triangle& triangle)
 | 
					void SweepContext::MeshClean(Triangle& triangle)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  if (&triangle != NULL && !triangle.IsInterior()) {
 | 
					  std::vector<Triangle *> triangles;
 | 
				
			||||||
    triangle.IsInterior(true);
 | 
					  triangles.push_back(&triangle);
 | 
				
			||||||
    triangles_.push_back(&triangle);
 | 
					
 | 
				
			||||||
    for (int i = 0; i < 3; i++) {
 | 
					  while(!triangles.empty()){
 | 
				
			||||||
      if (!triangle.constrained_edge[i])
 | 
						Triangle *t = triangles.back();
 | 
				
			||||||
        MeshClean(*triangle.GetNeighbor(i));
 | 
						triangles.pop_back();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (t != NULL && !t->IsInterior()) {
 | 
				
			||||||
 | 
					      t->IsInterior(true);
 | 
				
			||||||
 | 
					      triangles_.push_back(t);
 | 
				
			||||||
 | 
					      for (int i = 0; i < 3; i++) {
 | 
				
			||||||
 | 
					        if (!t->constrained_edge[i])
 | 
				
			||||||
 | 
					          triangles.push_back(t->GetNeighbor(i));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -194,4 +202,4 @@ SweepContext::~SweepContext()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user