From 05df003e6f74e32621173985f1560ee54c6e6e4d Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Wed, 30 Aug 2017 15:58:22 +0200 Subject: [PATCH] Added TriSplit helper function --- vcg/simplex/face/topology.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index 45d54e7e..636d6674 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -710,6 +710,22 @@ void FlipEdge(FaceType &f, const int z) } +template +void TriSplit(FaceType *fToSplit, FaceType *newf0, FaceType *newf1, typename FaceType::VertexType *newVert) +{ + typedef typename FaceType::VertexType VertexType; + + VertexType *vp0 = fToSplit->V(0); + VertexType *vp1 = fToSplit->V(1); + VertexType *vp2 = fToSplit->V(2); + + fToSplit->V(0) = vp0; fToSplit->V(1) = vp1; fToSplit->V(2) = newVert; + newf0->V(0) = vp1; newf0->V(1) = vp2; newf0->V(2) = newVert; + newf1->V(0) = vp2; newf1->V(1) = vp0; newf1->V(2) = newVert; +} + + + template void VFDetach(FaceType & f) {