Pasting an area over a grid surface
Introduction
The task is to paste or drape an area over a grid surface to get an informative display in 3D showing the area on top of the grid surface.
The area is described by one or more closed polygon lines.
On this page:
Solution
The principles to be used in the task are as follows:
Principles for draping a surface on a grid
- The closed line is gridded using border model gridding to a bmo grid.
- The bmo grid is converted to a polygon surface.
- The polygon surface is zapped to the grid surface.
- The zapped surface is lifted a little bit up and displayed (often with a some opacity)
Implementation using shell commands
The draping feature can be described with a few shell commands.
# draping an area on top of a grid vie def ini ; # view initialization win demo ; # set up a demo window mak ran 11 ; # make 11 random points grp 222 222 ; # make grid with 222 rows and columns acm auto sma ; # auto mapping mhi grid ; # saving the grid ewi -10 ; # make the window a little smaller mak ran 4 ; # make random points mak cpl ; # make a closed polygon cur sav nodraw ; # spline generate and save, but not draw zap adj grid ; # zap data from grid and adjust it upwards pol 2 ; # draw the boundary bmo 300 300 ; # make a border grid zap adj grid ; # zap data from grid and adjust it upwards col pink ; # set pink color for next display dis opa .6 ; # display with opacity
The above example produces this image.
Example code and window tiled together
To run the example, create a text window by File > New > Text Editor . Then do Windows > Tile. Paste the example code into the text editor and right click and do Execute. As the display uses random data you will get various results each time.
The experienced (or clever) user can use this example and bring in closed boundaries and drape the area over a grid.
Implementations in menus
There are at least two menus where the principles are implemented:
Menus used for draping a closed poly line surface on a grid
- Area calculator
- Shaded polygons
Both commands are accessible on the polydata schema. The grid to be draped upon should be set as sticky_surface.
Example
Area draped on surface in area calculation