OMICRONEnergy / oscd-designer

Apache License 2.0
3 stars 6 forks source link

Improve pathfinding for connections #49

Open ca-d opened 10 months ago

ca-d commented 10 months ago

At least make it so that lines never go through pieces of equipment they're actually connecting.

For bonus points, introduce some real pathfinding with obstacle avoidance à la https://qiao.github.io/PathFinding.js/visual/

danyill commented 10 months ago

Although very desirable and likely to improve user experience considerably - and for SLD use cases something like A* would seem sufficient I think this is perhaps quite high complexity.

It would almost immediately result in a requirement to edit edges/vertices as well to "correct" "visually imperfect" outcomes which may then require extending/joining/combining logic.

ca-d commented 10 months ago

I was thinking we keep the current click-guided behavior and just make the "last click to this click" connection slightly more sophisticated than "exactly one vertical and one horizontal line going straight for the cursor position". What do you think?

danyill commented 10 months ago

I think that's a great way to get a key gain without requiring a massive amount of work. Nice thought :clap: