Results 1 to 8 of 8

Thread: Tweaking the areavol.p plugin

  1. #1
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    394

    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. #2
    Super Member JohnMarchant's Avatar
    Join Date
    Mar 2003
    Location
    Murcia, Spain
    Posts
    2,915
    I hope you have put in a feature request.
    Dell XPS 15
    15.6-inch (3840 x 2160) 4K 282ppi IPS LCD
    Intel i7 7700HQ 2.8GHz
    Windows 10 64Bit
    NVidia GeForce GTX 1050 Ti
    1TB SDD
    32Gb Ram

    LightWave 2019.03

    Very nice Laptop

  3. #3
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    394
    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. #4
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    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 by Kryslin; 03-26-2019 at 08:31 AM.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  5. #5
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    394
    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...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.

  6. #6
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I'll probably make an lscript of it, too. And, of course, Oliver will probably add it to ODTools.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  7. #7
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    394
    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. #8
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I've got to find the time to actually _do_ it. Right now, that's kind of a problem.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

Bookmarks

Posting Permissions

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