Commit 406c0f29 authored by TheNumbat's avatar TheNumbat
Browse files

don't subdivide boundaries

parent abf3e05e
...@@ -557,7 +557,7 @@ bool Halfedge_Mesh::subdivide(SubD strategy) { ...@@ -557,7 +557,7 @@ bool Halfedge_Mesh::subdivide(SubD strategy) {
Index idx = 0; Index idx = 0;
size_t nV = vertices.size(); size_t nV = vertices.size();
size_t nE = edges.size(); size_t nE = edges.size();
size_t nF = faces.size(); size_t nF = faces.size() - n_boundaries();
verts.resize(nV + nE + nF); verts.resize(nV + nE + nF);
for(VertexRef v = vertices_begin(); v != vertices_end(); v++, idx++) { for(VertexRef v = vertices_begin(); v != vertices_end(); v++, idx++) {
...@@ -569,11 +569,13 @@ bool Halfedge_Mesh::subdivide(SubD strategy) { ...@@ -569,11 +569,13 @@ bool Halfedge_Mesh::subdivide(SubD strategy) {
layout[e->id()] = idx; layout[e->id()] = idx;
} }
for(FaceRef f = faces_begin(); f != faces_end(); f++, idx++) { for(FaceRef f = faces_begin(); f != faces_end(); f++, idx++) {
if(f->is_boundary()) continue;
verts[idx] = f->new_pos; verts[idx] = f->new_pos;
layout[f->id()] = idx; layout[f->id()] = idx;
} }
for(auto f = faces_begin(); f != faces_end(); f++) { for(auto f = faces_begin(); f != faces_end(); f++) {
if(f->is_boundary()) continue;
Index i = layout[f->id()]; Index i = layout[f->id()];
HalfedgeRef h = f->halfedge(); HalfedgeRef h = f->halfedge();
do { do {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment