VolumeCalculator Enhancement Request Attn: TIG
-
TIG,
See attached
Would it be possible for you to enhance your VolumeCalculator Script please ???
...
What I would like to be able to do, is click on several objects (Groups / Components) and then finally see the results in a spreadsheet and add (total) up all the volumes.
...
What I was thinking was that if the instance name of each volume group was given a name which equalled the volume calculated by the script eg "4.929 cu m" instead of "Volume-7378058" for instance. (see attached)[This could give non unique instance names]
...
Users could then run your existing Component Reporter Script and after a little manual editing in the appropriate field in Excel (to delete any unwanted text) the individual volumes can be easily totalled - as the volumes would be exported thru from SU to Excel.
...
Also, could you adjust the VolumeCalculator Script so that the Layer the Volume Groups are saved on is repeated (ie the same as last time used in current su session) - so you don't have to select the appropriate layer.
Maybe you could also have a repeat volume function so users could move from object to object calculating volumes for each, without having to go back to the volume dialog ??
This would be a huge time saver.
...
Anything you can do hugely appreciated.
Regards
Howard Leslie
-
I think this does what you ask...
http://www.sketchucation.com/forums/scf/viewtopic.php?p=14555#p14555
Volume groups are now named after their volume without a unit suffix - e.g. '4.567' (unlike their text tags).
Also you can now right click on a Volume to get the option to make a csv list of all of them - no need to use ComponentReporter+'s clunkiness... -
TIG,
Thanks very much for shining your ruby !!!
Works really well.
This makes a great script - the VolumeCalculator - even better.
...
Regards
Howard Leslie -
TIG,
Would it also be possible to add the following... ???
...- If the user had the option to choose either Horizontal or Vertical Volume slices it would make the VolumeCalculator more accurate.
Not sure if its possible but would be brilliant.
(See attached file which illustrates the problem).
... - To Calculate Volume on a Selection of Several Groups / Components at once...
eg User selects 12 Groups or Components...
VolumeCalculator then loops thru each Group / Component in the selection in turn calculating volumes for each individual group / component that was selected based upon the users settings in the Volume Dialog box eg Layer for Volume Slices / Hide Edges / (Vertical or Horizontal Slices) etc
...
Hope this all makes sense.
Anything you can do hugely appreciated.
...
Regards
Howard Leslie
Edit 1 / Ideas Thoughts:
Script could actually make true Vertical Slices (or any angle) or
Temporarily rotate geometry in the background hidden from user and then turn it back again ??? or
Produce both Horizontal & Vertical Slices for each Group / Component and Delete the lowest Value ??? (might be slow)
Edit 2 / Ideas Thoughts:
Vertical slices may be a problem - how would the script know the best orientation to draw them in ???
ie Vertical slices can be drawn to be parallel to either the red or the green axis - how would any script choose the best way to draw them ???
Poss Solution - Draw Volume Slices Parallel to all 3 Axes !!!
Delete lowest Volume that was computed for each Group / Component (Could be VERY slow).
Edit 3 / Ideas Thoughts:
Best Solution may be to forget Vertical slices altogether ???
Working out Individual Volumes in Turn (Looping) for Several selected Groups / Components would be good though.
That way, for any "problem" Groups (eg similar to attached file), the accuracy could be turned up to say 1% - the Script could then be left to run eg over a lunch break or over night if required.
- If the user had the option to choose either Horizontal or Vertical Volume slices it would make the VolumeCalculator more accurate.
-
TIG,
If you're going for a rewrite, along the lines suggested by Adam,
I would vote for keeping the following features (if at all possible) from you're original script as they're really useful:- CSV output
- Edges (Slices) or Copied Group / Component (coloured) as you've suggested = a really good visual check of geometry whose volume has been calculated by any script.
- Text showing Volume eg 3.421 m3 (very handy) - put on seperate Layer (Default = Vol Text ???)
- Seperate Layer for any Volume ouput eg Slices / Groups (Default Name = Volumes ???). Ability to put Output on any Layer / Make new Layer (as now).
...
New features (as already suggested) - Ability to Select Multiple Objects - Groups / Components - Calc Seperate Volume for each.
...
If you stay with the TIG (Integration / Calculus)Method:
I'm not sure exactly how the current script (V 1-8) works, but going back to the idea of generating slices parallel to all 3 axes (a Slice Set), maybe a newer version could work like this:
- User Selects say 4 Components / Groups
- Script produces a set of slices (parallel to all 3 axes) for first Group.
These slices are parallel to and restricted to, the Bounding Box of that individual group / component.
Restricting slice production to an individual group / component bounding box should speed script up (if it doesn't work like this already).
Making slices parallel to the bounding box axes would also give the best chance of catching the most appropriate / representative profile of each group; since many groups / components are drawn (at some stage) parallel / square on to an axis (unless it's a very curvy object).
This should work a little bit better for groups / components that have been created and then rotated or tilted. - The slices which give the Highest Volume for that particular Group / Component are retained - the other two in the Slice Set are Deleted.
- The Script then moves (loops) to the next Group / Component in the Selection
You would end up with Slices for each Group / Component - but they'd be at different angles for each individual Group / Component.
...
Whichever way you decide to go - GOOD LUCK
...
Howard L' -
@unknownuser said:
TIG,
Would it also be possible to add the following... ???
...- If the user had the option to choose either Horizontal or Vertical Volume slices it would make the Volume Calculator more accurate.
Not sure if its possible but would be brilliant.
(See attached file which illustrates the problem).
... - To Calculate Volume on a Selection of Several Groups / Components at once...
eg User selects 12 Groups or Components...
Volume Calculator then loops thru each Group / Component in the selection in turn calculating volumes for each individual group / component that was selected based upon the users settings in the Volume Dialog box eg Layer for Volume Slices / Hide Edges / (Vertical or Horizontal Slices) etc
...
Hope this all makes sense.
Anything you can do hugely appreciated.
...
Regards
Howard Leslie
Edit 1 / Ideas Thoughts:
Script could actually make true Vertical Slices (or any angle) or
Temporarily rotate geometry in the background hidden from user and then turn it back again ??? or
Produce both Horizontal & Vertical Slices for each Group / Component and Delete the lowest Value ??? (might be slow)
Edit 2 / Ideas Thoughts:
Vertical slices may be a problem - how would the script know the best orientation to draw them in ???
ie Vertical slices can be drawn to be parallel to either the red or the green axis - how would any script choose the best way to draw them ???
Poss Solution - Draw Volume Slices Parallel to all 3 Axes !!!
Delete lowest Volume that was computed for each Group / Component (Could be VERY slow).
Edit 3 / Ideas Thoughts:
Best Solution may be to forget Vertical slices altogether ???
Working out Individual Volumes in Turn (Looping) for Several selected Groups / Components would be good though.
That way, for any "problem" Groups (eg similar to attached file), the accuracy could be turned up to say 1% - the Script could then be left to run eg over a lunch break or over night if required.AdamB has just fired a broadside through the current ideas behind Volume Calculator with an ingenious method the calculate volumes from faces...
I wrote my volume calculator based on totting up areas of slices - somewhat like calculus - which was a few years ago after TBD said it couldn't be done... It's taken till now for someone (AdamB) to come up with a method that does it properly 'mathematically' - his '.dot' method was the answer. Adam's way returns a more accurate result very quickly, but the downsides of his method are that it gives no 'solid' artifact of the volume - although it could have a text-tag made with a volume attribute so that csv making was eased: a copy' group of the entities could be made coloured as desired too. Also his gives unexpected answers for volumes with missing faces, whereas mine only fills up to the top level and then overflows so to speak - like a tilted glass; and I not sure how his method copes with having some faces reversed as it uses face normals during the maths - I need to test that...
I intend putting a a new version 'to the vote' and if there's sufficient demand and Adam agrees I'll look at v2.0 using his methods, but adjusted to suit whatever the 'users' want of it - clearly it'd need alternate volume options, csv listing etc...
His method would allow multiple selections and I can contrive it so that you get much of what you do now but more accurately and faster... Watch this space...
- If the user had the option to choose either Horizontal or Vertical Volume slices it would make the Volume Calculator more accurate.
Advertisement