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

Display IfcGridAxis #386

Open
rvouilloz opened this issue Oct 28, 2022 · 7 comments
Open

Display IfcGridAxis #386

rvouilloz opened this issue Oct 28, 2022 · 7 comments

Comments

@rvouilloz
Copy link

The IFC files have their own grid axes drawn directly in the model. Could we display them as lines (dotted?) with their names as well? I did a test here by exporting them as a separate gltf and displaying the name as CSS2DObject :
2

const ifcGridLoader = new GLTFLoader();
  ifcGridLoader.load("../5-grid/IfcGrid.glb", function (gltf) {
    const model = gltf.scene;
    model.traverse(function (child) {
      if (child instanceof Line) {
        const ifcGridAxisName = child.name;
        const ifcGridAxisShortName = ifcGridAxisName.substring(
          ifcGridAxisName.lastIndexOf("IfcGridAxis") + 11
        );
        const firstLabel = document.createElement("span");
        firstLabel.textContent = ifcGridAxisShortName;
        const ifcGridAxisFirstLabel = new CSS2DObject(firstLabel);
        ifcGridAxisFirstLabel.position.set(
          child.geometry.attributes.position.array[0],
          child.geometry.attributes.position.array[1],
          child.geometry.attributes.position.array[2]
        );
        viewer.context.getScene().add(ifcGridAxisFirstLabel);
        const secondLabel = document.createElement("span");
        secondLabel.textContent = ifcGridAxisShortName;
        const ifcGridAxisSecondLabel = new CSS2DObject(secondLabel);
        ifcGridAxisSecondLabel.position.set(
          child.geometry.attributes.position.array[3],
          child.geometry.attributes.position.array[4],
          child.geometry.attributes.position.array[5]
        );
        viewer.context.getScene().add(ifcGridAxisSecondLabel);
      }
    });
    viewer.context.getScene().add(model);
  });
@beachtom
Copy link
Collaborator

beachtom commented May 2, 2023

The main work to do in web-ifc here is we have no way to get the 2d geomety directly out - we need some functionality to allow us to call GetGometry with an express ID of some 2D element

@pbbr
Copy link

pbbr commented May 4, 2023

@beachtom Is there a way to generate 2d geometries (like IfcGrid and IfcAnnotation)? This is a common case that additional infos were placed as annotations in a model. What do you think?

@beachtom
Copy link
Collaborator

beachtom commented May 4, 2023

Yeah it should be possible - we just don't expose it to the typescript interface in any way - so it will need some work

@pbbr
Copy link

pbbr commented May 4, 2023

@beachtom That would be very nice! Do you have any plans / timeline to do this?

@pbbr
Copy link

pbbr commented Jun 7, 2023

@beachtom Do you have any updates on this? It would be very useful to have 2D geometries available to replace tranditional drawings and extend models with annotations. Thanks a lot!

@beachtom
Copy link
Collaborator

beachtom commented Jun 7, 2023

No update yet I am afraid. There is a need to some some refactoring to expose the 2d geometries - which is in progress - but not ready yet

@pbbr
Copy link

pbbr commented Jun 7, 2023

Thanks a lot for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants