- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Help for 3D mesh - How to mesh multiple solids in a ENTITY_LIS T?
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-07-2010 09:46 AM - last edited on 06-07-2010 09:48 AM
We are testing ACIS 3D mesh. It works very good if there is only one solid in ENTITY_LIST, but if there are more than 1 solids in the list, the "api_va_generate_tet_mesh()" always fail.
Can you tell me what is the problem and how to solve it?
Following is the code:
BODY *block1=NULL;
BODY *block2=NULL;
api_solid_block( SPAposition(0,0,0), SPAposition(50,50,50),block1);
api_solid_block( SPAposition(50,0,0),SPAposition(100,50,50),block2) ;
ENTITY_LIST e_list;
e_list.add( block1 );
e_list.add( block2 );
// Generate a tet mesh using defaults for meshing options
va_tetmesh* p_mesh = NULL; va_tet_mesh_options opts;
opts.setGrowthRate( 1.3 );
opts.setTargetEdgeLength( 20.0 );
va_surface_mesh_options surf_opts;
surf_opts.setTargetEdgeLength( 20 );
surf_opts.setMinEdgeLength( 0.5 );
if( api_va_generate_tet_mesh(e_list, p_mesh, &surf_opts, &opts).ok() )
{
// output mesh
{
ofstream of( "tet_mesh.txt" );
int nNoEle;
api_va_get_element_count( (va_mesh*)p_mesh, nNoEle );
of << nNoEle << "\n";
}
api_va_delete_mesh((va_mesh*)p_mesh);
}
// release BODY
api_del_entity( block1 );
api_del_entity( block2 );Thanks in advance.
Re: Help for 3D mesh - How to mesh multiple solids in a ENTITY_LIS T?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-07-2010 10:04 AM
Hello xpz,
The api_va_generate_tet_mesh has journaling capability. Can you please journal the api and send us the results as that will speed up the investigation?
Regards,
Yogesh
Re: Help for 3D mesh - How to mesh multiple solids in a ENTITY_LIS T?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-07-2010 08:29 PM
Following is our new code with API journaling, attached is the journal output
// Create an AcisOptions object and initialize journalling
AcisOptions * ao = ACIS_NEW AcisOptions();
api_start_journal(ao);
// Create solids
BODY *block1=NULL;
BODY *block2=NULL;
api_solid_block( SPAposition(0,0,0), SPAposition(50,50,50),block1, ao);
api_solid_block( SPAposition(50,0,0),SPAposition(100,50,50),block2, ao);
ENTITY_LIST e_list;
e_list.add( block1 );
e_list.add( block2 );
// Generate a tet mesh using defaults for meshing options
va_tetmesh* p_mesh = NULL;
//
va_tet_mesh_options opts;
opts.setGrowthRate( 1.3 );
opts.setTargetEdgeLength( 20.0 );
va_surface_mesh_options surf_opts;
surf_opts.setTargetEdgeLength( 20 );
surf_opts.setMinEdgeLength( 0.5 );
// meshing
if( api_va_generate_tet_mesh(e_list, p_mesh, &surf_opts, &opts, ao).ok() )
{
// output mesh
{
ofstream of( "tet_mesh.txt" );
int nNoEle;
api_va_get_element_count( (va_mesh*)p_mesh, nNoEle );
of << nNoEle << "\n";
}
//
api_va_delete_mesh((va_mesh*)p_mesh);
}
// release BODY
api_del_entity( block1 );
api_del_entity( block2 );
// Terminate journalling and delete the AcisOptions object
api_end_journal(ao);
ACIS_DELETE ao;
Re: Help for 3D mesh - How to mesh multiple solids in a ENTITY_LIS T?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-08-2010 04:40 PM
We find the reason of why api_va_generate_tet_mesh() fail.
If the solids in the ENTITY_LIST is adjacent (touching or intersect), api_va_generate_tet_mesh() always fail.
But our purpose is creating conformal mesh on several adjacent solids. We find a way to make it work: firstly make non-regularized unite on all solids, then mesh. There is one problem in this method. We need to know which mesh element belonging to which original solids. But after union, all solids infomation are loss (only a united solid left), we can not use api_va_get_entity() to obain the information.
Does anybody have example code to show how to mesh several adjacent solids and query the mesh element belonging to which original body?
One more question, how to obtain the conectivity information of mesh element, for example, given a mesh element (a tetrahedron), how to get the adjacent (connecting) mesh elements (tetrahedrons),
Thanks in advance.
Re: Help for 3D mesh - How to mesh multiple solids in a ENTITY_LIS T?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-09-2010 10:02 AM
Doing a non-regularized unite is the proper way to prepare your geometry for the mesher. To create double-backed faces in a tet-mesh, you need to first create a surface mesh with double backed faces and the use that mesh to create a tet mesh. Here is some code:
// create a surface mesh with given options
va_surfmesh* sur_mesh = NULL;
va_surface_mesh_options surf_opts;
surf_opts.setEnableIntSurfBack( true );
api_va_create_surface_mesh( sur_mesh, &surf_opts );
// now create the tet mesh
va_tetmesh* tet_mesh = NULL;
api_va_generate_tet_mesh( sur_mesh, tet_mesh );
You can then use the following functions to get information about the mesh and body topology:
| api_va_get_entity | eda:element-entities | Given an element extract the face, edge or vertex entity associated with it. |
| api_va_get_elements | eda:entity-elements | Given an entity, extract the elements associated with it. |
| api_va_get_node_entities | eda:node-entities | Given a node, extract the entities associated with it. |
| api_va_get_nodes | eda:entity-nodes | Given an entity, extract the nodes associated with it. |
Check out the following documentation regarding how to then query the mesh you created:
http://doc.spatial.com/index.php/EDA_Querying
Please let me know if this helps you, or if this is not what you're looking for.

