class Geometry · Computations

SeparatePrevious

Properties

circlesoptional

circles?: (Circle | null | undefined)[]

One entry per input circle, in the same order: where it was in the last update (usually the last result), or null / undefined (or missing at the end) for a circle that had no place, e.g. one shown again. Circles without an entry are placed afresh around the others.

keepoptional

keep?: "sides" | "order"

What is kept: "sides" (default): each circle stays on the side of its own position it was on, unless the other side is closer by more than its radius; circles don't jump from side to side but come back when there is room again (e.g. after an obstacle has moved on). "order": the circles keep their order in their direction of movement (across the axis), so none passes another; obstacles can be passed: a circle changes its side of an obstacle as with "sides", so it doesn't ride on an obstacle that moves away. Both are meant for small, continuous changes (see SeparateCirclesAlongAxisOptions.previous).