by TIG » Sat Dec 15, 2007 7:44 pm
VolumeCalculator2.rb Rewritten with a much quicker volume calc method thanks to AdamB. Please try and feedback. It has most of the functions/options of v1.8 and also puts the text-tag on a separate layer... Note its new name - remove any earlier versions before running or you'll get two Volume items in the context-menu...
Please, register (free) to access all the attachments on the forums.
Last edited by TIG on Wed Dec 19, 2007 11:22 am, edited 1 time in total.
TIG
-

TIG
- Global Moderator
-
- Posts: 14012
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by TIG » Wed Dec 19, 2007 11:21 am
Here's v2.1 Nested Groups/Components within Groups now 'mined' and each calculated. Dialogs combined into one and only one dialog per selection set. Reversed faces in some volume-groups now properly colored. [Note that 'Red' faces show a problem too] Warning at end if any ambiguous forms.
Please, register (free) to access all the attachments on the forums. TIG
-

TIG
- Global Moderator
-
- Posts: 14012
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by pdpotter » Thu Feb 14, 2008 4:13 pm
How do I add the VolumeCalculator v2 script to SketchUp?
-
pdpotter
-
- Posts: 4
- Joined: Wed Feb 13, 2008 11:16 pm
by Pilou » Thu Feb 14, 2008 4:37 pm
Simply add it inside the folder Plugins of (Google) Sketchup  Instructions are in the header of the file: you can read it by a simple text editor (bloc note) In this case just after a speedy use : you must create a goupe or a component before Clic on this Group or Component and then "Volume" will appear on the "Right clic"  Seems work like a charm This guy is this one 
Please, register (free) to access all the attachments on the forums.
Last edited by Pilou on Tue Apr 29, 2008 6:00 pm, edited 1 time in total.
-

Pilou
- Top SketchUcator
-
- Posts: 10079
- Joined: Wed Jan 23, 2008 10:33 pm
- Operating system: Windows
- SketchUp version: 6
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by pdpotter » Thu Feb 14, 2008 11:48 pm
Thanks, Pilou. There was no Plugins folder in my Google SketchUp 6 folder, so I created one and copied the VolumeCalculator2.rb file into it. I then created a component which has connected faces forming a solid which has a volume. When I right click on the component, I do not see a Volume option. I do not have a Plugins menu item, either.
Perhaps it is because I am using the free version of SketchUp. Or perhaps because I am using a Mac (OS X 10.5.2).
Any suggestions?
-
pdpotter
-
- Posts: 4
- Joined: Wed Feb 13, 2008 11:16 pm
by Pilou » Thu Feb 14, 2008 11:52 pm
Ah damned there is no right button on Mac? But as writed in the header there is also a Menu on the top line  Because Menu volume is on contextuel menu on right clic button ! you must have also sketchup.rb in the folders Plugins! Maybe it's for that you don't see that! works fine wtih the free one!  Moderator note from thomthom: I removed the sketchup.rb file as it not be needed to distribute this. Each SketchUp version needs a specific version, otherwise odd bugs can appear. The file should also not be in the Plugins folder. (Might have been true many many versions ago, but for the last few it should be in the Tools folder.)
Last edited by thomthom on Tue Feb 28, 2012 10:51 am, edited 1 time in total.
Reason: sketchup.rb attachment removed to avoid users installing the file from an older SketchUp version to their new version. Reinstall SketchUp instead.
-

Pilou
- Top SketchUcator
-
- Posts: 10079
- Joined: Wed Jan 23, 2008 10:33 pm
- Operating system: Windows
- SketchUp version: 6
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by pdpotter » Fri Feb 15, 2008 12:01 am
I have a 2-button mouse (could have used Control-click for right-click otherwise), so that's not it. I think I should see an entry in the About Plugins menu, also, but I don't.
-
pdpotter
-
- Posts: 4
- Joined: Wed Feb 13, 2008 11:16 pm
by pdpotter » Fri Feb 15, 2008 12:31 am
Pilou (and others)
I got it! On a Mac, you have to place the .rb file in the Library > Application Support > Google SketchUp 6 > SketchUp > Plugins folder. (This assumes that the SketchUp program exists in a folder called Google SketchUp 6 within the Applications folder.) Once I did that, the sub-menu included a Volume option. Thanks for your help, Pilou.
-
pdpotter
-
- Posts: 4
- Joined: Wed Feb 13, 2008 11:16 pm
by gurkesaft » Thu Apr 10, 2008 8:17 pm
Ug. I cannot get this thing to appear anywhere in sketchup 6. I tried to put it in the "Plugins" folder or the "plugins/utilities" folder but it just won't appear.
It's not the pro version. Do you need pro to use custom scripts? Sorry if I'm missing something stupid.
Thanks, Jack
-
gurkesaft
-
- Posts: 3
- Joined: Thu Apr 10, 2008 7:33 pm
by gurkesaft » Thu Apr 10, 2008 8:19 pm
Woa woa woa, never mind.
I knew I'd figure it out once I posted...
Sorry!
-Jack
-
gurkesaft
-
- Posts: 3
- Joined: Thu Apr 10, 2008 7:33 pm
by gurkesaft » Tue Apr 29, 2008 3:37 pm
Hello again,
I'm having trouble with volume calculator, and I can reproduce the odd behavior:
Make a 1"x1" rectangle, push it 1" into a cube, draw a 0.25" circle in the middle and push it to the bottom of the cube to make a hole. Group it, and run volume calculator. It goes wonky! (I'm pretty sure it does this for all through-holes, but I wanted to be sure we're all doing it the same)
I'm using v2.1 and sketchup free 6. Any ideas?
Thanks! Jack
-
gurkesaft
-
- Posts: 3
- Joined: Thu Apr 10, 2008 7:33 pm
by Pilou » Tue Apr 29, 2008 6:53 pm
Seems that is the same for all volumes with holes  A solution is to cut the volume in 2 parts and add the volumes results  Now the calculator works! 
Please, register (free) to access all the attachments on the forums.
-

Pilou
- Top SketchUcator
-
- Posts: 10079
- Joined: Wed Jan 23, 2008 10:33 pm
- Operating system: Windows
- SketchUp version: 6
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by watkins » Tue Apr 29, 2008 7:11 pm
Dear Gurkesaft,
Try TIG's version 1.8. It works fine with through holes
Regards, Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by svetik » Mon Jun 30, 2008 2:32 pm
This is sad- what does v2.1 exist for? 
-
svetik
-
- Posts: 7
- Joined: Fri Mar 21, 2008 1:20 pm
by watkins » Sun Oct 12, 2008 9:10 pm
Dear TIG,
Do you think you might have time to look at your latest, fast version of the volume calculator? I am still using V1.8 as V2.1 seems to fail when challenged with one of my models.
Kind regards, Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by TIG » Sun Oct 12, 2008 9:37 pm
V2 was a quicker alternative way of accurately calculating volumes. v2 does it by 'slicing'...
Use v1 for more complex shapes (slow) or use v2 for simpler shapes (quicker) - see which suits you best...
I currently don't have time to sort out v2 - if anyone else wants to tweak it, please feel free...
.
TIG
-

TIG
- Global Moderator
-
- Posts: 14012
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by watkins » Mon Oct 13, 2008 6:46 am
Dear TIG,
Okay, I will do that. Thanks for the response.
Kind regards, Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by Free Agent » Tue Mar 24, 2009 3:21 pm
is there any way to force a volume, i have a bottle design here and the client needs it to be 500ml and wants to know what the resulting dimensions would be.
-

Free Agent
-
- Posts: 273
- Joined: Thu Jun 05, 2008 10:00 am
- Location: Cape Town, South Africa
- Name: Sean
by AdamB » Tue Mar 24, 2009 9:00 pm
Free Agent wrote:is there any way to force a volume, i have a bottle design here and the client needs it to be 500ml and wants to know what the resulting dimensions would be.
If you know the current volume with the current dimensions, then you'll need to scale the current design by: 3√(targetvolume / currentvolume) Adam
-

AdamB
- LightUp
-
- Posts: 756
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by Free Agent » Wed Mar 25, 2009 1:39 pm
see a good reason to have payed attension in math class... i'll try
-

Free Agent
-
- Posts: 273
- Joined: Thu Jun 05, 2008 10:00 am
- Location: Cape Town, South Africa
- Name: Sean
by thomthom » Wed Mar 25, 2009 2:22 pm
Free Agent wrote:see a good reason to have payed attension in math class... i'll try
Did you ever say: "I'll naver have use of that!"..?
-

thomthom
- Global Moderator
-
- Posts: 17688
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by AdamB » Thu Mar 26, 2009 9:59 am
BTW Thats "cube root" not "3 times squareroot"
Perhaps TIG could be persuaded to add a function to Volume Calc that does this since I can see it must be pretty common to be wanting to get to a target volume.
Now if three men take four days to dig.. nevermind..
Adam
-

AdamB
- LightUp
-
- Posts: 756
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by watkins » Thu Mar 26, 2009 11:32 am
Dear Adamm & TIG,
Could the volume calculator be updated so that the newer, faster script doesn't fall over with multiple internal volumes? I am currently using V1.8 as that seems to work well for complicated shapes, but it does take a long time when the precision goes up. Further, while easily calculated by hand (once one knows the volume), could an editable drop-down list of densities be added so that the script works out the mass as an option. Typical densities would be for concrete, steel, wood, water, sand etc.
Another option would be to assign materials properties to components (is this possible?), and then to get the script to work on an assembly (such as a wooden cabinet), treating each component separately (volume and mass) returning a table (spreadsheet) of volumes and masses with the total mass. This could be useful in assessing loading, lifting and shipping requirements. The calculations for C of G are very similar to those for volume (slicing the model), so that is yet another option, as is moments of inertia.
I'm sure you are both very busy, but I offer these few thoughts for consideration.
Regards, Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by AdamB » Thu Mar 26, 2009 1:08 pm
First off, "Volume Calculator" is TIG's baby not mine! The analytic method for Volume calc (the fast one) will not give the right answer if you have "open geometry". You can find all open edges by running a script like this (doesn't recurse into groups/components): - Code: Select all
def findleaks(ents = Sketchup.active_model.entities)
for ent in ents next unless ent.kind_of? Sketchup::Edge if ent.faces.length == 1 Sketchup.active_model.selection.add ent end end end
The problem is there isn't a real simple way of automatically closing those "leaks". Adam
-

AdamB
- LightUp
-
- Posts: 756
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by Free Agent » Thu Mar 26, 2009 1:26 pm
woohoo it worked thanx adamB
-

Free Agent
-
- Posts: 273
- Joined: Thu Jun 05, 2008 10:00 am
- Location: Cape Town, South Africa
- Name: Sean
by TIG » Thu Mar 26, 2009 3:37 pm
I'd better jump in here...
I made the early versions of Volume calculate by slicing the selected component or group into pieces and totting up the face-cut areas - like crude 'calculus'... It had levels of accuracy as it takes a while to slice and calculate a lot of faces. Often simple shapes return reasonably accurate volumes with few slices...
Adam suggested a 'clever' way of calculating the volume - it has the advantage of being very fast and accurate but is prone to falling over it the faces aren't complete etc...
That's why there are two versions out there.
I would like to fix the fast version much as you ask. It could also include density and CofG etc: however, I am very busy on other things - I will publish something as soon as I can... but no promises...
If anyone else would like to adopt my 'Volume' code and re-do it please feel free [I did something similar with Mirror.rb a while back - completely rewriting the method, but still gave Frank Wiesner the initial credit for having the original ideas up to 2.5 - now on 3.1 ?]... .
TIG
-

TIG
- Global Moderator
-
- Posts: 14012
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by watkins » Mon Mar 30, 2009 6:50 pm
Dear TIG and Adam,
Thank you for taking my request/suggestions seriously.
Regards to you both.
Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by watkins » Sat Jul 18, 2009 2:24 pm
Dear TIG,
Do you think you might find a moment to take a look at your volume calculator. As I wrote before, the 'faster' version falls over when applied to a shape with cavities. A faster, working version would be good as then one could use the higher precision without the time overhead.
Other improvements might include:
1. Mass calculation (volume x density), with a editable drop down menu of typical densities (glass, concrete, soil, sand, water, steel, plastic etc)
2. Centre of Gravity
3. Moments of inertia
Kind regards, Bob
-
watkins
-
- Posts: 1367
- Joined: Wed Nov 14, 2007 5:47 pm
by piyono » Sun Nov 01, 2009 4:06 pm
Sorry to go OT, but I can't seem to get Sketchup 7.1.4871 to recognize the volume plugins. I've dropped them into the /Plugins folder with the rest of my plugins, all the rest of which work fine.
Any ideas?
Piyono
-
piyono
-
- Posts: 2
- Joined: Sun Nov 01, 2009 12:45 pm
- Name: Piyono
by TIG » Sun Nov 01, 2009 8:59 pm
Piyono wrote:Sorry to go OT, but I can't seem to get Sketchup 7.1.4871 to recognize the volume plugins. I've dropped them into the /Plugins folder with the rest of my plugins, all the rest of which work fine.
Any ideas?
Piyono
It's a right-click context-menu item only - available if you have a group or component-instance selected... There's no menu item - if that's your point ? 
TIG
-

TIG
- Global Moderator
-
- Posts: 14012
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
Return to Plugins
|