Home
Reply
Contributor
bosimaoxiaoyu
Posts: 11

Very weird issue about acis and 3d mesh

[ Edited ]

why demo1() and demo2() has the different result?

demo1() can mesh successfully, but demo2() failed to mesh that throw a error "Access violation". and demo2 just adding line"int rcc = 0; "

Why does acis and 3dmehs behavior so weird?? 

 

int demo1()
{
API_BEGIN
ENTITY_LIST tmpEnList;
API_BEGIN

BODY *plane_2;
result=api_make_cuboid(1000,2000,500,plane_2);

tmpEnList.add((ENTITY*)plane_2);

API_END

va_surfmesh *meshIns_1;
va_surface_mesh_options surf_opts;
surf_opts.setTargetEdgeLength(100);

result = api_va_generate_surface_mesh(tmpEnList,meshIns_1,&surf_opts);

if (!result.ok())
{
err_mess_type err_no = result.error_number();
string tmpS(find_err_mess(err_no));
QMessageBox::information(NULL, "Mesh error", QString::fromStdString(tmpS));
return -1;
}else
{
QMessageBox::information(NULL, "Mesh OK","OK");
}

API_END
return 0;
}

 

int demo2()
{

int rcc = 0;
API_BEGIN
ENTITY_LIST tmpEnList;
API_BEGIN

BODY *plane_2;
result=api_make_cuboid(1000,2000,500,plane_2);

tmpEnList.add((ENTITY*)plane_2);

API_END

va_surfmesh *meshIns_1;
va_surface_mesh_options surf_opts;
surf_opts.setTargetEdgeLength(100);

result = api_va_generate_surface_mesh(tmpEnList,meshIns_1,&surf_opts);

if (!result.ok()) 
{
err_mess_type err_no = result.error_number(); 
string tmpS(find_err_mess(err_no));
QMessageBox::information(NULL, "Mesh error", QString::fromStdString(tmpS));
return -1;
}else
{
QMessageBox::information(NULL, "Mesh OK","OK");
}

API_END
return 0;

Regular Contributor
Vi2
Posts: 55

Re: Very weird issue about acis and 3d mesh

va_surfmesh *meshIns_1 - this variable is not initialized, but is used because "va_surfmesh *& surface_mesh - (input/output) - Surface Mesh object, if this is NULL then a new one is created" from api_va_generate_surface_mesh.