Update to the state of things #4
fenjalien
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I started this repository many moons ago because I wanted to have an equivalent to
circuitikz
. Since then, the repository has gained over 50 stars and two PRs about improving the project. However, my last commit was over three months ago and my focus has been on other Typst packages (particularlycetz
as its needed to draw stuff). So, here I want to layout and discuss my ideas and plans for this project, it'll be a ramble because I haven't planned this and I'm in an annoyingly warm room right now.To summarise
This package aims to be a port of
circuitikz
for Typst. Anything you can do in it you should be able to do in this package.Name
I originally picked
circuitypst
as it follows the same pattern ascircuitikz
, but since Typst recommends against using "typst" in the name of packages, a new one should be found. I want to recommendcircetz
as it is still similar and includes the main dependency package.Components
There are frankly too many component in
circuitikz
to be able to include all of them for an MVP so they should be added on a as-needed basis. That being said the way in which to create components should be easy and user-facing enough that any user could do it without having to delve into some pits of spaghetti code (also you shouldn't have to register them).Another issue with adding components is having a reliable source to take diagrams and base them off. I'm not sure where they came from for
circuitikz
but from what I can find the industry standard is to use IEC 60617. However this costs CHF 650 (swiss francs)! for a 1 year subscription. So for now either playing around with measuring them incircuitikz
or somehow scraping them from the source would be the best way.Styling
Being able to customise the appearance of each component or group or class is a big thing in
circuitikz
. I'm not sure ifcetz
's styling is able to perform in the same way yet...API
Currently two functions
to
andnode
are exported. To draw a component with them you have to pass the component name and some coordinates, they then do some funky transformations and insert the component from a dictionary. The component element in the dictionary draws around the point (0,0) and to (1,0) for paths. Theres some extra stuff to do with anchors as well.The functions
to
andnode
come directly fromcicuitikz
's api for drawing components in a path or node command, which I copied because I wanted to remain as similar as possible. Butcetz
is different and I honestly don't like this way. So instead I want to try, each component is a function. Something like this:Its more cetz-y for the lack of a better word. I would then plan to possibly have each call a
componet
function, which takes the coordinates, styling and the component's body/draw function and does the funky stuff to transform the component and its anchors properly.To conclude
I hope this makes sense and clears up where I want to take this. Please ask questions or suggest a different direction. I'm not sure when I could get around to this, tbh I'm going to get distracted improving
cetz
again. The main thing I don't want with laying dormant is https://xkcd.com/927/!Beta Was this translation helpful? Give feedback.
All reactions