PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Win Aung Cho   PHP CAD 2D   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Read me
Class: PHP CAD 2D
Draw vectorial graphics in an image canvas
Author: By
Last change: Update README.md
Update README.md
Update README.md
Date: 1 year ago
Size: 1,825 bytes
 

Contents

Class file image Download

PHP-CAD2D

CAD2D is a class to create an engineering drawing. Entity data are stored in the associative array. Class draw the drawing on image after pre-defined entity data.

PHP-CAD2D

Usage

First include the cad2d.php class in your file, and use the class as following to create drawing.

<?php
require_once ("cad2d.php");

$model2d = new CAD2D();
$model2d->setCanvas(200, 800, 1.5);
$model2d->drawGrid(-50, -50, 300, 600, 50);

$fname = "cad2dsample.png";
imagePng($model2d->canvas, './images/'.$fname);
imagedestroy($model2d->canvas);

echo "<img src='images/$fname?u=".time()."'/>";
?>

Examples

Draw Line

Line drawing example code PHP-CAD2D

Draw Polylines And Filling Hatch

Poly Line and Hatch drawing example PHP-CAD2D

Draw Ellipse And Filling Hatch

Ellipse drawing example PHP-CAD2D

Draw Dimension

Dimension drawing example PHP-CAD2D

Draw Text

Text drawing example PHP-CAD2D

Draw Rectangle And Points

Rectangle and Point drawing example PHP-CAD2D

Contact

Contact me for comercial use via mail winaungcho@gmail.com.