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](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cad2darray.png)
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](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cadline.png)
Draw Polylines And Filling Hatch
Poly Line and Hatch drawing example
![PHP-CAD2D](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cadpoly.png)
Draw Ellipse And Filling Hatch
Ellipse drawing example
![PHP-CAD2D](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cad2dellipse.png)
Draw Dimension
Dimension drawing example
![PHP-CAD2D](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cad2ddim.png)
Draw Text
Text drawing example
![PHP-CAD2D](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cad2dtext.png)
Draw Rectangle And Points
Rectangle and Point drawing example
![PHP-CAD2D](https://raw.githubusercontent.com/winaungcho/PHP-CAD2D/main/images/cad2drectpt.png)
Contact
Contact me for comercial use via mail winaungcho@gmail.com.
|
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 |
|
|
|
Screenshots |
|
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.
|
Files |
|
File |
Role |
Description |
index.php |
Aux. |
Auxiliary script |
File |
Role |
Description |
cad2d.php |
Class |
Class source |
|
Files |
|
File |
Role |
Description |
index.php |
Aux. |
Auxiliary script |
File |
Role |
Description |
cad2d.php |
Class |
Class source |