Subversion Repositories gelsvn

Rev

Rev 514 | Rev 526 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 514 Rev 519
Line 47... Line 47...
47
 
47
 
48
        template<class T> 
48
        template<class T> 
49
        void smooth_something_on_mesh(const Manifold& m, VertexAttributeVector<T>& vec, int smooth_steps)
49
        void smooth_something_on_mesh(const Manifold& m, VertexAttributeVector<T>& vec, int smooth_steps)
50
        {
50
        {
51
            for(int iter=0;iter<smooth_steps;++iter){
51
            for(int iter=0;iter<smooth_steps;++iter){
52
                VertexAttributeVector<T> new_vec(m);
52
                VertexAttributeVector<T> new_vec(m.total_vertices());
53
                for(VertexIDIterator v = m.vertices_begin(); v != m.vertices_end(); ++v){
53
                for(VertexIDIterator v = m.vertices_begin(); v != m.vertices_end(); ++v){
54
                    new_vec[*v] = vec[*v];
54
                    new_vec[*v] = vec[*v];
55
                    for(HalfEdgeWalker w = m.halfedgewalker(*v); !w.full_circle(); w = w.circulate_vertex_cw()){
55
                    for(HalfEdgeWalker w = m.halfedgewalker(*v); !w.full_circle(); w = w.circulate_vertex_cw()){
56
                        new_vec[*v] += vec[w.vertex()];
56
                        new_vec[*v] += vec[w.vertex()];
57
                    }
57
                    }
Line 265... Line 265...
265
    }
265
    }
266
 
266
 
267
    void smooth_curvature_tensors(const Manifold& m, VertexAttributeVector<Mat3x3d>& curvature_tensors)
267
    void smooth_curvature_tensors(const Manifold& m, VertexAttributeVector<Mat3x3d>& curvature_tensors)
268
    {
268
    {
269
        assert(curvature_tensors.size() == m.no_vertices(false));
269
        assert(curvature_tensors.size() == m.no_vertices(false));
270
        VertexAttributeVector<Mat3x3d> tmp_curvature_tensors(m);
270
        VertexAttributeVector<Mat3x3d> tmp_curvature_tensors(m.total_vertices());
271
        double tmp_area;
271
        double tmp_area;
272
 
272
 
273
        for(VertexIDIterator v = m.vertices_begin(); v != m.vertices_end(); ++v){
273
        for(VertexIDIterator v = m.vertices_begin(); v != m.vertices_end(); ++v){
274
            if(boundary(m, *v))
274
            if(boundary(m, *v))
275
                continue;
275
                continue;