Many years ago I learned how to create a pixeled landscape from a surface using the contour option. Now time has passed and I totally forgot how to do this. I have a 50cm by 50cm wavey surface which i contoured 1cm on the y axis, and then contoured 1 cm on the z axis. Now Im stuck, i know im supposed to extrude something, or maybe contour again. Does any one know which steps i should take next?
What I’d do is:
1: point array with points at the center of each cell
2: project the points on the surface
3: run the button-macro below to copy rods to those points
4: cut the bottom of the rods to length:
HTH
-Willem
Macro on a button to distribute one object to multiple points
! _NoEcho _-Runscript (
Sub main
Pts=rhino.selectedobjects
if isnull(Pts) then Pts=rhino.getobjects("Points ?",1)
obs=rhino.getobjects("Objects ?")
rp=rhino.getpoint("Reference point ?")
rhino.enableredraw vbfalse
for each pt in Pts
if rhino.ispoint(pt) then
xyz=rhino.pointcoordinates(pt)
rhino.unselectallobjects
rhino.selectobjects obs
rhino.copyobjects obs,rp,xyz
End If
next
rhino.unselectallobjects
rhino.enableredraw vbtrue
end sub
main
)
Ive gotten as far as projecting the points on landscape, but I dont understand the next steps. do i draw surfaces or rods, not familiar with scripting in rhino. how should i project these rods to the points next?
set a point relative to the object where it will end up relative to the points.
So in the case of the rod; the point needs to be in the center of the top surface (draw a point there in andvance to snap to if needed)
seems that macroeditor desnt work on the new rhino 5 for mac, so i will be forced to find another option, is there a way to project the rod surfaces to the points manually?
Even though the MacroEditor is not available yet on Rhino for Mac, you might try @Willem’s macro with a workaround that @Helvetosaur described in this post.
My macro will not work on a mac, it’s a macro containing rhino-script that is not available on a Mac.
The python-script @0netech posted above should work though.
I was able to get it to work on the PC at work, however selecting all the rods causes my computer to crash and about an hour for the operation to occur. I don’t want to do each rod separately, that would take forever. maybe if i divide the model into sections i can slow down the operation time. thanks again for the script
Someone will correct me if I’m wrong, but only select one rod with the macro. This one rod will be copied to each individual point. It sounds like you selected all your rods and the macro is trying to copy all your rods to all the points, hence why your computer crashed. The macro cycles through each point and copies the one rod to that point, then moves onto the next point until there are no points left.
here’s a quick go at it with grasshopper on mac… there’s a slider to control the box amount… pretty sure this definition could be streamlined some but for proof of concept…
Here is another one - Windows only (RhinoScript). Should be quite fast - processing here 30,000 pixel terrain in under 15 seconds. Not sure what your output needs are but this will give you a single joined mesh (possible to process further) - should work fast and not crash your machine unless you go into few millions of pixels…
you can pick many objects (surfaces or polysurfaces for now - meshes can be added, if needed) as your base terrain - it will use top-most points as pixel tops
define pixel size
define ‘bottom’ offset - the depth of the terrain from the lowest point of your base
Looks like now you should have plenty of solutions to choose from.