Modifier

Partager via


InscribedRectangle(Edge[], Int32) Constructor

Definition

Finds a large inscribed rectangle. Tries to be maximal but this is best effort. The algorithm used was inspired by the blog post https://d3plus.org/blog/behind-the-scenes/2014/07/08/largest-rect/ Random points within the polygon are chosen, and then 2 lines are drawn through those points. The midpoints of those lines are used as the center of various rectangles, using a binary search to vary the size, until the largest fit-able rectangle is found. This is then repeated for predefined angles (0-180 in steps of 15) and aspect ratios (1 to 15 in steps of 0.5).

public:
 InscribedRectangle(cli::array <Microsoft::MixedReality::Toolkit::Boundary::Edge> ^ geometryEdges, int randomSeed);
public InscribedRectangle (Microsoft.MixedReality.Toolkit.Boundary.Edge[] geometryEdges, int randomSeed);
new Microsoft.MixedReality.Toolkit.Boundary.InscribedRectangle : Microsoft.MixedReality.Toolkit.Boundary.Edge[] * int -> Microsoft.MixedReality.Toolkit.Boundary.InscribedRectangle
Public Sub New (geometryEdges As Edge(), randomSeed As Integer)

Parameters

geometryEdges
Edge[]

The boundary geometry.

randomSeed
Int32

Random number generator seed.

Remarks

For the most reproducible results, use the same randomSeed value each time this method is called.

Applies to