2017 © Pedro Peláez
 

library shooting-target

Draw shooting targets with hits based on coordinate system

image

patrickbussmann/shooting-target

Draw shooting targets with hits based on coordinate system

  • Friday, August 18, 2017
  • by patrickbussmann
  • Repository
  • 4 Watchers
  • 4 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

Shooting Target

Build Status Latest Stable Version Total Downloads StyleCI codecov.io, (*1)

The goal was it to display the hits from the www.meyton.org/shooting-data-feed-sdf/ system. The data source is called Shooting Data Feed (SDF) and could be a XML file or a MySQL database., (*2)

Installation

With Composer

$ composer require patrickbussmann/shooting-target
{
    "require": {
        "patrickbussmann/shooting-target": "dev-master"
    }
}
<?php

require 'vendor/autoload.php';

use ShootingTarget\Target;
use ShootingTarget\Hit;

Without Composer

$ git clone https://github.com/patrickbussmann/shooting-target.git
<?php

require 'shooting-target/src/Target.php';
require 'shooting-target/src/Hit.php';

use ShootingTarget\Target;
use ShootingTarget\Hit;

Usage

Example Air Rifle 10m (DE: Luftgewehr LG 10m)

$target = new Target(0.5, 0.5, 2.5, 4, 10);
$target->addHit(new Hit(0, 0));
$target->addHit(new Hit(500, 500));
$target->addHit(new Hit(-500, 500));
$target->addHit(new Hit(500, -500));
$target->addHit(new Hit(-500, -500));
header('Content-Type: image/png');
$target->draw();

Result

The picture generated by the script above, (*3)

Example Air Pistol 10m (DE: Luftpistole / LP 10m)

$target = new Target(11.5, 5.0, 8.0, 7, 10);
$target->addHit(new Hit(0, 0));
$target->addHit(new Hit(1000, 1000));
$target->addHit(new Hit(-1000, 1000));
$target->addHit(new Hit(1000, -1000));
$target->addHit(new Hit(-1000, -1000));
header('Content-Type: image/png');
$target->draw(10);

Result

The picture generated by the script above, (*4)

Example with custom font

Using a custom font is more better because it will scale up to your selected size., (*5)

$target = new Target(0.5, 0.5, 2.5, 4, 10);
$target->addHit(new Hit(0, 0));
$target->addHit(new Hit(500, 500));
$target->addHit(new Hit(-500, 500));
$target->addHit(new Hit(500, -500));
$target->addHit(new Hit(-500, -500));
header('Content-Type: image/png');
$target->draw(10, Target::DRAW_TYPE_PNG, __DIR__ . '/arial.ttf');

Result

The picture generated by the script above, (*6)

Target list

There are many targets which are compatible with this. Use them as you like. The examples below based on this document from the DSB. This is the reason why the table is in german language., (*7)

Wettbewerb / Discipline Ø 10 Innen-Ø 10 Ringabstand Erster schw. Ring Ringzahl Status
Gewehr 10 m
Armbrust 10 m
0.5 0.5 2.5 4 10
$target = new Target(0.5, 0.5, 2.5, 4, 10);
10 m Pistole 11.5 5 8 7 10
$target = new Target(11.5, 5, 8, 7, 10);
Gewehr 15 m 4.5   4.5 6 10
$target = new Target(4.5, 0, 4.5, 6, 10);
100 m Gewehr
25 m Pistole
50 m Pistole
50 25 25 7 10
$target = new Target(50, 25, 25, 7, 10);
Gewehr 300 m
Vorderlader Freigewehr 300 m
100 50 50 5 10
$target = new Target(100, 50, 50, 5, 10);
Muskete 50 m 80   40 1 6
$target = new Target(80, 0, 40, 1, 6);
25 m Schnellfeuer-/Duell-Pistole
Pistole (Duell)
100 50 40 5 6
$target = new Target(100, 50, 40, 5, 6);
Laufende Scheibe 10 m 5.5 0.5 2.5 5 10
$target = new Target(5.5, 0.5, 2.5, 5, 10);
Laufende Scheibe 50 m 60 30 17 0 2
$target = new Target(60, 30, 17, 0, 2);
Armbrust international 30 m 6 2 6 3 10
$target = new Target(6, 2, 6, 3, 10);
Armbrust National 30 m 10 0.5 15 4 6
$target = new Target(10, 0.5, 15, 4, 6);

Contribution

  • Having an issue? or looking for support? Open an issue please.
  • Do you have a new feature or a bug fix? Fork the repo, make your changes, and submit a pull request. Thank you in Advance!

Support

If you like this project please star it 😉, (*8)

The Versions

18/08 2017

dev-master

9999999-dev

Draw shooting targets with hits based on coordinate system

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-gd *

 

The Development Requires

by Patrick Bußmann

drawing hits target goal hit draw aim shooting gun weapon shoot shot shooting-sport air-gun air-rifle air-pistol

18/08 2017

1.0.1

1.0.1.0

Draw shooting targets with hits based on coordinate system

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-gd *

 

The Development Requires

by Patrick Bußmann

drawing hits target goal hit draw aim shooting gun weapon shoot shot shooting-sport air-gun air-rifle air-pistol

13/08 2017

1.0.0

1.0.0.0

Draw shooting targets with hits based on coordinate system

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-gd *

 

The Development Requires

by Patrick Bußmann

drawing hits target goal hit draw aim shooting gun weapon shoot shot shooting-sport air-gun air-rifle air-pistol