Mobius StripΒΆ
The function taken from the Cylindrical Coordinates example.
Blender rendering of non-orientable surfaces will directly use the geometry, considering the view of the visualization. This is in contrast to Matplotlib rendering in which the view must be considered in constructing the Matplotlib visualization. This is discussed in the Non-Orientable Surface guide.
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,1) )
s3d.save_surfgeom_to_obj('obj_files/mobius_surface.obj',surface)