dragoncoder047 / schemascii

A command-line tool and library for converting ASCII-art diagrams into nice SVG circuit schematics.
https://dragoncoder047.github.io/schemascii/
GNU General Public License v3.0
7 stars 1 forks source link

Asciio/AACircuit integration/compatibility (was: Join under common ASCII umbrella project) #8

Open nkh opened 1 year ago

nkh commented 1 year ago

Hi, we're https://github.com/nkh/P5-App-Asciio

You probably know of https://josoansi.de/download.php and its python clone.

After I saw the project above I though of making an Asciio mode to handle electronic components; but I have little electronics knowledge so my requirements may fall short. I have also been looking for something to export the ASCII to that would generate some png/svg and by pure luck I found your project.

Gains for Asciio

Gains for schemascii

You don't have to develop anything in Asciio, except if you want to, only cooperate on common requirements and formats.

Let us know if this would be of interest to you.

dragoncoder047 commented 1 year ago

1) I didn't know of either of those two libraries, so thanks for sharing them.

My inspiration was actually SVGBob and the "circuit diagram" example from that page.

Schemascii was designed with two goals in mind: 1. to create legible circuit diagrams (duh), and 2) to force myself to use the correct reference designators. My main use for it is embedding it in Python-Markdown-rendered web sites like my blog, where I've used it a few times.

Schemascii's internal representation is pretty much just the raw text, no structure or anything, and any coordinate information is thrown out after rendering each component or line to a string. If you connect two separate wires using the G symbols, electrically, they are connected (both ground), but Schemascii has no idea and ends up making them appear as two separate wires when you hover over them. So I doubt I'd be able to add any thing to export a Schemascii diagram to any of the other formats.

What would probably wok better is adding compatibility to Asciio/AACircuit to draw stuff in Schemascii format, so you could have an easier time editing it. We'll see how that goes. I know nothing about Perl so I'd be no help with the code.

nkh commented 1 year ago

if you like SvgBob you will like Goat https://github.com/blampe/goat which I used to generate this https://raw.githubusercontent.com/nkh/P5-App-Asciio/801164e39f63011c71074f50bb54e6f578187549/documentation/mdbook_asciio/src/examples/screenshot_2023-06-25_17-45-31.png

if you render each comonent separately there must be some kind of structure otherwise you couldn't

U1:NE555,7,6,2,1,5,3,4,8

and have it at the right place

Asciio is all about an easier time editing, ASCII editing is fun 2 minutes otherwise.

What do you think would be necessary in Asciio to draw in Schemascii format? And what's the format?

No need for coding help :)

dragoncoder047 commented 1 year ago

if you render each comonent separately there must be some kind of structure otherwise you couldn't

U1:NE555,7,6,2,1,5,3,4,8

and have it at the right place

WHat you pasted there is a "BOM data" which is pulled out separately before components are rendered, and Schemascii matches them up using the reference designator. That is how it knows when you write R1 in a circuit it is 10kΩ, because you wrote R1:10k somewhere else. The full format is described in format.md but there's not much to it either way.

I think that the easiest thing to do at least for Asciio is you could have a "Schemascii mode" where it draws boxes using . for corners and :~ for sides (what Schemascii expects) and line corners using * exclusively, or some way to export to that even if it doesn't show it onscreen. Schemascii's box format is just a way to make components bigger so you can put more terminals on them. You can draw a resistor with a box if you want, Schemascii won't care.