Triangle generates exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations, Voronoi diagrams, and high-quality triangular meshes. The latter can be generated with no small or large angles, and are thus suitable for finite element analysis.
This is a Python wrapper for the Triangle library referenced above. It uses ctypes. The add-on adds a ‘Triangulate’ operator (and button!) to Blender, which can take any planar meshable object (curves and meshes) and create a triangulated mesh based on specified input parameters.
Input parameters are provided via a text field and are described in the Triangle documentation.
Further work could be done to expand functionality and add support for meshing Ngon faces or some other way of operating out of the XY plane, but for now it is limited to this.
This is especially useful for creating meshes for sculpting or meshes with good face densities from 2d CAD data, for arch. viz or other uses. Interior edges are respected, meaning creating dense meshes with interior regions is possible.
UPDATE 190514
Fixed issue with crashes on newer Windows versions.
Added Linux support.
Regions and holes can be implemented, but I just need to figure out the best way of controlling / exposing this in Blender…
UPDATE 171208:
Added checkboxes and clearer options in the UI, with the option of specifying a argument string instead.
A vertex group (Triangle Boundary) is added to the new mesh, which contains all the original vertices from the input mesh / curve. This is great, but when edges are split / vertices are inserted between input vertices, these don’t get included. One option would be to keep track of input edges, and find the mesh shortest path between the ends after triangulation, and add these new vertices to the vertex group as well.
Getting an error when running the operator on curves/meshes (doesn’t show panel either). Also you might want to include common parameters as enum presets for better ease of use.
Interesting. Some of the args for the entry box look like switchable functions or perhaps toggles. (Or at least it would make sense without understanding all the details, seems a bit technical.) Any chance it will be given a proper UI and some half-decent starting presets in regards to values? That would make it easier for people to play around with, might even be able to control-scroll and watch changes on the mesh like other Blender functions which would be awesome.
That’s a good point, I hadn’t thought too much about cloth! Would be cool to see how this could be combined with cloth simulation, esp. vertex groups for goals and such…
The params are default (invoked from panel). The meshes are two mesh circles with different sizes. Not too sure what actually causes the error. Also after messing around a bit I’m getting the same error but from return createMesh(out_mesh)
Haven’t got experience with compiling for Linux, but could give it a crack when I get some time. Alternatively, if someone wants to compile Triangle as an .so library and send it to me, I could see how to make it work on the Python side?
Was really surprised to see how well did it work heh.
There is a lot you can build upon it. For a start it could be super useful to have original vertices grouped in separate vertex group after the object creation, so that you can easily shrinkwrap it back to the original (3D) shape (can be also automated).
Check out the update. It has basic vertex group support now.
Triangulate -> Add Cloth / Softbody modifier -> Set goal to ‘Triangle Boundary’ vertex group
Also noticed triangle.py has tabs as whitespace instead of 4 spaces, you might want to fix that. And usually you post addons in Released Scripts instead of Latest News.
I’m getting the same thing, seems like my system doesn’t like dll.triangulate(). The actual arguments seem fine though when printing them.
Ok, that’s probably a better place for this thread. Any idea how to get it moved?
For these DLL problems, make sure to install the MS Visual C++ Redistributable 2015, since that’s what the library is compiled against. See if that helps…
Yes, I can, but it is very simple… two bezier circles only or one bezier closed curve. I open blender, I delete default box mesh and add circle shape, after to click on triangulate button I get the dll error.
Trying install vs 2015 redistributable, windows say I already have it installed.