# volume measurements

8 messages
Open this post in threaded view
|

## volume measurements

 Is there any easy way to compute the volume of an OpenSCAD object? I am making molds, and wonder if OpenSCAD can tell me how much material to prepare for a casting. Jon _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: volume measurements

 below you can find the formula to calculate the volume from the triangles (faces). I am not a programmer, but skilled enough to test it with Javascript. It works fine but I can't put it inside OpenScad. If somebody could implement it, it would be fine to see the result not only as part of the message window, but also offering the opportunity to export the result in any way, so I can make use of it in our software. /*xyz=[ 0, 0, 3000, 5000, 0, 3000, 5000, 200, 3000, 0, 200, 3000, 0, 200, 0, 5000, 200, 0, 5000, 0, 0, 0, 0, 0, 1000, 200, 0, 2000, 200, 0, 1000, 0, 0, 2000, 0, 0, 1000, 0, 2000, 2000, 0, 2000, 1000, 200, 2000, 2000, 200, 2000]; p=[ 7, 0, 4, 4, 0, 3, 0, 7, 10, 13, 0, 12, 12, 0, 10, 1, 0, 13, 6, 13, 11, 1, 13, 6, 7, 4, 10, 10, 4, 8, 4, 3, 8, 15, 3, 2, 9, 2, 5, 14, 3, 15, 8, 3, 14, 15, 2, 9, 3, 0, 1, 2, 3, 1, 1, 6, 5, 2, 1, 5, 11, 9, 6, 6, 9, 5, 15, 9, 13, 13, 9, 11, 15, 13, 14, 14, 13, 12, 8, 14, 12, 10, 8, 12];*/ xyz=[ 0, 0, 3000, 5000, 0, 3000, 5000, 200, 3000, 0, 200, 3000, 0, 200, 0, 5000, 200, 0, 5000, 0, 0, 0, 0, 0, 1000, 0,2000, 1000, 0, 1000, 3000, 0, 2000, 3000, 0, 1000, 1000, 200, 2000, 1000, 200, 1000, 3000, 200, 2000, 3000, 200, 1000]; p=[ 7, 0, 4, 4, 0, 3, 9, 7, 6, 11, 9, 6, 0, 7, 9, 0, 9, 8, 1, 10, 6, 1, 0, 10, 10, 11, 6, 8, 10, 0, 7, 4, 6, 6, 4, 5, 14, 3, 2, 4, 3, 12, 13, 15, 5, 4, 12, 13, 4, 13, 5, 5, 14, 2, 12, 3,14, 14, 5, 15, 3, 0, 1, 2, 3, 1, 1, 6, 5, 2, 1, 5, 13, 12, 8, 9, 13, 8, 11, 15, 13, 9, 11, 13, 14, 15, 10, 10, 15, 11, 14, 10, 12, 12, 10, 8]; j=0;k=(p.length)/3;Vol=0.0;console.log(k);  for (var i=0;i
Open this post in threaded view
|

## Re: volume measurements

 Cheat's way:  Open it in a slicer for 3d printing, set to 100% infill, no raft, brim or support, and from the estimate of quantity of filament used, get the volume... -----Original Message----- From: Discuss [mailto:[hidden email]] On Behalf Of Ehlert, Wolfgang Sent: 29 December 2014 14:10 To: OpenSCAD general discussion Subject: Re: [OpenSCAD] volume measurements below you can find the formula to calculate the volume from the triangles (faces). I am not a programmer, but skilled enough to test it with Javascript. It works fine but I can't put it inside OpenScad. If somebody could implement it, it would be fine to see the result not only as part of the message window, but also offering the opportunity to export the result in any way, so I can make use of it in our software. /*xyz=[ 0, 0, 3000, 5000, 0, 3000, 5000, 200, 3000, 0, 200, 3000, 0, 200, 0, 5000, 200, 0, 5000, 0, 0, 0, 0, 0, 1000, 200, 0, 2000, 200, 0, 1000, 0, 0, 2000, 0, 0, 1000, 0, 2000, 2000, 0, 2000, 1000, 200, 2000, 2000, 200, 2000]; p=[ 7, 0, 4, 4, 0, 3, 0, 7, 10, 13, 0, 12, 12, 0, 10, 1, 0, 13, 6, 13, 11, 1, 13, 6, 7, 4, 10, 10, 4, 8, 4, 3, 8, 15, 3, 2, 9, 2, 5, 14, 3, 15, 8, 3, 14, 15, 2, 9, 3, 0, 1, 2, 3, 1, 1, 6, 5, 2, 1, 5, 11, 9, 6, 6, 9, 5, 15, 9, 13, 13, 9, 11, 15, 13, 14, 14, 13, 12, 8, 14, 12, 10, 8, 12];*/ xyz=[ 0, 0, 3000, 5000, 0, 3000, 5000, 200, 3000, 0, 200, 3000, 0, 200, 0, 5000, 200, 0, 5000, 0, 0, 0, 0, 0, 1000, 0,2000, 1000, 0, 1000, 3000, 0, 2000, 3000, 0, 1000, 1000, 200, 2000, 1000, 200, 1000, 3000, 200, 2000, 3000, 200, 1000]; p=[ 7, 0, 4, 4, 0, 3, 9, 7, 6, 11, 9, 6, 0, 7, 9, 0, 9, 8, 1, 10, 6, 1, 0, 10, 10, 11, 6, 8, 10, 0, 7, 4, 6, 6, 4, 5, 14, 3, 2, 4, 3, 12, 13, 15, 5, 4, 12, 13, 4, 13, 5, 5, 14, 2, 12, 3,14, 14, 5, 15, 3, 0, 1, 2, 3, 1, 1, 6, 5, 2, 1, 5, 13, 12, 8, 9, 13, 8, 11, 15, 13, 9, 11, 13, 14, 15, 10, 10, 15, 11, 14, 10, 12, 12, 10, 8]; j=0;k=(p.length)/3;Vol=0.0;console.log(k);  for (var i=0;i
Open this post in threaded view
|

## Re: volume measurements

Open this post in threaded view
|

## Re: volume measurements

 In reply to this post by alexgibson 2014-12-29 19:31 GMT+01:00 Alex Gibson <[hidden email]>: > Cheat's way:  Open it in a slicer for 3d printing, set to 100% infill, no > raft, brim or support, and from the estimate of quantity of filament used, > get the volume... WOW, that's an overkill. ADMesh gives you the volume (precise, not this magic). _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: volume measurements

 Even slic3r tells you the volume without any tomfoolery. On Dec 29, 2014 1:16 PM, "Miro Hrončok" <[hidden email]> wrote:2014-12-29 19:31 GMT+01:00 Alex Gibson <[hidden email]>: > Cheat's way:  Open it in a slicer for 3d printing, set to 100% infill, no > raft, brim or support, and from the estimate of quantity of filament used, > get the volume... WOW, that's an overkill. ADMesh gives you the volume (precise, not this magic). _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org