48 #define BASE_REMESHERT_C 54 #include "BaseRemesherT.hh" 57 #include "DiffGeoT.hh" 60 #include <OpenMesh/Core/Utils/Property.hh> 78 : mesh_(_mesh), refmesh_(0), bsp_(0), nothing_selected_(true),progress_(_progress) {
100 BaseRemesherT<Mesh>::
103 typename Mesh::VIter v_it, v_end;
104 typename Mesh::FIter f_it, f_end;
105 typename Mesh::CFVIter fv_it;
106 typename Mesh::VHandle v0, v1, v2;
110 if (bsp_) delete_reference();
113 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
115 mesh_.status(*v_it).set_tagged(!mesh_.status(*v_it).locked());
120 refmesh_ =
new Mesh();
123 mesh_.add_property(vhandles);
125 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
127 if (mesh_.status(*v_it).tagged())
128 mesh_.property(vhandles, *v_it) = refmesh_->
add_vertex(mesh_.point(*v_it));
130 for (f_it=mesh_.faces_begin(), f_end=mesh_.faces_end();
133 fv_it = mesh_.cfv_iter(*f_it);
138 if (mesh_.status(v0).tagged() &&
139 mesh_.status(v1).tagged() &&
140 mesh_.status(v2).tagged())
142 refmesh_->add_face( mesh_.property(vhandles, v0),
143 mesh_.property(vhandles, v1),
144 mesh_.property(vhandles, v2) );
149 mesh_.remove_property(vhandles);
152 refmesh_->request_face_normals();
153 refmesh_->request_vertex_normals();
158 bsp_ =
new BSP(*refmesh_);
159 bsp_->
reserve(refmesh_->n_faces());
160 for (f_it=refmesh_->faces_begin(), f_end=refmesh_->faces_end();
163 bsp_->
build(10, 100);
170 template <
class Mesh>
172 BaseRemesherT<Mesh>::
175 delete bsp_; bsp_ = 0;
176 delete refmesh_; refmesh_ = 0;
183 template <
class Mesh>
185 BaseRemesherT<Mesh>::
189 typename Mesh::FaceHandle fh = bsp_->
nearest(p).handle;
191 if ( ! fh.is_valid() )
194 typename Mesh::CFVIter fv_it = refmesh_->cfv_iter(fh);
197 const typename Mesh::Point& p0 = refmesh_->point(*fv_it);
199 const typename Mesh::Point& p1 = refmesh_->point(*(++fv_it));
201 const typename Mesh::Point& p2 = refmesh_->point(*(++fv_it));
207 mesh_.set_point(_vh, p);
212 p[0] = p[1] = p[2] = 1.0/3.0;
221 mesh_.set_normal(_vh, n);
228 template <
class Mesh>
230 BaseRemesherT<Mesh>::
231 remesh(
unsigned int _iters,
232 unsigned int _area_iters,
233 bool _use_projection,
234 Selection _selection) {
238 if (_selection == VERTEX_SELECTION)
240 else if (_selection == FACE_SELECTION)
242 remeshh(_iters, _area_iters, _use_projection);
244 catch (std::bad_alloc&)
247 omerr() <<
"Remeshig: Out of memory\n";
255 template <
class Mesh>
260 typename Mesh::EIter e_it, e_end;
261 typename Mesh::VIter v_it, v_end;
262 typename Mesh::FIter f_it, f_end;
263 typename Mesh::CFVIter fv_it;
264 typename Mesh::CVOHIter vh_it;
265 typename Mesh::VHandle v0, v1;
266 typename Mesh::FHandle f0, f1;
270 mesh_.request_vertex_status();
271 mesh_.request_edge_status();
272 mesh_.request_face_status();
277 nothing_selected_ =
true;
278 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
280 if (mesh_.status(*v_it).selected())
281 { nothing_selected_ =
false;
break; }
283 if (nothing_selected_)
284 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
286 mesh_.status(*v_it).set_selected(
true);
291 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
293 mesh_.status(*v_it).set_locked(!mesh_.status(*v_it).selected());
295 for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end();
298 v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 0));
299 v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 1));
300 mesh_.status(*e_it).set_locked(mesh_.status(v0).locked() ||
301 mesh_.status(v1).locked());
309 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
312 if (mesh_.status(*v_it).feature())
315 for (vh_it=mesh_.cvoh_iter(*v_it); vh_it.is_valid(); ++vh_it)
316 if (mesh_.status(mesh_.edge_handle(*vh_it)).feature())
318 if (c!=2) mesh_.status(*v_it).set_locked(
true);
330 mesh_.add_property(valences_);
331 mesh_.add_property(update_);
332 mesh_.add_property(area_);
338 template <
class Mesh>
343 typename Mesh::EIter e_it, e_end;
344 typename Mesh::VIter v_it, v_end;
345 typename Mesh::FIter f_it, f_end;
346 typename Mesh::CFVIter fv_it;
347 typename Mesh::CVOHIter vh_it;
348 typename Mesh::VHandle v0, v1;
349 typename Mesh::FHandle f0, f1;
353 mesh_.request_vertex_status();
354 mesh_.request_edge_status();
355 mesh_.request_face_status();
358 nothing_selected_ =
true;
359 for (f_it = mesh_.faces_begin(), f_end = mesh_.faces_end(); f_it != f_end;
362 if (mesh_.status(*f_it).selected())
364 nothing_selected_ =
false;
369 if (nothing_selected_)
370 MeshSelection::selectAllFaces(&mesh_);
375 for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end();
376 v_it != v_end; ++v_it)
378 bool all_faces_selected =
true;
381 vf_it.is_valid(); ++vf_it)
383 if (!mesh_.status(*vf_it).selected())
385 all_faces_selected =
false;
389 mesh_.status(*v_it).set_locked(!all_faces_selected);
392 for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end();
393 e_it != e_end; ++e_it)
395 if (mesh_.is_boundary(*e_it))
397 mesh_.status(*e_it).set_locked(
true);
401 f0 = mesh_.face_handle(mesh_.halfedge_handle(*e_it, 0));
402 f1 = mesh_.face_handle(mesh_.halfedge_handle(*e_it, 1));
404 mesh_.status(*e_it).set_locked(!(mesh_.status(f0).selected() && mesh_.status(f1).selected()));
408 MeshSelection::clearFaceSelection(&mesh_);
413 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
416 if (mesh_.status(*v_it).feature())
419 for (vh_it=mesh_.cvoh_iter(*v_it); vh_it.is_valid(); ++vh_it)
420 if (mesh_.status(mesh_.edge_handle(*vh_it)).feature())
422 if (c!=2) mesh_.status(*v_it).set_locked(
true);
434 mesh_.add_property(valences_);
435 mesh_.add_property(update_);
436 mesh_.add_property(area_);
443 template <
class Mesh>
447 unsigned int _area_iters,
bool _use_projection) {
449 double progress_step = 100.0 / (((double)_iters/4.0 + (
double)_area_iters));
450 double total_progress = 0.0;
452 for (
unsigned int i = 0; i < _iters; ++i) {
455 if(progress_ != NULL) {
456 total_progress += progress_step;
457 progress_->sendProgressSignal(total_progress);
460 collapse_short_edges();
461 if(progress_ != NULL) {
462 total_progress += progress_step;
463 progress_->sendProgressSignal(total_progress);
467 if(progress_ != NULL) {
468 total_progress += progress_step;
469 progress_->sendProgressSignal(total_progress);
472 tangential_smoothing(_use_projection);
473 if(progress_ != NULL) {
474 total_progress += progress_step;
475 progress_->sendProgressSignal(total_progress);
480 balanace_area(_area_iters, _use_projection);
481 if(progress_ != NULL) {
482 total_progress += progress_step;
483 progress_->sendProgressSignal(total_progress);
495 template <
class Mesh>
500 typename Mesh::EIter e_it, e_end;
501 typename Mesh::VIter v_it, v_end;
502 typename Mesh::FIter f_it, f_end;
503 typename Mesh::CFVIter fv_it;
504 typename Mesh::CVOHIter vh_it;
505 typename Mesh::VHandle v0, v1;
506 typename Mesh::FHandle f0, f1;
510 mesh_.remove_property(valences_);
511 mesh_.remove_property(update_);
512 mesh_.remove_property(area_);
520 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
523 mesh_.status(*v_it).set_locked(
false);
525 for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end();
528 mesh_.status(*e_it).set_locked(
false);
533 if (nothing_selected_)
534 for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
536 mesh_.status(*v_it).set_selected(
false);
541 mesh_.release_vertex_status();
542 mesh_.release_edge_status();
543 mesh_.release_face_status();
550 template <
class Mesh>
555 typename Mesh::VIter v_it, v_end;
556 typename Mesh::EIter e_it, e_end;
557 typename Mesh::VHandle v0, v1, vh;
558 typename Mesh::EHandle eh, e0, e1;
559 typename Mesh::FHandle f0, f1, f2, f3;
561 bool ok, is_feature, is_boundary;
565 for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it)
566 mesh_.status(*v_it).set_tagged(
false);
570 mesh_.get_property_handle(pids,
"Nastran PIDs");
573 for (ok =
false, i = 0; !ok && i < 100; ++i) {
576 for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
577 v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 0));
578 v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 1));
580 if (!mesh_.status(*e_it).locked() && is_too_long(v0, v1)) {
584 is_feature = mesh_.status(*e_it).feature();
585 is_boundary = mesh_.is_boundary(*e_it);
588 mesh_.
split(*e_it, vh);
590 mesh_.status(vh).set_selected(
true);
593 eh = (is_boundary ? mesh_.edge_handle(mesh_.n_edges() - 2) : mesh_.edge_handle(mesh_.n_edges() - 3));
595 mesh_.status(eh).set_feature(
true);
596 mesh_.status(vh).set_feature(
true);
598 project_to_reference(vh);
603 e1 = (is_boundary ? mesh_.edge_handle(mesh_.n_edges() - 2) : mesh_.edge_handle(mesh_.n_edges() - 3));
605 f0 = mesh_.face_handle(mesh_.halfedge_handle(e0, 0));
606 f1 = mesh_.face_handle(mesh_.halfedge_handle(e0, 1));
607 f2 = mesh_.face_handle(mesh_.halfedge_handle(e1, 0));
608 f3 = mesh_.face_handle(mesh_.halfedge_handle(e1, 1));
610 if (f0.is_valid() && f3.is_valid()) mesh_.property(pids, f3) = mesh_.property(pids, f0);
612 if (f1.is_valid() && f2.is_valid()) mesh_.property(pids, f2) = mesh_.property(pids, f1);
620 if (i == 100) omlog() <<
"split break\n";
627 template <
class Mesh>
632 typename Mesh::EIter e_it, e_end;
633 typename Mesh::CVVIter vv_it;
634 typename Mesh::VHandle v0, v1;
635 typename Mesh::HHandle h0, h1, h01, h10;
637 bool ok, skip, b0, b1, l0, l1, f0, f1;
641 for (ok =
false, i = 0; !ok && i < 100; ++i) {
644 for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
645 if (!mesh_.status(*e_it).deleted() && !mesh_.status(*e_it).locked()) {
646 h10 = mesh_.halfedge_handle(*e_it, 0);
647 h01 = mesh_.halfedge_handle(*e_it, 1);
648 v0 = mesh_.to_vertex_handle(h10);
649 v1 = mesh_.to_vertex_handle(h01);
651 if (is_too_short(v0, v1)) {
653 b0 = mesh_.is_boundary(v0);
654 b1 = mesh_.is_boundary(v1);
655 l0 = mesh_.status(v0).locked();
656 l1 = mesh_.status(v1).locked();
657 f0 = mesh_.status(v0).feature();
658 f1 = mesh_.status(v1).feature();
659 hcol01 = hcol10 =
true;
661 if (mesh_.status(*e_it).feature() && !f0 && !f1)
662 std::cerr <<
"Bad luck" << std::endl;
666 if (!mesh_.is_boundary(*e_it))
684 h0 = mesh_.prev_halfedge_handle(h01);
685 h1 = mesh_.next_halfedge_handle(h10);
686 if (mesh_.status(mesh_.edge_handle(h0)).feature() || mesh_.status(mesh_.edge_handle(h1)).feature())
688 h0 = mesh_.prev_halfedge_handle(h10);
689 h1 = mesh_.next_halfedge_handle(h01);
690 if (mesh_.status(mesh_.edge_handle(h0)).feature() || mesh_.status(mesh_.edge_handle(h1)).feature())
695 if (!mesh_.status(*e_it).feature())
699 h0 = mesh_.prev_halfedge_handle(h01);
700 h1 = mesh_.next_halfedge_handle(h10);
701 if (mesh_.status(mesh_.edge_handle(h0)).feature() || mesh_.status(mesh_.edge_handle(h1)).feature())
703 h0 = mesh_.prev_halfedge_handle(h10);
704 h1 = mesh_.next_halfedge_handle(h01);
705 if (mesh_.status(mesh_.edge_handle(h0)).feature() || mesh_.status(mesh_.edge_handle(h1)).feature())
714 hcol01 = mesh_.is_collapse_ok(h01);
716 hcol10 = mesh_.is_collapse_ok(h10);
719 if (hcol01 && hcol10) {
720 if (mesh_.valence(v0) < mesh_.valence(v1))
730 for (vv_it = mesh_.cvv_iter(v1); vv_it.is_valid() && !skip; ++vv_it)
731 if (is_too_long(v0, *vv_it))
744 for (vv_it = mesh_.cvv_iter(v0); vv_it.is_valid() && !skip; ++vv_it)
745 if (is_too_long(v1, *vv_it))
758 mesh_.garbage_collection();
761 omlog() <<
"collapse break\n";
768 template <
class Mesh>
773 typename Mesh::EIter e_it, e_end;
774 typename Mesh::VIter v_it, v_end;
775 typename Mesh::VHandle v0, v1, v2, v3, vh;
776 typename Mesh::HHandle hh;
778 typename Mesh::FHandle fh;
780 int val0, val1, val2, val3;
781 int val_opt0, val_opt1, val_opt2, val_opt3;
782 int ve0, ve1, ve2, ve3, ve_before, ve_after;
787 for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it)
788 mesh_.property(valences_, *v_it) = mesh_.valence(*v_it);
791 for (ok =
false, i = 0; !ok && i < 100; ++i) {
794 for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
795 if (!mesh_.status(*e_it).locked() && !mesh_.status(*e_it).feature()) {
796 hh = mesh_.halfedge_handle(*e_it, 0);
797 v0 = mesh_.to_vertex_handle(hh);
798 v2 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh));
799 if ( !mesh_.next_halfedge_handle(hh).is_valid() ) {
800 std::cerr <<
"Error v2" << std::endl;
803 hh = mesh_.halfedge_handle(*e_it, 1);
804 v1 = mesh_.to_vertex_handle(hh);
805 v3 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh));
806 if ( !mesh_.next_halfedge_handle(hh).is_valid() ) {
807 std::cerr <<
"Error v3" << std::endl;
814 if (!mesh_.status(v0).locked() && !mesh_.status(v1).locked() && !mesh_.status(v2).locked()
815 && !mesh_.status(v3).locked()) {
816 val0 = mesh_.property(valences_, v0);
817 val1 = mesh_.property(valences_, v1);
818 val2 = mesh_.property(valences_, v2);
819 val3 = mesh_.property(valences_, v3);
821 val_opt0 = (mesh_.is_boundary(v0) ? 4 : 6);
822 val_opt1 = (mesh_.is_boundary(v1) ? 4 : 6);
823 val_opt2 = (mesh_.is_boundary(v2) ? 4 : 6);
824 val_opt3 = (mesh_.is_boundary(v3) ? 4 : 6);
826 ve0 = (val0 - val_opt0);
828 ve1 = (val1 - val_opt1);
830 ve2 = (val2 - val_opt2);
832 ve3 = (val3 - val_opt3);
835 ve_before = ve0 + ve1 + ve2 + ve3;
842 ve0 = (val0 - val_opt0);
844 ve1 = (val1 - val_opt1);
846 ve2 = (val2 - val_opt2);
848 ve3 = (val3 - val_opt3);
851 ve_after = ve0 + ve1 + ve2 + ve3;
853 if (ve_before > ve_after && mesh_.is_flip_ok(*e_it)) {
855 --mesh_.property(valences_, v0);
856 --mesh_.property(valences_, v1);
857 ++mesh_.property(valences_, v2);
858 ++mesh_.property(valences_, v3);
867 omlog() <<
"flip break\n";
874 template <
class Mesh>
879 typename Mesh::VIter v_it, v_end(mesh_.vertices_end());
880 typename Mesh::CVVIter vv_it;
886 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
887 mesh_.status(*v_it).set_tagged( !mesh_.status(*v_it).locked() &&
888 !mesh_.status(*v_it).feature() &&
889 !mesh_.is_boundary(*v_it) );
893 for (
int iters=0; iters<10; ++iters)
895 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
897 if (mesh_.status(*v_it).tagged())
902 for (vv_it=mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
904 u += mesh_.point(*vv_it);
911 u -= mesh_.point(*v_it);
912 n = mesh_.normal(*v_it);
917 mesh_.property(update_, *v_it) = u;
921 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
922 if (mesh_.status(*v_it).tagged())
923 mesh_.point(*v_it) += mesh_.property(update_, *v_it);
928 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
929 mesh_.status(*v_it).set_tagged(
false);
934 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
935 if (!mesh_.status(*v_it).locked() && !mesh_.status(*v_it).feature())
936 project_to_reference(*v_it);
943 template <
class Mesh>
948 typename Mesh::VIter v_it, v_end(mesh_.vertices_end());
949 typename Mesh::CVVIter vv_it;
958 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
960 bool active = ( !mesh_.status(*v_it).locked() &&
961 !mesh_.status(*v_it).feature() &&
962 !mesh_.is_boundary(*v_it) );
965 for (vv_it=mesh_.cvv_iter(*v_it); active && vv_it.is_valid(); ++vv_it)
966 if (mesh_.is_boundary(*vv_it))
969 mesh_.status(*v_it).set_tagged( active );
974 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
976 mesh_.status(*v_it).set_tagged2(
false);
977 for (vv_it=mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
979 if (mesh_.status(*vv_it).tagged())
981 mesh_.status(*v_it).set_tagged2(
true);
989 for (
unsigned int bla=0; bla<_iters; ++bla)
992 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
993 if (mesh_.status(*v_it).tagged2())
994 mesh_.property(area_, *v_it) = pow(diffgeo.compute_area(*v_it), 2);
999 for (
int iters=0; iters<10; ++iters)
1001 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
1003 if (mesh_.status(*v_it).tagged())
1008 for (vv_it=mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
1010 w = mesh_.property(area_, *vv_it);
1011 u += mesh_.point(*vv_it) * w;
1018 u -= mesh_.point(*v_it);
1019 n = mesh_.normal(*v_it);
1026 mesh_.property(update_, *v_it) = u;
1030 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
1031 if (!mesh_.status(*v_it).locked() &&
1032 !mesh_.status(*v_it).feature() &&
1033 !mesh_.is_boundary(*v_it))
1034 mesh_.point(*v_it) += mesh_.property(update_, *v_it);
1039 if (_use_projection)
1040 for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
1041 if (!mesh_.status(*v_it).locked() && !mesh_.status(*v_it).feature())
1042 project_to_reference(*v_it);
1055 template <
class Mesh>
1060 typename Mesh::EdgeIter e_it, e_end(mesh_.edges_end());
1061 typename Mesh::HalfedgeHandle h;
1062 typename Mesh::Scalar a0, a1, amin, aa(cos(170.0 * M_PI / 180.0));
1063 typename Mesh::VHandle v, vb, vd;
1064 typename Mesh::FHandle fb, fd;
1070 mesh_.get_property_handle(pids,
"Nastran PIDs");
1073 for (e_it=mesh_.edges_begin(); e_it!=e_end; ++e_it)
1075 if (!mesh_.status(*e_it).locked() &&
1076 mesh_.is_flip_ok(*e_it))
1078 h = mesh_.halfedge_handle(*e_it, 0);
1079 a = mesh_.point(mesh_.to_vertex_handle(h));
1081 h = mesh_.next_halfedge_handle(h);
1082 b = mesh_.point(vb=mesh_.to_vertex_handle(h));
1084 h = mesh_.halfedge_handle(*e_it, 1);
1085 c = mesh_.point(mesh_.to_vertex_handle(h));
1087 h = mesh_.next_halfedge_handle(h);
1088 d = mesh_.point(vd=mesh_.to_vertex_handle(h));
1090 a0 = ( (a-b).normalize() | (c-b).normalize() );
1091 a1 = ( (a-d).normalize() | (c-d).normalize() );
1093 if (a0 < a1) { amin = a0; v = vb; }
1094 else { amin = a1; v = vd; }
1100 if (mesh_.status(*e_it).feature() && mesh_.status(v).feature())
1106 fb = mesh_.face_handle(mesh_.halfedge_handle(*e_it, 0));
1107 fd = mesh_.face_handle(mesh_.halfedge_handle(*e_it, 1));
1110 mesh_.property(pids, fb) = mesh_.property(pids, fd);
1112 mesh_.property(pids, fd) = mesh_.property(pids, fb);
1116 if (mesh_.status(*e_it).feature())
1117 mesh_.set_point(v, (a+c)*0.5);
Kernel::Point Point
Coordinate type.
NearestNeighbor nearest(const Point &_p) const
Return handle of the nearest neighbor face.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
void growVertexSelection(MeshT *_mesh)
Grow vertex selection.
void prepare_vertex_selection()
prepare for remeshing only selected vertices (if no vertex was selected, remesh whole mesh) ...
Kernel::Scalar Scalar
Scalar type.
void prepare_face_selection()
prepare for remeshing only vertices which are fully surrounded by selected faces (if no face was sele...
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Kernel::Normal Normal
Normal type.
Functions for selection on a mesh.
Vec::value_type distPointTriangle(const Vec &_p, const Vec &_v0, const Vec &_v1, const Vec &_v2, Vec &_nearestPoint)
distance from point _p to triangle (_v0, _v1, _v2)
void clearVertexSelection(MeshT *_mesh)
Set all vertices to unselected.
void push_back(Handle _h)
Add a handle to the BSP.
void reserve(size_t _n)
Reserve memory for _n entries.
bool baryCoord(const VectorT< Scalar, 3 > &_p, const VectorT< Scalar, 3 > &_u, const VectorT< Scalar, 3 > &_v, const VectorT< Scalar, 3 > &_w, VectorT< Scalar, 3 > &_result)
bool is_valid() const
The handle is valid iff the index is not negative.
void build(unsigned int _max_handles, unsigned int _max_depth)
void update_normals()
Compute normals for all primitives.
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)