FaceSelection#
- class ansys.geometry.core.selection_builder.face_selection.FaceSelection(design: ansys.geometry.core.designer.design.Design, grpc_client: ansys.geometry.core.connection.client.GrpcClient, items: list[ansys.geometry.core.designer.face.Face] = None)#
Bases:
ansys.geometry.core.selection_builder.typed_selection.TypedSelectionA builder for creating a face selection.
Overview#
Return all visible faces in the active document. |
|
Return all faces in the active document. |
|
Return faces belonging to a named selection. |
|
Return faces whose area falls within a range. |
|
Return faces whose X-location centroid falls within a range. |
|
Return faces whose Y-location centroid falls within a range. |
|
Return faces whose Z-location centroid falls within a range. |
|
Return faces that match a specific color. |
|
Return all faces not in the given selection. |
|
Filter faces whose area falls within a range. |
|
Return the face with the maximum area from the selection. |
|
Return the face with the minimum area from the selection. |
|
Filter faces whose perimeter falls within a range. |
|
Return the face with the maximum perimeter from the selection. |
|
Return the face with the minimum perimeter from the selection. |
|
Filter faces whose edge count falls within a range. |
|
Return the face with the maximum edge count from the selection. |
|
Return the face with the minimum edge count from the selection. |
|
Filter faces whose loop count falls within a range. |
|
Return the face with the maximum loop count from the selection. |
|
Return the face with the minimum loop count from the selection. |
|
Filter faces by the count of a specific curve type they contain. |
|
Return the face with the most curves of a given type. |
|
Return the face with the fewest curves of a given type. |
|
Filter faces that contain specific curve types. |
|
Filter faces that match a specific color. |
|
Filter faces by area percentile relative to the selection. |
|
Filter faces by perimeter percentile relative to the selection. |
|
Filter faces by edge count percentile relative to the selection. |
|
Filter faces by loop count percentile relative to the selection. |
|
Filter faces by the percentile of a curve type count relative to the selection. |
|
Extend the selection with faces that have the same area. |
|
Extend the selection with faces that have the same number of edges. |
|
Extend the selection with faces that have the same number of loops. |
|
Extend the selection with faces that share the same color. |
|
Extend the selection with faces that are coincident to the selection. |
|
Extend the selection with faces that are coaxial to the selection. |
|
Return faces sorted by area in ascending order. |
|
Return faces sorted by perimeter in ascending order. |
|
Return faces sorted by edge count in ascending order. |
|
Return faces sorted by loop count in ascending order. |
|
Return faces sorted by the count of a given curve type in ascending order. |
|
Group faces by area. |
|
Group faces by perimeter. |
|
Group faces by their parent body. |
|
Group faces by edge count. |
|
Group faces by loop count. |
|
Group faces by color. |
|
Group faces by coincidence. |
Import detail#
from ansys.geometry.core.selection_builder.face_selection import FaceSelection
Method detail#
- FaceSelection.__add__(other: FaceSelection) FaceSelection#
Return a new selection that is the union of this selection and another.
- FaceSelection.__sub__(other: FaceSelection) FaceSelection#
Return a new selection that is the difference of this selection and another.
- FaceSelection.__and__(other: FaceSelection) FaceSelection#
Return a new selection that is the intersection of this selection and another.
- FaceSelection.get_all_visible_faces() FaceSelection#
Return all visible faces in the active document.
- Returns:
FaceSelectionAll visible faces.
- FaceSelection.get_all_faces() FaceSelection#
Return all faces in the active document.
- Returns:
FaceSelectionAll faces.
- FaceSelection.get_faces_from_named_selection(name: str) FaceSelection#
Return faces belonging to a named selection.
- Parameters:
- name
str Name of the named selection to match.
- name
- Returns:
FaceSelectionFaces belonging to the matched named selection.
- FaceSelection.get_faces_with_area(min: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real | None = None) FaceSelection#
Return faces whose area falls within a range.
- Parameters:
- min
Area|Quantity|Real Minimum area (inclusive).
- max
Area|Quantity|Real,optional Maximum area (inclusive). If not provided, no upper bound is applied.
- min
- Returns:
FaceSelectionFaces whose area is within the specified range.
- FaceSelection.get_faces_with_x_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) FaceSelection#
Return faces whose X-location centroid falls within a range.
- Parameters:
- range_type
RangeType, default:RangeType.RANGETYPE_INTERSECT Range type specifier.
- min
Distance|Quantity|Real,optional Minimum X-location. If not provided, no lower bound is applied.
- max
Distance|Quantity|Real,optional Maximum X-location. If not provided, no upper bound is applied.
- range_type
- Returns:
FaceSelectionFaces whose X-location is within the specified range.
- FaceSelection.get_faces_with_y_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) FaceSelection#
Return faces whose Y-location centroid falls within a range.
- Parameters:
- range_type
RangeType, default:RangeType.RANGETYPE_INTERSECT Range type specifier.
- min
Distance|Quantity|Real,optional Minimum Y-location. If not provided, no lower bound is applied.
- max
Distance|Quantity|Real,optional Maximum Y-location. If not provided, no upper bound is applied.
- range_type
- Returns:
FaceSelectionFaces whose Y-location is within the specified range.
- FaceSelection.get_faces_with_z_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) FaceSelection#
Return faces whose Z-location centroid falls within a range.
- Parameters:
- range_type
RangeType, default:RangeType.RANGETYPE_INTERSECT Range type specifier.
- min
Distance|Quantity|Real,optional Minimum Z-location. If not provided, no lower bound is applied.
- max
Distance|Quantity|Real,optional Maximum Z-location. If not provided, no upper bound is applied.
- range_type
- Returns:
FaceSelectionFaces whose Z-location is within the specified range.
- FaceSelection.get_faces_with_color(color: str | tuple[float, float, float] | tuple[float, float, float, float]) FaceSelection#
Return faces that match a specific color.
- FaceSelection.invert_face_selection(scope: ansys.geometry.core.selection_builder.selection_builder.InvertTopologyScope = InvertTopologyScope.INVERTTOPOLOGYSCOPE_ALL) FaceSelection#
Return all faces not in the given selection.
- Parameters:
- scope
InvertTopologyScope, default:InvertTopologyScope.INVERTTOPOLOGYSCOPE_ALL Whether to invert within visible faces or all faces.
- scope
- Returns:
FaceSelectionFaces that are the inverse of the input selection.
- FaceSelection.filter_faces_by_area(min: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real | None = None) FaceSelection#
Filter faces whose area falls within a range.
- Parameters:
- min
Area|Quantity|Real Minimum area (inclusive).
- max
Area|Quantity|Real,optional Maximum area (inclusive). If not provided, no upper bound is applied.
- min
- Returns:
FaceSelectionFaces whose area is within the specified range.
- FaceSelection.filter_faces_max_area() FaceSelection#
Return the face with the maximum area from the selection.
- Returns:
FaceSelectionFace with the maximum area.
- FaceSelection.filter_faces_min_area() FaceSelection#
Return the face with the minimum area from the selection.
- Returns:
FaceSelectionFace with the minimum area.
- FaceSelection.filter_faces_by_perimeter(min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) FaceSelection#
Filter faces whose perimeter falls within a range.
- Parameters:
- min
Distance|Quantity|Real Minimum perimeter (inclusive).
- max
Distance|Quantity|Real,optional Maximum perimeter (inclusive). If not provided, no upper bound is applied.
- min
- Returns:
FaceSelectionFaces whose perimeter is within the specified range.
- FaceSelection.filter_faces_max_perimeter() FaceSelection#
Return the face with the maximum perimeter from the selection.
- Returns:
FaceSelectionFace with the maximum perimeter.
- FaceSelection.filter_faces_min_perimeter() FaceSelection#
Return the face with the minimum perimeter from the selection.
- Returns:
FaceSelectionFace with the minimum perimeter.
- FaceSelection.filter_faces_by_edge_count(min: int, max: int = None) FaceSelection#
Filter faces whose edge count falls within a range.
- FaceSelection.filter_faces_max_edge_count() FaceSelection#
Return the face with the maximum edge count from the selection.
- Returns:
FaceSelectionFace with the maximum edge count.
- FaceSelection.filter_faces_min_edge_count() FaceSelection#
Return the face with the minimum edge count from the selection.
- Returns:
FaceSelectionFace with the minimum edge count.
- FaceSelection.filter_faces_by_loop_count(min: int, max: int = None) FaceSelection#
Filter faces whose loop count falls within a range.
- FaceSelection.filter_faces_max_loop_count() FaceSelection#
Return the face with the maximum loop count from the selection.
- Returns:
FaceSelectionFace with the maximum loop count.
- FaceSelection.filter_faces_min_loop_count() FaceSelection#
Return the face with the minimum loop count from the selection.
- Returns:
FaceSelectionFace with the minimum loop count.
- FaceSelection.filter_faces_by_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType, min: int, max: int = None) FaceSelection#
Filter faces by the count of a specific curve type they contain.
- FaceSelection.filter_faces_max_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType) FaceSelection#
Return the face with the most curves of a given type.
- Parameters:
- curve_type
CurveType The curve type to count per face.
- curve_type
- Returns:
FaceSelectionFace with the maximum count of the specified curve type.
- FaceSelection.filter_faces_min_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType) FaceSelection#
Return the face with the fewest curves of a given type.
- Parameters:
- curve_type
CurveType The curve type to count per face.
- curve_type
- Returns:
FaceSelectionFace with the minimum count of the specified curve type.
- FaceSelection.filter_faces_containing_curve_types(curve_type: ansys.geometry.core.designer.edge.CurveType, exclusive: bool = False) FaceSelection#
Filter faces that contain specific curve types.
- FaceSelection.filter_faces_by_color(color: str | tuple[float, float, float] | tuple[float, float, float, float]) FaceSelection#
Filter faces that match a specific color.
- FaceSelection.filter_faces_area_percentile(min_percentile: float, max_percentile: float) FaceSelection#
Filter faces by area percentile relative to the selection.
- FaceSelection.filter_faces_perimeter_percentile(min_percentile: float, max_percentile: float) FaceSelection#
Filter faces by perimeter percentile relative to the selection.
- FaceSelection.filter_faces_edge_count_percentile(min_percentile: float, max_percentile: float) FaceSelection#
Filter faces by edge count percentile relative to the selection.
- FaceSelection.filter_faces_loop_count_percentile(min_percentile: float, max_percentile: float) FaceSelection#
Filter faces by loop count percentile relative to the selection.
- FaceSelection.filter_faces_by_number_curves_percentile(curve_type: ansys.geometry.core.designer.edge.CurveType, min_percentile: float, max_percentile: float) FaceSelection#
Filter faces by the percentile of a curve type count relative to the selection.
- FaceSelection.extend_to_same_area(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that have the same area.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional faces with matching areas.
- FaceSelection.extend_to_same_number_of_edges(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that have the same number of edges.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional faces with the same edge count.
- FaceSelection.extend_to_same_number_of_loops(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that have the same number of loops.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional faces with the same loop count.
- FaceSelection.extend_to_same_color(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that share the same color.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional faces with matching colors.
- FaceSelection.extend_to_coincident(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that are coincident to the selection.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional coincident faces.
- FaceSelection.extend_to_coaxial_faces(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) FaceSelection#
Extend the selection with faces that are coaxial to the selection.
- Parameters:
- scope
ExtendScope, default:ExtendScope.EXTENDSCOPE_ALL Whether to search all faces or only visible ones.
- scope
- Returns:
FaceSelectionInput faces plus additional coaxial faces.
- FaceSelection.order_faces_by_area() FaceSelection#
Return faces sorted by area in ascending order.
- Returns:
FaceSelectionFaces ordered from smallest to largest area.
- FaceSelection.order_faces_by_perimeter() FaceSelection#
Return faces sorted by perimeter in ascending order.
- Returns:
FaceSelectionFaces ordered from smallest to largest perimeter.
- FaceSelection.order_faces_by_edge_count() FaceSelection#
Return faces sorted by edge count in ascending order.
- Returns:
FaceSelectionFaces ordered from fewest to most edges.
- FaceSelection.order_faces_by_loop_count() FaceSelection#
Return faces sorted by loop count in ascending order.
- Returns:
FaceSelectionFaces ordered from fewest to most loops.
- FaceSelection.order_faces_by_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType) FaceSelection#
Return faces sorted by the count of a given curve type in ascending order.
- Parameters:
- curve_type
CurveType The curve type to count per face.
- curve_type
- Returns:
FaceSelectionFaces ordered from fewest to most curves of the given type.
- FaceSelection.group_faces_by_area() list[FaceSelection]#
Group faces by area.
- Returns:
list[FaceSelection]Faces partitioned into groups with the same area.
- FaceSelection.group_faces_by_perimeter() list[FaceSelection]#
Group faces by perimeter.
- Returns:
list[FaceSelection]Faces partitioned into groups with the same perimeter.
- FaceSelection.group_faces_by_body() list[FaceSelection]#
Group faces by their parent body.
- Returns:
list[FaceSelection]Faces partitioned into groups by parent body.
- FaceSelection.group_faces_by_edge_count() list[FaceSelection]#
Group faces by edge count.
- Returns:
list[FaceSelection]Faces partitioned into groups with the same edge count.
- FaceSelection.group_faces_by_loop_count() list[FaceSelection]#
Group faces by loop count.
- Returns:
list[FaceSelection]Faces partitioned into groups with the same loop count.
- FaceSelection.group_faces_by_color() list[FaceSelection]#
Group faces by color.
- Returns:
list[FaceSelection]Faces partitioned into groups sharing the same color.
- FaceSelection.group_faces_by_coincident() list[FaceSelection]#
Group faces by coincidence.
- Returns:
list[FaceSelection]Faces partitioned into groups of coincident faces.