IfcOpenShell python: Extracting 2D polygons from edges #4627
Answered
by
Moult
FransKnibbe
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Have you looked at util.shape? It uses similar logic to getting real and projected footprint areas. You can then union the polygons with shapely.
Dion Moult
Sent from Proton Mail mobile
…-------- Original Message --------
On 7 May 2024, 12:22 am, Frans Knibbe wrote:
Hello! I am trying to extract 2D polygons from IFC elements with ifcopenshell python. The 2D polygons should represent the ground footprint of the IFC element.
What is working so far: I can create a geometric shape from e.g. an IfcRoof element. The shape consists of vertices, edges and faces. From the vertices, I can create a convex hull that approximates the outer boundary.
In order to get an exact outer boundary, I think I need to create polygons based on the edges. I have been trying to manipulate the list of edges to create closed rings of line segments that can be used to define polygons, but that has not been entirely successful yet.
As far as I can tell, the edges always consist of two indices: one for a 'from' vertex, and one for a 'to' vertex. But my understanding stops there. It would probably help to know how the edges are ordered by ifcopenshell.geom.create_shape(). Is there documentation on that?
And if someone has already found an algorithm for finding 2D polygons, I would love to hear about that!
Regards,
Frans
—
Reply to this email directly, [view it on GitHub](#4627), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAVR3XE7GLOPVC4QOXDW3DZA6G2DAVCNFSM6AAAAABHJEKYFWVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGYYTQMJVGQ).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Moult
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I am trying to extract 2D polygons from IFC elements with ifcopenshell python. The 2D polygons should represent the ground footprint of the IFC element.
What is working so far: I can create a geometric shape from e.g. an IfcRoof element. The shape consists of vertices, edges and faces. From the vertices, I can create a convex hull that approximates the outer boundary.
In order to get an exact outer boundary, I think I need to create polygons based on the edges. I have been trying to manipulate the list of edges to create closed rings of line segments that can be used to define polygons, but that has not been entirely successful yet.
As far as I can tell, the edges always consist of two indices: one for a 'from' vertex, and one for a 'to' vertex. But my understanding stops there. It would probably help to know how the edges are ordered by ifcopenshell.geom.create_shape(). Is there documentation on that?
And if someone has already found an algorithm for finding 2D polygons, I would love to hear about that!
Regards,
Frans
Beta Was this translation helpful? Give feedback.
All reactions