STEP writer translation problem

Hi All,
I am having difficulty writing non-planar faces to a STEP file.
From other threads I gather that some faces require seam edges to be added in some cases, and the STEP translator should automatically fix this. Despite this I cannot get any non-planar faces to work.

The STEP writer code is as follows:

int output_STEPShape (std::string modelName, TopoDS_Shape shape) {
Standard_CString cStr = (Standard_CString)modelName.c_str();
STEPControl_Writer writer;
Interface_Static::SetCVal("write.step.product.name",cStr);
writer.Transfer(shape, STEPControl_AsIs);
writer.Write("OPENCASCADE_RESULTS.stp");
return 0; }

When given a non-planar face, the following error is returned: Access violation reading location 0xfefd0000.

Any help would be great - I'm kind of stuck here. Data for an example face is given below.

Cheers, Chris

Specific example:

The following data defines a single wire, 4 sided face with a cylindrical surface.
It is successfully constructed and works correctly in other functions within OCC.

----------------
CYLINDRICAL SURFACE:
----------------
3D axis data:
origin: -7.16899294042149,-81.2601390553134,62.799071918041
normal: 0,-0.972086235390313,-0.234623849948571
axis : 0,-0.234623849948571,0.972086235390313

Radius: 40.1889929405536

----------------
EDGE 1:
----------------
BSPLINE CURVE:
Poles:
28.0489141385313,-87.6545511602366,81.1728220357105
28.0489141385313,-86.4200018033001,81.4707942860423
28.0489141385313,-85.1854524463636,81.7687665363743
28.0489141385313,-83.9509027978012,82.0667388570935

Mults: 0,1
Knots 4,4
Degree: 3

VERTEX1: 28.0489141385313,-87.6545511602366,81.1728220357105
VERTEX2: 28.0489141385313,-83.9509027978012_82.0667388570935

----------------
EDGE 2:
----------------
BSPLINE CURVE:
Poles:
28.0489141385313,-87.6545511602366,81.1728220357105
31.2928981195571,-86.2700821939072,75.4367332885995
33.0200000001321,-84.6918531718696,68.8978639070235
33.0200000001321,-83.1119633337399,62.3521134838871

Mults: 0,1
Knots 4,4
Degree: 3

VERTEX1: 28.0489141385313_-87.6545511602366,81.1728220357105
VERTEX2: 33.0200000001321,-83.1119633337399,62.3521134838871

----------------
EDGE 3:
----------------
BSPLINE CURVE:
Poles:
33.0200000001321,-83.1119633337399,62.3521134838871
33.0200000001321,-81.8774138147893,62.6500857733229
33.0200000001321,-80.6428642958385,62.9480580627588
33.0200000001321,-79.4083148740961,63.2460303287324

Mults: 0,1
Knots 4,4
Degree: 3

VERTEX1: 33.0200000001321,-83.1119633337399,62.3521134838871
VERTEX2: 33.0200000001321,-79.4083148740961,63.2460303287324

----------------
EDGE 4:
----------------
BSPLINE CURVE:
Poles:
33.0200000001321,-79.4083148740961,63.2460303287324
33.0200000001321,-80.988204615017,69.7917807753311
31.2928981195572,-82.5664336370545,76.3306501569072
28.0489141385313,-83.9509027978012,82.0667388570935

Mults: 0,1
Knots 4,4
Degree: 3

VERTEX1: 33.0200000001321,-79.4083148740961,63.2460303287324
VERTEX2: 28.0489141385313,-83.9509027978012,82.0667388570935

Christian Van der Velden's picture

OK that was really easy :)
Added the following 3 lines:

ShapeFix_Face fix(face);
fix.Perform();
face = fix.Face();

Cheers, Chris