Skip to main content
Solved

How can you remove unwanted centerlines ?

  • September 2, 2021
  • 3 replies
  • 26 views

larue
Contributor
Forum|alt.badge.img+12

I am struggling with creating centerlines in wall geometry from CAD, where some squirrely ones show up:

AreasToCtrLines2I was hoping that I could filter by # of vertices, or separating by angle, but this is not reliable. Any ideas?

 

Thanks,

@larue​ 

 

Best answer by redgeographics

I'm guessing it's the ones in the middle of the rooms, which are being formed because the room itself is in fact a closed polygon.

 

If you have no way of filtering those out through original data attributes you can try using a CircularityCalculator to calculate the circularity of the polygons. The walls being long, thin, polygons will have a very low circularity, the rooms will have a high one. Pass them through a TestFilter and remove the ones that are too high. You'll need to inspect your data first to come up with a good threshold value.

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • September 2, 2021

Can you mark the ones that you don't want on your screenshot?

The number of vertexes on centerlines is dependent on the corresponding number of them on the original features.

You can try both algorithms (Centerline/Straight Skeleton) and choose the one that fits best to your situation.

For filtering and cleanup you can filter by length (sometimes, using GroupBy after StatisticsCalculator), you can remove one or many vertex from the Start and End of the line via VertexRemover and extend them back to the area feature that generated them to get rid of unwanted bends on the ends. Or you can use Generalizer/SherbendGeneralizer.

It mostly depends on what you want to remove.


redgeographics
Celebrity
Forum|alt.badge.img+62
  • Celebrity
  • Best Answer
  • September 2, 2021

I'm guessing it's the ones in the middle of the rooms, which are being formed because the room itself is in fact a closed polygon.

 

If you have no way of filtering those out through original data attributes you can try using a CircularityCalculator to calculate the circularity of the polygons. The walls being long, thin, polygons will have a very low circularity, the rooms will have a high one. Pass them through a TestFilter and remove the ones that are too high. You'll need to inspect your data first to come up with a good threshold value.

 

 


larue
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • September 2, 2021

Correct, the goal is to get something like this:

AreasToCtrLines1The CircularityCalculator could work, but I will have to do a little more cleanup beforehand. When I ran it and filtered out the higher numbers, it also grabbed a wall area section. I need a decent gap between them to accommodate a variety of floor plans.

 

Most of my forum posts have to do with translating CAD floor plans into a format that will work in Dynamo to create a Revit model. I can get about 90% of these walls processed, but the remaining 10% is causing me to completely rethink my approach, which is what you see here. My previous method was to pair wall lines to create a bounding boxes and centerlines. Good, but it has a limit.

 

I am going to close out this question, as I need to figure out what my CAD files should be to work best.

 

Thanks all for the input!