[Plugin] Volume Calculator2...

[Plugin] Volume Calculator2...

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

This is v2.0 - the NEXT post contains v2.1
2
Last edited by TIG on Wed Dec 19, 2007 11:22 am, edited 1 time in total.
TIG
User avatar
TIG 
Global Moderator
 

[Plugin] Volume Calculator2 - v2.2

Postby TIG » Wed Dec 19, 2007 11:21 am

Here's v2.2

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.
Get its RBZ from here

Download

1
TIG
User avatar
TIG 
Global Moderator
 

Re: Volume Calculator2 ?

Postby pdpotter » Thu Feb 14, 2008 4:13 pm

How do I add the VolumeCalculator v2 script to SketchUp?
1

pdpotter 
 

Re: Volume Calculator v2...

Postby 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 :thumb:
This guy is this one :D
0
Last edited by pilou on Tue Apr 29, 2008 6:00 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Volume Calculator v2...

Postby 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?
0

pdpotter 
 

Re: Volume Calculator v2...

Postby 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! :enlight:




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.)
0
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.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Volume Calculator v2...

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

pdpotter 
 

Re: Volume Calculator v2...

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

pdpotter 
 

Re: Volume Calculator v2...

Postby 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
0

gurkesaft 
 

Re: Volume Calculator v2...

Postby 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
0

gurkesaft 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

gurkesaft 
 

Re: [Plugin] Volume Calculator v2...

Postby 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! :fro:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Volume Calculator v2...

Postby watkins » Tue Apr 29, 2008 7:11 pm

Dear Gurkesaft,

Try TIG's version 1.8. It works fine with through holes

Regards,
Bob
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

Postby svetik » Mon Jun 30, 2008 2:32 pm

This is sad- what does v2.1 exist for? :cry:
0

svetik 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

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

.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Volume Calculator v2...

Postby watkins » Mon Oct 13, 2008 6:46 am

Dear TIG,

Okay, I will do that. Thanks for the response.

Kind regards,
Bob
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

Postby 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.
0
User avatar
free agent 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0
Developer of LightUp Click for website
User avatar
AdamB 
LightUp Support
LightUp Support
 

Re: [Plugin] Volume Calculator v2...

Postby free agent » Wed Mar 25, 2009 1:39 pm

see a good reason to have payed attension in math class... i'll try
0
User avatar
free agent 
 

Re: [Plugin] Volume Calculator v2...

Postby 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!"..?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0
Developer of LightUp Click for website
User avatar
AdamB 
LightUp Support
LightUp Support
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0
Developer of LightUp Click for website
User avatar
AdamB 
LightUp Support
LightUp Support
 

Re: [Plugin] Volume Calculator v2...

Postby free agent » Thu Mar 26, 2009 1:26 pm

woohoo it worked thanx adamB
0
User avatar
free agent 
 

Re: [Plugin] Volume Calculator v2...

Postby 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 ?]...
.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

watkins 
 

Re: [Plugin] Volume Calculator v2...

Postby 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
0

piyono 
 

Re: [Plugin] Volume Calculator v2...

Postby 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 ? :?:
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: zul6041 and 23 guests

Visit our sponsors: