Controlling number of elements with Octree mesh refinement

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
nimal136
Posts: 1
Joined: Mon Nov 18, 2019 5:19 am

Controlling number of elements with Octree mesh refinement

Post by nimal136 »

Hello TexGen Team,
I am trying to use the newly released feature in COctreeVoxelMesh() class for obtaining a reasonable quality hex mesh. SaveVoxelMesh() function in this class has only the option to specify the minimum and maximum refinement and hence all the dimensions are subjected to same degree of refinement.
I am trying to voxel mesh a flat weave of dimensions (x,y,z: 2.82,2.82,0.6). For such a flat weave with longer x and y dimensions compared to z dimension, this results in high aspect ratio elements as the Octree algorithm tries to refine every dimension uniformly. Is there a way to more explicitly control the number of voxels in the COctreeVoxelMesh() class ?

Code: Select all

SaveVoxelMesh(Textile, Filename, Min Refinement, Max Refinement, Smoothing, Smoothing Iterations, Smoothing Parameter 1, 
              Smoothing Parameter 2, Create surfaces, Create cohesive contact)
Alternatively, Is it possible to draw the functionality of Laplacian Smoothing algorithm implemented in COctreeVoxelMesh() class to the CVoxelMesh class? I have little experience with C++ code so I haven't dug into the TexGen source code. If you could guide me how I can bootstrap the CVoxelMesh() to just use the smoothing algorithm of its child class COctreeVoxelMesh() using the Python syntax, that would be very helpful.

Thanks for your time.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Controlling number of elements with Octree mesh refineme

Post by louisepb »

Hi,

Many apologies for the very slow reply to your questions. The code in the current release only allows the same level of refinement in all directions. The next release will include a user interface to allow the octree refinement and smoothing to be accessed from the user interface and also to specify the starting number of voxels along each axis.

The code is currently on GitHub so you can download it to try but we have discovered a bug where some of the nodes are assigned zero coordinates which we are still trying to track down. Once we've found this we'll be doing a release but, in the meantime, you're welcome to download the code. I think the bug only occurs for very large meshes.

Best wishes,
Louise
Post Reply