I want write a program to calculate cutting shape of foam. For example, a piece of big foam can cut to 3 different size of foam same thick and each can cut to piece in different thick. like picture below. how can i make calculation. It possible how can i make a shape picture to display after enter number. or any good suggestion.

Attachments shape.jpg 12.89 KB

Please show what data (dimensions, measurements) you want to enter into the program. It's not clear to me what you want. If you are going to use this for a real-world program, then you will want to enter the width of the saw blade or hot wire kerf (width removed from foam by cutting tool). Tolerance of the measurements may also be a factor, for instance, 32mm by 40mm by 20mm +/- .25mm.

If you want the program to calculate optimal use of the foam block, you will still have to give it some information and at least the size of the block, the number of pieces and the relationship of the pieces.

I can see that your command of the English language is difficult but please do the best you can.

Please show what data (dimensions, measurements) you want to enter into the program. It's not clear to me what you want. If you are going to use this for a real-world program, then you will want to enter the width of the saw blade or hot wire kerf (width removed from foam by cutting tool). Tolerance of the measurements may also be a factor, for instance, 32mm by 40mm by 20mm +/- .25mm.

If you want the program to calculate optimal use of the foam block, you will still have to give it some information and at least the size of the block, the number of pieces and the relationship of the pieces.

I can see that your command of the English language is difficult but please do the best you can.

Thanks for replay. I wan calculate width x height x thick.
A form block can be cut into many different size and different thickness.
So i want to know how to calculate it in more flexible. because the foam block not only cut in 1 way, it can cut into many different shape and size. but mainly is rectangle. If better can display shape is better. It can let user easy to know.

To calculate volume which is "width x height x thick", is very easy:
In "C",

volume = width * height * thick;
printf( "volume = %4.2f\n", volume);

Creating a 3D visual interface is not my expertise. It's easier to use a CAD (Computer Aided Design) program such as Sketchup for Windows or Mac OS. For linux, more people prefer Blender. I haven't used Blender but in SketchUp, you can create a starter diagram and the user can move the cut lines around, delete or create new ones, even change the size of the block. These programs (Sketchup, Blender) can be downloaded and used for free. Using these programs is much easier than writing a C program, for instance. Writing the program from scratch to optimize the use of a block while minimizing the waste material is a project larger than I'm willing to tackle and it's probable that there are quite a few programs that do this and programmers who have already written such code.

If you want to do this in "C", then you need to specify the input parameters and the output format:

myprompt> mycalc <width> <height> <thick>

for example.
For the output I would need to know what you want to see.

Edited 5 Years Ago by jonkx: Clarify answer and add information.

To calculate volume which is "width x height x thick", is very easy:
In "C",

volume = width * height * thick;
printf( "volume = %4.2f\n", volume);

Creating a 3D visual interface is not my expertise. It's easier to use a CAD (Computer Aided Design) program such as Sketchup for Windows or Mac OS. For linux, more people prefer Blender. I haven't used Blender but in SketchUp, you can create a starter diagram and the user can move the cut lines around, delete or create new ones, even change the size of the block. These programs (Sketchup, Blender) can be downloaded and used for free. Using these programs is much easier than writing a C program, for instance. Writing the program from scratch to optimize the use of a block while minimizing the waste material is a project larger than I'm willing to tackle and it's probable that there are quite a few programs that do this and programmers who have already written such code.

If you want to do this in "C", then you need to specify the input parameters and the output format:

myprompt> mycalc <width> <height> <thick>

for example.
For the output I would need to know what you want to see.

Actually I'm write program in C# window form application in visual studio 2008. Actually I want use key in number W x H X T and display shape. user can select shape want to cut. so it can decide cut pattern of shape.

I'm sorry, I am only familiar with open source and free programs. If you are familiar with SketchUp, it's available for Windows. I don't know C# and have never used Visual Studio. You might consider Windows PowerShell to create an interface to SketchUp. That could save you time and effort. Just create an input for WxHxT and then feed that to SketchUp, possibly using the Google API. You might be able to do the same thing with C# and Visual Studio. Once the user has selected a shape, what data do you want the user to get as output? Does the user need numbers or special output to a machine that will cut the shape?

This article has been dead for over six months. Start a new discussion instead.