[cgma-dev] question about iges format (to Jane)

Iulian Grindeanu iulian at mcs.anl.gov
Wed Jan 18 13:06:18 CST 2012


Hi Jane, Thank you for looking into this. So I verified that with this fix, the output coordinates in testgeom_occ are the same with the one from testgeom. This is "hardcoded", so all iges files read by occ will be "converted" to M. What field in igs file shows that the unit is M? Or is MM? I am still confused who does the conversion to MM, OCC igs reader ? Anyway, this has implications for MOAB too. With the current code, moab will convert the igs file to a faceted model, and in case of OCC it takes forever to facet (I think we have a unit issue there, as we use an absolute value for facet size, not a relative size of model) I mean, if you do "mbsize cducts.igs" for mbsize built with OCC, it will not finish in more than 3 minutes I waited (I had to kill the process). I need to try after this fix. While mbsize cducts.igs for moab built with cubit, finishes almost instantly. Again, mbsize <>.igs will do a faceting of geometry first, then will output the size of the (faceted) mesh. Thanks, Iulian ----- Original Message -----
| I need to code for reading the unit of iges, and set up the unit in
| the cgm.
| For now, if you already knows the unit of the iges files, here is
| meter, then just add the following lines to OCCQueryEngine.cpp should
| work. Please let me know if it temporarily solves your problem.
| --- OCCQueryEngine.cpp (revision 5293)
| +++ OCCQueryEngine.cpp (working copy)
| @@ -32,6 +32,7 @@
| #include "gp_Ax2.hxx"
| #include "Geom_Surface.hxx"
| #include "Geom_Curve.hxx"
| +#include "Interface_Static.hxx"
| #include "BRepBuilderAPI.hxx"
| #include "BRepBuilderAPI_Transform.hxx"
| #include "BRepBuilderAPI_GTransform.hxx"
| @@ -1491,6 +1492,9 @@
| else if(strcmp(file_type, "IGES") == 0)
| {
| IGESControl_Reader reader;
| + char* name = "xstep.cascade.unit";
| + char* val = "M";
| + Interface_Static::SetCVal (name, val);
| const Standard_CString string1 = file_name;
| IFSelect_ReturnStatus stat = reader.ReadFile( string1);
| if (stat != IFSelect_RetDone)
| Thanks.
| Jane
| On Wed, Jan 18, 2012 at 10:21 AM, Jane Hu < janejhu at gmail.com > wrote:
| | Hi, Iulian,
| | Opencascade internally assumes that OCC models are measured in
| | millimeters, so if the model is given in unit M (meter), it'll be
| | changed to 1000times larger and uses MM(millimeter) in OCC. I am now
| | checking on the code, and see if we can do something on it.
| | Jane
| | On Wed, Jan 18, 2012 at 9:14 AM, Iulian Grindeanu <
| | iulian at mcs.anl.gov
| | > wrote:
| | | Hi Jane,
| | | Dan Le found this problem with respect to igs reader:
| | | Please see the attached files.
| | | testgeom.cc is a version of CGM/itaps/testgeom.cc file, which also
| | | prints the coordinates of all the vertices from the model.
| | | iges format is supported by OCC and Acis/cubit engines.
| | | Still, the coordinates of the vertices are 1000 larger when occ is
| | | used.
| | | So if you run this test
| | | testgeom cduct.igs
| | | in Cubit based cgm or
| | | testgeom_occ cduct.igs
| | | in OCC based cgm,
| | | you get different results (1000 times bigger in occ case). It
| | | seems
| | | that in cubit case, we do a conversion to sat format, first.
| | | ITAPS GEOMETRY INTERFACE TEST PROGRAM:
| | | gLoad: Reading STEP/IGES file
| | | '/home/iulian/tmp/test_lorenzo/cduct.igs'...
| | | Model conversion succeeded: /tmp/CBT.Hoo5yc.sat
| | | Read 6 ACIS Entities from the input file
| | | Constructed 6 Volumes: 1 to 6
| | | Model contents:
| | | vertices: 24
| | | edges: 24
| | | faces: 6
| | | regions: 6
| | | vertex index 0 : 0 0 0
| | | vertex index 1 : 0 1 0
| | | vertex index 2 : 10.5 15 0
| | | vertex index 3 : 11.5 15 0
| | | ...
| | | testgeom_occ cduct.igs
| | | Geometry engine set to: OpenCascade 6.3
| | | ITAPS GEOMETRY INTERFACE TEST PROGRAM:
| | | gLoad: Total number of loaded entities : 78.
| | | Constructed 6 Volumes: 1 to 6
| | | Model contents:
| | | vertices: 24
| | | edges: 24
| | | faces: 6
| | | regions: 6
| | | vertex index 0 : 0 0 0
| | | vertex index 1 : 0 1000 0
| | | vertex index 2 : 10500 15000 0
| | | vertex index 3 : 11500 15000 0
| | | ...
| | | Can you please tell me what we should do to get similar results ?
| | | Thanks,
| | | Iulian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/cgma-dev/attachments/20120118/0fe27ee2/attachment.htm>


More information about the cgma-dev mailing list