Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Generates the Teesside Programming Club logo using Sutherland-Hodgman clipping.

Notifications You must be signed in to change notification settings

tees-prog-club/logo-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo Generator

Generates the Teesside Programming Club logo using Sutherland-Hodgman clipping.

Moves a mask across a logo shape to generate stripes on it using the Sutherland-Hodgman polygon clipping algorithm. In the end, outputs an SVG of the logo to logo.svg in the same directory.

Render

Here's the logo that the program produces, rendered as a PNG.

Logo

Usage

This program is written in the scripting language Python. You'll need Python installed on your machine to run it. Call it like this:

python logo.py <number_of_stripes> <stripe_spacing>

So to create the logo as you see it in this repo, run it like this:

python logo.py 4 4.0

Files

There is a base polygon (base.poly) which is just a list of vertex coordinates drawing out the outline of the logo and a clipping polygon (clip.poly) which the program moves (or translates) downwards to create the stripes. The colour palette is in colours.txt in hexadecimal format (one per line, no blank lines). These colours are applied cyclically to the stripes.

A skeleton SVG file is located in outline.svg. It's not actually the logo outline (that's in base.poly) but rather an outline of an SVG document ready for the program to fill in.

The file logo.svg is an example render generated by the program. The file logo.png is what the render looks like rasterised as a PNG image.

Limitations

If you give a stripe count or stripe spacing that causes the clipping polygon to fall completely outside the bounds of the base shape, you'll get an error when the program tries to apply the clipping algorithm. Try adjusting the command line arguments you provide.

About

Generates the Teesside Programming Club logo using Sutherland-Hodgman clipping.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages