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_client
GrpcClient
gRPC client to use for the geometry commands.
- grpc_client
Overview#
Create a chamfer on an edge or adjust the chamfer of a face. |
|
Create a fillet on an edge or adjust the fillet of a face. |
|
Create a full fillet betweens a collection of faces. |
|
Extrude a selection of faces. |
|
Extrude a selection of faces up to another object. |
|
Extrude a selection of edges. Provide either a face or a direction and point. |
|
Extrude a selection of edges up to another object. |
|
Rename an object. |
|
Create a linear pattern. The pattern can be one or two dimensions. |
|
Modify a linear pattern. Leave an argument at 0 for it to remain unchanged. |
|
Create a circular pattern. The pattern can be one or two dimensions. |
|
Modify a circular pattern. Leave an argument at 0 for it to remain unchanged. |
|
Create a fill pattern. |
|
Update a fill pattern. |
|
Revolve face around an axis. |
|
Revolve face around an axis up to a certain object. |
|
Revolve face around an axis in a helix shape. |
|
Replace a face with another face. |
|
Split bodies with a plane, slicers, or faces. |
|
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.
- 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.
- GeometryCommands.full_fillet(faces: list[ansys.geometry.core.designer.face.Face]) bool #
Create a full fillet betweens a collection of faces.
- 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:
- faces
Face
|list
[Face
] Faces to extrude.
- distance
Real
Distance to extrude.
- direction
UnitVector3D
, default:None
Direction of extrusion. If no direction is provided, it will be inferred.
- extrude_type
ExtrudeType
, default:ExtrudeType.ADD
Type of extrusion to be performed.
- offset_mode
OffsetMode
, 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
, ifFalse
allows extrusion by offset.
- faces
- 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:
- faces
Face
|list
[Face
] Faces to extrude.
- up_to_selection
Face
|Edge
|Body
The object to pull the faces up to.
- seed_point
Point3D
Origin to define the extrusion.
- direction
UnitVector3D
, default:None
Direction of extrusion. If no direction is provided, it will be inferred.
- extrude_type
ExtrudeType
, default:ExtrudeType.ADD
Type of extrusion to be performed.
- offset_mode
OffsetMode
, 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
, ifFalse
allows extrusion by offset.
- faces
- 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:
- edges
Edge
|list
[Edge
] Edges to extrude.
- distance
Real
Distance to extrude.
- from_face
Face
, default:None
Face to pull normal from.
- from_point
Point3D
, default:None
Point to pull from. Must be used with
direction
.- direction
UnitVector3D
, default:None
Direction to pull. Must be used with
from_point
.- extrude_type
ExtrudeType
, 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.
- edges
- 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:
- edges
Edge
|list
[Edge
] Edges to extrude.
- up_to_selection
Face
, default:None
The object to pull the faces up to.
- seed_point
Point3D
Origin to define the extrusion.
- direction
UnitVector3D
, default:None
Direction of extrusion.
- extrude_type
ExtrudeType
, default:ExtrudeType.ADD
Type of extrusion to be performed.
- edges
- 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.
- 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:
- selection
Face
|list
[Face
] Faces to create the pattern out of.
- linear_direction
Edge
|Face
Direction of the linear pattern, determined by the direction of an edge or face normal.
- count_x
int
How many times the pattern repeats in the x direction.
- pitch_x
Real
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_y
int
, default:None
How many times the pattern repeats in the y direction.
- pitch_y
Real
, default:None
The spacing between each pattern member in the y direction.
- selection
- 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:
- selection
Face
|list
[Face
] Faces that belong to the pattern.
- count_x
int
, default: 0 How many times the pattern repeats in the x direction.
- pitch_x
Real
, default: 0.0 The spacing between each pattern member in the x direction.
- count_y
int
, default: 0 How many times the pattern repeats in the y direction.
- pitch_y
Real
, default: 0.0 The spacing between each pattern member in the y direction.
- new_seed_index
int
, default: 0 The new seed index of the member.
- old_seed_index
int
, default: 0 The old seed index of the member.
- selection
- 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:
- selection
Face
|list
[Face
] Faces to create the pattern out of.
- circular_axis
Edge
The axis of the circular pattern, determined by the direction of an edge.
- circular_count
int
How many members are in the circular pattern.
- circular_angle
Real
The angular range of the pattern.
- two_dimensionalbool, default:
False
If
True
, create a two-dimensional pattern.- linear_count
int
, default:None
How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.
- linear_pitch
Real
, default:None
The spacing along the radial lines for a two-dimensional pattern.
- radial_direction
UnitVector3D
, default:None
The direction from the center out for a two-dimensional pattern.
- selection
- 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:
- selection
Face
|list
[Face
] Faces that belong to the pattern.
- circular_count
int
, default: 0 How many members are in the circular pattern.
- linear_count
int
, default: 0 How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.
- step_angle
Real
, default: 0.0 Defines the circular angle.
- step_linear
Real
, default: 0.0 Defines the step, along the radial lines, for a pattern dimension greater than 1.
- selection
- 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:
- selection
Face
|list
[Face
] Faces to create the pattern out of.
- linear_direction
Edge
Direction of the linear pattern, determined by the direction of an edge.
- fill_pattern_type
FillPatternType
The type of fill pattern.
- margin
Real
Margin defining the border of the fill pattern.
- x_spacing
Real
Spacing between the pattern members in the x direction.
- y_spacing
Real
Spacing between the pattern members in the x direction.
- row_x_offset
Real
, default: 0 Offset for the rows in the x direction. Only used with
FillPattern.SKEWED
.- row_y_offset
Real
, default: 0 Offset for the rows in the y direction. Only used with
FillPattern.SKEWED
.- column_x_offset
Real
, default: 0 Offset for the columns in the x direction. Only used with
FillPattern.SKEWED
.- column_y_offset
Real
, default: 0 Offset for the columns in the y direction. Only used with
FillPattern.SKEWED
.
- selection
- 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.
- 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.
- 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:
- selection
Face
|list
[Face
] Face(s) to revolve.
- up_to
Face
|Edge
|Body
Object to revolve the face up to.
- axis
Line
Axis of revolution.
- direction
UnitVector3D
Direction of extrusion.
- extrude_type
ExtrudeType
, default:ExtrudeType.ADD
Type of extrusion to be performed.
- selection
- 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:
- selection
Face
|list
[Face
] Face(s) to revolve.
- axis
Line
Axis of revolution.
- direction
UnitVector3D
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 ifFalse
.- both_sidesbool,
Create on both sides if
True
, one side ifFalse
.
- selection
- 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.
- 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.
- 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.