drawshield / Drawshield-Code

PHP code to create SVG shield images from Blazons, as used on drawshield.net
https://drawshield.net
GNU General Public License v3.0
50 stars 17 forks source link

Divisions of Charges divide all paths within the SVG separately #676

Open TestTimothy opened 4 months ago

TestTimothy commented 4 months ago
# Testing for divisions of charges
a roll of 2 columns
title "Divided Charges"
consisting of
argent a lozenge per pale vert and purpure
caption "A charge with a single SVG path"
then
argent a fleur de lys per pale vert and purpure
caption "A charge with multuiple SVG paths"
then
argent a lion per pale vert and purpure
caption "A complex SVG (per pale)"
then
argent a lion per bend vert and purpure
caption "A complex SVG (per bend)"

divided roll

TestTimothy commented 4 months ago

Divisions per bary and per paly are also wrong in the same way. I probably should have included some in the test case.

karlwilcox commented 4 months ago

Yes, I don't know of an easy way to fix this, it is an artifact of the way that SVG pattern fills work when you pattern fill a group of objects like the lion (the fill is applied before the grouping, when we really want it to work the other way around).

It could possibly be fixed by using the charge as a mask on to the division but then you would need to overlay the charge again with a coloured stroke and transparent fill to get the details and shading back and then apply the features separately but it all got too complicated and my brain started to hurt.

As you note, it only works neatly if the charge is a single SVG path (so only the very simple, geometric ones), but it can produce some nice unintentional effects on really complicated shapes like the lions.

So sorry, yes you are correct but I can't fix it.