ivanceras / svgbob

Convert your ascii diagram scribbles into happy little SVG
http://ivanceras.github.io/svgbob-editor/
Apache License 2.0
3.83k stars 108 forks source link

Lines crossing issue #105

Closed ipocentro87 closed 1 year ago

ipocentro87 commented 1 year ago

Hi all, When I try to do this:

 |
---
 |

The result SVG shows two lines where the horizontal line appears to be above the vertical one. However, the other way around doesn't seem to work:

-|-

as it basically behaves as same as:

 |
-+-
 |

Is anyone else having the same issue?

ivanceras commented 1 year ago

Hello @ipocentro87 , this is an intended effect as it make sense topology wise. In the first figure, the vertical line is much farther to the horizontal line, thus it shouldn't automatically connect. On the other hand in the second figure, the horizontal line is much closer to the vertical line on its side, therefore it automatically connects. Explicitly putting + or | on the intersection would connect it.

ipocentro87 commented 1 year ago

Hi @ivanceras , is there an alternative way to write -|- but without having those lines crossing? Example:

            //     |||   |||   |||   |||  | |
            //     vvv   vvv   vvv   vvv  | |
            //    +---+ +---+ +---+ +---+ | |
            //    |CSA| |CSA| |CSA| |CSA| | |
            //    +---+ +---+ +---+ +---+ | |
            //    s| |c  | |   | |   | |  | |
            //     | |   | | .-' '-. | |  | |
            //     | |   | '-|---. | | |  | |
            //     | '-------|-. | | | |  | |
            //     '---. | .-' | | | | |  | |
            //     .---|-|-|---|-|-|-|-|--' |
            //     | .-|-|-|---|-|-|-|-|----'
            //     | | | | | .-|-|-|-' |
            //     v v v v v v v v v   v
ivanceras commented 1 year ago

@ipocentro87 you can use the any of the parenthesis, ( or ) to visually indicate the that lines is not connected, like so.

            //     |||   |||   |||   |||  | |
            //     vvv   vvv   vvv   vvv  | |
            //    +---+ +---+ +---+ +---+ | |
            //    |CSA| |CSA| |CSA| |CSA| | |
            //    +---+ +---+ +---+ +---+ | |
            //    s| |c  | |   | |   | |  | |
            //     | |   | | .-' '-. | |  | |
            //     | |   | '-|---. | | |  | |
            //     | '---)---|-. | | | |  | |
            //     '---. | .-' | | | | |  | |
            //     .---|-|-|---|-|-|-|-(--' |
            //     | .-|-|-|---|-|-|-|-|----'
            //     | | | | | .-|-|-|-' |
            //     v v v v v v v v v   v

Also, in electrical circles lines that just without putting a dot marker is also considered not connected.