xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
729 stars 288 forks source link

BIMServerLoaderPlugin not rendering geometries properly #15

Closed sha-N closed 5 years ago

sha-N commented 5 years ago

Hi, I was checking out this SDK as a replacement for BIMSURFER, Great Job 👍.

But Im facing an issue, the plugin loads structural IFC files properly, but for IFC files containing pipes or those type of geometries, the objects look pixelated and shake while moving the camera.

Does this has anything to do with the plugin being based on PerformanceModel.

Is this being worked on? capture

Originally posted by @sha-N in https://github.com/xeokit/xeokit-sdk/issues/5#issuecomment-464797607

sha-N commented 5 years ago

Side note

BIMSURFER2 which is based on SceneJS renders the above model as follows

image

and in BIMSURFER3 when quantization is disabled, it also behaves in a similar fashion.

sha-N commented 5 years ago

@xeolabs can you provide some pointers on where to start for resolving this, I just got started on this whole bimserver stuff a week back, trying to catch up on what is available and how is it done.

xeolabs commented 5 years ago

This is a quantization accuracy error, which is not an error within xeokit as such. It is caused by your floating-point geometry losing accuracy when xeokit internally quantizes it to integers. Two things you can try:

For example:

var model = bimServerLoader.load({
    //..
    scale: [0.5, 0.5, 0.5],    
    position: [-90, 0, 0] 
});
sha-N commented 5 years ago

Thank you for the reply, I had tried changing the scale with no luck.

can internal quantization be disabled once, * Download quantized geometry from BIMServer - in progress is done

xeolabs commented 5 years ago

No, quantization can't be disabled. Are you able to share your IFC file, or any IFC file that reproduces this issue for you? Then I can investigate ways to make quantization more robust.

sha-N commented 5 years ago

Yes, I will send you the link in mail, shall i send to this id lindsay.kay@xeolabs.com ?

Please check of a solution as this SDK is kind of a perfect solution for the problem Im trying to solve.

xeolabs commented 5 years ago

Yes, please send to that email, thanks.

sha-N commented 5 years ago

Hi, were you able to reproduce the issue

sha-N commented 5 years ago

Hi, Solved the issue as per your comment by setting the position: parameter.

Right now it is kind of a workaround,

Update

If anybody else face similar issue

Position information can be retrieved from bimserver using ServiceInterface method: "getModelMinBounds" and multiply the coordinates with value of scale

@xeolabs is it possible to avoid the step.

xeolabs commented 5 years ago

@sha-N yes I'll add an option to BIMServerLoader - see https://github.com/xeokit/xeokit-sdk/issues/22