<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><BR><BR>--- On <B>Wed, 1/18/12, Iulian Grindeanu <I><iulian@mcs.anl.gov></I></B> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px"><BR>From: Iulian Grindeanu <iulian@mcs.anl.gov><BR>Subject: Re: [cgma-dev] question about iges format (to Jane)<BR>To: "Jane Hu" <janejhu@gmail.com><BR>Cc: "jiangtao ma" <jiangtao_ma@yahoo.com>, "CGMA Development" <cgma-dev@mcs.anl.gov><BR>Date: Wednesday, January 18, 2012, 2:06 PM<BR><BR>
<DIV id=yiv1031861050>
<STYLE type=text/css>#yiv1031861050 p {margin:0;}</STYLE>
<DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt">Hi Jane,<BR>Thank you for looking into this.<BR>So I verified that with this fix, the output coordinates in testgeom_occ are the same with the one from testgeom. <BR>This is "hardcoded", so all iges files read by occ will be "converted" to M.<BR></DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f>That's why I haven't checked in the code yet.</FONT></DIV><FONT color=#00007f></FONT>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><BR>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 ?<BR></DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f>In the iges file first several lines, with a 'G' in the 73th column, you can find a 1HM, which shows the unit is one charactor 'M', if it's MM, it'll be 2HMM. The conversion to MM is done in Opencascade reader, we need to set up the global unit outside it to prevent the conversion in this case. </FONT></DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f></FONT> </DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f>What I need to do is to add code in cgm to read iges/step file about the unit, and assign it to the reader, so it won't be hard coded to M.</FONT></DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f></FONT> </DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f>I may take tomorrow off since I agreed to give a talk to my son's preschool about Chinese New Year, I'll try to fix it as soon as possible.</FONT></DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f></FONT> </DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><FONT color=#00007f>Jane</FONT></DIV><FONT color=#00007f></FONT></DIV>
<DIV><BR>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)<BR><BR>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.<BR>While mbsize cducts.igs for moab built with cubit, finishes almost instantly.<BR><BR>Again, mbsize <>.igs will do a faceting of geometry first, then will output the size of the (faceted) mesh.<BR><BR>Thanks,<BR>Iulian<BR><BR></DIV>
<DIV>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt">
<HR id=yiv1031861050zwchr>
</DIV>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; FONT-FAMILY: Times New Roman; COLOR: #000000; MARGIN-LEFT: 5px; FONT-SIZE: 12pt">I need to code for reading the unit of iges, and set up the unit in the cgm.<BR><BR>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.<BR><BR>--- OCCQueryEngine.cpp (revision 5293)<BR>+++ OCCQueryEngine.cpp (working copy)<BR>@@ -32,6 +32,7 @@<BR> #include "gp_Ax2.hxx"<BR> #include "Geom_Surface.hxx"<BR> #include "Geom_Curve.hxx"<BR>+#include "Interface_Static.hxx"<BR> #include "BRepBuilderAPI.hxx"<BR> #include "BRepBuilderAPI_Transform.hxx"<BR> #include "BRepBuilderAPI_GTransform.hxx"<BR>@@ -1491,6 +1492,9 @@<BR> else if(strcmp(file_type, "IGES") == 0)<BR>
{<BR> IGESControl_Reader reader;<BR>+ char* name = "xstep.cascade.unit";<BR>+ char* val = "M";<BR>+ Interface_Static::SetCVal (name, val);<BR> const Standard_CString string1 = file_name;<BR> IFSelect_ReturnStatus stat = reader.ReadFile( string1);<BR> if (stat != IFSelect_RetDone)<BR><BR>Thanks.<BR><BR>Jane<BR><BR><BR>
<DIV class=yiv1031861050gmail_quote>On Wed, Jan 18, 2012 at 10:21 AM, Jane Hu <SPAN dir=ltr><<A href="http://us.mc1616.mail.yahoo.com/mc/compose?to=janejhu@gmail.com" rel=nofollow target=_blank ymailto="mailto:janejhu@gmail.com">janejhu@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=yiv1031861050gmail_quote>Hi, Iulian,<BR><BR>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.<SPAN class=yiv1031861050HOEnZb><FONT color=#888888><BR><BR>Jane</FONT></SPAN>
<DIV class=yiv1031861050HOEnZb>
<DIV class=yiv1031861050h5><BR><BR>
<DIV class=yiv1031861050gmail_quote>On Wed, Jan 18, 2012 at 9:14 AM, Iulian Grindeanu <SPAN dir=ltr><<A href="http://us.mc1616.mail.yahoo.com/mc/compose?to=iulian@mcs.anl.gov" rel=nofollow target=_blank ymailto="mailto:iulian@mcs.anl.gov">iulian@mcs.anl.gov</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=yiv1031861050gmail_quote>
<DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">Hi Jane,<BR>Dan Le found this problem with respect to igs reader:<BR>Please see the attached files.<BR>testgeom.cc is a version of CGM/itaps/testgeom.cc file, which also prints the coordinates of all the vertices from the model.<BR>iges format is supported by OCC and Acis/cubit engines.<BR>Still, the coordinates of the vertices are 1000 larger when occ is used.<BR>So if you run this test<BR>testgeom cduct.igs<BR>in Cubit based cgm or<BR>testgeom_occ cduct.igs <BR>in OCC based cgm,<BR>you get different results (1000 times bigger in occ case). It seems that in cubit case, we do a conversion to sat format, first.<BR><BR>ITAPS GEOMETRY INTERFACE TEST PROGRAM:<BR><BR> gLoad: Reading STEP/IGES file '/home/iulian/tmp/test_lorenzo/cduct.igs'...<BR>Model conversion succeeded: /tmp/CBT.Hoo5yc.sat<BR>Read 6 ACIS Entities from the input file<BR><BR><BR>Constructed 6 Volumes: 1 to 6<BR>Model
contents: <BR>vertices: 24<BR>edges: 24<BR>faces: 6<BR>regions: 6<BR>vertex index 0 : 0 0 0<BR>vertex index 1 : 0 1 0<BR>vertex index 2 : 10.5 15 0<BR>vertex index 3 : 11.5 15 0<BR>...<BR><BR> testgeom_occ cduct.igs <BR>Geometry engine set to: OpenCascade 6.3<BR><BR><BR>ITAPS GEOMETRY INTERFACE TEST PROGRAM:<BR><BR> gLoad: Total number of loaded entities : 78.<BR><BR>Constructed 6 Volumes: 1 to 6<BR>Model contents: <BR>vertices: 24<BR>edges: 24<BR>faces: 6<BR>regions: 6<BR>vertex index 0 : 0 0 0<BR>vertex index 1 : 0 1000 0<BR>vertex index 2 : 10500 15000 0<BR>vertex index 3 : 11500 15000 0<BR>...<BR><BR><BR><BR>Can you please tell me what we should do to get similar results ?<BR><BR>Thanks,<BR>Iulian<BR><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE>
<DIV style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 12pt"><BR></DIV></DIV></DIV></BLOCKQUOTE></td></tr></table>