EdgeSelection#

class ansys.geometry.core.selection_builder.edge_selection.EdgeSelection(design: ansys.geometry.core.designer.design.Design, grpc_client: ansys.geometry.core.connection.client.GrpcClient, items: list[ansys.geometry.core.designer.edge.Edge] = None)#

Bases: ansys.geometry.core.selection_builder.typed_selection.TypedSelection

A builder for creating an edge selection.

Overview#

get_all_visible_edges

Return all visible edges in the active document.

get_all_edges

Return all edges in the active document.

get_edges_from_named_selection

Return edges belonging to a named selection.

get_edges_with_length

Return edges whose length falls within a range.

get_edges_with_x_location

Return edges whose X-location falls within a range.

get_edges_with_y_location

Return edges whose Y-location falls within a range.

get_edges_with_z_location

Return edges whose Z-location falls within a range.

invert_edge_selection

Return the complement of this edge selection.

filter_edges_by_length

Filter edges by length range.

filter_edges_max_length

Filter edges keeping only the edge(s) with the maximum length.

filter_edges_min_length

Filter edges keeping only the edge(s) with the minimum length.

filter_edges_by_curve_type

Filter edges by curve type.

filter_edges_length_percentile

Filter edges by length percentile range.

extend_nearby_edges

Extend selection to include nearby edges within a distance.

extend_to_connected

Extend selection to all topologically connected edges.

extend_to_tangent_chain

Extend selection to all tangentially chained edges.

extend_to_coaxial_edges

Extend selection to all coaxial edges.

order_edges_by_length

Order edges by length (ascending).

group_edges_by_curve_type

Group edges by curve type.

__add__

Return a new selection that is the union of this selection and another.

__sub__

Return a new selection that is the difference of this selection and another.

__and__

Return a new selection that is the intersection of this selection and another.

Import detail#

from ansys.geometry.core.selection_builder.edge_selection import EdgeSelection

Method detail#

EdgeSelection.__add__(other: EdgeSelection) EdgeSelection#

Return a new selection that is the union of this selection and another.

EdgeSelection.__sub__(other: EdgeSelection) EdgeSelection#

Return a new selection that is the difference of this selection and another.

EdgeSelection.__and__(other: EdgeSelection) EdgeSelection#

Return a new selection that is the intersection of this selection and another.

EdgeSelection.get_all_visible_edges() EdgeSelection#

Return all visible edges in the active document.

Returns:
EdgeSelection

All visible edges.

EdgeSelection.get_all_edges() EdgeSelection#

Return all edges in the active document.

Returns:
EdgeSelection

All edges.

EdgeSelection.get_edges_from_named_selection(name: str) EdgeSelection#

Return edges belonging to a named selection.

Parameters:
namestr

Name of the named selection.

Returns:
EdgeSelection

Edges belonging to the matched named selection.

EdgeSelection.get_edges_with_length(min: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance, max: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None) EdgeSelection#

Return edges whose length falls within a range.

Parameters:
minReal, Quantity, or Distance

Minimum edge length (in mm if a plain number).

maxReal, Quantity, or Distance, optional

Maximum edge length. If None, no upper bound is applied.

Returns:
EdgeSelection

Edges whose length is within the specified range.

EdgeSelection.get_edges_with_x_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType, min: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None, max: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None) EdgeSelection#

Return edges whose X-location falls within a range.

Parameters:
range_typeRangeType

Whether to intersect or contain the range.

minReal, Quantity, or Distance, optional

Minimum X coordinate (in mm if a plain number).

maxReal, Quantity, or Distance, optional

Maximum X coordinate.

Returns:
EdgeSelection

Edges within the specified X-location range.

EdgeSelection.get_edges_with_y_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType, min: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None, max: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None) EdgeSelection#

Return edges whose Y-location falls within a range.

Parameters:
range_typeRangeType

Whether to intersect or contain the range.

minReal, Quantity, or Distance, optional

Minimum Y coordinate (in mm if a plain number).

maxReal, Quantity, or Distance, optional

Maximum Y coordinate.

Returns:
EdgeSelection

Edges within the specified Y-location range.

EdgeSelection.get_edges_with_z_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType, min: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None, max: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None) EdgeSelection#

Return edges whose Z-location falls within a range.

Parameters:
range_typeRangeType

Whether to intersect or contain the range.

minReal, Quantity, or Distance, optional

Minimum Z coordinate (in mm if a plain number).

maxReal, Quantity, or Distance, optional

Maximum Z coordinate.

Returns:
EdgeSelection

Edges within the specified Z-location range.

EdgeSelection.invert_edge_selection(scope: ansys.geometry.core.selection_builder.selection_builder.InvertTopologyScope = InvertTopologyScope.INVERTTOPOLOGYSCOPE_ALL) EdgeSelection#

Return the complement of this edge selection.

Parameters:
scopeInvertTopologyScope, default: InvertTopologyScope.INVERTTOPOLOGYSCOPE_ALL

Whether to invert relative to all edges or only visible edges.

Returns:
EdgeSelection

The inverted edge selection.

EdgeSelection.filter_edges_by_length(min: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance, max: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance | None = None) EdgeSelection#

Filter edges by length range.

Parameters:
minReal or Quantity

Minimum edge length (in mm if a plain number).

maxReal or Quantity, optional

Maximum edge length. If None, no upper bound is applied.

Returns:
EdgeSelection

Edges within the specified length range.

EdgeSelection.filter_edges_max_length() EdgeSelection#

Filter edges keeping only the edge(s) with the maximum length.

Returns:
EdgeSelection

Edge(s) with the maximum length.

EdgeSelection.filter_edges_min_length() EdgeSelection#

Filter edges keeping only the edge(s) with the minimum length.

Returns:
EdgeSelection

Edge(s) with the minimum length.

EdgeSelection.filter_edges_by_curve_type(curve_type: ansys.geometry.core.designer.edge.CurveType) EdgeSelection#

Filter edges by curve type.

Parameters:
curve_typeCurveType

The curve type to retain.

Returns:
EdgeSelection

Edges matching the given curve type.

EdgeSelection.filter_edges_length_percentile(min_percentile: float, max_percentile: float) EdgeSelection#

Filter edges by length percentile range.

Parameters:
min_percentilefloat

Minimum percentile (0.0-100.0).

max_percentilefloat

Maximum percentile (0.0-100.0).

Returns:
EdgeSelection

Edges whose lengths fall within the given percentile range.

EdgeSelection.extend_nearby_edges(distance: numbers.Real | pint.Quantity | ansys.geometry.core.misc.measurements.Distance, scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) EdgeSelection#

Extend selection to include nearby edges within a distance.

Parameters:
distanceReal, Quantity, or Distance

Maximum gap distance (in mm if a plain number).

scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Scope of edges to consider for extension.

Returns:
EdgeSelection

Extended edge selection.

EdgeSelection.extend_to_connected(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) EdgeSelection#

Extend selection to all topologically connected edges.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Scope of edges to consider for extension.

Returns:
EdgeSelection

Extended edge selection.

EdgeSelection.extend_to_tangent_chain(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) EdgeSelection#

Extend selection to all tangentially chained edges.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Scope of edges to consider for extension.

Returns:
EdgeSelection

Extended edge selection.

EdgeSelection.extend_to_coaxial_edges(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) EdgeSelection#

Extend selection to all coaxial edges.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Scope of edges to consider for extension.

Returns:
EdgeSelection

Extended edge selection.

EdgeSelection.order_edges_by_length() EdgeSelection#

Order edges by length (ascending).

Returns:
EdgeSelection

Edges ordered by ascending length.

EdgeSelection.group_edges_by_curve_type() list[EdgeSelection]#

Group edges by curve type.

Returns:
list[EdgeSelection]

Edges partitioned into groups of the same curve type.