Getting smallest Bounding Box (MinimumAreaRectangle) problem
Hey. i wanna get the smallest enclosuring rectangle. Basically what i'm doing right now: getting each boundary, calculate the 2d-vertices A,B,C,D (also minding the rotation!) and add them to a array. Then feed that array of cvertices into a node called "MinimumAreaRectangle". Here is the problem: it outputs the right x and y dimensions, but not the right centerpoint. (actually it outputs the average of all points) if included some pics to better visualize the problem: two boundaries with same size and no rotation: no problem but if i add a 3rd one or change the size or rotation of one of the boundaries then fallowing happens: somehow gets offset by a random value?
so is the algorithm broken?
asked Feb 06 '19 at 05:00 PM in Blueprint Scripting
You are correct that it is taking the average of all points when it should only be considering points that make up the convex hull. I would definitely submit a bug report, as I don't see one currently on Unreal Issues. It should be a very simple fix.
In the meantime you can fix this in the C++ source for yourself if you are using it. It's in KismetMathLibrary.cpp. If you are in blueprint only, you could write the algorithm yourself using the link below, although it will be pretty complex for BP. This is the same source that the Unreal implementation comes from, so be sure to correct its center as well.
answered Feb 06 '19 at 06:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here