|:compute scalar product,数乘,点积,x1x2 + y1y2 + z1z2 %:叉积,(y1z2-y2z1, x2z1-x1z2, x1y2-x2*y1) /:component-wise division by with scalar,分量上用标量除 减法-是里面的向量可以直接相减
//提取网格的对应索引的点 mesh src_mesh_; src_mesh_->vertex_handle(点的索引);//只是得到这个点的顶点句柄 //然后使用函数point()根据点的句柄得到src中点的坐标 src_mesh_->point(src_mesh_->vertex_handle(点的索引); //或者使用函数normal()根据点的句柄得到src中点的法式,返回值是vec3d OpenMesh::Vec3d src_normal = src_mesh_->normal(src_mesh_->vertex_handle(点的索引);转自:https://www.cnblogs.com/VVingerfly/p/4402186.html 对于点p(x1,y1), q(x2,y2) n o r m = ( ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 ) ½ : norm =( (x2-x1)^2 + (y2-y1)^2 )^½: norm=((x2−x1)2+(y2−y1)2)½:
Scalar length() const //compute euclidean norm Scalar norm() const //compute euclidean normn o r m 2 norm^2 norm2
Scalar sqrnorm() const //compute squared euclidean norm曼哈顿距离(L1距离) l1_norm = |x2-x1| + |y2-y1|
Scalar l1_norm() const //compute L1 (Manhattan) norm切比雪夫距离(L∞距离) l8_norm = max{|x2-x1| , |y2-y1|}
Scalar l8_norm() const //compute l8_norm其中openmesh中一些点的读取操作
//提取tar_mesh_中第i个点的第一个坐标值,存到tar_points_(为[x0,x1,...,xn])的第0行,i列中 MatrixXX tar_points_; tar_points_.resize(3, n_tar_vertex_); tar_points_(0, i) = tar_mesh_->point(tar_mesh_->vertex_handle(i))[0]; //correspondence_pairs_[i0].first的第一个值作为提取的索引 point(src_mesh_->vertex_handle(correspondence_pairs_[i0].first)) Mesh* src_mesh_; Eigen::Matrix3Xd rig_src_v = Eigen::Matrix3Xd::Zero(3, n_src_vertex_); rig_src_v.col(i0) = Eigen::Map<Eigen::Vector3d>(src_mesh_ ->point(src_mesh_->vertex_handle(correspondence_pairs_[i0].first)).data(), 3, 1);参考资料: openmesh官方说明文档的半边结构说明(https://mcoder.cc/2019/07/06/half_edge_data_structure/) openmesh的半边数据结构,及相关几何元素的遍历
关于点的循环,即与点有关的点、半边、边、邻面的遍历
//迭代点的邻点 VertexVertexIter: iterate over all neighboring vertices. VertexIHalfedgeIter: iterate over all incoming halfedges. VertexOHalfedgeIter: iterate over all outgoing halfedges. //迭代点的所有边 VertexEdgeIter: iterate over all incident edges. VertexFaceIter: iterate over all adjacent faces.关于面的循环:即与面有关的点、半边、边、邻面的遍历
FaceVertexIter: iterate over the face’s vertices. FaceHalfedgeIter: iterate over the face’s halfedges. FaceEdgeIter: iterate over the face’s edges. FaceFaceIter: iterate over all edge-neighboring faces.