diff --git a/vcg/complex/intersection.h b/vcg/complex/intersection.h index 560d8a29..b717c598 100644 --- a/vcg/complex/intersection.h +++ b/vcg/complex/intersection.h @@ -36,10 +36,10 @@ bool Intersect( GridType & grid,Plane3 plane, vector pl,EdgeMeshType & em,dou typedef GridStaticPtr GridType; EdgeMeshType::VertexIterator vi; TriMeshType::FaceIterator fi; - + vector v; + v.clear(); Intersect(*grid,pl,cells); Segment3 seg; ave_length = 0.0; @@ -91,8 +92,10 @@ bool Intersection( TriMeshType & m, Plane3 pl,EdgeMeshType & em,dou if(!face.IsS()) { face.SetS(); + v.push_back(&face); if(vcg::Intersection(pl,face,seg))// intersezione piano triangolo { + face.SetS(); // add to em ave_length+=seg.Length(); vcg::edge::Allocator::AddEdges(em,1); @@ -108,6 +111,8 @@ bool Intersection( TriMeshType & m, Plane3 pl,EdgeMeshType & em,dou }//end while } ave_length/=em.en; + vector::iterator v_i; + for(v_i=v.begin(); v_i!=v.end(); ++v_i) (*v_i)->ClearS(); return true; }