common_geometry
index
/Users/vmarchetti/OneDrive/Documents/SPRI 2021-10/Jupyter tutorial/web3d2021_jupyter_tutorial/common_geometry.py

A collection of callable objects whose return values
are X3D elements representing geometry
 
optional input arguments may be used to specify
an X3D Appearance node to apply to the geometry

 
Modules
       
math
numpy
x3d.x3d

 
Functions
       
Cone(vertex_height, total_height, half_angle, appearance=None)
returns a cone of of specified geometry and location
 
Args:
vertex_height : the distance of the vertex above (on y axis) the origin
total_height  : the total height of the cone
half_angle    : the opening angle of the cone in radians, pi/2 >= half_angle >= 0
appearance: (optional) Must be an x3d.Appearance instance
    If not supplied, no Appearance node will appear in the x3d Shape
    instances, and X3D specified defaults will be applied by browsers 
    
Returns:
An x3d.Transform node containing a single Shape
Sphere(center, radius, appearance=None)
returns a sphere with specified radius and center
 
Args:
center: a (3,) sequence of (x,y,z) coordinates of sphere center
radius: a numeric radius
 
appearance: (optional) Must be an x3d.Appearance instance
    If not supplied, no Appearance node will appear in the x3d Shape
    instances, and X3D specified defaults will be applied by browsers
   
Returns:
An x3d.Transform node containing a single x3d.Shape node
TiltedPlane(length, width, beta, appearance=None)
returns a rectangle of specified length and width, centered on cone axis, making angle beta with horizontal
 
Args:
length : length of rectanle in x axis
width  : width of rectangle in z axis
beta   : angle the plane makes with horizontal (x-z plane)
appearance: (optional) Must be an x3d.Appearance instance
    If not supplied, no Appearance node will appear in the x3d Shape
    instances, and X3D specified defaults will be applied by browsers 
    
Returns:
An x3d.Shape node