IGES import problem

I used IGESControl_Reader to import igs file into occ, and use the GiveList(“iges-faces”) to read all face, but the model have been imported contains the reference plane, and the surface have not been trimmed? thus the same problem occurs in the sample of import/export while importing the igs file. but use the draw test harness with the igesread command, the model display is ok, anybody know why? or how to get the source code of igesread command? thanks

P G's picture

igesread src/XSDRAWIGES/XSDRAWIGES.cxx

pizibing's picture

thank you very much for your help. can you help me to figure out why the follow code could not trim the surface:
#include “IGESControl_Reader.hxx”
#include “TColStd_HSequenceOfTransient.hxx”
#include “TopoDS_Shape.hxx”
{
IGESControl_Reader myIgesReader;
Standard_Integer nIgesFaces,nTransFaces;
myIgesReader.ReadFile (“MyFile.igs”);
//loads file MyFile.igs
Handle(TColStd_HSequenceOfTransient) myList = myIgesReader.GiveList(“iges-faces”);
//selects all IGES faces in the file and puts them into a list called //MyList,
nIgesFaces = myList-Length();
nTransFaces = myIgesReader.TransferList(myList);
//translates MyList,
cout“IGES Faces: “nIgesFaces“ Transferred:”nTransFacesendl;
TopoDS_Shape sh = myIgesReader.OneShape();
//and obtains the results in an OCCT shape.
}

however, the iges draw command seems handle in this way:
IGESToBRep::WriteShape (shape,1);
which the final result show the model have been trimmed.

Attachments: 
Forum supervisor's picture

Hi yibing,

If you like to request our professional assistance in solving your specific problems, please consider purchasing one of our support programs described at http://www.opencascade.org/support/alacarte/.

See the big yellow button "Contact us"? Use it if you like to get more information about pricing etc. :)

F.S.

pizibing's picture

I dont think this is a specific problem, it is a command problem if using the opencascade for import iges model into the occ, the sample given does show appropriate results, not trim the surface, however, by using the draw test harness using igesread performs well. we have a nonprofit group in China, we have discussed this problem, and try to figure out why, and help other to use the opencascade to import igs file correctly. Thanks!

Y.B.

Forum supervisor's picture

Great!

Now you know where to find the source for both cases of reading, so just thoroughly compare the source to understand what affects the translation results.

F.S.

pizibing's picture

I have tried to find out why for almost a day, but found the two have no different but for a brep model file been written, and with the vdisplay command to show the processed file. can you tell me where the source code of vdisplay, thanks in advance.

Forum supervisor's picture

It's in src/ViewerTest/ViewerTest.cxx

P G's picture

the RAr contains two snapshots.
The second one looks good - output in which s/w?
also could u share the IGES file.
thanks

pizibing's picture
P G's picture

thanks
I tested in my code too, getting two untrimmed faces when
OneShape() is processed using iges-faces option.

pizibing's picture

Thanks for your help. I have checked the source code of igesread, founding that it is almost the same as the import sample do, but with Brepwrite method to write a opencascade file, and use vdisplay to visualize the file. Now, I am check why the draw test harness could display the file exactly, will this be the proplem of brepwrite or the vdisplay? can you give me some advance?

P G's picture

igesread command or any import Iges command does not have an option to test
"Iges-faces" argument.
Do u know how to use it ?

pizibing's picture

I have checked the source code of igesread, it does not have an option for "iges-faces" argument.

Forum supervisor's picture

Hi yibing,

For a Draw command, typing:

getsource

in the Draw prompt will give you the source file name.

Cheers,
Forum supervisor

pizibing's picture

thank for your advice, but in 6.5 version, I type the command getsource igesread, it says invalid command getsource

Forum supervisor's picture

Hmm,

It sounds strange... this command exists since the beginning of times...
Do you type it in the Draw prompt? Or in the MS DOS command window? In the latter case, it won't work ;)

Anyway, what is the reason for you to use version 6.5? Why don't you try the latest 6.7.1. instead?

F.S.

pizibing's picture

I type it in the draw prompt. see the follow picture. I have complie the source code for almost 5 month now, have not try 6.7.

Attachments: 
Forum supervisor's picture

Aren't you bothered by the message "tkLoop: error in Tk initialization ..."?

Actually it indicates something is wrong with your Draw configuration.

pizibing's picture

It not really affect much.

xu weibin's picture

Hi,

I have the same question.Did you find the way?