Commit 1cc64e2a by Christophe Geuzaine

make screenshots automatically

parent ad538b2a
Pipeline #284 passed with stage
in 9 minutes 14 seconds
......@@ -10,21 +10,42 @@ name=demos_boolean
files=$*
rm -rf ${name}
mkdir ${name}
cd $name
cp *.step ${name}/
cat <<EOT >> ${name}/infos.xml
cp ../*.step .
cat <<EOT >> infos.xml
<?xml version="1.0" encoding="utf-8"?>
<models>
EOT
cat <<EOT >> screenshot.geo
Print.Width = 1014;
Print.Height = 1014;
Print.Background = 1;
General.TrackballQuaternion0 = -0.09134439936266693;
General.TrackballQuaternion1 = 0.09382793879350552;
General.TrackballQuaternion2 = 0.02293507983466721;
General.TrackballQuaternion3 = 0.9911238574062343;
General.Orthographic = 0;
Mesh 2;
Draw;
Save StrCat("screenshot_", StrPrefix(StrRelative(General.FileName)), ".png") ;
SystemCall StrCat("convert -scale 128 screenshot_", StrPrefix(StrRelative(General.FileName)),
".png screenshot_", StrPrefix(StrRelative(General.FileName)), "_128.png");
Exit;
EOT
for file in $files ; do
cp $file ${name}/
echo "<model>" >> ${name}/infos.xml
echo "<title>$file</title>" >> ${name}/infos.xml
echo "<summary>$file</summary>" >> ${name}/infos.xml
echo "<file type=\"geo\">$file</file>" >> ${name}/infos.xml
echo "</model>" >> ${name}/infos.xml
cat <<EOT > ${name}/${file%.geo}.pro
cp ../$file .
/Applications/Gmsh.app/Contents/MacOS/gmsh ${file} screenshot.geo
echo "<model>" >> infos.xml
echo "<title>OpenCASCADE demo: ${file%.geo}</title>" >> infos.xml
echo "<summary>gmsh/demos/boolean/${file}</summary>" >> infos.xml
echo "<file type=\"geo\">$file</file>" >> infos.xml
echo "<preview type=\"png\">screenshot_${file%.geo}_128.png</preview>" >> infos.xml
echo "</model>" >> infos.xml
rm -f screenshot_${file%.geo}.png
cat <<EOT > ${file%.geo}.pro
DefineConstant[
R_ = {"", Name "GetDP/1ResolutionChoices", Visible 0},
C_ = {"", Name "GetDP/9ComputeCommand", Visible 0},
......@@ -33,8 +54,10 @@ DefineConstant[
EOT
done
cat <<EOT >> ${name}/infos.xml
cat <<EOT >> infos.xml
</models>
EOT
cd ..
rm ${name}.zip
zip -r ${name}.zip ${name}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment