GeometryGym / GeometryGymIFC

C# classes to generate and parse OpenBIM IFC files
Other
269 stars 97 forks source link

IfcPolygonialFaceSet constructor generates wrong empty list #34

Closed seb-esser closed 3 years ago

seb-esser commented 3 years ago

Seems like the same issue I was reporting in #31 :

#33= IFCPOLYGONALFACESET(#32,$,(#),$);

@jmirtsch would you mind spending a look on it? I was using: var ptList = new IfcCartesianPointList3D(database, new List<Tuple<double, double, double>>()); hostProduct.Representation = new IfcProductDefinitionShape( new IfcShapeRepresentation( new IfcPolygonalFaceSet( ptList, new List<IfcIndexedPolygonalFace>()))); , which has produced the given output.

Thanks!

jmirtsch commented 3 years ago

Hi Sebastian,

That output isn't right, but unfortunately neither is

33= IFCPOLYGONALFACESET(#32,$,(),$);

The attribute definition is this: Faces : LIST [1:?] OF IfcIndexedPolygonalFace; requiring the list to have at least one element.

I don't necessarily think the constructor should prevent an empty list to be passed, but it's up to the code calling it to add at least one face to the instance.

Let me know if this doesn't make sense.

Cheers,

Jon

seb-esser commented 3 years ago

fair enough. I thought, maybe a $ might suit better if no face is given. But I agree with your argumentation of LIST [1,:], so lets stick to the existing solution