Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

dump a line shape into a file

dump a line shape into a file
Gan Lu 2012/10/29 21:53
Hi all, I\'m try to do a simple test, which builds a line through 2 points and then dump it into a file, named \'EdgeData\', as follows:
gp_Pnt aPnt1(0,0,0);
gp_Pnt aPnt2(1,1,0);
Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1 , aPnt2);

TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);

FSD_File f;
ShapeSchema *ssche = new ShapeSchema;

f.Open(\"EdgeData\", Storage_VSWrite);
PTColStd_TransientPersistentMap aMap;
Handle(PTopoDS_HShape) aPShape= MgtBRep::Translate(aEdge1, aMap, MgtBRep_WithoutTriangle);
Handle(Storage_Data) d= new Storage_Data;
d->AddRoot(\"ObjectName\", aPShape);

But it has a segment fault, and the error comes from the line ssche->Write(f,d). Can anyone please suggest how to solve it?

Many Thanks
Gan Lu 2012/10/29 22:24
Hi, the problem has been solved... I should define the ShapeSchema as: Handle(ShapeSchema) ssche = new ShapeSchema;
But what the format of the output file is it? My intention is to get the interpreted points and perhaps I can plot it through gnuplot.
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map