Face#

class ansys.geometry.core.designer.face.Face(id: str, surface_type: SurfaceType, body: ansys.geometry.core.designer.body.Body, grpc_client: ansys.geometry.core.connection.client.GrpcClient, is_reversed: bool = False)#

Represents a single face of a body within the design assembly.

This class synchronizes to a design within a supporting Geometry service instance.

Parameters:
idstr

Server-defined ID for the body.

surface_typeSurfaceType

Type of surface that the face forms.

bodyBody

Parent body that the face constructs.

grpc_clientGrpcClient

Active supporting Geometry service instance for design modeling.

Overview#

set_color

Set the color of the face.

normal

Get the normal direction to the face at certain UV coordinates.

face_normal

Get the normal direction to the face at certain UV coordinates.

point

Get a point of the face evaluated at certain UV coordinates.

face_point

Get a point of the face evaluated at certain UV coordinates.

create_isoparametric_curves

Create isoparametic curves at the given proportional parameter.

setup_offset_relationship

Create an offset relationship between two faces.

tessellate

Tessellate the face and return the geometry as triangles.

plot

Plot the face.

id

Face ID.

is_reversed

Flag indicating if the face is reversed.

body

Body that the face belongs to.

shape

Underlying trimmed surface of the face.

surface_type

Surface type of the face.

area

Calculated area of the face.

edges

List of all edges of the face.

loops

List of all loops of the face.

color

Get the current color of the face.

bounding_box

Get the bounding box for the face.

Import detail#

from ansys.geometry.core.designer.face import Face

Property detail#

property Face.id: str#

Face ID.

property Face.is_reversed: bool#

Flag indicating if the face is reversed.

property Face.body: ansys.geometry.core.designer.body.Body#

Body that the face belongs to.

property Face.shape: ansys.geometry.core.shapes.surfaces.trimmed_surface.TrimmedSurface#

Underlying trimmed surface of the face.

If the face is reversed, its shape is a ReversedTrimmedSurface type, which handles the direction of the normal vector to ensure it is always facing outward.

property Face.surface_type: SurfaceType#

Surface type of the face.

property Face.area: pint.Quantity#

Calculated area of the face.

property Face.edges: list[ansys.geometry.core.designer.edge.Edge]#

List of all edges of the face.

property Face.loops: list[FaceLoop]#

List of all loops of the face.

property Face.color: str#

Get the current color of the face.

property Face.bounding_box: ansys.geometry.core.math.bbox.BoundingBox2D#

Get the bounding box for the face.

Method detail#

Face.set_color(color: str | tuple[float, float, float]) None#

Set the color of the face.

Face.normal(u: float = 0.5, v: float = 0.5) ansys.geometry.core.math.vector.UnitVector3D#

Get the normal direction to the face at certain UV coordinates.

Parameters:
ufloat, default: 0.5

First coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

vfloat, default: 0.5

Second coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

Returns:
UnitVector3D

UnitVector3D object evaluated at the given U and V coordinates. This UnitVector3D object is perpendicular to the surface at the given UV coordinates.

Notes

To properly use this method, you must handle UV coordinates. Thus, you must know how these relate to the underlying Geometry service. It is an advanced method for Geometry experts only.

Face.face_normal(u: float = 0.5, v: float = 0.5) ansys.geometry.core.math.vector.UnitVector3D#

Get the normal direction to the face at certain UV coordinates.

Parameters:
ufloat, default: 0.5

First coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

vfloat, default: 0.5

Second coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

Returns:
UnitVector3D

UnitVector3D object evaluated at the given U and V coordinates. This UnitVector3D object is perpendicular to the surface at the given UV coordinates.

Notes

This method is deprecated. Use the normal method instead.

Face.point(u: float = 0.5, v: float = 0.5) ansys.geometry.core.math.point.Point3D#

Get a point of the face evaluated at certain UV coordinates.

Parameters:
ufloat, default: 0.5

First coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

vfloat, default: 0.5

Second coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

Returns:
Point3D

Point3D object evaluated at the given UV coordinates.

Notes

To properly use this method, you must handle UV coordinates. Thus, you must know how these relate to the underlying Geometry service. It is an advanced method for Geometry experts only.

Face.face_point(u: float = 0.5, v: float = 0.5) ansys.geometry.core.math.point.Point3D#

Get a point of the face evaluated at certain UV coordinates.

Parameters:
ufloat, default: 0.5

First coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

vfloat, default: 0.5

Second coordinate of the 2D representation of a surface in UV space. The default is 0.5, which is the center of the surface.

Returns:
Point3D

Point3D object evaluated at the given UV coordinates.

Notes

This method is deprecated. Use the point method instead.

Face.create_isoparametric_curves(use_u_param: bool, parameter: float) list[ansys.geometry.core.shapes.curves.trimmed_curve.TrimmedCurve]#

Create isoparametic curves at the given proportional parameter.

Typically, only one curve is created, but if the face has a hole, it is possible that more than one curve is created.

Parameters:
use_u_parambool

Whether the parameter is the u coordinate or v coordinate. If True, it is the u coordinate. If False, it is the v coordinate.

parameterfloat

Proportional [0-1] parameter to create the one or more curves at.

Returns:
list[TrimmedCurve]

list of curves that were created.

Face.setup_offset_relationship(other_face: Face, set_baselines: bool = False, process_adjacent_faces: bool = False) bool#

Create an offset relationship between two faces.

Parameters:
other_faceFace

The face to setup an offset relationship with.

set_baselinesbool, default: False

Automatically set baseline faces.

process_adjacent_facesbool, default: False

Look for relationships of the same offset on adjacent faces.

Returns:
bool

True when successful, False when failed.

Face.tessellate() pyvista.PolyData#

Tessellate the face and return the geometry as triangles.

Returns:
PolyData

pyvista.PolyData object holding the face.

Face.plot(screenshot: str | None = None, use_trame: bool | None = None, use_service_colors: bool | None = None, **plotting_options: dict | None) None#

Plot the face.

Parameters:
screenshotstr, default: None

Path for saving a screenshot of the image that is being represented.

use_tramebool, default: None

Whether to enable the use of trame. The default is None, in which case the ansys.tools.visualization_interface.USE_TRAME global setting is used.

use_service_colorsbool, default: None

Whether to use the colors assigned to the face in the service. The default is None, in which case the ansys.geometry.core.USE_SERVICE_COLORS global setting is used.

**plotting_optionsdict, default: None

Keyword arguments for plotting. For allowable keyword arguments, see the Plotter.add_mesh method.