The auxiliary.py module#

Summary#

get_design_from_component

Get the Design of the given Component object.

get_design_from_body

Get the Design of the given Body object.

get_design_from_face

Get the Design of the given Face object.

get_design_from_edge

Get the Design of the given Edge object.

get_all_bodies_from_design

Find all the Body objects inside a Design.

get_bodies_from_ids

Find the Body objects inside a Design from its ids.

get_faces_from_ids

Find the Face objects inside a Design from its ids.

get_edges_from_ids

Find the Edge objects inside a Design from its ids.

convert_color_to_hex

Get the hex string color from input formats.

Description#

Auxiliary functions for the PyAnsys Geometry library.

Module detail#

auxiliary.get_design_from_component(component: ansys.geometry.core.designer.component.Component) ansys.geometry.core.designer.design.Design#

Get the Design of the given Component object.

Parameters:
componentComponent

The component object for which to find the Design.

Returns:
Design

The Design of the provided component object.

auxiliary.get_design_from_body(body: ansys.geometry.core.designer.body.Body) ansys.geometry.core.designer.design.Design#

Get the Design of the given Body object.

Parameters:
bodyBody

The body object for which to find the Design.

Returns:
Design

The Design of the provided body object.

auxiliary.get_design_from_face(face: ansys.geometry.core.designer.face.Face) ansys.geometry.core.designer.design.Design#

Get the Design of the given Face object.

Parameters:
faceFace

The face object for which to find the Design.

Returns:
Design

The Design of the provided face object.

auxiliary.get_design_from_edge(edge: ansys.geometry.core.designer.edge.Edge) ansys.geometry.core.designer.design.Design#

Get the Design of the given Edge object.

Parameters:
edgeEdge

The edge object for which to find the Design.

Returns:
Design

The Design of the provided edge object.

auxiliary.get_all_bodies_from_design(design: ansys.geometry.core.designer.design.Design) list[ansys.geometry.core.designer.body.Body]#

Find all the Body objects inside a Design.

Parameters:
designDesign

Parent design for the bodies.

Returns:
list[Body]

List of Body objects.

Notes

This method takes a design and gets the corresponding Body objects.

auxiliary.get_bodies_from_ids(design: ansys.geometry.core.designer.design.Design, body_ids: list[str]) list[ansys.geometry.core.designer.body.Body]#

Find the Body objects inside a Design from its ids.

Parameters:
designDesign

Parent design for the faces.

body_idslist[str]

List of body ids.

Returns:
list[Body]

List of Body objects.

Notes

This method takes a design and body ids, and gets their corresponding Body object.

auxiliary.get_faces_from_ids(design: ansys.geometry.core.designer.design.Design, face_ids: list[str]) list[ansys.geometry.core.designer.face.Face]#

Find the Face objects inside a Design from its ids.

Parameters:
designDesign

Parent design for the faces.

face_idslist[str]

List of face ids.

Returns:
list[Face]

List of Face objects.

Notes

This method takes a design and face ids, and gets their corresponding Face object.

auxiliary.get_edges_from_ids(design: ansys.geometry.core.designer.design.Design, edge_ids: list[str]) list[ansys.geometry.core.designer.edge.Edge]#

Find the Edge objects inside a Design from its ids.

Parameters:
designDesign

Parent design for the edges.

edge_idslist[str]

List of edge ids.

Returns:
list[Edge]

List of Edge objects.

Notes

This method takes a design and edge ids, and gets their corresponding Edge objects.

auxiliary.convert_color_to_hex(color: str | tuple[float, float, float]) str#

Get the hex string color from input formats.

Parameters:
colorstr | tuple[float, float, float]

Color to set the body to. This can be a string representing a color name or a tuple of RGB values in the range [0, 1] (RGBA) or [0, 255] (pure RGB).

Returns:
str

The hex code string for the color.