[cgma-dev] r2111 - in cgm/trunk: geom/ACIS_SRC test
janehu at mcs.anl.gov
janehu at mcs.anl.gov
Wed Oct 1 12:06:22 CDT 2008
Author: janehu
Date: 2008-10-01 12:06:19 -0500 (Wed, 01 Oct 2008)
New Revision: 2111
Modified:
cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp
cgm/trunk/test/hollow_acis.cpp
cgm/trunk/test/modify.cpp
Log:
Not like in OCC, the solid body got hollowed, hence the volume get updated, in Acis, the solid body provide the skin to produce a new thick body and itself be destroyed.
Modified: cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp 2008-09-30 19:09:48 UTC (rev 2110)
+++ cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp 2008-10-01 17:06:19 UTC (rev 2111)
@@ -5944,6 +5944,7 @@
return CUBIT_FAILURE;
}
+ DLIList<BodySM*> bad_bodies;
DLIList<BodySM*> shell_bodies;
for(int i = bodies.size(); i >= 1 ; i-- )
{
@@ -5952,6 +5953,7 @@
if (!acis_body)
{
PRINT_ERROR("Non-ACIS BodySM passed to AcisModifyEngine::hollow.\n");
+ bad_bodies.append(BodyPtr);
continue;
}
DLIList<ShellSM*> shells;
@@ -5959,6 +5961,7 @@
if(shells.size() > 1)
{
PRINT_ERROR("A solid body is required.\n");
+ bad_bodies.append(BodyPtr);
continue;
}
@@ -5968,6 +5971,7 @@
if(size < 2)
{
PRINT_ERROR("Body must have at least 2 surfaces for hollow operation.\n");
+ bad_bodies.append(BodyPtr);
continue;
}
@@ -5980,7 +5984,8 @@
surfaces.remove_all_with_value(NULL);
if(size == surfaces.size())
{
- PRINT_ERROR("Must remove at least one surfaces to make thick body.\n");
+ PRINT_ERROR("Must remove at least one surface to make thick body.\n");
+ bad_bodies.append(BodyPtr);
continue;
}
@@ -6001,6 +6006,7 @@
if ( surfaces.size() != copied_surface_list.size())
{
PRINT_ERROR("Failed to copy surfaces.\n");
+ bad_bodies.append(BodyPtr);
continue;
}
@@ -6027,6 +6033,10 @@
return CUBIT_FAILURE;
CubitStatus stat = thicken(shell_bodies, new_body_list, depth, CUBIT_FALSE);
+
+ //delete the solid bodies which have been hollowed
+ bodies -= bad_bodies;
+ AcisQueryEngine::instance()->delete_solid_model_entities(bodies);
return stat;
}
Modified: cgm/trunk/test/hollow_acis.cpp
===================================================================
--- cgm/trunk/test/hollow_acis.cpp 2008-09-30 19:09:48 UTC (rev 2110)
+++ cgm/trunk/test/hollow_acis.cpp 2008-10-01 17:06:19 UTC (rev 2111)
@@ -145,6 +145,8 @@
from_bodies = new_bodies;
new_bodies.clean_out();
CubitStatus stat = gmti->hollow(from_bodies, faces_to_remove, new_bodies, -.2);
+ //Created volume(s): 2
+ //Destroyed volume(s): 1
n = new_bodies.get()->num_ref_faces(); //n = 9
d = new_bodies.get()->measure(); //d = 72.4074
return CUBIT_SUCCESS;
Modified: cgm/trunk/test/modify.cpp
===================================================================
--- cgm/trunk/test/modify.cpp 2008-09-30 19:09:48 UTC (rev 2110)
+++ cgm/trunk/test/modify.cpp 2008-10-01 17:06:19 UTC (rev 2111)
@@ -721,6 +721,7 @@
from_bodies = new_bodies;
new_bodies.clean_out();
stat = gmti->hollow(from_bodies, faces_to_remove, new_bodies, -.2);
+ //Updated volume(s): 54
n = new_bodies.get()->num_ref_faces(); //n = 10
d = new_bodies.get()->measure(); //d = 72.3618
More information about the cgma-dev
mailing list