GeometryCommands#

class ansys.geometry.core.designer.geometry_commands.GeometryCommands(grpc_client: ansys.geometry.core.connection.client.GrpcClient)#

Provides geometry commands for PyAnsys Geometry.

Parameters:
grpc_clientGrpcClient

gRPC client to use for the geometry commands.

Overview#

chamfer

Create a chamfer on an edge or adjust the chamfer of a face.

fillet

Create a fillet on an edge or adjust the fillet of a face.

full_fillet

Create a full fillet betweens a collection of faces.

extrude_faces

Extrude a selection of faces.

extrude_faces_up_to

Extrude a selection of faces up to another object.

extrude_edges

Extrude a selection of edges. Provide either a face or a direction and point.

extrude_edges_up_to

Extrude a selection of edges up to another object.

rename_object

Rename an object.

create_linear_pattern

Create a linear pattern. The pattern can be one or two dimensions.

modify_linear_pattern

Modify a linear pattern. Leave an argument at 0 for it to remain unchanged.

create_circular_pattern

Create a circular pattern. The pattern can be one or two dimensions.

modify_circular_pattern

Modify a circular pattern. Leave an argument at 0 for it to remain unchanged.

create_fill_pattern

Create a fill pattern.

update_fill_pattern

Update a fill pattern.

revolve_faces

Revolve face around an axis.

revolve_faces_up_to

Revolve face around an axis up to a certain object.

revolve_faces_by_helix

Revolve face around an axis in a helix shape.

replace_face

Replace a face with another face.

split_body

Split bodies with a plane, slicers, or faces.

get_round_info

Get info on the rounding of a face.

Import detail#

from ansys.geometry.core.designer.geometry_commands import GeometryCommands

Method detail#

GeometryCommands.chamfer(selection: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], distance: ansys.geometry.core.typing.Real) bool#

Create a chamfer on an edge or adjust the chamfer of a face.

Parameters:
selectionEdge | list[Edge] | Face | list[Face]

One or more edges or faces to act on.

distanceReal

Chamfer distance.

Returns:
bool

True when successful, False when failed.

GeometryCommands.fillet(selection: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], radius: ansys.geometry.core.typing.Real) bool#

Create a fillet on an edge or adjust the fillet of a face.

Parameters:
selectionEdge | list[Edge] | Face | list[Face]

One or more edges or faces to act on.

radiusReal

Fillet radius.

Returns:
bool

True when successful, False when failed.

GeometryCommands.full_fillet(faces: list[ansys.geometry.core.designer.face.Face]) bool#

Create a full fillet betweens a collection of faces.

Parameters:
faceslist[Face]

Faces to round.

Returns:
bool

True when successful, False when failed.

GeometryCommands.extrude_faces(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], distance: ansys.geometry.core.typing.Real, direction: ansys.geometry.core.math.vector.UnitVector3D = None, extrude_type: ExtrudeType = ExtrudeType.ADD, offset_mode: OffsetMode = OffsetMode.MOVE_FACES_TOGETHER, pull_symmetric: bool = False, copy: bool = False, force_do_as_extrude: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of faces.

Parameters:
facesFace | list[Face]

Faces to extrude.

distanceReal

Distance to extrude.

directionUnitVector3D, default: None

Direction of extrusion. If no direction is provided, it will be inferred.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

offset_modeOffsetMode, default: OffsetMode.MOVE_FACES_TOGETHER

Mode of how to handle offset relationships.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the face and move it instead of extruding the original face if True.

force_do_as_extrudebool, default: False

Forces to do as an extrusion if True, if False allows extrusion by offset.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.extrude_faces_up_to(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], up_to_selection: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, seed_point: ansys.geometry.core.math.point.Point3D, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD, offset_mode: OffsetMode = OffsetMode.MOVE_FACES_TOGETHER, pull_symmetric: bool = False, copy: bool = False, force_do_as_extrude: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of faces up to another object.

Parameters:
facesFace | list[Face]

Faces to extrude.

up_to_selectionFace | Edge | Body

The object to pull the faces up to.

seed_pointPoint3D

Origin to define the extrusion.

directionUnitVector3D, default: None

Direction of extrusion. If no direction is provided, it will be inferred.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

offset_modeOffsetMode, default: OffsetMode.MOVE_FACES_TOGETHER

Mode of how to handle offset relationships.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the face and move it instead of extruding the original face if True.

force_do_as_extrudebool, default: False

Forces to do as an extrusion if True, if False allows extrusion by offset.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.extrude_edges(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], distance: ansys.geometry.core.typing.Real, from_face: ansys.geometry.core.designer.face.Face = None, from_point: ansys.geometry.core.math.point.Point3D = None, direction: ansys.geometry.core.math.vector.UnitVector3D = None, extrude_type: ExtrudeType = ExtrudeType.ADD, pull_symmetric: bool = False, copy: bool = False, natural_extension: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of edges. Provide either a face or a direction and point.

Parameters:
edgesEdge | list[Edge]

Edges to extrude.

distanceReal

Distance to extrude.

from_faceFace, default: None

Face to pull normal from.

from_pointPoint3D, default: None

Point to pull from. Must be used with direction.

directionUnitVector3D, default: None

Direction to pull. Must be used with from_point.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the edge and move it instead of extruding the original edge if True.

natural_extensionbool, default: False

Surfaces will extend in a natural or linear shape after exceeding its original range.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.extrude_edges_up_to(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], up_to_selection: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, seed_point: ansys.geometry.core.math.point.Point3D, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of edges up to another object.

Parameters:
edgesEdge | list[Edge]

Edges to extrude.

up_to_selectionFace, default: None

The object to pull the faces up to.

seed_pointPoint3D

Origin to define the extrusion.

directionUnitVector3D, default: None

Direction of extrusion.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.rename_object(selection: list[ansys.geometry.core.designer.body.Body] | list[ansys.geometry.core.designer.component.Component] | list[ansys.geometry.core.designer.face.Face] | list[ansys.geometry.core.designer.edge.Edge], name: str) bool#

Rename an object.

Parameters:
selectionlist[Body] | list[Component] | list[Face] | list[Edge]

Selection of the object to rename.

namestr

New name for the object.

Returns:
bool

True when successful, False when failed.

GeometryCommands.create_linear_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], linear_direction: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.face.Face, count_x: int, pitch_x: ansys.geometry.core.typing.Real, two_dimensional: bool = False, count_y: int = None, pitch_y: ansys.geometry.core.typing.Real = None) bool#

Create a linear pattern. The pattern can be one or two dimensions.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

linear_directionEdge | Face

Direction of the linear pattern, determined by the direction of an edge or face normal.

count_xint

How many times the pattern repeats in the x direction.

pitch_xReal

The spacing between each pattern member in the x direction.

two_dimensionalbool, default: False

If True, create a pattern in the x and y direction.

count_yint, default: None

How many times the pattern repeats in the y direction.

pitch_yReal, default: None

The spacing between each pattern member in the y direction.

Returns:
bool

True when successful, False when failed.

GeometryCommands.modify_linear_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], count_x: int = 0, pitch_x: ansys.geometry.core.typing.Real = 0.0, count_y: int = 0, pitch_y: ansys.geometry.core.typing.Real = 0.0, new_seed_index: int = 0, old_seed_index: int = 0) bool#

Modify a linear pattern. Leave an argument at 0 for it to remain unchanged.

Parameters:
selectionFace | list[Face]

Faces that belong to the pattern.

count_xint, default: 0

How many times the pattern repeats in the x direction.

pitch_xReal, default: 0.0

The spacing between each pattern member in the x direction.

count_yint, default: 0

How many times the pattern repeats in the y direction.

pitch_yReal, default: 0.0

The spacing between each pattern member in the y direction.

new_seed_indexint, default: 0

The new seed index of the member.

old_seed_indexint, default: 0

The old seed index of the member.

Returns:
bool

True when successful, False when failed.

GeometryCommands.create_circular_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], circular_axis: ansys.geometry.core.designer.edge.Edge, circular_count: int, circular_angle: ansys.geometry.core.typing.Real, two_dimensional: bool = False, linear_count: int = None, linear_pitch: ansys.geometry.core.typing.Real = None, radial_direction: ansys.geometry.core.math.vector.UnitVector3D = None) bool#

Create a circular pattern. The pattern can be one or two dimensions.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

circular_axisEdge

The axis of the circular pattern, determined by the direction of an edge.

circular_countint

How many members are in the circular pattern.

circular_angleReal

The angular range of the pattern.

two_dimensionalbool, default: False

If True, create a two-dimensional pattern.

linear_countint, default: None

How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.

linear_pitchReal, default: None

The spacing along the radial lines for a two-dimensional pattern.

radial_directionUnitVector3D, default: None

The direction from the center out for a two-dimensional pattern.

Returns:
bool

True when successful, False when failed.

GeometryCommands.modify_circular_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], circular_count: int = 0, linear_count: int = 0, step_angle: ansys.geometry.core.typing.Real = 0.0, step_linear: ansys.geometry.core.typing.Real = 0.0) bool#

Modify a circular pattern. Leave an argument at 0 for it to remain unchanged.

Parameters:
selectionFace | list[Face]

Faces that belong to the pattern.

circular_countint, default: 0

How many members are in the circular pattern.

linear_countint, default: 0

How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.

step_angleReal, default: 0.0

Defines the circular angle.

step_linearReal, default: 0.0

Defines the step, along the radial lines, for a pattern dimension greater than 1.

Returns:
bool

True when successful, False when failed.

GeometryCommands.create_fill_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], linear_direction: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.face.Face, fill_pattern_type: FillPatternType, margin: ansys.geometry.core.typing.Real, x_spacing: ansys.geometry.core.typing.Real, y_spacing: ansys.geometry.core.typing.Real, row_x_offset: ansys.geometry.core.typing.Real = 0, row_y_offset: ansys.geometry.core.typing.Real = 0, column_x_offset: ansys.geometry.core.typing.Real = 0, column_y_offset: ansys.geometry.core.typing.Real = 0) bool#

Create a fill pattern.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

linear_directionEdge

Direction of the linear pattern, determined by the direction of an edge.

fill_pattern_typeFillPatternType

The type of fill pattern.

marginReal

Margin defining the border of the fill pattern.

x_spacingReal

Spacing between the pattern members in the x direction.

y_spacingReal

Spacing between the pattern members in the x direction.

row_x_offsetReal, default: 0

Offset for the rows in the x direction. Only used with FillPattern.SKEWED.

row_y_offsetReal, default: 0

Offset for the rows in the y direction. Only used with FillPattern.SKEWED.

column_x_offsetReal, default: 0

Offset for the columns in the x direction. Only used with FillPattern.SKEWED.

column_y_offsetReal, default: 0

Offset for the columns in the y direction. Only used with FillPattern.SKEWED.

Returns:
bool

True when successful, False when failed.

GeometryCommands.update_fill_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) bool#

Update a fill pattern.

When the face that a fill pattern exists upon changes in size, the fill pattern can be updated to fill the new space.

Parameters:
selectionFace | list[Face]

Face(s) that are part of a fill pattern.

Returns:
bool

True when successful, False when failed.

GeometryCommands.revolve_faces(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], axis: ansys.geometry.core.shapes.curves.line.Line, angle: ansys.geometry.core.typing.Real) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

axisLine

Axis of revolution.

angleReal

Angular distance to revolve.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.revolve_faces_up_to(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], up_to: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, axis: ansys.geometry.core.shapes.curves.line.Line, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis up to a certain object.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

up_toFace | Edge | Body

Object to revolve the face up to.

axisLine

Axis of revolution.

directionUnitVector3D

Direction of extrusion.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.revolve_faces_by_helix(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], axis: ansys.geometry.core.shapes.curves.line.Line, direction: ansys.geometry.core.math.vector.UnitVector3D, height: ansys.geometry.core.typing.Real, pitch: ansys.geometry.core.typing.Real, taper_angle: ansys.geometry.core.typing.Real, right_handed: bool, both_sides: bool) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis in a helix shape.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

axisLine

Axis of revolution.

directionUnitVector3D

Direction of extrusion.

heightReal,

Height of the helix.

pitchReal,

Pitch of the helix.

taper_angleReal,

Tape angle of the helix.

right_handedbool,

Right-handed helix if True, left-handed if False.

both_sidesbool,

Create on both sides if True, one side if False.

Returns:
list[Body]

Bodies created by the extrusion if any.

GeometryCommands.replace_face(target_selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], replacement_selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) bool#

Replace a face with another face.

Parameters:
target_selectionUnion[Face, list[Face]]

The face or faces to replace.

replacement_selectionUnion[Face, list[Face]]

The face or faces to replace with.

Returns:
bool

True when successful, False when failed.

GeometryCommands.split_body(bodies: list[ansys.geometry.core.designer.body.Body], plane: ansys.geometry.core.math.plane.Plane, slicers: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], faces: list[ansys.geometry.core.designer.face.Face], extendfaces: bool) bool#

Split bodies with a plane, slicers, or faces.

Parameters:
bodieslist[Body]

Bodies to split.

planePlane

Plane to split with

slicersEdge | list[Edge] | Face | list[Face]

Slicers to split with.

faceslist[Face]

Faces to split with.

extendFacesbool

Extend faces if split with faces.

Returns:
bool

True when successful, False when failed.

GeometryCommands.get_round_info(face: ansys.geometry.core.designer.face.Face) tuple[bool, ansys.geometry.core.typing.Real]#

Get info on the rounding of a face.

Parameters:
Face

The design face to get round info on.

Returns:
tuple[bool, Real]

True if round is aligned with face’s U-parameter direction, False otherwise. Radius of the round.