You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
layout: new cloud flows can overlap chains that are not left to right #445
When layout adds a flow to or from a cloud on a stock that is part of a chain, it assumes the chain runs left to right: the chain's outflow on the right face and its inflow on the left.
In a diagram where the chain runs vertically or right to left, the new cloud flow can land on the face the chain already uses, and the two pipes overlap.
Example
An imported diagram with two stocks stacked vertically, a above b, joined by a flow leaving a's bottom face.
Adding an outflow from a to a cloud: layout treats right and left as taken by the chain, so it picks the bottom face, which is where the chain's pipe already is.
Why it matters
Affects diagrams imported from Vensim or Stella, or hand-arranged, whose chains are not left to right.
Not yet seen in a real model; the default generated layout always draws chains left to right.
Fix
In incremental layout, measure which face each chain flow actually attaches to, the same way side flows' faces are already measured from the drawn geometry, and pass those faces in instead of assuming right and left.
A new chain flow on such a stock has the same assumption and could take the measured direction too.
Pointers
src/simlin-engine/src/layout/mod.rs (classify_flow_sides: chain outflows go right, inflows go left)
src/simlin-engine/src/layout/incremental.rs (existing_side_flow_faces, which measures only cloud flows)
changed the title [-]layout: classify_flow_sides assumes left-to-right chain direction[/-][+]layout: new cloud flows can overlap chains that are not left to right[/+]on Oct 12, 2026
Activity
[-]layout: classify_flow_sides assumes left-to-right chain direction[/-][+]layout: new cloud flows can overlap chains that are not left to right[/+]