[工具]toolbox_graph基本操作

toolbox_graph提供了对3D模型的一些操作。MATLAB代码源自:http://www.mathworks.com/matlabcentral/fileexchange/5355-toolbox-graph/content/toolbox_graph/toolbox_graph.m

关于代码的总结说明:(toolbox_graph.m)

基本操作——

compute_vertex_ring:为网格的每一个顶点计算第一环邻居。

function vring = compute_vertex_ring(face)

参数说明:face——3*f的矩阵,f表示面的数目。

输出:vring{i} 表示与第i个顶点相邻的顶点集合。在MATLAB中的结果为1*f cell(f为顶点个数),cell中保存的为顶点序号。

compute_normal:使用面的法向量的平均值作为顶点的法向量。

function [normal,normalf] = compute_normal(vertex,face)

参数说明:vertex——3*v的矩阵,v表示顶点的数目;

  face——同上。

输出:normal——顶点的法向量。3*v的矩阵;

  normalf——面的法向量。3*f的矩阵。

triangulation2adjacency:为给定的三角形网格计算邻接矩阵。

function A = triangulation2adjacency(face,vertex)

参数说明:face——同上;

  vertex——同上。

输出:A——保存顶点相连的邻接矩阵,大小为v*v。

reverse_orientation:翻转面的法向量的方向。

function face1 = reverse_orientation(face)

参数说明:face——同上。

输出:face1——翻转后的面。

原文地址:https://www.cnblogs.com/haoyul/p/5909491.html