CIBC:Project:TetGen

From NCRR Biomedical Software Development, Engineering, and Dissemination Wiki

Jump to: navigation, search

Contents

Documenting the TetGen bridge

Download and documentation site: TetGen

The dev version: TetGen Developement Version

I recommend using the dev version, as it has some fixes and better debugging info and a new -q refinement algorithm. (See this paper)

Compiling and Configuring

  1. download the tarball
  2. untar it.
  3. cd into tetgen1.4.0
  4. If you have a 64 bit machine, you have to add -fPIC to CFLAGS in makefile.
  5. type: make tetlib
  6. on your scirun configure line add --with-tetgen=/full/path/to/your/tetgen1.4.0

Once you successfully configure the module SCIRun/FieldsCreate/TetGen will attempt to compile.


Note: The command line switches that are passed to tetrahedralize are very sensitive to the input data. It is easy to make it do anything from crashing to infinite loop to work correctly. So I'm not sure how much control we should allow the user from a gui.

Crash Bug Currently tetgen can crash given a sperical input mesh. I am talking with Hang Si about it. You can work around this by jittering the nodes in the mesh somewhat. This happens at least on 64bit machines.

Proposed Modules

The following modules would depend upon tetgen, and conditionally compile when successfully configured --with-tetgen.


TetGen

module spec

  • More generic use of tetgen
  • Allow the user to specify the command line switch string
    • which can allow them to crash tetgen or infinite loop
  • point cloud input field (optional)
    • Force the output volume to include each point as nodes.
  • second point cloud field input (optional)
    • only needed if you need to control the region attributes.
      • like the region id (material value)
      • or if you want to have regional control over the volume constraint
    • these points indicate regions (in the same order as input fields)
    • the double value stored at the points are the volume constraint
  • dynamic field input port
    • each input is added with a unique region number


This module is for using the capabilities of tetgen on SCIRun fields.

The test netowork is: SCIRun/src/nets/Modules/FieldsCreate/TetGen-3regions.srn

Use the ClipField UI in this net to show you the different tetvol regions, valid values are 1,2,and 3.

Image:tetgen3surf.png

BuildFEVol

module spec

  • each geometrically distinct surface has a unique region number stored at each face (constant data)
  • One input field for the surface data
    • constant basis surface field
    • region id at each face indicating which spatially different surface the face belongs to.
    • a property which maps region id to material id, volume constraint
    • correct surfaces (consistent ordering with outward facing normals), and a Point in the region
    • the property would be generated upstream
    • likely the result of another module that does ray casting with user input for specifying the volume constraint in a region think gather fields ++
  • point cloud input field (optional)
    • Force the output volume to include each point as nodes.
  • this module uses tetgen in a very specific way (the most stable way we can determine)
  • We will need a UI to allow the user to input values for q or a switches (quality, area)


This module is for building a FE TetVol that specifies a material id per element. GenericField<TetVolMesh<TetLinearLgn<Point> >, ConstantBasis<double>, vector<double> >

One double per element should be flexible enough to represent any material representation, although char is likely sufficient but limiting. Perhaps this should be specified in the UI?

Personal tools