PHP Classes

PHP CAD 2D: Draw vectorial graphics in an image canvas

Recommend this page to a friend!

  Author Author  
Picture of Win Aung Cho
Name: Win Aung Cho <contact>
Classes: 11 packages by
Country: Myanmar Myanmar
Innovation award
Innovation award
Nominee: 3x


  Detailed description   Download Download .zip .tar.gz  
This package can draw vectorial graphics in an image canvas.

It can create a canvas with a given width, height, and scale factor.

The package can draw several vectorial graphics on the canvas with adjustable parameters like colors, line widths, text styles, etc...

It can render the graphics and output them to an image file in PNG format.

Currently, it can draw:

- Points

- Lines

- Rectangles

- Ellipse

- Polygons

- Text strings

- Arrows

- Grids

- Ellipses

- Dimension

- Etc...

Details

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.


  Classes of Win Aung Cho  >  PHP CAD 2D  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP CAD 2D
Base name: php-cad2d
Description: Draw vectorial graphics in an image canvas
Version: 1.0
PHP version: 5
Licenses: Custom (specified in a license file)
MIT/X Consortium License
 
  Groups   Screenshots Screenshots   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Graphics Colors, images, charts and picture formats View top rated classes

  Files folder image Screenshots  
cad2darray.png
File Role Description
Accessible without login Image file cad2darray.png Screen Floorplan
Accessible without login Image file cad2ddim.png Screen Drawing Dimensions
Accessible without login Image file cadellipse.png Screen Drawing Ellipse
Accessible without login Image file cadlines.png Screen Drawing Lines
Accessible without login Image file cadpoly.png Screen Drawing Polylines and Hatch
Accessible without login Image file cadtext.png Screen Drawing Text


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageexample (6 files, 1 directory)
Files folder imageimages (8 files)
Files folder imagesrc (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
Files folder imageimages (1 file)
  Accessible without login Plain text file cad2ddim.php Example Example script
  Accessible without login Plain text file cad2dellipse.php Example Example script
  Accessible without login Plain text file cad2drectpt.php Example Example script
  Accessible without login Plain text file cad2dtext.php Example Example script
  Accessible without login Plain text file cadline.php Example Example script
  Accessible without login Plain text file cadpoly.php Example Example script

  Files folder image Files  /  example  /  images  
File Role Description
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  images  
File Role Description
  Accessible without login Image file cad2darray.png Data Auxiliary data
  Accessible without login Image file cad2ddim.png Output Result image
  Accessible without login Image file cad2dellipse.png Output Result image
  Accessible without login Image file cad2drectpt.png Output Result image
  Accessible without login Image file cad2dtext.png Output Result image
  Accessible without login Image file cadline.png Output Result image
  Accessible without login Image file cadpoly.png Output Result image
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
  Plain text file cad2d.php Class Class source

Download Download all files: php-cad2d.tar.gz php-cad2d.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder imageexample (6 files, 1 directory)
Files folder imageimages (8 files)
Files folder imagesrc (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
Files folder imageimages (1 file)
  Accessible without login Plain text file cad2ddim.php Example Example script
  Accessible without login Plain text file cad2dellipse.php Example Example script
  Accessible without login Plain text file cad2drectpt.php Example Example script
  Accessible without login Plain text file cad2dtext.php Example Example script
  Accessible without login Plain text file cadline.php Example Example script
  Accessible without login Plain text file cadpoly.php Example Example script

  Files folder image Files  /  example  /  images  
File Role Description
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  images  
File Role Description
  Accessible without login Image file cad2darray.png Data Auxiliary data
  Accessible without login Image file cad2ddim.png Output Result image
  Accessible without login Image file cad2dellipse.png Output Result image
  Accessible without login Image file cad2drectpt.png Output Result image
  Accessible without login Image file cad2dtext.png Output Result image
  Accessible without login Image file cadline.png Output Result image
  Accessible without login Image file cadpoly.png Output Result image
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
  Plain text file cad2d.php Class Class source

Download Download all files: php-cad2d.tar.gz php-cad2d.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.