Skip to main content

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​ 

 

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.


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.

 

 


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!


Reply