sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    [Plugin] VolumeCalculator v1.8

    Scheduled Pinned Locked Moved Plugins
    5 Posts 4 Posters 7.1k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TIGT Offline
      TIG Moderator
      last edited by

      Here's v1.8. For some reason it's just started to Bugsplat on my new PC (Vista). It didn't before ! This new version avoids a splat since it has a two step undo. The splat seems to come from after it's intersected the volume slicing disc group to make entities inside another vol group and then it is trying to erase that disc group within the same commit/undo as the rest. By making 2 undo steps it doesn't splat - go figure ? PayPalButton


      VolumeCalculator.rb

      TIG

      1 Reply Last reply Reply Quote 0
      • ToboboT Offline
        Tobobo
        last edited by

        Thanks

        Toby

        Philippians 4:13

        I can do everything through him who gives me strength.

        1 Reply Last reply Reply Quote 0
        • AdamBA Offline
          AdamB
          last edited by

          This all seems quite a complex way of getting the volume.. The following analytic approach works nicely.

          def calculateVolume(container)
          	
          	volume = 0
          	for face in container
          		next unless face.kind_of? Sketchup;;Face
          
          		volume += (2 * face.area * (face.vertices[0].position.dot face.normal)) / 6		
          	end
          	volume
          end
          

          Developer of LightUp Click for website

          1 Reply Last reply Reply Quote 0
          • AdamBA Offline
            AdamB
            last edited by

            Doh. And you need to have Geom::Point3d#dot defined - (which is beyond me why it isn't as standard)

            class Geom;;Point3d
            	def dot(v)
            		self.x * v.x + self.y * v.y + self.z * v.z
            	end
            end	
            

            Developer of LightUp Click for website

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              I have posted my rendition of the "no temporary group" calculate volume solution.

              See: Calculate volume on manifold surface without group & explode


              Bonus method for a volume display string in model units:

              See: [code] format volume in model units

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better πŸ’—

              Register Login
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement