IndustryFoundationClasses / Questions

Have a question about IFCs? Ask here. Use Github Issues.
20 stars 4 forks source link

Overlapping IFCSpace in IfcOpenShell #16

Closed MahmoudAbdelRahman closed 6 years ago

MahmoudAbdelRahman commented 6 years ago

Hi everyone,

Thanks so much for your support, I'm using Python IfcOpenShell and OpenGL to read IFCSpace entities, When I draw the spaces, I get overlapped spaces as shown in the figure, I'm not sure what the problem is ? Is there any key to solving the problem to make spaces similar to those from Revit?

problem_ifcopenshell

Best regards, Mahmoud

MahmoudAbdelRahman commented 6 years ago

Here is a hint of what I have done:

  1. Read the ifcfile and extracted each IFCSpace entity.
  2. Got the IFCRectangleProfileDef and read the IFCAxis2Placement2D of the rectangle as well as the width and height and direction.
  3. From the previous data, I draw the rectangles and extruded them in OpenGL.
aothms commented 6 years ago

Hi,

Couple of remarks.

There are a lot of different types of representation items, assuming that every space is defined as a IfcRectangleProfileDef is very likely too optimistic.

There are also a lot of placements throughout the file. In particular you do not mention the ObjectPlacement of the IfcSpace. Did you take that into account?

ifcopenshell.geom.create_shape() when passed a product instance (e.g a space) will take care of each of these things. Including an option to triangulate the resulting (3d) geometry to directly visualize in e.g. OpenGL.

Kind regards, Thomas

MahmoudAbdelRahman commented 6 years ago

Hi @aothms, It is great to hear from you, Thanks so much, your answer is very helpful and much appreciated. It is my first time to know about ifcopenshell.geom.cereate_shape(), is there a good documentation on python ifcopenshell I can follow ?

Thanks so much, Best regards, Mahmoud.

aothms commented 6 years ago

@MahmoudAbdelRahman good to hear. A complete reference documentation is being worked on, for the moment the best resource are the tutorials on http://academy.ifcopenshell.org

MahmoudAbdelRahman commented 6 years ago

Thanks so much. Best regards, Mahmoud