Tweaking the areavol.p plugin

kyuzo

Member
A lot of the work I do requires specific weights of materials, which I have as 'grams per cubic cm'. I am constantly having to run areavol.p then enter the result into a calculator to convert to cubic cm, then to grams.

I'd love to have a version of areavol.p which returns...
a) the volume as cubic cm.
and
b) as grams.

I have one main material which is 1.325 grams per cubic cm, so the maths is simple enough.

It'd be nice to have a plugin which allows me to edit the grams per cm3, just in case the material density changes. I'm guessing an lscript can be edited in a text editor to make such an adjustment, and I'm assuming it would complicate things quite a bit to consider adding an option/interface to enter different densities.

Anyway. Bearing in mind I know practically nothing about programming, do you think this is a simple enough tweak? Is it something I could accomplish once pointed in the right direction? Or are there any scripting experts out there who could manage it without breaking a sweat?

Cheers,

Derek
 

kyuzo

Member
Cheers John,
I haven't put in a feature request yet, I was hoping it was a simple amendment to an existing plugin.
If others think it'd be useful, then I'll get round to doing a proper feature request.
 

Kryslin

Active member
It's fairly straight forward.

Lightwave's native unit is the Meter. So, you'd compute the volume in meters, multiply by 100^3 (100 cm to the meter) to convert to cubic centimeters, then multiply by the weight per cubic cm.

Simple dialog box (or a drop down list) for entry of the material, then press OK to get your volume and mass.

However, computing the volume of an arbitrary solid is a non-trivial task. I'd have to consult some computational geometry references for the correct algorithm.
I wonder if it's related to the surface area of an arbitrary polygon in 3D, which I use in my FFX calculator...

*edit* It's do-able. A little math intensive, but do-able.
 
Last edited:

kyuzo

Member
Hi Kryslin,

Yeah, converting the volume from cubic metres then into grams is straightforward.
Computing the volume in the first place, less so... LOL

I've just discovered that when Lightwolf posted the 64 bit version, he included Ernie wright's original source code...

https://forums.newtek.com/showthread.php?93321-Measure-volume-plugin-for-x64

So when I get a moment, I should be able to go through it, and figure out where to do the conversion. Then I need to figure out how to compile a plugin... Sure that can't be too hard.
 

Kryslin

Active member
I'll probably make an lscript of it, too. And, of course, Oliver will probably add it to ODTools. :)
 

kyuzo

Member
I've submitted this as a feature request. Thought it may be useful to others, including anyone doing 3D printing.

Not that I don't trust your coding skills Kryslin, but I thought it would be handy to have as a native tool.
 
Top Bottom