xBimTeam / XbimGeometry

XbimGeometry contains the CLR interop libraries and the c++ engine used to compute the 3D geometry of models.
https://xbimteam.github.io/
Other
260 stars 131 forks source link

Getting Polylines via XBimShapeInstance #429

Open GVladislavG opened 1 year ago

GVladislavG commented 1 year ago

Hello, xBim team! I'm using XBimShapeInstance to get geometry data of IfcProducts. I use this code

XbimShapeGeometry geometry = m_3DMdlContext.ShapeGeometry(instance);                         
byte[] data = ((IXbimShapeGeometryData)geometry).ShapeData;           
using (var stream = new MemoryStream(data))
{
     using (var reader = new BinaryReader(stream))
     {
         var mesh = reader.ReadShapeTriangulation();   
     }
}

So I get only triangulated geometry. If IfcProduct has some IfcPolylines attached, I miss this data unfortunately. Is there any way to get these IfcPolylines?

Thanks!

martin1cerny commented 1 year ago

Yes, instead of reading the processed geometry, just access the product representation directly in its IFC form: IfcProduct.Representation