From 8f0e595e23b8665d8a5b9f67637f11e4e19d1bb6 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 5 Jan 2021 12:26:50 +0300 Subject: [PATCH] fix(renderings): Avoid too-thin books from rendering inside-out --- rules/functions.mk | 1 + rules/rules.mk | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rules/functions.mk b/rules/functions.mk index 2d082fa6..ea2ea3df 100644 --- a/rules/functions.mk +++ b/rules/functions.mk @@ -298,6 +298,7 @@ define povray ?= #declare Rand1 = seed(1234); #declare Rand2 = seed(4123); #declare Rand3 = seed(2134); + #declare MinThickness = 0.005; EOF sleep 1.$${RANDOM} # block parallel execution while $(PGREP) povray > /dev/null; do sleep 2.$${RANDOM}; done diff --git a/rules/rules.mk b/rules/rules.mk index 99620f73..9de7434f 100644 --- a/rules/rules.mk +++ b/rules/rules.mk @@ -1149,7 +1149,7 @@ $(BOOKSCENESINC): %.inc: $$(geometryfile) %-pov-$(_front).png %-pov-$(_back).png #declare CoilWidth = $(COILWIDTH); #declare CoilColor = $(COILCOLOR); #declare PaperWeight = $(PAPERWEIGHT); - #declare BookThickness = $${spinemm} / $${pagewmm} / 2; + #declare BookThickness = max($${spinemm} / $${pagewmm} / 2, MinThickness); #declare HalfThick = BookThickness / 2; EOF @@ -1160,7 +1160,7 @@ $(BOOKSCENES): %-$(_3d).pov: $$(geometryfile) %.inc #declare DefaultBook = "$(filter %.inc,$^)"; #declare Lights = $(call scale,8,2); #declare BookAspect = $${pagewmm} / $${pagehmm}; - #declare BookThickness = $${spinemm} / $${pagewmm} / 2; + #declare BookThickness = max($${spinemm} / $${pagewmm} / 2, MinThickness); #declare HalfThick = BookThickness / 2; #declare toMM = 1 / $${pagehmm}; EOF