dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #06571
Re: TriTetMesh 0.1
On Thu, Feb 28, 2008 at 03:08:25PM +0100, Johan Hake wrote:
> Dear all!
>
> I hearby present version 0.1 of TriTetMesh. It is a c++/python wrapper of the
> high quality mesh generators: Tetgen and Triangle.
>
> The output format is dolfin mesh, and dolfin meshfunctions for markers. It is
> also possible to output the native Tetgen and Triangle formats.
>
> For now the code resides in a tarball:
>
> <http://folk.uio.no/hake/tritetmesh/tritetmesh.tar.gz>
>
> I have not checked if it builds on mac, but it should build on Linux/Ubuntu.
> You will then need swig, python, python-dev, python-numpy, python-numpy-dev
> and scons. (I think this is all...)
>
> The documentation is sparse but have a look at the provided demos. It can be
> usefull to look at the docstrings for the python functions too. As TriTetMesh
> is a more or less complete wrapper of Triangle and Tetgen it is instructive
> to have a look at their webpages for clues.
>
> Tetgen <http://tetgen.berlios.de>
> Triangle <http://www.cs.cmu.edu/~quake/triangle.html>
>
> Please have a try!
>
> Send me an email if you encounter problems. Such discussions should probably
> stay of this list ;)
>
> Cheers
>
> Johan
Looks very nice!
I've also looked a bit a Netgen as an alternative to Tetgen and it
seems to have a simple interface that might be simpler to wrap than
Tetgen. Netgen can also save directly to DOLFIN XML (patch from
Kent-Andre that is in Netgen CVS).
Netgen uses input files like these:
# a cube
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
# two shperes
solid sph1 = sphere (0.5, 0.5, 0.5; 0.58);
solid sph2 = sphere (0.5, 0.5, 0.5; 0.75);
# cut cube with inner and outer sphere
solid main = cube and sph2 and not sph1;
This would be *very* easy to wrap in DOLFIN so one could do things
like
s1 = Sphere(...)
s2 = Sphere(...)
c = Cube(...)
mesh = Mesh(c + s2 - s1)
Perhaps this could be done also with Tetgen/Triangle?
--
Anders
Follow ups
References