Surface

../../../_images/steno3d_surface.png

Steno3D Surfaces are 2D resources. The steps to construct the surface resource pictured above can be found online in the example notebooks.

class steno3d.surface.Surface(project=None, **kwargs)[source]

Contains all the information about a 2D surface

Required Properties:

  • mesh (Mesh2D, Mesh2DGrid): Mesh, an instance of Mesh2D or an instance of Mesh2DGrid, Default: new instance of Mesh2D
  • opts (_SurfaceOptions): Options, an instance of _SurfaceOptions, Default: new instance of _SurfaceOptions
  • project (a list of Project): Project containing the resource, a list (each item is an instance of Project)

Optional Properties:

  • data (a list of _SurfaceBinder): Data, a list (each item is an instance of _SurfaceBinder)
  • description (String): Description of the model., a unicode string
  • textures (a list of Texture2DImage): Textures, a list (each item is an instance of Texture2DImage)
  • title (String): Title of the model., a unicode string

Meshes

class steno3d.surface.Mesh2D(**metadata)[source]

class steno3d.Mesh2D

Contains spatial information about a 2D surface defined by triangular faces.

Required Properties:

  • opts (_Mesh2DOptions): Mesh2D Options, an instance of _Mesh2DOptions, Default: new instance of _Mesh2DOptions
  • triangles (Array): Mesh triangle vertex indices, a list or numpy array of <type ‘int’> with shape (*, 3)
  • vertices (Array): Mesh vertices, a list or numpy array of <type ‘float’> with shape (*, 3)

Optional Properties:

  • description (String): Description of the model., a unicode string
  • title (String): Title of the model., a unicode string
class steno3d.surface.Mesh2DGrid(**metadata)[source]

Contains spatial information of a 2D grid.

Required Properties:

  • O (Vector3): Origin vector, a 3D Vector of <type ‘float’> with shape (3), Default: [0.0, 0.0, 0.0]
  • U (Vector3): Orientation of h1 axis, a 3D Vector of <type ‘float’> with shape (3), Default: X
  • V (Vector3): Orientation of h2 axis, a 3D Vector of <type ‘float’> with shape (3), Default: Y
  • h1 (Array): Grid cell widths, U-direction, a list or numpy array of <type ‘float’>, <type ‘int’> with shape (*)
  • h2 (Array): Grid cell widths, V-direction, a list or numpy array of <type ‘float’>, <type ‘int’> with shape (*)
  • opts (_Mesh2DOptions): Mesh2D Options, an instance of _Mesh2DOptions, Default: new instance of _Mesh2DOptions

Optional Properties:

  • Z (Array): Node topography, a list or numpy array of <type ‘float’> with shape (*)
  • description (String): Description of the model., a unicode string
  • title (String): Title of the model., a unicode string

Other Properties:

  • x0: This property has been renamed ‘O’ and may be removed in the future.

Data

The intended method of binding data to surfaces is simply using a dictionary containing location (either nodes/vertices, ‘N’, or cell centers/faces, ‘CC’) and data, a DataArray.

>> ...
>> my_surf = steno3d.Surface(...)
>> ...
>> my_data = steno3d.DataArray(
       title='Six Numbers',
       array=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
   )
>> my_surf.data = [dict(
       location='N',
       data=my_data
   )]

Under the surface, this dictionary becomes a _SurfaceBinder.

Binding data to a Surface using Mesh2D requires the data array to correspond to mesh vertices or mesh triangles, for node and cell-center data, respectively. When binding data to a Surface using Mesh2DGrid, you may specify data order; the default is C-style, row-major ordering, but Fortran-style, column-major ordering is also available. For more details see the DataArray documentation.

class steno3d.surface._SurfaceBinder(**metadata)[source]

Contains the data on a 2D surface with location information

Required Properties:

  • data (DataArray): Data, an instance of DataArray, Default: new instance of DataArray
  • location (StringChoice): Location of the data on mesh, either “CC” or “N”

Options

Similar to data, options are intended to be constructed simply as a dictionary.

>> ...
>> my_surf = steno3d.Surface(...)
>> ...
>> my_surf.opts = dict(
       color='red',
       opacity=0.75
   )

This dictionary then becomes _SurfaceOptions.

class steno3d.surface._SurfaceOptions(**metadata)[source]

Optional Properties:

  • color (Color): Solid color, a color, Default: random
  • opacity (Float): Opacity, a float in range [0.0, 1.0], Default: 1.0
class steno3d.surface._Mesh2DOptions(**metadata)[source]

Optional Properties:

  • wireframe (Bool): Wireframe, a boolean, Default: False