Hello,
I am using CE update 11, VS 2015
Lets say we have 3d element with volume >0.
I want to construct smallest possible rectangular box around my element.
This means that box volume has to be as close as possible to elements volume.
Any ideas, existing functions?
thanks
Nenad
Nenad Poljcic said:I want to construct smallest possible rectangular box around my element
Every DGN element has a Range. The range is a box that completely encloses the element. It is measured using integer units: it is intended for fast initial spatial analysis of elements when scanning, or other purposes such as clash detection.
A Convex Hull is the smallest surface that will enclose a set of points. You could calculate a convex hull and take the max/min points to create a tightly-fitting box that's more accurate than the element range. A 3D convex hull is a hard computation: AFAIK there are no MicroStation functions and few published algorithms.
A Concave Hull is the smallest surface that will enclose a set of points and follow concave contours (incursions). However, that's not the smallest rectangle or rectangular shape. A 3D concave hull is also a very hard computation (harder than a convex hull).
Regards, Jon Summers LA Solutions
Answer Verified By: Nenad Poljcic
Hi,
To compute a 3d Convexhull in C#, I am using https://github.com/DesignEngrLab/MIConvexHull. For C++ you could look at https://www.geometrictools.com/Samples/Geometrics.html.
If the shrink wrapping tool (https://communities.bentley.com/products/microstation/b/microstation_blog/posts/shrinkwrapper-tool---new-tech-preview-feature-in-microstation-connect-edition-update-8) could be used per api (I don't know or found anything), you could use that to 'heal' your element.
Regards Harrmen