matlab三维怎么分块,matlab将由面和顶点定义的二维或三维网格拆分为单独连接的网格块...

splitFV - split a mesh

FVOUT = SPLITFV(F,V) separates disconnected pieces inside a patch defined by faces (F) and

vertices (V). FVOUT is a structure array with fields "faces" and "vertices". Each element of

this array indicates a separately connected patch.

FVOUT = SPLITFV(FV) takes in FV as a structure with fields "faces" and "vertices"

For example:

fullpatch.vertices = [2 4; 2 8; 8 4; 8 0; 0 4; 2 6; 2 2; 4 2; 4 0; 5 2; 5 0];

fullpatch.faces = [1 2 3; 1 3 4; 5 6 1; 7 8 9; 11 10 4];

figure, subplot(2,1,1), patch(fullpatch,'facecolor','r'), title('Unsplit mesh');

splitpatch = splitFV(fullpatch);

colours = lines(length(splitpatch));

subplot(2,1,2), hold on, title('Split mesh');

for i=1:length(splitpatch)

patch(splitpatch(i),'facecolor',colours(i,:));

end

Note: faces and vertices should be defined such that faces sharing a coincident vertex reference

the same vertex number, rather than having a separate vertice defined for each face (yet at the

same vertex location). In other words, running the following command: size(unique(v,'rows') ==

size(v) should return TRUE. An explicit test for this has not been included in this function so

as to allow for the deliberate splitting of a mesh at a given location by simply duplicating

those vertices.

See also PATCH

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值