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

Jane Hu janejhu at gmail.com
Wed Jan 18 12:31:28 CST 2012


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/09d27c9f/attachment.htm>


More information about the cgma-dev mailing list