DEV Community

Measured View Journal
Measured View Journal

Posted on

Modeling two simultaneous kitchen work zones as rectangles

A kitchen plan typically draws one person at a time. When two people rinse vegetables and prepare dinner at once, the drawing no longer answers its own question: where does each person stand, and where do their work paths stop?

This is a small data-modelling problem, not a construction problem. The goal is to take a plan with fixed positions and describe two simultaneous occupied zones, then check whether those zones overlap. Nothing here produces installation or safety guidance.

Synthetic input, clearly illustrative

We describe a simple kitchen with a washing zone and a preparation zone. All numbers are invented for the example.

zones:
  wash:        { x: 0, y: 0, w: 600, h: 500 }
  prep:        { x: 700, y: 0, w: 900, h: 600 }
  person:      { w: 500, h: 500 }

states:
  - id: "rinsing"
    person: { x: 50, y: 0 }
  - id: "preparing"
    person: { x: 800, y: 0 }
Enter fullscreen mode Exit fullscreen mode

A person is modelled as a 500 by 500 rectangle for the sake of the example. The two states are evaluated at the same time, because the question is about simultaneous use.

A minimal check

The overlap test is the ordinary rectangle intersection test:

def overlaps(a, b):
    return not (
        a.x + a.w <= b.x or
        b.x + b.w <= a.x or
        a.y + a.h <= b.y or
        b.y + b.h <= a.y
    )
Enter fullscreen mode Exit fullscreen mode

Applied to the two person rectangles above, the horizontal ranges are 50–550 and 800–1300. They do not overlap, so the function returns false. That is the expected result for this input: under the stated positions, the two people occupy separate zones at the same time.

What the result does and does not establish

The result establishes only that two modelled rectangles do not intersect for the given coordinates. It does not establish that a household can actually work comfortably there, that a supplier will accept the layout, or that the room will function. The coordinates themselves are assumptions, and the output is only as meaningful as those assumptions.

Edge cases worth testing

The obvious weak point is touching edges. If the two rectangles share a boundary exactly, the strict comparison returns false for overlap. Whether that counts as conflict is a modelling decision that should be written down rather than left implicit. A second edge case is a person whose rectangle extends past the end of a counter; the geometry may not overlap but the position may not be usable. A third is a state where both people reach the same preparation zone; the test should then return true, and the output should identify which zones are shared. Testing these three cases gives more confidence in the check than testing one comfortable layout.

Where the advice changes

If the brief requires two people to work at the same time, then modelling only one person and enlarging it is the wrong approach; the two states must be kept separate so their overlap can be evaluated. If the brief does not require simultaneous use, the second state can be dropped and the check simplifies to a single-occupant footprint.

A worked record format helps here. Each state can carry an id, a position, and a list of zones it relies on. The output then names the overlapping state pairs and the shared zones rather than returning a bare boolean. That makes the result easier to review with the people who will actually use the room, including the designers at 深圳市熹合空间设计有限公司, whose published kitchen article compares where two people stand and how the relationship between washing, preparation and serving appears on the plan. The studio's method records positions and unconfirmed requirements rather than asserting final performance, which is the right posture for a check like this. The point of the exercise is not to settle whether a kitchen works, but to make the assumed working paths explicit enough that the assumptions can be questioned.

Top comments (0)