Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture support in BIM files #391

Closed
16 of 17 tasks
carmenfan opened this issue Oct 13, 2020 · 4 comments · Fixed by #402
Closed
16 of 17 tasks

Texture support in BIM files #391

carmenfan opened this issue Oct 13, 2020 · 4 comments · Fixed by #402
Assignees
Milestone

Comments

@carmenfan
Copy link
Member

carmenfan commented Oct 13, 2020

Dev tasks

Preparation

  • Get access to some 3D models with textures
  • Compile and run the the test program from (Program.cs) the related branch to get the resultant BIM file
  • Examine C# code to understand the BIM format layout
  • SHOULD: Create description/diagram of the BIM format

See the Notes section below

  • Highlight changed areas in the BIM format to allow for textures
  • Pass feedback on for internal inconsistencies in the .NET code for the latest BIM003 format

Bouncer dev

  • Complete the notes on getting bouncer dev environment up here
  • Highlight the key areas that require updating to match the changes in the format
  • Write a test to pass on processing the BIM003 file
  • Implement code changes
  • Probe for texture notes and attempt to binary dump texture to an image file
  • Write tests for BIM001/002
  • Write edge case tests for the above
  • Write system test for the client exe
  • Set up the local environment for converting to unity asset bundles
  • Test with large BIM files (via client)
  • SHOULD: Export to Asset bundle

Assumptions

  • Changes will be backwards compatibility with v2/1 of the BIM format.

Questions

  • What is sizes for? If its the size of each node, then sizes[0] does make sense...

Updated format descriptions with correct info about this

  • I cannot find a BIM001 label/property in the git history for the exporter was it ever publicly released?

This is in the format descriptions below

  • Can we place small 3d models used for unit testing the .NET code here?

Can use the linked repo

Observations going through this issue

  • metadata is duplicated in the current BIM format. This also complicates importing of the model in bouncer

Related ticket

see https://github.com/3drepo/3drepoPlugin/issues/105

Reference

Wiki page for the file format descriptions

@har00n-haider har00n-haider self-assigned this Nov 6, 2020
@har00n-haider
Copy link
Contributor

@carmenfan , I'm getting close to testing the solution with with the BIM003 file generated by the plugins. Could you point me to some BIM001/BIM002 files I can use for unit testing?

@har00n-haider
Copy link
Contributor

har00n-haider commented Nov 12, 2020

@carmenfan Is there reason that we are casting to float here, even though we may have 64bit verts? I noticed that there was no makeMeshNode for 64bit verts are they not supported?

@carmenfan
Copy link
Member Author

@carmenfan Is there reason that we are casting to float here, even though we may have 64bit verts? I noticed that there was no makeMeshNode for 64bit verts are they not supported?

Every single renderer in the world seems to work on 32bit vertices so there's no point storing them in 64 bit (would double the memory usage and we'd have to end up casting it down before sending it to the renderer), so we store it in 32bit.

However, a lot of CAD software works in crazy values (like 1e6-1e7) due to the fact that they work in some form of world coordinate system, so they need 64bit representation at import to preserve the precision.

Luckily they don't use the whole scale of the number range. So we calculate the world offset (minimum point within the model) and subtract that off every single vertices. This way the numbers become significantly smaller to the point we can preserve the precision using 32bit values. So this is what is going on on that line.

@carmenfan
Copy link
Member Author

carmenfan commented Nov 12, 2020

@carmenfan , I'm getting close to testing the solution with with the BIM003 file generated by the plugins. Could you point me to some BIM001/BIM002 files I can use for unit testing?

I thought we had some system test setup for .bim but it looks like I was imagining things.. 😆

If you install the current release version of the plugin you should be able create BIM002:
https://www.dropbox.com/s/co35ehx75pewsxw/%5B4.6.1%5D%203D%20Repo%20Navisworks%20Plugins.msi?dl=0

this is 2.8.0, which should produce BIM001: (EDIT: this predates navis 2021 so you're going to have to installer an older version of navis for this) https://www.dropbox.com/s/gghy33rnsh7yela/%5Bv2.8%5D%203D%20Repo%20Navisworks%20Plugins.msi?dl=0

Make sure the files are relatively small (like a cube or something) so Travis doesn't take forever.

While you're at it, if you create some system test as well (can use the same model files, that's fine), that would be great too (in st_3drepobouncerClient.cpp)

har00n-haider pushed a commit that referenced this issue Nov 12, 2020
har00n-haider pushed a commit that referenced this issue Nov 12, 2020
har00n-haider pushed a commit that referenced this issue Nov 12, 2020
…'t break things as fin get reset by the end of the function)
har00n-haider pushed a commit that referenced this issue Nov 13, 2020
har00n-haider pushed a commit that referenced this issue Nov 13, 2020
har00n-haider pushed a commit that referenced this issue Nov 30, 2020
har00n-haider pushed a commit that referenced this issue Dec 11, 2020
carmenfan added a commit that referenced this issue Dec 14, 2020
carmenfan added a commit that referenced this issue Dec 14, 2020
carmenfan added a commit that referenced this issue Dec 14, 2020
carmenfan pushed a commit that referenced this issue Dec 14, 2020
carmenfan pushed a commit that referenced this issue Dec 14, 2020
…on, so explicitly included the relevant for for error codes
carmenfan pushed a commit that referenced this issue Dec 14, 2020
…string char pointer. putting the variable memory on the stack is it is not used elsewhere.
@carmenfan carmenfan added this to the 4.13.0 milestone Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants