Images or sketches in PHP website

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
maxdba
Forum Newbie
Posts: 2
Joined: Thu Oct 24, 2013 6:24 am

Images or sketches in PHP website

Post by maxdba »

Hi,
I am putting together a PHP database driven site that helps my customers select parts.
It gives them dimensions and weights etc. as they progressively select parts into an assembly.
What I want to do is to have a dynamic sketch drawn on the page, as well as the tabulation, to illustrate the change in the assembly configuration as they choose the parts.
In simple terms first they might choose a bolt,then they might add a washer, then a nut and so on....
My range of options is not infinite, but there will be maybe 1200 different, but standard, parts to choose from.

If you imagine the left side of the page filled with tabulated numbers and the right side of the page has the sketch which changes as they build up their assembly.

Any suggestions on how to handle this (if it is possible) would be appreciated as I don't know where to look as a first step to handle the image/drawing aspect, I am not even sure if I have seen anyone do it !

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Images or sketches in PHP website

Post by Christopher »

What format are the parts images in? There are several ways to do what you want. It depends on the complexity of the assemblies.

The two main strategies are:

1. Overlay images of the various parts to create the final image. This could be done with layers in HTML or with one of the image libraries in PHP or with Flash or the HTML5 canvas.

2. Create the images from vector data and draw them with Flash or the HTML5 canvas, maybe using SVG. A graphics library on the server could also be used to generate the images this way.
(#10850)
maxdba
Forum Newbie
Posts: 2
Joined: Thu Oct 24, 2013 6:24 am

Re: Images or sketches in PHP website

Post by maxdba »

The images are all AutoCAD images so they can be exported to anything such as JPEG, GIF etc etc.
The thought of overlaying images sounds like it would work well for less complex assemblies, but I think this might be less flexible for complex items or for future growth/needs.
I now see that because the products are designed by the database that I could use it to create the vector data for drawing.
Being an engineer the idea of making the website draw everything appeals so with database generated vectors, the next step of drawing the lines should be straightforward (famous last words) once I work out how to code it that is !
Thank you for pointing me in a direction.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Images or sketches in PHP website

Post by Christopher »

You may want to look at vector drawing libraries for PHP's GD and Imagick libraries. There are also vector drawing libraries for HTML5 canvas. And of course the whole, evil world of Flash.
(#10850)
Post Reply