Geometry: inner/outer surfaceΒΆ

The function taken from the Inner/Outer Surface Colormap example.

../../_images/blender_bin_surf.png

Coloration of the front and back surfaces was done using Blender after file import.

import numpy as np
import s3dlib.surface as s3d

#.. Geometry: inner/outer surface.

# 1. Define function to examine .....................................

def twistFunction(rtz,twists) :
    r,t,z = rtz
    # Note: sliced surface needed due to discontinuity @ t=0 if twists is odd
    thickness = 0.33
    w = thickness*z 
    phi = 0.5*t*twists
    R = 1 + w * np.cos(phi)
    Z = w * np.sin(phi)
    return R,t,Z

# 2. Setup and map surfaces .........................................
rez = 5

surface = s3d.CylindricalSurface(rez, basetype='squ_s')
surface.map_geom_from_op( lambda rtz : twistFunction(rtz,6) )

s3d.save_surfgeom_to_obj('obj_files/binary_surface.obj',surface)