matlab二维三角网格,matlab实现二维三角剖分的栅格化

patch_rasterize

patch_rasterize Rasterization of a 2D triangulation

patch_rasterize rasterize a 2D triangulation into a image. The function

returns an image rasterizing the triangulation. This image is similar

to the one used for OpenGL's glSelectBuffer for fast "picking".

I = patch_rasterize(p) creates an image of size=max(p.vertices). If the

f-th triangle p.faces(f,:) contains the pixels at position (i,j) then

I(i,j)=f.

Once I has been computed, retrieving a the index of the triangle

containing the point (x,y) can be achieved by f = I( round(x), round(y) )

The function run without parameters executes Example 1.

Example 1:

clc, clear, close all;

% generate some data

P = gallery('uniformdata',[100 2],0);

DT = delaunayTriangulation(P);

p.faces = DT.ConnectivityList;

p.vertices = DT.Points * 300;

% rasterize it

I = patch_rasterize(p);

figure, hold on;

imagesc(I); axis image;

triplot(p.faces, p.vertices(:,1), p.vertices(:,2), 'color', 'white');

See also patch, triangulation,

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值