Question

Is there anyway we can build area or polygon from lines? I know that areabuilder can do that with closed lines. However my problem here is that our lines are not closed. For example, we have walls lines, but some times the room has only 3 wall lines.


For example, we have walls lines, but some times the room has only 3 wall lines. Or sometimes there is gap between wall lines. Is there way to create room shape(area or polygon)? Please see attached Sample CAD Cleaned File.dwg. This is my input dwg file. And I want to create a new layer called _Plines, this layer will have the enclosed polygn created based on the wall lines. The out put is something like CAP Level 1_RevC_MB.dwg

input

imageresultimage


15 replies

Badge +1

You already have polygons in the CAD file. When you set up the reader, change the mode to geometry and extract the polygons. I could not find any blocks or attributes to name the rooms, maybe that is in a related database?polys

Thanks for your suggestion Kimo! Actually the one you look at is the result file we are trying to get to. Currently we manually draw the closed lines(_pline layer). We are looking to use transformer and automated the pline. If you look at the first drawing, Sample CAD Cleaned File.dwg, this is the source drawing file. We would like to use this file, and get to the result file simliar to CAP Level 1_RevC_MB.dwg

You already have polygons in the CAD file. When you set up the reader, change the mode to geometry and extract the polygons. I could not find any blocks or attributes to name the rooms, maybe that is in a related database?polys

Thanks for your suggestion Kimo! Actually the one you look at is the result file we are trying to get to. Currently we manually draw the closed lines(_pline layer) in Auto CAD. We are looking to use transformer to automate the drawing the pline. If you look at the first drawing, Sample CAD Cleaned File.dwg, this is the source drawing file. We would like to use this file, and get to the result file simliar to CAP Level 1_RevC_MB.dwg

Badge +1

Haha, my silly mistake. Actually I had worked out a workflow but deleted it when I found the polygons!

Ok, I have done similar things with cartographic data where crossings have been suppressed eg streams and bridges. The idea is to find the dangling end nodes/points and connect them, such as the doorways. In your case the double walls need to be either collapsed or separated so there is an ambiguous node. Maybe find the centrepoint of the short ends. Do you need the wall thickness? Maybe collapse the walls to centrelines? You will need to split all the walls at vertices and build topology. Perhaps keep a group id for each boundary.

To help with this I have published a simple transformer called NodeValence on the FME site. This takes a polyline layer and creates points with a valence (the number of lines sharing the vertex). This makes it easy to find the doorway nodes. Joining them up is not too hard, you can extend the line with the other coordinate or draw a new line with the pair of adjacent points with the same groupid.

There will be edge cases that you can filter out or tag for manual fixing so don't try to solve every case.

 

Badge +1

I have had another look at the samples. The cleaned lines are not in the same coordinate space for some reason so they don't overlay. I cannot find any useful attributes that might separate the lines further such as color, linetype or thickness. Similarly I extracted the text and found a centroid for each room, but not the ID. Perhaps layers needed for the polygons could be tagged better to separate?

I note that the polygons are not space-filling. There are lots of undefined areas. We need to account for these even if they are tagged as general space areas. There are lots of issues with including/excluding walls and columns. I thought rent was measured out the the window glass that included all structures.

Haha, my silly mistake. Actually I had worked out a workflow but deleted it when I found the polygons!

Ok, I have done similar things with cartographic data where crossings have been suppressed eg streams and bridges. The idea is to find the dangling end nodes/points and connect them, such as the doorways. In your case the double walls need to be either collapsed or separated so there is an ambiguous node. Maybe find the centrepoint of the short ends. Do you need the wall thickness? Maybe collapse the walls to centrelines? You will need to split all the walls at vertices and build topology. Perhaps keep a group id for each boundary.

To help with this I have published a simple transformer called NodeValence on the FME site. This takes a polyline layer and creates points with a valence (the number of lines sharing the vertex). This makes it easy to find the doorway nodes. Joining them up is not too hard, you can extend the line with the other coordinate or draw a new line with the pair of adjacent points with the same groupid.

There will be edge cases that you can filter out or tag for manual fixing so don't try to solve every case.

 

Thanks again Kimo! Really appreciate you look-into this for me. No, we don't really need the wall thickness. All we need is the room shape polygon. Yes, I do find it very challenge to connect the doorways. Not sure how to do that. Also, you mention to collapse the walls to centrelines. How can I do that?

I have had another look at the samples. The cleaned lines are not in the same coordinate space for some reason so they don't overlay. I cannot find any useful attributes that might separate the lines further such as color, linetype or thickness. Similarly I extracted the text and found a centroid for each room, but not the ID. Perhaps layers needed for the polygons could be tagged better to separate?

I note that the polygons are not space-filling. There are lots of undefined areas. We need to account for these even if they are tagged as general space areas. There are lots of issues with including/excluding walls and columns. I thought rent was measured out the the window glass that included all structures.

Thanks, also do you know if it's possible to use the _Room ID layer? Those are points. Is there any way to use the point along with the line (Walls) around it to create polygon?

Badge +1

Thanks, also do you know if it's possible to use the _Room ID layer? Those are points. Is there any way to use the point along with the line (Walls) around it to create polygon?

Yes, do they have an ID? Are they blocks with attributes. If so we can get them and label the polygons. I have just found my NodeValence transformer needs updating for Python 3.

It would be helpful to be able to identify the walls by an attribute such as linetype, color or attribute within the layer. Or maybe you can move them all to a named layer to make it easy to remove columns etc.

Thanks, also do you know if it's possible to use the _Room ID layer? Those are points. Is there any way to use the point along with the line (Walls) around it to create polygon?

Yes, the walls are at _Wall layer and room ids are at _Room_ID layer in my Sample CAD Cleaned File.dwg.

Thanks, also do you know if it's possible to use the _Room ID layer? Those are points. Is there any way to use the point along with the line (Walls) around it to create polygon?

In this Sample CAD Cleaned File.dwg drawing, I have separated wall, door, windows to different layers. Please take a look. Thanks,

Badge +1

I am trying a new approach, inspired by the convex hull algorithm. If I use the room label as a centre perhaps I can collect the adjacent vertices, put them in order and draw a boundary. This is a more general approach that does not rely on line attributes to filter boundaries.

I am trying a new approach, inspired by the convex hull algorithm. If I use the room label as a centre perhaps I can collect the adjacent vertices, put them in order and draw a boundary. This is a more general approach that does not rely on line attributes to filter boundaries.

Sounds good. Let me know how that go. Thanks!

Userlevel 2
Badge +17

Hi @vin​,

A technique I have used in the past is to close the door gaps using a line derived from the door swing arc. This works best if the door swings are consistently drawn in the same direction, or were placed using the same door block and then exploded.

The ArcPropertyExtractor transformer will give you the arc properties as attributes. Use either the Start X/Y or End X/Y in a VertexCreator to replace the arc with a point, then use the Center X/Y in a second VertexCreator to add a point, creating a line. If you have chosen the correct initial location, the line should close the door gap.

Hi @vin​,

A technique I have used in the past is to close the door gaps using a line derived from the door swing arc. This works best if the door swings are consistently drawn in the same direction, or were placed using the same door block and then exploded.

The ArcPropertyExtractor transformer will give you the arc properties as attributes. Use either the Start X/Y or End X/Y in a VertexCreator to replace the arc with a point, then use the Center X/Y in a second VertexCreator to add a point, creating a line. If you have chosen the correct initial location, the line should close the door gap.

Thanks, how do you draw the line from door swing arc?

Hi @vin​,

A technique I have used in the past is to close the door gaps using a line derived from the door swing arc. This works best if the door swings are consistently drawn in the same direction, or were placed using the same door block and then exploded.

The ArcPropertyExtractor transformer will give you the arc properties as attributes. Use either the Start X/Y or End X/Y in a VertexCreator to replace the arc with a point, then use the Center X/Y in a second VertexCreator to add a point, creating a line. If you have chosen the correct initial location, the line should close the door gap.

Thanks for the suggestion. Yes, with the ArcPropertyExtractor to get start x,y and center x,y I am able to create the line.

Reply