Skip to content

HybridOctree_Hex_v1.2

Latest
Compare
Choose a tag to compare
@gt2001 gt2001 released this 01 Feb 03:56
· 180 commits to main since this release
344cb8f

Changes in v1.2

  1. Improved the octree structure generation code speed.
  2. Modified default parameters for better performance.
  3. Cleaned unnecessary or even unused code, improved code readability.
  4. Improved output message readability.

Input

The program supports .raw input models. The format of a .raw file should look like this, below is a unit cube centered at (0, 0, 0):

8 12
-0.5 -0.5 -0.5
0.5 -0.5 -0.5
0.5 0.5 -0.5
-0.5 0.5 -0.5
-0.5 -0.5 0.5
0.5 -0.5 0.5
0.5 0.5 0.5
-0.5 0.5 0.5
0 1 2
0 3 2
4 5 6
4 7 6
0 1 5
0 4 5
1 2 6
1 5 6
2 3 7
2 6 7
0 3 7
0 4 7

Line 1 contains two integers, representing #vert and #elem.
Line 2 to Line #vert+1 contain three real numbers, representing xyz coordinates.
Line #vert+2 to Line #vert+#elem+1 contain three integers in [0, #vert), representing three indexes to form triangles.

Please replace the volumeFileName in Main.cpp Line 8 with your own input file name.

Parameters

The default parameters should work for most of the models, as they are relatively conservative (although this leads to some unnecessary elements).

  1. To adjust the deepest octree level, modify the VOXEL_SIZE in Initialization.h Line 6. Feasible values: 3, 4, 5, ..., 9.
  2. To make the mesh coarse/dense at detailed features, modify the C_THRES and H_THRES in Initialization.h Line 7, 8. Smaller C_THRES and H_THRES result in denser mesh.

Output

The mesh result is in finalMesh.vtk. Notice that the program does not quit by itself. You can take the mesh result and terminate the program when you are satisfied with the mesh quality.

Compilation

Please compile with cmake. No third-party packages are needed.

Issue Report

Please report issues in the Issues column or email me.