From db92bc17c595231d3df519412da1e833378adf50 Mon Sep 17 00:00:00 2001 From: "tlepoix@localhost" Date: Wed, 16 Oct 2024 21:50:15 +0200 Subject: [PATCH] Add icon --- CMakeLists.txt | 1 + README.md | 5 ++ default.nix | 4 ++ icon/CMakeLists.txt | 3 ++ icon/icon.tex | 54 ++++++++++++++++++++ icon/openemsh.svg | 122 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+) create mode 100644 icon/CMakeLists.txt create mode 100644 icon/icon.tex create mode 100644 icon/openemsh.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index 31c7494..39a91d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ endif() add_subdirectory( "${CMAKE_SOURCE_DIR}/src" ) add_subdirectory( "${CMAKE_SOURCE_DIR}/test" ) +add_subdirectory( "${CMAKE_SOURCE_DIR}/icon" ) if( CMakeUtils_FOUND ) coverage_global() diff --git a/README.md b/README.md index a3bc778..683ca44 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ + + [![Liberapay patrons](https://img.shields.io/liberapay/patrons/thomaslepoix.svg?logo=liberapay)](https://liberapay.com/thomaslepoix/donate) [![Discord](https://img.shields.io/discord/616889479298547722?logo=discord)](https://discord.gg/P82fEmE) [![License](https://img.shields.io/github/license/Open-RFlab/openemsh)](LICENSE) + [![Version](https://img.shields.io/github/v/release/Open-RFlab/openemsh)](https://github.com/Open-RFlab/openemsh/releases/latest) [![Nix](https://img.shields.io/static/v1?logo=nixos&logoColor=white&label=&message=Built%20with%20Nix&color=41439a)](https://builtwithnix.org/) @@ -8,6 +11,8 @@ [![SonarCloud quality gate](https://sonarcloud.io/api/project_badges/measure?project=Open-RFlab_openemsh&metric=alert_status)](https://sonarcloud.io/dashboard?id=Open-RFlab_openemsh) [![SonarCloud coverage](https://sonarcloud.io/api/project_badges/measure?project=Open-RFlab_openemsh&metric=coverage)](https://sonarcloud.io/dashboard?id=Open-RFlab_openemsh) + + # OpenEMSH : OpenEMS Mesher [WIP] _This project is under heavy development and not yet usable, for now the best way to contribute is to give a symbolic tip. :)_ diff --git a/default.nix b/default.nix index 5d12534..0a49858 100644 --- a/default.nix +++ b/default.nix @@ -4,6 +4,7 @@ , cmake , cmake-utils , git +, texlive }: with pkgs; @@ -18,6 +19,9 @@ stdenv.mkDerivation { cmake cmake-utils git + (texlive.combine { + inherit (texlive) scheme-small standalone pgfplots; + }) ]; meta = { diff --git a/icon/CMakeLists.txt b/icon/CMakeLists.txt new file mode 100644 index 0000000..61b3bc5 --- /dev/null +++ b/icon/CMakeLists.txt @@ -0,0 +1,3 @@ + +compile_latex_file( "icon" REGISTER_TO "ICON_FILES" ) +add_custom_target( "icon" DEPENDS ${ICON_FILES} ) diff --git a/icon/icon.tex b/icon/icon.tex new file mode 100644 index 0000000..c28addd --- /dev/null +++ b/icon/icon.tex @@ -0,0 +1,54 @@ +\documentclass[tikz]{standalone} + +\usepackage{tikz} +\usetikzlibrary{fadings} +\usetikzlibrary{shadings} +\usepackage{xfp} + +% https://raw.githubusercontent.com/thliebig/openEMS-Project/refs/heads/master/other/openEMS.svg +\definecolor{openemsblue}{HTML}{304090} + +\begin{document} +\begin{tikzpicture} + +\def\width{3} +\def\height{3} +\def\ox{\fpeval{\width /2}} +\def\oy{\fpeval{\height /2}} + +\path [use as bounding box] (0,0) rectangle (\width,\height); + +% SHADES +\fill [openemsblue, path fading=west] (\ox,\oy) + +(-1.2,-1.2) -- + +(0.5,-1.2) -- + +(0.5,0.5) -- + +(-1.2,0.5) -- + cycle; + +% TODO Converting this to SVG invert the Y axis for the fading only. +% Tested with pdf2svg, pdftocairo, dvisvgm, inkscape. +% Probably a bug in PGF/TikZ. +% Workaround: +% - Open PDF with inkscape with poppler/cairo import +% - Flip vertically this shading (keep this code after/on-top for easier selection) +% - Export to SVG +\fill [openemsblue, path fading=south] (\ox,\oy) + +(-1.2,-1.2) -- + +(0.5,-1.2) -- + +(0.5,0.5) -- + +(-1.2,0.5) -- + cycle; + +% VERTICAL LINES +\draw [line width=3pt] (\ox,\oy) ++(0.5,0) + +(0.4,-1.5) -- +(0.4,1.5) + +(-0.2,-1.5) -- +(-0.2,1.5); + +% HORIZONTAL LINES +\draw [line width=3pt] (\ox,\oy) ++(0,0.5) + +(-1.5,0.4) -- +(1.5,0.4) + +(-1.5,-0.2) -- +(1.5,-0.2); + +\end{tikzpicture} +\end{document} diff --git a/icon/openemsh.svg b/icon/openemsh.svg new file mode 100644 index 0000000..dede961 --- /dev/null +++ b/icon/openemsh.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +