Dividing Rectangle from an External Point in Equal Areas

For another application, a neat division of a rectangle into three equal areas was required using two lines from a point located outside the rectangle. This Grasshopper definition has emerged from that need. It divides a rectangle from an external point or a point on the edge into equal areas.

The program reconstructs the rectangle in the XY world coordinates. The rectangle is then divided into diagonal sections, determining where the reference point lies within one of those sections. Next, the rectangle and the reference point are rotated so that mathematics only needs to be applied to one side. These sections are further divided into locations where different conditions apply.

A mathematical expression is used to find the point on the opposite side of the rectangle, ensuring that the areas remain equal. After these actions, the rectangle and reference point are rotated back to their original positions. Finally, the constructed lines are translated to the reference rectangle.

The question now is whether this can also be accomplished with Grasshopper components without mathematics, or with significantly less mathematics. As a novice Grasshopper user, finding these kinds of solutions can be challenging. It’s understood that programming becomes even more complicated if this definition is to work for multiple rectangles simultaneously, but this will be addressed in a future project.

Dividing Rectangle from an External Point.gh (48.3 KB)

For this type of work you could use geometric solving, there are many example in all the equal area subjects.
The idea there is to make lines from angleMin to angleMax (covering the rectangle) measure the surface between each pair of line then represent as a curve the angle in abcissa and cummulative area as ordinates.
The draw lines equally spaced in area, find the intersection in the curves => you have the angles that could lead to equal area division.
image

1 Like

You can do more simple but less exact with bins. Same idea as above but you cut and you group in bins.
2000 divisions [0 to 2*Pi]


10000 divisions

Dividing Rectangle from an External Point LD.gh (18.5 KB)

1 Like

You can solve this with Kangaroo to 6 digit precision in a few ms:


rectangle_divide.gh (13.3 KB)

4 Likes

Thank you very much @laurent_delrieu and @DanielPiker , Great. Exactly what I was looking for. Which of you two solved this? Daniel’s answer has great precision I consider this solved. Both great answers. I can learn a lot from this. Thanks again.

1 Like