• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ 30% Off | Artisan 2 on sale until April 30th Buy Now

An idea: topography in sketchup (I am not a programmer :-( )

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 4 Posters 1.9k Views
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.
  • P Offline
    pichuneke
    last edited by 12 Dec 2007, 15:45

    I don't know if it could be possible, because I don't know programming. I did a search with "points" and "cloud of points", but I didn't find anything.

    Well, in my job I have to use a GPS (or a topographic device) to measure a cloud of points. Usually, I have to know the stock of a material (like sand, for example). After doing it, I have to triangulate it with a program. In that sofware, I create a polyline, and I measure the volume inside that polyline. After that I erase all the points inside the polyline (excepts the polyline), and triangulate it again (just with the points of the polyline). I obtain a second volume. The difference between the firs and the second volume gives me the amount of sand I have.

    I contour it sometimes, to make maps. I usually take thousands of points...

    ΒΏCould it be turned into a topographic plugin for Sketchup?

    Consider that is just a question. I have to be sure and I use a reliable software, and I will continue using it for obvious reasons. So I believe that I am losing my time asking you and making you to lose yours by reading my.

    But I believe is an idea, and I wanted to say it here. I don't know why, perhaps I have fun with sketchup and I was thinking of my job πŸ˜‰

    Forgive my spanglish...

    1 Reply Last reply Reply Quote 0
    • I Offline
      ilay7k
      last edited by 12 Dec 2007, 15:56

      look at http://www.crai.archi.fr/RubyLibraryDepot/Ruby/Newest_scripts.html and you can find great D.Bur's cloud-plugin - http://www.crai.archi.fr/RubyLibraryDepot/Ruby/Cloud_V6.zip and use sandbox tools + Bezier Splines -project
      or search in Network - COMPUneering\SimuTerra, old plugin
      i also use indorcad/road tool by indorsoft.ru , but it is russian

      1 Reply Last reply Reply Quote 0
      • P Offline
        pichuneke
        last edited by 12 Dec 2007, 16:10

        I have been playing with D. Bur's plugin (I have problems importing my own data at the moment, but sure it works), and I have read about the plugins.

        If someone combine contour + cloud of points + volume measurement, you have a basic topographic plugin... (dxf would be dreaming, of course, for the presentations πŸ˜† )

        I have to do some more work now, but I will study the cloud plugin. Thanks πŸ˜„

        Forgive my spanglish...

        1 Reply Last reply Reply Quote 0
        • A Offline
          AdamB
          last edited by 12 Dec 2007, 16:29

          Well funnily enough I wrote the following snippet for calculating volume this morning.

          class Geom;;Point3d
          	def dot(v)
          		self.x * v.x + self.y * v.y + self.z * v.z
          	end
          end	
          
          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
          • A Offline
            a4chitect
            last edited by 12 Dec 2007, 16:39

            adamb: great idea, i understand that you calculate the volume as a group of pyramids (bounding faces are the pyramid bases - and all pyramids share 1 top point inside the volume) but is it necessary to multiply by 2 and then divide by 6? wouldn't division by 3 be enough?
            do i understand your script right?

            you have saved the day twice as of now, what's next? (1.light in SU,2. volume formula,...)

            1 Reply Last reply Reply Quote 0
            • A Offline
              AdamB
              last edited by 12 Dec 2007, 17:02

              Ah, you spotted my deliberate slowdown so I could come out with v2.0 Damn.

              Yes of course that would be picoseconds faster..

              FWIW, its because I would normally write this as edge1 x edge2 to get the 0.5 the face area, but the good folks at Sketchup already gave me a Face#area call but I neglected to remove the multiply. Or I hadn't had enough coffee.

              Adam

              Developer of LightUp Click for website

              1 Reply Last reply Reply Quote 0
              • A Offline
                a4chitect
                last edited by 12 Dec 2007, 18:07

                πŸ˜†
                this method is usable only for simple shapes (correct me if i'm wrong)

                1 Reply Last reply Reply Quote 0
                • A Offline
                  AdamB
                  last edited by 12 Dec 2007, 20:19

                  Not sure what you mean by "simple shapes"..

                  If the origin is outside the shape, then the origin-facing faces give a negative contribution, the others a positive so you get the right answer.

                  Not sure what happens with multi-boundary faces, but all this was in the context of a marching cubes point cloud triangulation, so we're good to go.

                  Developer of LightUp Click for website

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    a4chitect
                    last edited by 12 Dec 2007, 20:38

                    i spoke about a case, when a face-origin pyramid is partially inside and partially outside of the calculated shape

                    but maybe since complicated things tend to be trivial once you get the 'clue' after adding all the pyramids together you will get the correct result, forgive me for being sceptic... πŸ˜‰ comparing your and the original 'slicing' method could prove your point

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    1 / 1
                    • First post
                      3/9
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement