Creoox / creoox-ifc2gltfcxconverter

Public repository of Creoox & XeoKit convertion Tool
Other
14 stars 2 forks source link

Showing lines on the edges #13

Open mbalajee opened 4 months ago

mbalajee commented 4 months ago

Is there a command line option currently (or in the roadmap) to show lines (like wireframe) on the edges of a geometry when converting from IFC to GLB format. Something like this - in the below image (rendered using HOOPS visualize viewer) there are lines on the edges,

ifcapps commented 4 months ago

Rendering lines at crease edges is normally done by the viewer. In this case, it is a feature of the xeokit viewer. It wouldn't make sense to write those lines into the glb file. Unless you want to use the glb file for something else?

mbalajee commented 4 months ago

Thanks for quick response.

We convert IFC to GLB on our backend using this converter and the converted GLB file is then rendered on mobile (Filament for Android, SceneKit for iOS). These lines on the edges help our customers since a lot of the work we’re focusing on is specific to the individual objects of the model.

ifcapps commented 4 months ago

Ok. If you prefer to compute those edges not in the viewer, but server side, we can integrate that as an option in the ifc2gltf converter. But that option will have to be ordered through Creoox. If you are interested, please contact Creoox sales on creoox.com

xeolabs commented 4 months ago

Just a note that convert2xkt automatically creates edges for triangles meshes in the XKT files, that it converts from the GLB output by ifc2gltf.

Then the xeokit Viewer has the option to draw those edges on the triangle meshes when we set the Viewer's edges flag to true.

The algorithm that convert2xkt uses is to create, in the XKT file's geometry, a line segment between each pair of adjacent triangles that are not co-planar, with a tolerance of a few degrees.

All our XKT models have such edges, and the Viewer shows them by default, like in this example.

So the convert2xkt tool is pre-calculating the edges in XKT files.

But the Viewer will also calculate the edges itself, when we load GLB/glTF directy into the Viewer, and when we programmatically create scene objects in the Viewer ourselves using the JavaScript API.