Terrain elevation calculator
-
I recently have a need for a quick way to indicate the highest, and lowest points, using the origin as a fixed reference. I currently use Chris Fullmer's on screen display to do this, but it is difficult to judge the terrain to find the highest, and lowest points, while looking at it, especially when the difference is less than 20 feet.
Any suggestions? -
To find the location of the highest and lowest points, you would need to look at every edge making up the terrain mesh. The only way to do this efficiently would be a plugin such as
def label_high_low mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection hi_pt=nil;lo_pt=nil;hi=-1e9;lo=1e9 hi_vec=[0,0,2400];lo_vec=[0,0,-2400] grp=sel.first;#select the GE 3D terrain grp.entities.each{|e| if e.class==Sketchup;;Edge (hi=e.start.position.z;hi_pt=e.start) if e.start.position.z>hi (lo=e.start.position.z;lo_pt=e.end) if e.start.position.z<lo (hi=e.end.position.z;hi_pt=e.end) if e.end.position.z>hi (lo=e.end.position.z;lo_pt=e.end) if e.end.position.z<lo end } ent.add_text(hi.to_s,hi_pt.position,hi_vec)#label the high point ent.add_text(lo.to_s,lo_pt.position,lo_vec)#label the low point end
-
So it is do-able, how hard would it be to make it work?
This is my first look inside a "plugin" but I wouldn't have a clue what everything means. -
Not hard at all. I will make it into a normal plugin that you can access from the Plugins Menu.
Check for PM.
-
why not just make a plane at 0 copy it up with the spacing you require (say 10') then do an intersection and hide the planes. You will then see rings like a make shift topo map. You can put the edges on a seperate layer and hide/show as you please.
-
With a plugin that was made for this purpose, and a projected texture this what I get, good enough for me for now.
-
Here is another view, I forgot to erase some items, sorry.
-
I guess i did miss the point.
Didn't Chris make a plugin alone these lines? (min,max) -
Don't know about Chris's version, sdmitch did one the other day, works as I needed it to.
-
@sdmitch said:
To find the location of the highest and lowest points, you would need to look at every edge making up the terrain mesh. The only way to do this efficiently would be a plugin such as
> def label_high_low > mod = Sketchup.active_model > ent = mod.active_entities > sel = mod.selection > hi_pt=nil;lo_pt=nil;hi=-1e9;lo=1e9 > hi_vec=[0,0,2400];lo_vec=[0,0,-2400] > grp=sel.first;#select the GE 3D terrain > grp.entities.each{|e| > if e.class==Sketchup;;Edge > (hi=e.start.position.z;hi_pt=e.start) if e.start.position.z>hi > (lo=e.start.position.z;lo_pt=e.end) if e.start.position.z<lo > (hi=e.end.position.z;hi_pt=e.end) if e.end.position.z>hi > (lo=e.end.position.z;lo_pt=e.end) if e.end.position.z<lo > end > } > ent.add_text(hi.to_s,hi_pt.position,hi_vec)#label the high point > ent.add_text(lo.to_s,lo_pt.position,lo_vec)#label the low point > end >
This episode code is the right thing i'm looking for. It provides an addititonal option
for Mesh2Heightmap. because the mesh2heightmap generate a greate heightmap but not provide
the minimum and maximum elevation values without which i can not use this map to generate
an accurate terrain.
Advertisement