Skip to content

Commit

Permalink
Add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslepoix committed Oct 16, 2024
1 parent 673db1a commit db92bc1
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<img src="./icon/openemsh.svg" align="right" style="float:right;" width="15%" title="OpenEMSH"/>

[![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/)

[![CodeQL](https://img.shields.io/github/actions/workflow/status/Open-RFlab/openemsh/test_codeql.yml?label=CodeQL&logo=github)](https://github.com/Open-RFlab/openemsh/security/code-scanning?query=is%3Aopen+branch%3Amain+tool%3ACodeQL)
[![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)

<img src="./icon/openemsh.svg" style="float:right;" width="15%" title="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. :)_
Expand Down
4 changes: 4 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, cmake
, cmake-utils
, git
, texlive
}:

with pkgs;
Expand All @@ -18,6 +19,9 @@ stdenv.mkDerivation {
cmake
cmake-utils
git
(texlive.combine {
inherit (texlive) scheme-small standalone pgfplots;
})
];

meta = {
Expand Down
3 changes: 3 additions & 0 deletions icon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

compile_latex_file( "icon" REGISTER_TO "ICON_FILES" )
add_custom_target( "icon" DEPENDS ${ICON_FILES} )
54 changes: 54 additions & 0 deletions icon/icon.tex
Original file line number Diff line number Diff line change
@@ -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}
122 changes: 122 additions & 0 deletions icon/openemsh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db92bc1

Please sign in to comment.