# Thread: Tweaking the areavol.p plugin

1. ## Tweaking the areavol.p plugin

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

2. I hope you have put in a feature request.

3. 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.

4. 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.

5. 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...

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.

6. I'll probably make an lscript of it, too. And, of course, Oliver will probably add it to ODTools.

7. 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.

8. I've got to find the time to actually _do_ it. Right now, that's kind of a problem.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•