Skip to content

Commit

Permalink
need to set vtx properties for new vertex in edge-split
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Aug 4, 2017
1 parent f97a120 commit cedf9d0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mesh/DMesh3_edge_operators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,17 @@ public MeshResult SplitEdge(int eab, out EdgeSplitInfo split)
// create new vertex
Vector3d vNew = 0.5 * ( GetVertex(a) + GetVertex(b) );
int f = AppendVertex( vNew );
if (HasVertexNormals)
SetVertexNormal(f, (GetVertexNormal(a) + GetVertexNormal(b)).Normalized);
if (HasVertexColors)
SetVertexColor(f, 0.5f * (GetVertexColor(a) + GetVertexColor(b)) );
if (HasVertexUVs)
SetVertexUV(f, 0.5f * (GetVertexUV(a) + GetVertexUV(b)));

// quite a bit of code is duplicated between boundary and non-boundary case, but it
// is too hard to follow later if we factor it out...
if ( edge_is_boundary(eab) ) {

// quite a bit of code is duplicated between boundary and non-boundary case, but it
// is too hard to follow later if we factor it out...
if ( edge_is_boundary(eab) ) {

// look up edge bc, which needs to be modified
Index3i T0te = GetTriEdges(t0);
Expand Down

0 comments on commit cedf9d0

Please sign in to comment.