class Grid(dtcc.Geometry)[source]

Represents a structured quadrilateral grid in 2D.

width

Number of cells in the x-direction (horizontal).

Type:

int

height

Number of cells in the y-direction (vertical).

Type:

int

Public members

width : int = 0
height : int = 0
__str__()[source]

Return str(self).

calculate_bounds()[source]
property xstep : int

Return the distance between adjacent grid points in the x-direction.

property ystep : int

Return the distance between adjacent grid points in the y-direction.

property num_vertices : int

Return the total number of vertices in the grid.

property num_cells : int

Return the total number of cells in the grid.

coordinates()[source]

Return the coordinates of the grid points.

to_proto() Geometry[source]

Return a protobuf representation of the Grid.

from_proto(pb: Geometry | bytes)[source]

Initialize Grid from a protobuf representation.

Grid(_bounds: ~dtcc_model.geometry.bounds.Bounds = <factory>, ...)

Initialize self. See help(type(self)) for accurate signature.

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

view()

View a mesh in 3D with a GLFW window.

property bounds
add_field(field: Field)[source]

Add a field to the geometry.

transform : Transform
fields : list[Field]
to_json() str

Return a JSON representation of the object.

copy(**kwargs)

Return a copy of the object.

classmethod add_methods(module, name=None)

Adds methods from a module or function to the class.

classmethod print_methods(verbose=False)

Print the methods that have been added to the class.