check_tipping
Check whether a load or structure will tip by computing its center of mass relative to the support base. Use for shelving, stacked loads, machinery, or vehicles to verify stability.
Instructions
Check whether a collection of weights will tip over its support footprint.
Computes the centre of mass and tests whether its vertical projection falls inside the support base (the polygon where the object touches the ground). If it falls outside, the object tips. Use this for shelving, stacked loads, machinery on legs, vehicles, or anything that could topple.
Args: masses: list of point masses, each {"x": metres, "y": metres, "mass": kg}. x/y are top-down (plan-view) positions. Height does not affect whether it tips on level ground, only the horizontal centre of mass does. base_polygon: the support footprint as ordered vertices [{"x", "y"}, ...] in metres (e.g. the four feet of a shelf, or the contact outline).
Returns: center_of_mass, is_stable (bool), tipping_margin_m (positive = inside the base with this much clearance; negative = already outside / tipping), tipping_direction (unit vector toward the closest base edge), and a short human-readable explanation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| masses | Yes | ||
| base_polygon | Yes |