From fe79b7cb30794144a7982ea4a016437bbaab79b6 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze <dehaeze.thomas@gmail.com> Date: Fri, 18 Apr 2025 17:49:48 +0200 Subject: [PATCH] Add inkscape directory --- figs/inkscape/convert_svg.sh | 18 ++++++++++++++++++ .../test_struts_bench_schematic.svg | 0 .../test_struts_misalign_schematic.svg | 0 .../test_struts_mounting_joints.svg | 0 .../test_struts_mounting_step_0.svg | 0 .../test_struts_mounting_step_1.svg | 0 .../test_struts_mounting_step_2.svg | 0 .../test_struts_mounting_step_3.svg | 0 .../test_struts_mounting_step_4.svg | 0 9 files changed, 18 insertions(+) create mode 100755 figs/inkscape/convert_svg.sh rename figs/{ => inkscape}/test_struts_bench_schematic.svg (100%) rename figs/{ => inkscape}/test_struts_misalign_schematic.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_joints.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_step_0.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_step_1.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_step_2.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_step_3.svg (100%) rename figs/{ => inkscape}/test_struts_mounting_step_4.svg (100%) diff --git a/figs/inkscape/convert_svg.sh b/figs/inkscape/convert_svg.sh new file mode 100755 index 0000000..c9c1755 --- /dev/null +++ b/figs/inkscape/convert_svg.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Directory containing SVG files +INPUT_DIR="." + +# Loop through all SVG files in the directory +for svg_file in "$INPUT_DIR"/*.svg; do + # Check if there are SVG files in the directory + if [ -f "$svg_file" ]; then + # Output PDF file name + pdf_file="../${svg_file%.svg}.pdf" + png_file="../${svg_file%.svg}" + + # Convert SVG to PDF using Inkscape + inkscape "$svg_file" --export-filename="$pdf_file" && \ + pdftocairo -png -singlefile -cropbox "$pdf_file" "$png_file" + fi +done diff --git a/figs/test_struts_bench_schematic.svg b/figs/inkscape/test_struts_bench_schematic.svg similarity index 100% rename from figs/test_struts_bench_schematic.svg rename to figs/inkscape/test_struts_bench_schematic.svg diff --git a/figs/test_struts_misalign_schematic.svg b/figs/inkscape/test_struts_misalign_schematic.svg similarity index 100% rename from figs/test_struts_misalign_schematic.svg rename to figs/inkscape/test_struts_misalign_schematic.svg diff --git a/figs/test_struts_mounting_joints.svg b/figs/inkscape/test_struts_mounting_joints.svg similarity index 100% rename from figs/test_struts_mounting_joints.svg rename to figs/inkscape/test_struts_mounting_joints.svg diff --git a/figs/test_struts_mounting_step_0.svg b/figs/inkscape/test_struts_mounting_step_0.svg similarity index 100% rename from figs/test_struts_mounting_step_0.svg rename to figs/inkscape/test_struts_mounting_step_0.svg diff --git a/figs/test_struts_mounting_step_1.svg b/figs/inkscape/test_struts_mounting_step_1.svg similarity index 100% rename from figs/test_struts_mounting_step_1.svg rename to figs/inkscape/test_struts_mounting_step_1.svg diff --git a/figs/test_struts_mounting_step_2.svg b/figs/inkscape/test_struts_mounting_step_2.svg similarity index 100% rename from figs/test_struts_mounting_step_2.svg rename to figs/inkscape/test_struts_mounting_step_2.svg diff --git a/figs/test_struts_mounting_step_3.svg b/figs/inkscape/test_struts_mounting_step_3.svg similarity index 100% rename from figs/test_struts_mounting_step_3.svg rename to figs/inkscape/test_struts_mounting_step_3.svg diff --git a/figs/test_struts_mounting_step_4.svg b/figs/inkscape/test_struts_mounting_step_4.svg similarity index 100% rename from figs/test_struts_mounting_step_4.svg rename to figs/inkscape/test_struts_mounting_step_4.svg