Functional Planar SurfaceΒΆ

The Scalar Function Colormapping on a 3D Surface example surface.

../../_images/blender_mp_triple.png
import numpy as np
import s3dlib.surface as s3d

#.. Functional planar surface

# 1. Define function to examine .....................................
rez=7

def wavefunc(xyz) :
    x,y,z = xyz
    Z = np.cos( x**2 + y**2 )
    return x,y,Z

# Figure 1 - wavefunc geometry ======================================

wave = s3d.PlanarSurface(rez, basetype='oct1').domain([-4,2],[-4,2])
wave.map_geom_from_op( wavefunc )

s3d.save_surfgeom_to_obj('obj_files/wave_surface.obj',wave)