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

Get IXbimMeshGeometry3D from XbimShapeGeometry #22

Closed PierreAlexandreADAMSKI closed 8 years ago

PierreAlexandreADAMSKI commented 8 years ago

assuming that the IfcStore as already been opened as var Model = ...

the call of :

var context = new Xbim3DModelContext(Model); var geometries = context.ShapeGeometries(); foreach (IXbimShapeGeometryData geometry in geometries { context.ShapeGeometryMeshOf(geometry as XbimShapeGeometry); }

returns an empty set of Meshes, Normals, Positions and TriangleIndices

The model is readable on WebUI and WindowsUI So i've tried using the method read(byte[] shapedata) of windowsUI which works fine in Xbim.Presentation.MeshGeometry3DExtensions

1° I haven't checked but does ShapeGeometries() is supposed to do the same work as read(). 2° did you ever get a similar issue?

Thanks you

SteveLockley commented 8 years ago

If you are using a new store then you have to build the geometry. Create an Xbim3DModelContext and call CreateContext on it (see program.cs in the Xbim.Geometry.Profiler project for an example. If the store is opened as an Xbim file, the geometry will be saved in the database for persistence, if a memory model store is used it will be held in transient memory.