Is the example file correct?

There is a link to the file from documentation page of IfcIndexedPolycurve (http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcgeometryresource/lexical/ifcindexedpolycurve.htm):
http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/annex/annex-e/slab-standard-case.ifc

There is a
#7= IFCGEOMETRICREPRESENTATIONCONTEXT($,‘Model’,3,0.0001,#8,#10);

#11= IFCGEOMETRICREPRESENTATIONSUBCONTEXT(‘Axis’,‘Model’,,,,,#7,$,.MODEL_VIEW.,$);

#12= IFCGEOMETRICREPRESENTATIONSUBCONTEXT(‘Body’,‘Model’,,,,,#7,$,.MODEL_VIEW.,$);

and

#13= IFCGEOMETRICREPRESENTATIONCONTEXT($,‘Model’,3,0.0001,#8,#14);

An IfcProject is linked with #13
#100= IFCPROJECT(‘3IU0sKDyX2mAWXvsGInP94’,#6,‘IfcProject’,$,$,‘IfcProject’,’’,(#13),#101);

While
#315= IFCSHAPEREPRESENTATION(#12,‘Body’,‘SweptSolid’,(#314));
is linked with #12 sub context of #7.

Of course could be changed manually for tests, but I believe the topology is conceptually incorrect as shape representation is going to nowhere.

Where you want to go , mean what you are finding in it.
if we will check #314 it will go to IFCEXTRUDEDAREASOLID and finaly it will go to IFCRECTANGLEPROFILEDEF and IFCAXIS2PLACEMENT3D and IFCAXIS2PLACEMENT2D and finaly we will get IFCCARTESIANPOINT .
if we talk about #12 i think this software is increasing too much work.(garbage data)
IFCSHAPEREPRESENTATION it must direct go to #7 and usualy there is only one IFCGEOMETRICREPRESENTATIONCONTEXT this file is also have #13 but don’t know why it is there.

It looks like you’re correct.

Personally I’d like to overhaul the way examples get generated going forward, in that everything is generated by code through the toolkit generated in IfcDoc.

This is akin to the way some of the examples are generated, such as the one you refer. https://github.com/buildingSMART/IfcScript/blob/master/Examples/Slab.ifc
But seems that in post processing the example file some sort of change is introduced (I will check the version of the sample stored in the definition of IFC). Did you check if other examples have similar? It might be a systematic error in IfcDoc.

Jon, can’t say about other such examples exist. This is the only one among others we looked at where we noticed such topology .

Hi, there is obviously an error in the example file, every valid IfcGeometricRepresentationContext shall be referenced by IfcContext (e.g. its subtype IfcProject). @jonm lets check and try to fix the error for a next documentation update.

For closure, this seems to now be fixed.