Ennemoser Andreas AVL/GRZ a écrit : > Dear all, > > may be someone can give me assistance in doing the following: > > I'd like to read the attached IGES curve and convert it to a set of > points and write them out to a new file with some format. > > What I can do so far: > > * Use the CADViewer demo and read in and display the IGES curve > (this is pretty simple, because everything is given already) > * from OCC import IGESControl > i = IGESControl.IGESControl_Controller() > i.Init() > iges_reader = IGESControl.IGESControl_Reader() > iges_reader.ReadFile(str(filename)) > iges_reader.TransferRoots() > shape = iges_reader.OneShape() > > What I worry about is which set of classes/methods I need in which > sequence to end up with an array or list that carries a set of points. > > I suppose I have to use something like: > > * IGESToBRep_BasicCurve > > <http://www.pythonocc.org/APIREF/OCC.IGESToBRep.IGESToBRep_BasicCurve-class.html> > > to convert the data into a generic representation but then i get stuck. > > Any comments appreciated. > > Andy > > ____________________________________________________________________________ > AVL List GmbH, Firmensitz: Graz, Firmenbuchnummer: FN 53507M, > Landesgericht fuer ZRS Graz > > Hi Andy,
The IGESReader class handles all the IGES to OpenCascade data model conversion. You should not have anything to do manually. When the import is finished, all the information is contained in your 'shape' instance. I'm not sure I understood what you expect, but if you want to handle the curve, I would suggest to: - not get all the information in *one* shape (it appears there are 2 in your igs sample), - perform a loop over the shape topology entities to filter edges (flag TopAbs_EDGE) - build a Wire from these Edges with the BRepBuildAPI_MakeWire.Add() method Hope this helps, Thomas _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users