Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is a lightweight Python module, including a command-line script, to generate NATO APP-6(E) compliant military symbol icons in SVG format. These SVGs can be generated from inputs formatted as NATO SIDCs (Symbol identification codes) or as natural-language names for symbols, i.e. "friendly infantry platoon" or "enemy mortar section." Features supported include:

- Headquarters, task force, mobility, and echelon indicators
- Optional text amplifiers for Field T (unique designation) and Field M (higher formation)
- Automatic checking of modifier and entity types for congruence
- Symbol sets to indicate land units and installations, air, space, sea surface, subsurface, signals intelligence, and cyber units, tracks, and activities
- Status indicators in both standard and alternate forms
Expand All @@ -23,6 +24,10 @@ military_symbol --use-variants --by-name -o . "Friendly artillery company" "Dest
# Create a single symbol at the designated path by name
military_symbol -o platoon.svg -n "Friendly infantry platoon"

# Add Field T / Field M text amplifiers (max 30 characters)
military_symbol -o . 13031000211211000000000000000 \
--unique-designation "1 DPLeg" --higher-formation "Wyszków"

# Print a set of symbols by name, in unfilled style, to STDOUT
military_symbol -s unfilled -n "Friendly infantry platoon" "Enemy anti-air battery"

Expand All @@ -41,6 +46,14 @@ if __name__ == '__main__':
# Print symbol generated from a name to STDOUT
print(military_symbol.get_symbol_svg_string_from_name("enemy infantry platoon"))

# Optional Field T / Field M text amplifiers
print(military_symbol.get_symbol_svg_string_from_sidc(
"13031000211211000000000000000",
unique_designation="1 DPLeg",
higher_formation="Wyszków",
))
# Field T/M strings are limited to 30 characters (longer values are truncated).

# Add a symbol template and write it to a file adjacent to this script
example_template_directory = os.path.dirname(__file__)
military_symbol.add_symbol_template_set(os.path.join(example_template_directory, 'example_template.json'))
Expand Down
12 changes: 12 additions & 0 deletions example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@
output_filename = os.path.join(os.getcwd(), '{} {} ({}).svg'.format(example_name, example_symbol.get_sidc(), example_style))
with open(output_filename, 'w') as output_file:
output_file.write(svg_string)

# Field T / Field M text amplifiers (unique designation / higher formation)
_, text_amp_svg = military_symbol.get_symbol_and_svg_string(
'13031000211211000000000000000',
is_sidc=True,
style='light',
padding=4,
unique_designation='1 DPLeg',
higher_formation='Wyszków',
)
with open(os.path.join(os.getcwd(), 'friendly_infantry_division_text_amplifiers.svg'), 'w') as output_file:
output_file.write(text_amp_svg)
Loading