Question

I would like to obtain the following triangulation in Matlab using the command DelaunayTri:

enter image description here

I tried the following code:

xgrid = [-0.5233   -0.3488   -0.1743    0.0001    0.1746    0.3490    0.5235];
ygrid = [-0.1745      0.3054    0.5454    0.7853];
[Xm,Ym] = ndgrid(xgrid,ygrid);      

DT      = DelaunayTri(Xm(:),Ym(:)); 

However, this generates the following triangulation:

enter image description here

Any ideas how I can adjust my code, such that I obtain the required triangulation?

Was it helpful?

Solution

You can't use delaunay triangulation I'm afraid. However if you break you target image into 6 squares then there are only two patterns you need to create. You've already proved capable of creating both. I suggest you create each of these pattern templates and then just tile then by adding constants.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top