File: gfx_mapiso.py

package info (click to toggle)
openstructure 2.11.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,256 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (11 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
import math,random
from ost import img
mh=img.CreateMap(img.Size(100, 25, 25))
for p in img.ExtentIterator(mh.GetExtent()):
  val=5*math.sin(0.4*math.sqrt(p[0]*p[0]+p[1]*p[1]))+7*math.cos(0.6*math.sqrt(p[2]*p[2]+p[1]*p[1]))
  mh.SetReal(p,val*(1.0+0.0*random.random()))

go=gfx.MapIso("test",mh,4.0)
scene.Add(go)
scene.SetCenter(go.GetCenter())
go.SetLineWidth(1.5)