I’m trying to sort a slice of point cloud to create best fit lines in the points as shown below. Tried sorting, shuffeling, grouping in various reasons (for example sort points as perimeter by sastrugi) but I’m stuck on this for waaay too long. Does someone have any idea how to get this to work?
(@Marcel_Rijsmus, I need #sastrugi to be a thing )
Not at the PC, but give this a go.
Use Point.Average from the clockwork package on your point data set.
Sort the points by Distance.To this new center point.
Take the first 100 or so closest points. This should give you 4 point groups, each about halfway along the square sides.
Create Vectors from the center point to each of the 100 points.
Group the vectors/points by their Vector.AngleWithVector to the X or Y axis of the Dynamo coordinate system (or generate a new plane using the Plane.ByBestFitThroughPoints on your point data set and use its X or Y axis)
Use the Line.ByBestFitThroughPoints node on these new point groups.
Extend the lines to create a new square profile that is an approximation of the input cloud point geometry.
Hope that helps
@Ewan_Opie Thank you, thou got stuck at grouping / sorting…
I imagine this might work (got to a point where 2 walls are sorted out / not grouped thou :p)
Got any idea about how this might work for more complex shapes? not only square slices of cloud points?
thanks works perfectly as usuall
What I’m after is to create whole floor sections - gonna have to think it over thou, for more complicated shapes.