How to place best fit 2D orientated block around almost rectangular 2D shape so all angles straight?
What I have tried:
Any other ideas? Example attached.
This is survey of building 4 corner points with cm accuracy but for BIM modelling it would be necessary to generalize it with straight angles if they are close to 90 degrees.
best-fit-block.dgn
Oto said:How to place best fit orientated block
How do you define 'best fit'?
Your example (thanks for supplying a DGN file!) shows a rhombus. None of its sides is parallel to an axis. How would you go about making a 'best fit' rectangle manually?
Regards, Jon Summers LA Solutions
I mean best fit by less difference between rhombus corners and new rectangle corners.
This is similar problem - https://gis.stackexchange.com/questions/212003/modifying-polygons-to-be-more-rectangular-using-pyqgis
Oriented MBR is not quite what is expected but close.
Orthogonalize or regularize seems to be the term.
Oto said:Oriented MBR is not quite what is expected but close
Does that suit your needs?
If that doesn't provide what you want, you will need to be very precise when specifying your exact requirement.
No. Range could be too big. Need more optimized approach where all orthogonal shape points are as close(outside or inside) as possible to original shape.
Will try another manual approach before fall back to VBA.
Edit: Tried using area tool to get Mass properties then converted matrix to degrees and placed block with the calculated angle but result is not close enough