An idea: topography in sketchup (I am not a programmer :-( )
-
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
-
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 -
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
-
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
-
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,...)
-
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
-
this method is usable only for simple shapes (correct me if i'm wrong) -
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.
-
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
Advertisement