This is a creation in Article, where the information may have evolved or changed. 2018-3-12, shortly before Monday, I started working on a random Simulation environment Builder project, and the heraldry constructor was just the initial part of the project. It follows some of the principles of the constructor design: Each part only does one thing, is done well, and can be shared throughout the project's ecosystem. So under the guidance of this principle, the badge generator is Born: The output can be programmed to modify, can use the necessary metadata to human or machine description of the content of a common format image. I chose SVG as the output image format, mainly because it is XML format, it is easy to modify, relatively small, and it is a vector graph, in the case of scaling without losing frames. In order to develop quickly, I chose to use PHP to complete this generator, if needed in the future, I will use more efficient language to rewrite it, for now, it has met my needs. Initially, I used an existing library to process SVG, but when I finished the initial version, I found that the library was temporarily not supporting the ' <msk> ' tag, which meant I couldn't cut the file into small pieces. In the second iteration of the version, I removed the library, directly on the XML file processing, the final effect is better, support any property operation. The formation of heraldry adheres to the necessary principles, and the shield badge is basically like the current signpost, with the aim of clearly indicating the direction. So I assumed some rules for this constructor: 1. If the emblem of the shield is a metal, then its main background will not be metal, the same will not have color; 2. Only the background and implication elements of European 10th century-16th century were considered; 3. The badge will contain the colors of the era, metal, fur and other elements, England's "scarlet" coloring will not be considered. This is the guiding rule for the time being and I might revise it later. At present, this constructor will only produce the basic background of the shield emblem, it can only be a color, or up and down symmetrical, left and right symmetrical two colors, the metal will be temporarily reserved for the meaning of the object. Here is a simple example:! [] (https://d33wubrfki0l68.cloudfront.net/152773ef00fd7c1f177ad2de4908fa49cd8c32e3/a28dc/ HERALDRY-BASIC-FIELD.SVG) The background constructor will be designed to a higher level so that the background design will be used for the design of the entire constructor, which violates the first principle. However, the same color (blue and blue) appears on the split of the color, which I'll fix in the next release. For example, the picture below looks the same as the previous one, but in fact there is a difference, which is caused by the same symmetrical color. [] (https://d33wubrfki0l68.cLoudfront.net/052c829f6fb97c432e14e3dd1fb207241e2a3b11/84fda/heraldry-duplicate-colors.svg) So far, the basic design is reasonable, Here is an example of a top-down symmetrical shield emblem:! [] (https://d33wubrfki0l68.cloudfront.net/61eef0ee0bb1590dcd0e03aa22d61f686ef6203c/19b46/ HERALDRY-BASIC-DIVISION.SVG) You can find the source code for this constructor on [GitHub] (Https://github.com/ironarachne/heraldry).
via:https://www.benovermyer.com/post/heraldry-pt-1/
Author: Ben Overmyer Translator: m1sery proofreading: Rxcai
This article by GCTT original compilation, go language Chinese network honor launches
This article was originally translated by GCTT and the Go Language Chinese network. Also want to join the ranks of translators, for open source to do some of their own contribution? Welcome to join Gctt!
Translation work and translations are published only for the purpose of learning and communication, translation work in accordance with the provisions of the CC-BY-NC-SA agreement, if our work has violated your interests, please contact us promptly.
Welcome to the CC-BY-NC-SA agreement, please mark and keep the original/translation link and author/translator information in the text.
The article only represents the author's knowledge and views, if there are different points of view, please line up downstairs to spit groove
291 Reads