hypar-io / Elements

The smallest useful BIM.
https://www.hypar.io
MIT License
347 stars 74 forks source link

Strange behaviour with rendering Model (in dotnet.interactive) #1083

Closed daniel-fink closed 4 months ago

daniel-fink commented 4 months ago

I am in the early stages of writing a lightweight Elements <-> Speckle converter. At the moment just concentrating on geometry. To test, I am visualizing results in Polyglot Notebooks (dotnet.interactive)

I am getting some strange behaviour when adding sequential Elements to a Model and visualizing them (see screenshot attached):

  1. I can retrieve the Speckle Brep (note the volume & faces)
  2. I've written a Brep -> Solid converter, that somehow gets the faces right but the volume wrong.
  3. To see where things might be going wrong, I attempt to visualise the Solid, but I note that on trying to sequentially add each face as a Panel to a Model, while I can render the 4th Panel individually, on adding it to the Model the rendering fails.
  4. No additional errors are found when searching through console logs in browsers...

I would expect to be able to sequentially add Panels to the Model and view all of them.

Running on macOS M1 Sonoma 14.4.1

image

andrewheumann commented 4 months ago

Without your speckle geometry this will be hard to debug. Is there a way you can provide a .dib that reproduces this without depending on your speckle account, perhaps by serializing the raw polygons you're getting out of speckle?

daniel-fink commented 4 months ago

Thanks @andrewheumann. I'm not sure how to best serialize data in a Polyglot Notebook, but in any case I figured it would be quicker to point you to a repo with the current (very very draft) code -- https://github.com/daniel-fink/speckle-hypar .dib file is in the /tests dir ('/tests/ConversionTests.dib)

In order to run it, you would need to:

  1. Build the SpeckleHypar.Conversion project
  2. Point the magic #i nuget source locator to the ../packages dir created in the solution folder, on your machine.
  3. Replace the argument in the SpeckleApi() method with your own Speckle API token.

I believe that should work but happy to coordinate.

daniel-fink commented 4 months ago

Hi @andrewheumann, just bumping this. Let me know if you were able to witness the issue, or I should look harder at providing an independent .dib file...

Thanks @andrewheumann. I'm not sure how to best serialize data in a Polyglot Notebook, but in any case I figured it would be quicker to point you to a repo with the current (very very draft) code -- https://github.com/daniel-fink/speckle-hypar .dib file is in the /tests dir ('/tests/ConversionTests.dib)

In order to run it, you would need to:

1. Build the SpeckleHypar.Conversion project

2. Point the magic #i nuget source locator to the `../packages` dir created in the solution folder, on your machine.

3. Replace the argument in the `SpeckleApi()` method with your own Speckle API token.

I believe that should work but happy to coordinate.

andrewheumann commented 4 months ago

Hi Daniel — The geometry looks fine, I submitted a fix for the viewer. In the meantime you can download the updated extension.dib here and import it directly with #!import extension.dib.