IfcPlugins icon indicating copy to clipboard operation
IfcPlugins copied to clipboard

IFC4 deserializer fails to parse IfcRationalBsplineSurfaceWithKnots

Open hlg opened this issue 8 years ago • 5 comments

IFC4 deserializer fails to parse IfcRationalBsplineSurfaceWithKnots with error message Error on line xxx: Field not found: ListAsString. The offending line looks like this and does not seem to be wrong:

#15=IFCRATIONALBSPLINESURFACEWITHKNOTS(3,1,((#1,#2),(#3,#4),(#5,#6),(#7, #8),(#9,#10),(#11,#12),(#13,#14)),.RULED_SURF.,.F.,.F.,.U.,(4,1,1,1,4),(2,2),(0.,0.25,0.5,0.749999999999999,1.),(0.,1.),.UNSPECIFIED.,((1.,1.),(1.,1.),(1.,1.),(1.,1.),(1.,1.),(1.,1.),(1.,1.)));

I checked against the attribute types in the Express file, but did not manage to trace this back to the ecore layer. I am using Bimserver version 1.5.81. Here is the stacktrace.

org.bimserver.shared.exceptions.UserException: 
        at org.bimserver.database.actions.StreamingCheckinDatabaseAction.execute(StreamingCheckinDatabaseAction.java:350)
        at org.bimserver.database.actions.StreamingCheckinDatabaseAction.execute(StreamingCheckinDatabaseAction.java:79)
        at org.bimserver.database.DatabaseSession.executeAndCommitAction(DatabaseSession.java:708)
        at org.bimserver.database.DatabaseSession.executeAndCommitAction(DatabaseSession.java:685)
        at org.bimserver.longaction.LongStreamingCheckinAction.execute(LongStreamingCheckinAction.java:62)
        at org.bimserver.longaction.LongActionManager$1.run(LongActionManager.java:43)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.bimserver.plugins.deserializers.DeserializeException: Error on line 429057: Field not found: ListAsString
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.readList(IfcStepStreamingDeserializer.java:437)
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.readList(IfcStepStreamingDeserializer.java:472)
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.processRecord(IfcStepStreamingDeserializer.java:377)
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.processLine(IfcStepStreamingDeserializer.java:248)
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.read(IfcStepStreamingDeserializer.java:183)
        at org.bimserver.ifc.step.deserializer.IfcStepStreamingDeserializer.read(IfcStepStreamingDeserializer.java:165)
        at org.bimserver.database.actions.StreamingCheckinDatabaseAction.execute(StreamingCheckinDatabaseAction.java:198)
        ... 6 common frames omitted

hlg avatar Aug 22 '17 07:08 hlg

This is obviously related to the deserialization of multidimensional arrays, which are new in IFC4. There was some work going on in this area of the IFC deserializer recently (commits 492bb931549b2d9e, 166790e79f32d6d7b). @rubendel, is this considered final or still under development?

hlg avatar Aug 24 '17 12:08 hlg

That's probably a bug in the multidimensional array code. I'll have a look at it, thanks for reporting. I still have very little (valid) IFC4 files to test with, can you perhaps help me with more models?

rubendel avatar Aug 25 '17 06:08 rubendel

I am sorry, we can not share IFC4 files from our research project currently. However, we can keep reporting issues as they arise, and provide minimal test files for these issues, such as the one attached. Would that help?

IfcRationalBSplineSurfaceWithKnots.ifc.txt (added .txt extension to make Github happy)

hlg avatar Aug 28 '17 13:08 hlg

Sure that's even better! Thanks. Kinda busy at the moment so it can take a while before I get back to this.

rubendel avatar Aug 31 '17 09:08 rubendel

I am adding two new sample files for testing. BIMserver fails when representation items are parsed in isolation without representation context. Thus, in the new file, I have embedded the sample IfcRationalBSplineSurfaceWithKnots entity in a proper IfcShapeRepresentation.

IfcRationalBSplineSurfaceWithKnots_IfcShapeRep.ifc.txt

The second sample file with IfcTriangulatedFaceSet does also contain a two-dimensional array, but as opposed to the original sample, this one does not refer to other entities, its elements are of primitive type. With this one, the error does not occur, the parser is happy.

IfcTriangulatedFaceSet_IfcShapeRep.ifc.txt

hlg avatar Sep 06 '17 05:09 hlg