step file export

Hi guys,

below is the piece of codes I use to export a face for testing purpose. I have inserted into the sample: topologybuilding to export PinkFace in that sample. However it doesn't work. I tried to trace it, but the codes is too much convoluted, I have no idea why it is wrong. Could anyone please tell me how I can export a face to step format?

thanks a lot.

Handle(TopTools_HSequenceOfShape) aSequence = new TopTools_HSequenceOfShape();

STEPControl_Writer aWriter;

IFSelect_ReturnStatus status;
for (Standard_Integer i=1;iLength();i++)
status = aWriter.Transfer(aSequence->Value(i), STEPControl_ManifoldSolidBrep);
if ( status != IFSelect_RetDone ) return;
status = aWriter.Write("c:\\tmp\\x.stp");

Rob Bachrach's picture

I could be wrong, but it seems odd to me that you are outputting a face using the ManifoldSolidBrep form. Chances are that your face does not represent a manifold solid, so you might get nothing. You might try changing your StepModelType to STEPControl_AsIs or STEPControl_ShellBasedSurfaceModel and see if you have more luck.