{"id":16723990,"url":"https://github.com/yatekii/copper","last_synced_at":"2025-07-26T00:36:59.545Z","repository":{"id":45170950,"uuid":"139206098","full_name":"Yatekii/copper","owner":"Yatekii","description":"An open source PCB editor in rust","archived":false,"fork":false,"pushed_at":"2021-11-11T01:40:11.000Z","size":1516,"stargazers_count":44,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T00:51:08.656Z","etag":null,"topics":["eda","layout","pcb","rust","schematic"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yatekii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-30T00:03:05.000Z","updated_at":"2025-02-26T01:13:32.000Z","dependencies_parsed_at":"2022-07-13T17:00:32.648Z","dependency_job_id":null,"html_url":"https://github.com/Yatekii/copper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yatekii/copper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yatekii%2Fcopper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yatekii%2Fcopper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yatekii%2Fcopper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yatekii%2Fcopper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yatekii","download_url":"https://codeload.github.com/Yatekii/copper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yatekii%2Fcopper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267093914,"owners_count":24034957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eda","layout","pcb","rust","schematic"],"created_at":"2024-10-12T22:40:19.807Z","updated_at":"2025-07-26T00:36:59.475Z","avatar_url":"https://github.com/Yatekii.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Copper\n\nCopper is a PCB EDA Tool written in Rust.\n\n![Screenshot](doc/img/screenshot.png)\n\n# Motivation\n\nComing from an electrical engineering background, we have used quite a few PCB EDA tools.\nSome of them are expensive and provide a lot of tools, that can work great or still be buggy.\nSome of them are open source but don't really seem to make progress in terms of neither stability nor features.\n\nWe genuinely think that this is not a misery coming from incompetent developers, but from a really old code base that is just lackluster and rusty (ha ha).\n\nThus we decided to try and write our own tooling.\n\n# Current state\n\nCurrently a basic [KiCad](http://kicad.org/) schema can be rendered. Text rendering is disabled for now as the development of [Pathfinder 2 by pcwalton](https://github.com/pcwalton/pathfinder) is awaited.\n\nA basic UI with just some info, made with GTK3, is working.\n\nPlacing, moving and rotating components works. Drawing new wires works as well.\n\nI am working on [a standalone hierarchical primitive renderer](https://github.com/Yatekii/svg) at the moment, to make rendering more convenient. Also I am trying to push [azul](https://github.com/maps4print/azul) to get a proper, native UI library.\n\nSo if you'd like to contribute, please help those two projects.\n\n# Roadmap\n\nThe idea is to complete a schema renderer first with regards to the PCB layouter in the future when it comes to performance questions.\nTo start the project off, the idea is to use the KiCad formats, such that KiCad as a tool can be replaced piece by piece.\n\n1. Schema renderer\n    - Text rendering on schema\n        - Adding \u0026 removing components\n    - Electrical logic correctness\n        - Tracking and validation of connections between components\n            - With regards to netlist generation\n    - Export the schema back to the KiCad format\n    - Store to a modern format (XML, JSON, YAML, TOML, RON, et al.) to maintain better readability, maintainability and serializing\n    - Generate a Netlist in the KiCad format\n    - (optional) Export to a modern format\n\n2. Layouter\n    - Basic rendering\n    - more to come\n\n# Project Structure\n\nThe project consists of\n    \n- a library which contains all the operations for parsing, rendering and manipulation. The API to manipulate the designs programmatically should be a first class citizen from the get go to enable tests to the very last layer before the GUI and future possibilities of scripting and a console. A few remarks:\n    - The library is thematically structured into\n        - `drawing` (everything involved in the process of drawing the designs)\n        - `loading` (everything involved in the process of loading the designs from various formats)\n        - `parsing` (everything involved in the process of parsing the project design files)\n        - `state` (contains all structures concerning the storing of the designs as well as their manipulation)\n        - `utils` (helpers to make the coders life easier)\n        - `geometry.rs` (for the moment contains various types; not sure if really need on the top level\n    - For KiCad formats parsing, [nom](https://github.com/Geal/nom) is used. For a future modern format, [https://github.com/serde-rs/serde](serde) can be used.\n    - No UI code should go in here.\n- a binary, which renders the schemata. This binary should only contain GUI code + glue which interfaces the copper library to draw and manipulate the schemata.\n    - For GUI [https://github.com/antoyo/relm](relm) is used, which is based on [https://github.com/gtk-rs/gtk](gtk-rs).\n- future binaries will be added for different tasks.\n\n## Schema Editor\n\n`SchemaEditor` loads, holds and stores the schema\n- `Schema` represents the state of the schema with all its components; does not contain any viewing information. Holds a vector of components and wires. It does not contain any manipulation methods itself.\n    - `ComponentInstance` represents a single component in its logical meaning.\n    - Each element (Components, Wires, Drawables, etc.) gets a UUID on creation. All entities are accessed via their UUID.\n- `ViewState` holds the current view of the schema, cursor position, etc. It should also hold information about selected components, wires or wire preview, etc.\n- `SchemaLoader(\u0026schema)` loads the schema\n- `SchemaViewer(\u0026schema, \u0026view_stae)` manipulates the current view of the schema; holds the current view state; does not manipulate the schema\n- `SchemaDrawer(\u0026schema, \u0026view_state)` daws the schema; does not manipulate the schema. Contains a single Vector of Drawables.\n    - Updates the Drawables only on changes.\n    - Swaps removed Elemnts for the last one and changes indices of its vertices.\n    - Data will only get pushed to the GPU when it changes. Not each frame as before\n    - Each Drawable holds a UUID which matches the UUID of an element in the Schema.\n\n- Actions are perfromed using the `EventMessage` enum, the `EventBus` struct and the `Listener` trait.\n    - `Listener` is an enum which holds a variant for every single possible change of the Schema or its view. For example `EventMessage::AddComponent(ComponentInstance)` or `EventMessage::Zoom(f32)`.\n    - Each `EventMessage` can be emitted using `EventBus::emit(EventMessage)` which internally pushes the `EventMessage` onto a stack. Simultaneously it calls `Listener::receive(EventMessage)` of each known `Listener`. When reverting an action, `Listener::revert(EventMessage)` will be executed in the same fashion and the `EventMessage` will be popped from the stack.\n    - `Listener` is a trait implementing `Listenr::receive(EventMessage)` and `Listener::revert(EventMessage)` which apply and revert an action on a given actor respectively. It is meant that the `Listener` matches the enum variants it needs and discards the rest.\n- No schema state is directly manipulated. Every action is started via the `MessageBus`. States that only concern a preview can be manipulated with methods directly (selected component marker display, wire preview, etc.).\n\n# Building\n\n## Building for Linux\n\nMake sure `libgtk3` and `libepoxy` are installed on your system.\nMake sure you have the current nightly rustc enabled. You can do so with\n\n```\nrustup override set nightly\nrustup update\n```\n\nInside the repository.\nFinally you should be able to\n\n```\ncargo run --release --bin schema_editor test_data/kicad.lib test_data/kicad.sch\n```\n\n## Building for Windows\n\nSet the active rustup toolchain using\n\n```\nrustup target add x86_64-pc-windows-gnu\nrustup override set nightly-x86_64-pc-windows-gnu\nrustup update\n```\n\nInstall [MSYS2](http://www.msys2.org/).\n\nIn the “MSYS2 MSYS Shell” install libgtk3.\n\n```\npacman -S mingw-w64-x86_64-gtk3\n```\n\nThen install the mingw toolchain\n\n```\npacman -S mingw-w64-x86_64-toolchain\n```\n\nStart the “MSYS2 MinGW Shell” (not to be confused with “MSYS2 MSYS Shell”).\nAll future operations should be performed from this shell.\n\nAdd the rustup/cargo binaries to the `PATH`.\nYou can do this by adding the line\n\n```\nexport PATH=$PATH:/c/Users/\u003cyour_name\u003e/.cargo/bin:\n```\n\nto the `.bashrc`.\nRestart the shell.\n\nNow make sure the MYSYS2 environment is up to date (weirdly enough this is not the case after doing a fresh install). If you are prompted about conflicts between packages, just accept that pacman resolves the conflicts by uninstalling one.\n\n```\npacman -Su\n```\n\nRestart the shell again (You might have to force close it, that's okay!)\n\n```\npacman -Su\n```\n\nagain. Now a ton of packages should get listed. Install them.\n\nNow you should be able to\n\n```\ncargo run --release --bin schema_editor test_data/kicad.lib test_data/kicad.sch\n```\n\n# Contributing\n\nIf you would like to contribute code, ideas or criticism, please do not hesitate to do so.\nWe do not think that we already know how to perfectly write this application, so we are very open for big adjustments as well.\n\nFor now there is no \"official process\" of contruibuting code, so please just open issues and pull requests at will ;)\n\n# Contact\n\nYatekii can be found on the mozilla and freenode IRC networks with the same nick, where he wanders in various rust and general programming related channels.\nSometimes tiwalun can be found there too if you get lucky.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyatekii%2Fcopper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyatekii%2Fcopper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyatekii%2Fcopper/lists"}