Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to display cartons as when it is placed in pallets in C# desktop program.
I need to display one by one, after the robo places the carton in pallet. i.e, initally the pallet will be empty. when the robo places first pallet i need to show carton in first positon.

NOTE: No need to show the exact picture. A simple drawing is enough.

similar to this


http://stock-image.mediafocus.com/images/previews/stack-carton-boxes-pallet-isolated-white-am1112087.jpg[^]

How can we do this for different combination 2x3x5, 2x2x2 etc??
Posted
Comments
Sergey Alexandrovich Kryukov 6-Oct-12 0:44am    
I'm not sure that GDI is best here. Did you think about WPF?

As to your whole request -- it's not really a well-defined question. There is nothing to "answer". This is just work to be done: design, implementation... You "how to" could be interpreted in many different ways, and most of those ways would require at least a short article, not a Quick answer. And this is a forum named Quick Questions & Answers.

--SA

1 solution

You draw a single carton as an hexagon formed of three parallelograms. Two of the sides are vertical. Adjust the lightness of the three faces to mimic the effect of ambiant lighting. You can also draw the six visible edges. Use the Graphics.FillPolygon method.

Now, when you place the cartons next to each other, the hexagons just translate, with the translation vector being equal to one of the inner edges, corresponding to X, Y, Z moves. This allows you to compute the position of a box anywhere on the pallet.

To render the cartons with hidden parts removal, you will resort to the painter's algorithm: start drawing the boxes at the back. The ones in front will hide those behind.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900