engine_components icon indicating copy to clipboard operation
engine_components copied to clipboard

Display IFCGRID in 3D view

Open agviegas opened this issue 1 year ago • 10 comments

Description 📝

Right now we can see geometries and alignments. It would be awesome to be able to display IFCGRIDs.

Suggested solution 💡

Generate the IFCGRID geometry in the IFCLoader code.

Alternative ⛕

No response

Additional context ☝️

No response

Validations ✅

  • [X] Read the docs.
  • [X] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

agviegas avatar Aug 06 '24 08:08 agviegas

@agviegas,

Awesome that feature request is considered. This will help to explore the building and measure the orientation of the elements visually. Looking forward to seeing the IfcGrid in the viewer.

ThatMetaverseArchitect avatar Aug 09 '24 07:08 ThatMetaverseArchitect

Is there any way to build out this functionality ourselves? Building out elements within That Open viewer with visual references would greatly benefit the AEC ecosystem!

emmyxth avatar Aug 14 '24 08:08 emmyxth

@emmyxth Yep! Our libraries allow to read all IFC data. So you need to:

  1. Get an IFC with a grid
  2. Open the IFC with a text editor and see how the grid is expressed
  3. Think of a strategy to build it with Three.js geometries
  4. Do it

agviegas avatar Aug 14 '24 09:08 agviegas

We'd love to view IfcGrid/IfcGridAxis elements in the viewer too. We'd be keen to support building out this feature as well!

@emmyxth - have you made any progress building out this functionality? If yes, is there anything we could support? @agviegas - to support these elements, do we need to make changes in web-ifc related to 2d geometry as well? Noting that there's an open issue that appears to be related to handling IfcGridAxis elements here: https://github.com/ThatOpen/engine_web-ifc/issues/386

jenessaman avatar Oct 09 '24 16:10 jenessaman

@jenessaman the grid is fundamentally different to a mesh, so it can't be handled just like the rest of IFC objects. IMO we should approach this problem the same way we approached civil alignments. That is, create a specific function (e.g. getIfcGrid) that returns the geometry buffer necessary to build the grid in 3D

agviegas avatar Oct 10 '24 15:10 agviegas

Hey again @agviegas!

I am trying to take a quick stab at this and made some progress. I am able to load the IFC grid lines at their local coordinate system position but am still trying to wrap my head around PlacementRelTo. I believe I need to walk the entire relative placement chain to calculate the true world coordinates of the grid lines. After this step I can use gridGeometry.applyMatrix4(model.coordinationMatrix); to align with my model since I am also using COORDINATE_TO_ORIGIN = true.

So my questions are:

  1. Does this seem like a reasonable approach?
  2. Is there a more efficient way to map elements from their local to world positions? For example, IFCOpenShell provides the option USE_WORLD_COORDS to avoid walking the entire relative placement chain. This might be more of a question for ThatOpen/engine_web-ifc.
  3. Can you point me to any code that does this remapping?

This is the state when drawing the grid lines in their local coordinate system while COORDINATE_TO_ORIGIN = true:

image

image

Models that don't have any relative placements seems to map correctly just by using gridGeometry.applyMatrix4(model.coordinationMatrix); such as:

image

Thanks!

alfarok avatar Oct 24 '24 19:10 alfarok

I think I sorted out how to extract the world coordinates. The 2nd model is still causing issues though.

2 sets of grids with different z heights (they were originally rendering on-top of another prior to applying the relative transforms): image

alfarok avatar Oct 25 '24 15:10 alfarok

Apologies for the spam but I got it resolved at least for grids composed of polylines.

image

alfarok avatar Oct 25 '24 15:10 alfarok

Hey @alfarok fantastic progress! I think you already answered some of your own questions. Is there anything I can help you with?

agviegas avatar Oct 28 '24 11:10 agviegas

All set on this topic, thank again!

alfarok avatar Oct 29 '24 16:10 alfarok