Objectloader/sender workflow "destroys" geometry

Objective

I want to fetch data from Speckle, add extra properties to the geometry and then save it back to Speckle.
This should all be done in the browser.

Issue:

I’ve noticed that geometry, that I pull from the server using @speckle/objectloader, modify and reupload with @speckle/objectsender gets “destroyed”.

I’ve created a simple example with a box from Blender:

Before Upload

After Upload

I don’t add any properties to the box, I just fetch it and reupload it again.
As you can see, the faces get mixed up.

Example

Here is a reproducible example that pulls down the box from Speckle and uploads it again.

Speckle link

Question

Is there something I do wrong in the code or is there a bug in the @speckle/objectsender?

Is this the latest object sender package? Did it work with an older version?

I know @adamhathcock has just been looking at Objectsender for other reasons; it’s good to highlight this for him if you can clarify.

Yes, I’m using 2.25.1 of both sender and loader.

It is pretty critical to our workflow, so I’m happy to contribute some effort and code, if it can help.

Someone is looking into this @chrkong and it relates to the indices ordering.

1 Like

Thank you for the detailed repro steps!

I believe the issue is on load with the fullyTraverseArrays: true setting. Omitting that or setting it to false causes the indices to be correct.

I’ve been hard at work on @speckle/objectloader2 - npm which doesn’t have this setting.

However, trying to use it on your project as given me things to do to make it work better for NodeJS. Currently, it’s optimized for the viewer.

Let me know if this fixes you and what else would help for OL2

Thanks,
Adam

1 Like

Thanks @adamhathcock !

Setting fullyTraverseArrays: false works for me - both in the example and in the “real” application.

What is the status of objectloader2?
Is it still in beta or is it advantageous already to move to it?

1 Like

Hi @chrkong

OL2 is working in the viewer already. It’s beta in the sense that we’re still going through the other use cases (as it won’t work with NodeJS at the moment) but a small PR should allow that.

It’s faster in downloading and caching which are the main viewer use cases (as well as a rewrite in Typescript) so I’m not sure how fast it will be for you.

A newer version with a new option on the ObjectLoader2Factory should work for you though. I’ll reply when I think it’s ready!

Thanks,
Adam

Thanks for the clarification @adamhathcock !

I actually use the loader/sender workflow in the browser, it was just easier to create a node.js example.

1 Like