0

I am looking for constrained triangulation code in matlab, similar to Shewchuk's triangle software. The main thing matlab's delaunay is missing is constraints, such as constraints on the minimum angle of the mesh etc.

I heard there's a port for Shewchuk's code to matlab using mex, but I couldn't find it.

John Conde
  • 217,595
  • 99
  • 455
  • 496
olamundo
  • 23,991
  • 34
  • 108
  • 149

2 Answers2

1

Here's GUI written for MATLAB, that uses external calls to Shewchuk's Triangle.c:

http://marineemlab.ucsd.edu/~kkey/software/triangle/index.php

Maybe you can use that.

Eitan T
  • 32,660
  • 14
  • 72
  • 109
0

I recommend Matlab's DelaunayTri(...,C) where C is the constraint edges in a numEdge x 2 matrix. Edges are specified with 2 indices into the set of triangulation points.

Output is object with a DelaunayTri class.

http://www.mathworks.com.au/help/techdoc/ref/delaunaytri.html

To filter out the triangles inside or outside the constraints use "inOutStatus()"

e.g.

dt = DelaunayTri(double(Points), double(Constraints));
outside = ~ dt.inOutStatus();
%filter using TriRep to create a new set of triangles, "tr"
tr = TriRep(dt(outside, :), dt.X);
Edmund
  • 1
  • I am not sure I understand how can you make more general constraints like I mentioned in the question, about the minimum size of the angle etc... – olamundo Jul 30 '12 at 13:28
  • This is still much slower than triangle for large input with edge constraints. Even writing to file, running Triangle on the command line and reading the result from file is orders of magnitude faster. – Alec Jacobson Feb 01 '14 at 15:41