plask.geometry.
Cartesian2D
(root, length=infty, **edges)¶Geometry in 2D Cartesian space.
Create a space around a twodimensional geometry object with a given length.
Parameters: 


Example
>>> block = geometry.Block2D(4, 2, 'GaAs')
>>> geometry.Cartesian2D(block, length=10, left='mirror', bottom='AlAs')
<plask.geometry.Cartesian2D object at (0x3dd6c70)>
get_grid () 
Get rectangular grid for space. 
get_leafs ([path]) 
Get list of the geometry tree leafs. 
get_leafs_bboxes ([path]) 
Calculate bounding boxes of all the geometry tree leafs. 
get_leafs_positions ([path]) 
Calculate positions of all the geometry tree leafs. 
get_leafs_translations ([path]) 
Get list of Translation objects holding all the geometry tree leafs. 
get_matching_objects (cond) 
Get list of the geometry tree objects matching condition. 
get_material (…) 
Get material at the given point. 
get_material_field (mesh) 
Distribution of materials for a given geometry on a mesh. 
get_object_bboxes (object[, path]) 
Calculate bounding boxes of all instances of specified object. 
get_object_positions (object[, path]) 
Calculate positions of all instances of the specified object. 
get_paths (…) 
Get subtree containing paths to all leafs covering the specified point. 
get_role_objects (role) 
Get list of the geometry tree objects that have the specified role. 
get_roles (…) 
Get roles of objects at specified point. 
has_role (…) 
Test if the specified point has a given role. 
modify_objects (callable) 
Modify all objects in the geometry tree. 
object_contains (…) 
Test if the specified geometry object contains a point. 
validate () 
Check if the object is complete and ready for calculations. 
axes 
Names of axes for this geometry. 
back_material 
Material at the negative side of the axis along the extrusion. 
bbox 
Minimal rectangle which contains all points of the geometry object. 
default_material 
Material of the empty regions of the geometry. 
dims 
Number of object’s dimensions (int, 2 or 3). 
edges 
Dictionary specifying the geometry edges. 
extrusion 
Extrusion object at the very root of the tree. 
front_material 
Material at the positive side of the axis along the extrusion. 
item 
GeometryObject2D at the root of the geometry tree. 
steps 
Step info for mesh generation for nonuniform objects. 
Cartesian2D.
get_grid
()¶Get rectangular grid for space.
Return rectangular mesh that has lines along the edges of all the geometry objects. In some objects are nonrectangular or nonuniform, they are divided according to their settings.
Cartesian2D.
get_leafs
(path=None)¶Get list of the geometry tree leafs.
This method returns all the geometry tree leafs located under this geometry object. By leaf we understand a proper geometry object, in contrast to any container or transformation.
Parameters:  path – Path that can be used to select only some leafs. 

Returns:  List of translations of the leafs. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order:
get_leafs()
,
get_leafs_bboxes()
,
get_leafs_positions()
,
get_leafs_translations()
.
Cartesian2D.
get_leafs_bboxes
(path=None)¶Calculate bounding boxes of all the geometry tree leafs.
This method computes the bounding boxes of all the geometry tree leafs located under this geometry object. By leaf we understand a proper geometry object, in contrast to any container or transformation.
Parameters:  path – Path that can be used to select only some leafs. 

Returns:  List of vectors containing the position of the leafs. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order:
get_leafs()
,
get_leafs_bboxes()
,
get_leafs_positions()
,
get_leafs_translations()
.
Cartesian2D.
get_leafs_positions
(path=None)¶Calculate positions of all the geometry tree leafs.
This method computes position of all the geometry tree leafs located under this geometry object. By leaf we understand a proper geometry object, in contrast to any container or transformation.
Parameters:  path – Path that can be used to select only some leafs. 

Returns:  List of vectors containing the position of the leafs. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order:
get_leafs()
,
get_leafs_bboxes()
,
get_leafs_positions()
,
get_leafs_translations()
.
Cartesian2D.
get_leafs_translations
(path=None)¶Get list of Translation
objects holding all the geometry tree leafs.
This method computes the Translation
objects of all the geometry tree
leafs located under this geometry object. By leaf we understand a proper
geometry object, in contrast to any container or transformation.
Parameters:  path – Path that can be used to select only some leafs. 

Returns:  List of translations of the leafs. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order:
get_leafs()
,
get_leafs_bboxes()
,
get_leafs_positions()
,
get_leafs_translations()
.
Cartesian2D.
get_matching_objects
(cond)¶Get list of the geometry tree objects matching condition.
This method returns all the objects in the geometry tree that match the specified condition.
Parameters:  cond – Python callable that accepts a geometry object and returns Boolean indicating whether the object should be returned by this method or not. 

Returns:  List of objects matching your condition. 
Return type:  sequence 
Cartesian2D.
get_material
(c0, c1)¶Cartesian2D.
get_material
(point)Get material at the given point.
This method returns a material object with the material at the given point if
this point is located within the geometry object self. Otherwise the method
returns default_material
.
Parameters: 


Returns:  Material at the specified point. 
Cartesian2D.
get_material_field
(mesh)¶Distribution of materials for a given geometry on a mesh.
This class creates a ‘field’ of material.Material
objects and
provides getters to easily obtain its properties as Data
object.
Parameters: 


Example
>>> material_field = this_geometry.get_material_field(your_mesh)
>>> plot_field(material_field.thermk(300.), comp=0)
Cartesian2D.
get_object_bboxes
(object, path=None)¶Calculate bounding boxes of all instances of specified object.
The bounding boxes are computed in the local coordinates of self.
Parameters: 


Returns:  List of bounding boxes of the instances of the object. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order,
provided they are called with the same arguments:
get_object_bboxes()
,
get_object_positions()
Cartesian2D.
get_object_positions
(object, path=None)¶Calculate positions of all instances of the specified object.
Parameters: 


Returns:  List of vectors containing the position of the instances of the object. 
Return type:  sequence 
All these methods are guaranteed to return their sequences in the same order,
provided they are called with the same arguments:
get_object_bboxes()
,
get_object_positions()
Cartesian2D.
get_paths
(point, all=False)¶Cartesian2D.
get_paths
(c0, c1, all=False)Get subtree containing paths to all leafs covering the specified point.
Parameters: 


Returns:  Subtree with the path to the specified point. 
See also
Cartesian2D.
get_role_objects
(role)¶Get list of the geometry tree objects that have the specified role.
This method returns all the objects in the geometry tree that have the specified role.
Warning!
This method will return the very object with the role specified and not its items, which is against the normal behavior of the roles.
Parameters:  role (str) – Role to search objects with. 

Returns:  List of objects matching your condition. 
Return type:  sequence 
Cartesian2D.
get_roles
(c0, c1)¶Cartesian2D.
get_roles
(point)Get roles of objects at specified point.
This method returns a set of all the roles given to the every object intersecting the specified point.
Parameters: 


Returns:  Set of the roles at given point. 
Return type:  set 
Cartesian2D.
has_role
(role, point)¶Cartesian2D.
has_role
(role, c0, c1)Test if the specified point has a given role.
This method checks if any object intersecting the specified point has the role role.
Parameters: 


Returns:  True if the point has the role role. 
Return type:  bool 
Cartesian2D.
modify_objects
(callable)¶Modify all objects in the geometry tree.
This method calls callable
on every object in the geometry tree.
The callable
takes a single geometry object as an argument and should
return None
(in which case nothing happens), a new object to replace
the original one, or an empty tuple (which will result in the removal of
the original object).
Parameters:  callable – a callable filtering each object in the tree 

Returns:  modified geometry 
Return type:  GeometryObject 
Cartesian2D.
object_contains
(object, c0, c1)¶Cartesian2D.
object_contains
(object, path, point)Cartesian2D.
object_contains
(object, path, mesh)Cartesian2D.
object_contains
(object, point)Cartesian2D.
object_contains
(object, path, c0, c1)Cartesian2D.
object_contains
(object, mesh)Test if the specified geometry object contains a point.
The given geometry object must be located somewhere within the self geometry tree.
Parameters: 


Returns: 

Return type:  bool 
Cartesian2D.
validate
()¶Check if the object is complete and ready for calculations.
This method is specific for a particular object. It raises an exception if the object definition is somehow incomplete.
Cartesian2D.
axes
¶Names of axes for this geometry.
Cartesian2D.
back_material
¶Material at the negative side of the axis along the extrusion.
Cartesian2D.
bbox
¶Minimal rectangle which contains all points of the geometry object.
See also
Cartesian2D.
default_material
¶Material of the empty regions of the geometry.
This material is returned by get_material()
for the points that do not belong to any object in the geometry tree.
Cartesian2D.
dims
¶Number of object’s dimensions (int, 2 or 3).
Cartesian2D.
edges
¶Dictionary specifying the geometry edges.
Cartesian2D.
front_material
¶Material at the positive side of the axis along the extrusion.
Cartesian2D.
item
¶GeometryObject2D
at the root of the geometry tree.
Cartesian2D.
steps
¶Step info for mesh generation for nonuniform objects.
This parameter is considered only for the nonuniform leafs in the geometry tree. It has two attributes that can be changed:
num 
Maximum number of the mesh steps in each direction the object is divided into. 
dist 
Minimum step size. 
The exact meaning of these attributes depend on the mesh generator, however in general they indicate how densely should the nonuniform object be subdivided.
It is possible to assign simply an integer number to this parameter, in which
case it changes its num
attribute.