Giter Site home page Giter Site logo

dmpl-builder's Introduction

DmplBuilder

Latest Version on Packagist Software License Build Status Coverage Status Quality Score SensioLabsInsight Total Downloads

DmplBuilder eases the process of creating DM/PL command instructions used for hardware pen plotters and cutters. Read more about the specific commands in this very modern manual by Summa.

Install

Via Composer

$ composer require nielsiano/dmpl-builder

Requirements

The following versions of PHP are supported by this version.

  • PHP 7.0

Usage

DmplBuilder uses a fluent interface to chain all commands and plots before compiling the final instructions.

$builder = new Nielsiano\DmplBuilder();

$builder->penUp()
        ->plot(200, 200)
        ->penDown()
        ->velocity(100)
        ->flexCut()
        ->plot(0, 1400)
        ->plot(1900, 0)
        ->plot(0, -1400)
        ->plot(-1900, 0)
        ->penUp()
        ->cutOff();

return $builder->compileDmpl();

Sending the generated DM/PL instructions to your plotter through USB can be done like so:

echo ';: ECM,U H L0,P0;A100,100,V10;BP50;D,0,1400,1900,0,e' > /dev/usb/lp0

Available methods at the moment:

$builder->penUp()
$builder->cutOff()
$builder->penDown()
$builder->flexCut()
$builder->flipAxes()
$builder->regularCut()
$builder->changePen(int $pen)
$builder->plot(int $x, int $y)
$builder->compileDmpl(): string
$builder->setMeasuringUnit($unit)
$builder->velocity(int $velocity)
$builder->pressure(int $gramPressure)
$builder->pushCommand(string $command)

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

dmpl-builder's People

Contributors

nielsiano avatar crishoj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.