glow.interface package
Submodules
glow.interface.geom_entities module
Module containing classes providing an interface towards the topological entities of the GEOM module of SALOME.
- class Compound(geom_obj: Any | None)[source]
Bases:
GeomWrapperClass acting as a wrapper for the GEOM compound object.
- Parameters:
geom_obj (Any | None) – The GEOM compound object to wrap (or
None). If provided, its shape type is checked against the expectedShapeType.COMPOUND.
- geom_obj
The wrapped GEOM compound object (or
None).- Type:
Any | None
- name
The name of the wrapped GEOM compound object.
- Type:
str
- class Edge(geom_obj: Any)[source]
Bases:
GeomWrapperClass acting as a wrapper for the GEOM edge object.
- Parameters:
geom_obj (Any | None) – The GEOM edge object to wrap (or
None). If provided, its shape type is checked against the expectedShapeType.EDGE.
- geom_obj
The wrapped GEOM edge object (or
None).- Type:
Any | None
- name
The name of the wrapped GEOM edge object.
- Type:
str
- class Face(geom_obj: Any)[source]
Bases:
GeomWrapperClass acting as a wrapper for the GEOM face object.
- Parameters:
geom_obj (Any | None) – The GEOM face object to wrap (or
None). If provided, its shape type is checked against the expectedShapeType.FACE.
- geom_obj
The wrapped GEOM face object (or
None).- Type:
Any | None
- name
The name of the wrapped GEOM face object.
- Type:
str
- class GeomWrapper(geom_obj: Any | None, expected_types: List[ShapeType])[source]
Bases:
objectBase class acting as a wrapper for low-level GEOM topological shape objects. It provides:
type validation of the provided GEOM object;
attribute delegation, so that this class behaves like the provided GEOM object when using any GEOM function;
geometric operator overloads. Arithmetic operators are overloaded to provide Boolean operations between two
GeomWrapperobjects.
- Parameters:
geom_obj (Any | None) – The GEOM object to wrap (or
None). If provided, its shape type is checked against the expected types.expected_types (List[ShapeType]) – List of allowed shape types to check the provided GEOM object against.
Notes
Attribute access is delegated to the underlying GEOM object via
__getattr__. During initialization this delegation is guarded to avoid recursion if the GEOM object has not yet been stored.The wrapper implements a few binary operator overloads that produce new wrapped shapes:
+(__add__) performs a fuse (union) of two shapes.-(__sub__) performs a cut (difference).*(__mul__) produces the common (intersection)./(__truediv__) perform a partition operation where the GEOM object is subdivided in sub shapes by given shape objects.//(__floordiv__) perform a partition operation where the resulting shape is the combination of all the shapes after being partitioned.
These operators call helper functions that interface with the corresponding GEOM ones, and then wrap the resulting GEOM_Object in an object of the subclasses of
GeomWrapper.
- Raises:
ValueError – If
geom_objis not None and its shape type is not contained among the expected ones.
- property geom_obj: Any
Access or set the corresponding GEOM object.
- Parameters:
geom_obj (Any) – The GEOM object this instance should be set to.
expected_types (List[ShapeType]) – List of allowed shape types to check the provided GEOM object against.
- Returns:
The GEOM object this instance is based on.
- Return type:
Any
- Raises:
ValueError – If the type of the provided GEOM object does not match with the expected one.
- property name: str
Get or set the name of the wrapped GEOM object.
- Parameters:
new_name (str) – The name the wrapped GEOM object should be set to.
- Returns:
The name assigned to the wrapped GEOM object.
- Return type:
str
- class Vertex(geom_obj: Any)[source]
Bases:
GeomWrapperClass acting as a wrapper for the GEOM vertex object.
- Parameters:
geom_obj (Any | None) – The GEOM vertex object to wrap (or
None). If provided, its shape type is checked against the expectedShapeType.VERTEX.
- geom_obj
The wrapped GEOM vertex object (or
None).- Type:
Any | None
- name
The name of the wrapped GEOM vertex object.
- Type:
str
- wrap_shape(geom_obj: Any) GeomWrapper[source]
Function that wraps a generic GEOM object in the appropriate wrapper class.
- Parameters:
geom_obj (Any) – The generic GEOM object to wrap.
- Returns:
An instance of a
GeomWrappersubclass built from the given GEOM object.- Return type:
- Raises:
TypeError – If the given GEOM object is not a valid GEOM shape.
ValueError – If the given GEOM object does not have a corresponding wrapper class.
glow.interface.geom_interface module
Module containing functions providing an interface towards the GEOM functions of SALOME.
- class ShapeType(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumEnumeration for defining the GEOM topological types of shapes.
- COMPOUND: int
Indicating a compound shape type.
- COMPSOLID: int
Indicating a compound solid shape type.
- EDGE: int
Indicating an edge shape type.
- FACE: int
Indicating a face shape type.
- FLAT: int
Indicating a flat shape type.
- SHAPE: int
Indicating a generic shape type.
- SHELL: int
Indicating a shell shape type.
- SOLID: int
Indicating a solid shape type.
- VERTEX: int
Indicating a vertex shape type.
- WIRE: int
Indicating a wire shape type
- add_to_study(shape: Any, name: str) str[source]
Function that adds the given shape in the current SALOME study and returns its ID entry assigned by SALOME.
- Parameters:
shape (Any) – The shape to be added to the study.
name (str) – The name of the shape to be visualized in the SALOME object browser.
- Returns:
A string representing the ID entry assigned by SALOME to the shape when added to the current study.
- Return type:
str
- add_to_study_in_father(father_shape: Any, shape: Any, name: str) str[source]
Function that adds the given shape in the current SALOME study and returns its ID entry assigned by SALOME.
- Parameters:
father_shape (Any) – The father shape in the object browser of the study.
shape (Any) – The shape to be added to the study.
name (str) – The name of the shape to be visualized in the SALOME object browser.
- Returns:
A string representing the ID entry assigned by SALOME to the shape when added to the current study under the given father shape.
- Return type:
str
- clear_view() None[source]
Function that clears out any geometrical shape currently displayed in the SALOME 3D viewer.
- display_shape(entry_id: str) None[source]
Function that displays the geometrical shape, whose entry ID is provided as input, in the SALOME 3D viewer.
- Parameters:
id (str) – The entry ID of the shape to display in the SALOME 3D viewer.
- extract_sorted_sub_shapes(shape: Any, sub_shapes_type: ShapeType) List[Any][source]
Function that explodes a shape on its sub-shapes of the given type. Sub-shapes are sorted by taking into account their gravity centers.
- Parameters:
shape (Any) – The shape object to explode.
sub_shapes_type (ShapeType) – The type of the sub-shapes to extract as value of the
ShapeTypeenumeration.
- Returns:
A list of the sub-shapes of the given type that are contained in the provided shape.
- Return type:
List[Any]
- extract_sub_shapes(shape: Any, sub_shapes_type: ShapeType) List[Any][source]
Function that explodes a shape on its sub-shapes of the given type without applying any sorting algorithm.
- Parameters:
shape (Any) – The shape object to explode.
sub_shapes_type (ShapeType) – The type of the sub-shapes to extract as item of the
ShapeTypeenumeration.
- Returns:
A list of the sub-shapes of the given type that are contained in the provided shape.
- Return type:
List[Any]
- fuse_edges_in_wire(wire: Any) Any[source]
Function that modifies the given wire object by suppressing all the vertices in the C1 continuous adjacent edges of the wire.
- Parameters:
wire (Any) – The wire object whose vertices to suppress.
- Returns:
A modified wire obtained by suppressing vertices in C1 continuous adjacent edges in the wire.
- Return type:
Any
- get_angle_between_shapes(shape1: Any, shape2: Any) float[source]
Function that computes the angle in degrees between two EDGE-type shapes, which must both be linear edges, i.e. their type name in SALOME is
SEGMENT.- Parameters:
shape1 (Any) – The first shape object, expected to be a linear edge.
shape2 (Any) – The second shape object, expected to be a linear edge.
- Returns:
The angle in degrees between the two segment-type shapes.
- Return type:
float
- Raises:
RuntimeError – If either
shape1orshape2is not of typeSEGMENT.
- get_basic_properties(shape: Any) List[float][source]
Function that returns the sum of the lengths of all the wires, the area and volume of the given shape.
- Parameters:
shape (Any) – The shape whose geometrical properties to extract.
- Returns:
A list providing the sum of the lengths of all the wires, the area and volume of the given shape.
- Return type:
List[float]
- get_bounding_box(shape: Any) List[float][source]
Function that returns the bounding box extension of the given shape.
- Parameters:
shape (Any) – The shape whose bounding box to extract.
- Returns:
The [Xmin, Xmax, Ymin, Ymax] values representing the shape bounding box extension. Values are rounded to the 6th decimal digit to remove floating-point precision errors SALOME could introduce.
- Return type:
List[float]
- get_closed_free_boundary(compound: Any) List[Any][source]
Function that evaluates the closed free boundaries of the given compound object. An exception is raised if any error occurred during the operation.
- Parameters:
compound (Any) – The compound object to extract the closed boundary from.
- Returns:
A list of the wire objects each one forming a closed boundary within the given compound.
- Return type:
List[Any]
- Raises:
RuntimeError – If no closed boundaries could be extracted from the given compound object.
- get_id_from_object(shape: Any) str[source]
Function that retrieves the unique SALOME ID associated with a given shape object, if shown in the current SALOME study.
- Parameters:
shape (Any) – The shape object for which to retrieve the SALOME ID.
- Returns:
The unique SALOME ID corresponding to the provided shape.
- Return type:
str
- Raises:
RuntimeError – If the shape is not present in the current SALOME study.
- get_in_place(shape1: Any, shape2: Any) Any[source]
Function that extracts the sub-shape(s) of first shape, which are coincident with, or could be a part of, the second shape.
- Parameters:
shape1 (Any) – The shape to find sub-shapes of.
shape2 (Any) – The shape specifying what to find in the first one.
- Returns:
A compound object including all the found sub-shapes in the first given shape.
- Return type:
Any
- get_in_place_by_hystory(shape1: Any, shape2: Any) Any[source]
Function that extracts the sub-shape(s) of first shape, which are coincident with, or could be a part of, the second shape. The implementation of the wrapped GEOM function is based on a saved history of an operation (e.g., a partition), which produced the first shape. The second shape must be among this operation’s arguments.
- Parameters:
shape1 (Any) – The shape to find sub-shapes of.
shape2 (Any) – The shape specifying what to find in the first one.
- Returns:
A compound object including all the found sub-shapes in the first given shape.
- Return type:
Any
- get_inertia_matrix(shape: Any) List[float][source]
Function that returns the inertia matrix of the given shape.
- Parameters:
shape (Any) – The shape whose inertia matrix to extract.
- Returns:
A list providing, for the given shape, the components of its inertia matrix and the moments of inertia in the XYZ directions.
- Return type:
List[float]
- get_kind_of_shape(shape: Any) List[Any][source]
Function that returns the list of geometrical information about the given shape which depends on the kind of shape. Shapes of interest returns the following information:
CIRCLE xc yc zc dx dy dz R (X-Y-Z center coordinates, X-Y-Z normal vector elements, circle radius).
ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2 (X-Y-Z center coordinates, X-Y-Z normal vector elements, arc radius, X-Y-Z coordinates of arc starting and ending points).
SEGMENT x1 y1 z1 x2 y2 z2 (X-Y-Z coordinates of segment starting and ending points).
Notes
Values lesser than the tolerance of 1e-6 are substituted with
0in the returned list.- Parameters:
shape (Any) – The shape whose geometrical information to extract.
- Returns:
A list providing, for the given shape, its geometrical information.
- Return type:
List[Any]
- get_min_distance(shape1: Any, shape2: Any) float[source]
Function that returns the minimum distance between the given shapes.
- Parameters:
shape1 (Any) – The first shape to get the minimum distance.
shape2 (Any) – The second shape to get the minimum distance.
- Returns:
The minimum distance between the two given shapes.
- Return type:
float
- get_object_from_id(entry_id: str) Any | None[source]
Function that returns the geometrical object associated to the entry ID declared in the current SALOME study.
- Parameters:
entry_id (str) – The value of the entry ID associated to the geometrical object in the current SALOME study.
- Returns:
The geometrical object associated with the given entry ID in the current SALOME study or
None, if no object could be found.- Return type:
Any | None
- get_point_coordinates(point: Any) Tuple[float, float, float][source]
Function that returns the XYZ coordinates of the given vertex object.
- Parameters:
point (Any) – The vertex object whose coordinates are returned.
- Returns:
The XYZ coordinates of the given vertex object.
- Return type:
Tuple[float, float, float]
- get_selected_object() Any[source]
Function that returns the geometrical object being currently selected in the study.
- Returns:
The selected geometrical object in the study.
- Return type:
Any
- get_shape_name(shape: Any) str[source]
Function that returns the
nameattribute assigned to the given shape.- Parameters:
shape (Any) – The geometrical shape whose name to retrieve.
- Returns:
The value of the
nameattribute assigned to the given shape.- Return type:
str
- get_shape_type(shape: Any) ShapeType[source]
Function that returns the type of the given shape as value of the
ShapeTypeenumeration.- Parameters:
shape (Any) – The shape whose type to determine.
- Returns:
The shape type as value of the
ShapeTypeenumeration.- Return type:
- get_subshape_id(shape: Any, subshape: Any) str[source]
Function that returns the entry ID of a given subshape contained in the parent shape.
- Parameters:
shape (Any) – The parent shape.
subshape (Any) – The subshape contained in the parent shape.
- Returns:
A string representing the entry ID associated to the subshape in the current study.
- Return type:
str
- get_tolerances(shape: Any) List[float][source]
Function that returns the min-max tolerances applied to the GEOM objects the shape is constituted by. In order, they are those for the faces, the edges, and the vertices of the shape. If the shape is not composed of any of these sub-shapes, an infinite number is returned instead.
- Parameters:
shape (Any) – The GEOM object whose tolerances are returned.
- Returns:
In order, the min-max tolerances of the faces, the edges, the vertices the shape is made of.
- Return type:
List[float]
- is_gui_available() None[source]
Function that returns a boolean flag indicating whether the SALOME GUI is available when running a script.
- Returns:
Trueif the SALOME GUI is available,Falseotherwise.- Return type:
bool
- is_point_inside_shape(point: Any, shape: Any) bool[source]
Function that checks if the given point object is within the boundaries of the given geometrical shape.
- Parameters:
point (Any) – The point object to check if inside the shape.
shape (Any) – The shape object the point position has to be evaluated.
- Returns:
True, if the point is inside the shape,Falseotherwise.- Return type:
bool
- limit_tolerance(shape: Any, max_tol: float = 1e-6) Any[source]
Function that tries to limit the tolerances applied to the GEOM objects the given shape is made of.
- Parameters:
shape (Any) – The shape to process.
max_tol (float = 1e-6) – The maximum required tolerance the shape should be limited to.
- Returns:
A new GEOM object from the given shape with tolerances limited to the required value.
- Return type:
Any
- make_arc(point1: Any, point2: Any, point3: Any) Any[source]
Function that returns the arc edge object built from the given three vertex objects.
- Parameters:
point1 (Any) – The vertex object being the arc’s start point.
point2 (Any) – The vertex object being the arc’s middle point.
point3 (Any) – The vertex object being the arc’s end point.
- Returns:
The arc edge built from the given three construction points.
- Return type:
Any
- make_arc_center(center: Any, point1: Any, point2: Any) Any[source]
Function that returns the arc edge object built from the center, start and end vertex objects.
- Parameters:
center (Any) – The vertex object being the arc’s center.
point1 (Any) – The vertex object being the arc’s start point.
point2 (Any) – The vertex object being the arc’s end point.
- Returns:
The arc edge built from the given three construction points.
- Return type:
Any
- make_cdg(shape: Any) Any[source]
Function that returns the vertex object of the given shape CDG.
- Parameters:
shape (Any) – The geometric shape whose CDG is returned.
- Returns:
The shape CDG as a vertex object.
- Return type:
Any
- make_circle(center: Any, axis: Any | None, radius: float) Any[source]
Function that returns a circle object, given its center, axis and radius.
- Parameters:
center (Any) – The vertex object being the center of the circle.
axis (Any) – The vector object being the normal axis of the circle.
radius (float) – The value of the circle radius.
- Returns:
The circle object from the given center, axis and radius.
- Return type:
Any
- make_common(shape1: Any, shape2: Any) Any[source]
Function that performs the common boolean operation between the two given shapes.
- Parameters:
shape1 (Any) – The first shape of the common operation.
shape2 (Any) – The second shape of the common operation.
- Returns:
A shape object resulting from the common operation.
- Return type:
Any
- make_compound(shapes: List[Any]) Any[source]
Function that creates a compound object from the given list of shapes.
- Parameters:
shapes (List[Any]) – The list of shapes to be put into the returned compound object.
- Returns:
A compound object made from the given list of shapes.
- Return type:
Any
- make_cut(shape1: Any, shape2: Any) Any[source]
Function that performs the cut boolean operation between the two given shapes.
- Parameters:
shape1 (Any) – The first shape of the cut operation.
shape2 (Any) – The second shape of the cut operation.
- Returns:
A shape object resulting from the cut operation.
- Return type:
Any
- make_edge(vertex1: Any, vertex2: Any) Any[source]
Function that returns an edge object, given the vertex objects being its start-end points.
- Parameters:
vertex1 (Any) – The vertex object being the edge start point.
vertex2 (Any) – The vertex object being the edge end point.
- Returns:
The edge object built from the given start-end points.
- Return type:
Any
- make_face(borders: List[Any]) Any[source]
Function that returns a 2D face object, given the list of its edge objects being the face borders.
- Parameters:
borders (List[Any]) – The list of edge objects being the face borders.
- Returns:
The face object built on the given borders.
- Return type:
Any
- make_fuse(shapes: List[Any]) Any[source]
Function that performs a fuse boolean operation on the given list of shapes.
- Parameters:
shapes (List[Any]) – The list of geometrical shapes to be fused into a single one.
- Returns:
The face object resulting from fusing all the given shapes.
- Return type:
Any
- make_intersection(shape1: Any, shape2: Any) Any[source]
Function that performs the intersection boolean operation between the two given shapes and returns the resulting GEOM object.
- Parameters:
shape1 (Any) – The GEOM object being the first argument of the intersection.
shape2 (Any) – The GEOM object being the second argument of the intersection.
- Returns:
The GEOM object resulting from the intersection of the two shapes.
- Return type:
Any
- make_line(point1: Any, point2: Any) Any[source]
Function that returns a line object (i.e. a straight edge), given the point objects being its start-end points.
- Parameters:
point1 (Any) – The point object being the line start point.
point2 (Any) – The point object being the line end point.
- Returns:
The line object built from the given start-end points.
- Return type:
Any
- make_multi_translation_1d(shape: Any, direction: Any, step: float, no_transl: float) Any[source]
Function that performs a specified number of 1D translations of the given shape along the given direction by the indicated distance.
- Parameters:
shape (Any) – The shape to be translated.
direction (Any) – The vector along which the shape is translated.
step (float) – The translation step, i.e. the distance between two shape copies.
no_transl (float) – The number of times the original shape is translated.
- Returns:
A GEOM compound object collecting the original and all the translated shapes.
- Return type:
Any
- make_partition(shapes: List[Any], tools: List[Any], shape_type: ShapeType) Any[source]
Function that performs a partition operation on the given list of shapes by means of the tool shapes intersecting the first ones. The result is a shape made by the intersection of all the provided ones with type given as input.
- Parameters:
shapes (List[Any]) – The list of shapes to be intersected.
tools (List[Any]) – The list of shapes intersecting.
shape_type (ShapeType) – The type of the shape resulting from the partition operation.
- Returns:
A shape made by the intersection of all the provided ones with the type specified as input.
- Return type:
Any
- make_partition_non_self_intersecting(shapes: List[Any], tools: List[Any], shape_type: ShapeType) Any[source]
Function that performs a partition operation on the given list of shapes by means of the tool shapes intersecting the first ones. This function can be used to speed up the partition operation whenever the shapes of the first argument list do not self-intersect. Only the partition of the shapes with the tools is computed, which gives as result a shape containing only the sub-shapes of the given type.
- Parameters:
shapes (List[Any]) – The list of shapes to be intersected. They must not self-intersect.
tools (List[Any]) – The list of shapes intersecting the shapes to partition.
shape_type (ShapeType) – The type of the shape resulting from the partition operation.
- Returns:
A shape made by those of the given type resulting from the intersection of the provided ones with the tools only.
- Return type:
Any
- make_rotation(shape: Any, axis: Any, angle: float) Any[source]
Function that rotates the given shape by the given angle in radians.
- Parameters:
shape (Any) – The generic shape object the rotation should be applied to.
axis (Any) – The vector object representing the rotation axis.
angle (float) – The rotation angle in radians.
- Returns:
The rotated shape object.
- Return type:
Any
- make_scale(shape: Any, center: Any, factor: float) Any[source]
Function that scales the given shape by the specified factor, wrt the indicated center point.
- Parameters:
shape (Any) – The generic shape object the scaling should be applied to.
center (Any) – The vertex object wrt the scaling is performed.
factor (float) – The scaling factor.
- Returns:
The scaled shape object.
- Return type:
Any
- make_translation(shape: Any, vector: Any) Any[source]
Function that translates the given shape along the vector object.
- Parameters:
shape (Any) – The generic shape object the translation should be applied to.
vector (Any) – The translation vector object.
- Returns:
The translated shape object.
- Return type:
Any
- make_vector(vect_elem: Tuple[float, float, float]) Any[source]
Function that returns a vector object, given its XYZ components.
- Parameters:
vect_elem (Tuple[float, float, float]) – The XYZ components of the vector to build.
- Returns:
The vector object built on the given XYZ components.
- Return type:
Any
- make_vector_from_points(point1: Any, point2: Any) Any[source]
Function that returns a vector object, given its start-end points.
- Parameters:
point1 (Any) – The start point object of the vector to build.
point2 (Any) – The end point object of the vector to build.
- Returns:
The vector object built on the given XYZ components.
- Return type:
Any
- make_vertex(coords: Tuple[float, float, float]) Any[source]
Function that returns a vertex object, given its XYZ coordinates.
- Parameters:
coords (Tuple[float, float, float]) – The XYZ coordinates of the vertex to build.
- Returns:
The vertex object positioned at the given XYZ coordinates.
- Return type:
Any
- make_vertex_inside_face(face: Any) Any[source]
Function that returns a vertex object which lays on the given face, in an arbitrary position with the only condition of having a non-zero distance to the face boundary.
- Parameters:
face (Any) – The reference face object to put a vertex into.
- Returns:
The vertex object positioned within the given face object.
- Return type:
Any
- make_vertex_on_curve(curve: Any, u_param: float) Any[source]
Function that returns a vertex object built on the given edge object (being a circle, an arc or a segment) and placed at a position identified by the adimensional parameter u_param, which expresses the scaled position wrt the edge length.
- Parameters:
curve (Any) – The reference edge object along which the vertex should be placed.
u_param (float) – Identifying the position of the vertex along the edge, expressed in the range [0-1] as it is scaled to the length of the edge.
- Returns:
The vertex object positioned along the edge length.
- Return type:
Any
- make_vertex_on_lines_intersection(line1: Any, line2: Any) Any[source]
Function that returns a vertex object built on the intersection of the two given line objects.
- Parameters:
line1 (Any) – The first reference line object.
line2 (Any) – The second reference line object.
- Returns:
The vertex object being the intersection point of the two given lines.
- Return type:
Any
- make_wire(edges: List[Any]) Any[source]
Function that builds a wire object from the given list of connected edge objects.
- Parameters:
edges (List[Any]) – The list of edge objects to build a wire from.
- Returns:
A wire object build from the given edges.
- Return type:
Any
- remove_extra_edges(shape: Any, fuse_faces: bool = False) Any[source]
Function that removes all the seams and degenerated edges from the given shape, thus returning a shape cleaned from any unnecessary edges.
- Parameters:
shape (Any) – The shape to heal by removing extra edges.
fuse_faces (bool = False) – Flag stating whether the faces, sharing a common surface, should be united. It defaults to
False.
- Returns:
The given shape healed from the unnecessary extra edges.
- Return type:
Any
- remove_from_study(entry_id: str) None[source]
Function that removes the geometrical object whose ID is provided as input.
- Parameters:
entry_id (str) – The ID of the geometrical object to be removed from the study.
- set_color_face(face: Any, color: Tuple[int, int, int]) None[source]
Function that assigns a color to the given face object. When displayed in the 3D viewer, the face will be shown with the assigned color.
- Parameters:
face (Any) – The face object to which a color is assigned when displayed in the 3D viewer.
color (Tuple[int, int, int]) – The RGB code of the color to assign to the face.