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

Read .bim files generated by other software #99

Open
krzysztofarendt opened this issue Nov 5, 2024 · 0 comments
Open

Read .bim files generated by other software #99

krzysztofarendt opened this issue Nov 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@krzysztofarendt
Copy link
Owner

Currently I can export to .bim and read from .bim exported by building3d. However, I cannot import models exported from other software, because I need specific metadata in the .bim file.

So I have this check when reading a .bim file:

def read_dotbim(path: str) -> Building:
    """Load model from .bim."""
    bim = {}
    with open(path, "r") as f:
        bim = json.load(f)

    error_msg = ".bim format not compatible with Building3D"
    if not "generated_by" in bim["info"].keys():
        raise KeyError(error_msg)
    elif bim["info"]["generated_by"] != TOOL_NAME:
        raise ValueError(error_msg)

Proposed fix:

  • check if the required metadata exists
  • if not, load the model similarly like STL - treat each triangle as a separate polygon
@krzysztofarendt krzysztofarendt added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant