RepairTools#

class ansys.geometry.core.tools.repair_tools.RepairTools(grpc_client: ansys.geometry.core.connection.GrpcClient, modeler: ansys.geometry.core.modeler.Modeler, _internal_use: bool = False)#

Repair tools for PyAnsys Geometry.

Parameters:
grpc_clientGrpcClient

Active supporting geometry service instance for design modeling.

modelerModeler

The parent modeler instance.

_internal_usebool, optional

Internal flag to prevent direct instantiation by users. This parameter is for internal use only.

Raises:
GeometryRuntimeError

If the class is instantiated directly by users instead of through the modeler.

Notes

This class should not be instantiated directly. Use modeler.repair_tools instead.

Overview#

find_split_edges

Find split edges in the given list of bodies.

find_extra_edges

Find the extra edges in the given list of bodies.

find_inexact_edges

Find inexact edges in the given list of bodies.

find_short_edges

Find the short edge problem areas.

find_duplicate_faces

Find the duplicate face problem areas.

find_missing_faces

Find the missing faces.

find_small_faces

Find the small face problem areas.

find_stitch_faces

Return the list of stitch face problem areas.

find_simplify

Detect faces in a body that can be simplified.

find_interferences

Find the interference problem areas.

find_and_fix_short_edges

Find and fix the short edge problem areas.

find_and_fix_extra_edges

Find and fix the extra edge problem areas.

find_and_fix_split_edges

Find and fix the split edge problem areas.

find_and_fix_simplify

Find and simplify the provided geometry.

find_and_fix_stitch_faces

Find and fix the stitch face problem areas.

inspect_geometry

Return a list of geometry issues organized by body.

repair_geometry

Attempt to repair the geometry for the given bodies.

Import detail#

from ansys.geometry.core.tools.repair_tools import RepairTools

Method detail#

RepairTools.find_split_edges(bodies: list[ansys.geometry.core.designer.body.Body], angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real = None, length: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = None) list[ansys.geometry.core.tools.problem_areas.SplitEdgeProblemAreas]#

Find split edges in the given list of bodies.

This method finds the split edge problem areas and returns a list of split edge problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that split edges are investigated on.

angleAngle | Quantity | Real

The maximum angle between edges. By default, None.

lengthDistance | Quantity | Real

The maximum length of the edges. By default, None.

Returns:
list[SplitEdgeProblemAreas]

List of objects representing split edge problem areas.

RepairTools.find_extra_edges(bodies: list[ansys.geometry.core.designer.body.Body]) list[ansys.geometry.core.tools.problem_areas.ExtraEdgeProblemAreas]#

Find the extra edges in the given list of bodies.

This method find the extra edge problem areas and returns a list of extra edge problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that extra edges are investigated on.

Returns:
list[ExtraEdgeProblemArea]

List of objects representing extra edge problem areas.

RepairTools.find_inexact_edges(bodies: list[ansys.geometry.core.designer.body.Body]) list[ansys.geometry.core.tools.problem_areas.InexactEdgeProblemAreas]#

Find inexact edges in the given list of bodies.

This method find the inexact edge problem areas and returns a list of inexact edge problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that inexact edges are investigated on.

Returns:
list[InExactEdgeProblemArea]

List of objects representing inexact edge problem areas.

RepairTools.find_short_edges(bodies: list[ansys.geometry.core.designer.body.Body], length: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0) list[ansys.geometry.core.tools.problem_areas.ShortEdgeProblemAreas]#

Find the short edge problem areas.

This method finds the short edge problem areas and returns a list of these objects.

Parameters:
bodieslist[Body]

List of bodies that short edges are investigated on.

lengthDistance | Quantity | Real, optional

The maximum length of the edges. By default, 0.0.

Returns:
list[ShortEdgeProblemAreas]

List of objects representing short edge problem areas.

RepairTools.find_duplicate_faces(bodies: list[ansys.geometry.core.designer.body.Body]) list[ansys.geometry.core.tools.problem_areas.DuplicateFaceProblemAreas]#

Find the duplicate face problem areas.

This method finds the duplicate face problem areas and returns a list of duplicate face problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that duplicate faces are investigated on.

Returns:
list[DuplicateFaceProblemAreas]

List of objects representing duplicate face problem areas.

RepairTools.find_missing_faces(bodies: list[ansys.geometry.core.designer.body.Body], angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real | None = None, distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None) list[ansys.geometry.core.tools.problem_areas.MissingFaceProblemAreas]#

Find the missing faces.

This method find the missing face problem areas and returns a list of missing face problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that missing faces are investigated on.

angleAngle | Quantity | Real, optional

The minimum angle between faces. By default, None. This option is only used if the backend version is 26.1 or higher.

distanceDistance | Quantity | Real, optional

The minimum distance between faces. By default, None. This option is only used if the backend version is 26.1 or higher.

Returns:
list[MissingFaceProblemAreas]

List of objects representing missing face problem areas.

RepairTools.find_small_faces(bodies: list[ansys.geometry.core.designer.body.Body], area: ansys.geometry.core.misc.measurements.Area | pint.Quantity | ansys.geometry.core.typing.Real | None = None, width: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None) list[ansys.geometry.core.tools.problem_areas.SmallFaceProblemAreas]#

Find the small face problem areas.

This method finds and returns a list of ids of small face problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that small faces are investigated on.

areaArea | Quantity | Real, optional

Maximum area of the faces. By default, None. This option is only used if the backend version is 26.1 or higher.

widthDistance | Quantity | Real, optional

Maximum width of the faces. By default, None. This option is only used if the backend version is 26.1 or higher.

Returns:
list[SmallFaceProblemAreas]

List of objects representing small face problem areas.

RepairTools.find_stitch_faces(bodies: list[ansys.geometry.core.designer.body.Body], max_distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None) list[ansys.geometry.core.tools.problem_areas.StitchFaceProblemAreas]#

Return the list of stitch face problem areas.

This method find the stitch face problem areas and returns a list of ids of stitch face problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that stitchable faces are investigated on.

max_distanceDistance | Quantity | Real, optional

Maximum distance between faces. By default, None. This option is only used if the backend version is 26.1 or higher.

Returns:
list[StitchFaceProblemAreas]

List of objects representing stitch face problem areas.

RepairTools.find_simplify(bodies: list[ansys.geometry.core.designer.body.Body]) list[ansys.geometry.core.tools.problem_areas.UnsimplifiedFaceProblemAreas]#

Detect faces in a body that can be simplified.

Parameters:
bodieslist[Body]

List of bodies to search.

Returns:
list[UnsimplifiedFaceProblemAreas]

List of objects representing unsimplified face problem areas.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_interferences(bodies: list[ansys.geometry.core.designer.body.Body], cut_smaller_body: bool = False) list[ansys.geometry.core.tools.problem_areas.InterferenceProblemAreas]#

Find the interference problem areas.

This method finds and returns a list of ids of interference problem areas objects.

Parameters:
bodieslist[Body]

List of bodies that small faces are investigated on.

cut_smaller_bodybool, optional

Whether to cut the smaller body if an intererference is found. By default, False.

Returns:
list[InterfenceProblemAreas]

List of objects representing interference problem areas.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_and_fix_short_edges(bodies: list[ansys.geometry.core.designer.body.Body], length: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, comprehensive_result: bool = False) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Find and fix the short edge problem areas.

This method finds the short edges in the bodies and fixes them.

Parameters:
bodieslist[Body]

List of bodies that short edges are investigated on.

lengthDistance | Quantity | Real, optional

The maximum length of the edges. By default, 0.0.

comprehensive_resultbool, optional

Whether to fix all problem areas individually. By default, False.

Returns:
RepairToolMessage

Message containing number of problem areas found/fixed, created and/or modified bodies.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_and_fix_extra_edges(bodies: list[ansys.geometry.core.designer.body.Body], comprehensive_result: bool = False) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Find and fix the extra edge problem areas.

This method finds the extra edges in the bodies and fixes them.

Parameters:
bodieslist[Body]

List of bodies that short edges are investigated on.

comprehensive_resultbool, optional

Whether to fix all problem areas individually. By default, False.

Returns:
RepairToolMessage

Message containing number of problem areas found/fixed, created and/or modified bodies.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_and_fix_split_edges(bodies: list[ansys.geometry.core.designer.body.Body], angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, length: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, comprehensive_result: bool = False) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Find and fix the split edge problem areas.

This method finds the extra edges in the bodies and fixes them.

Parameters:
bodieslist[Body]

List of bodies that split edges are investigated on.

angleAngle | Quantity | Real, optional

The maximum angle between edges. By default, 0.0.

lengthDistance | Quantity | Real, optional

The maximum length of the edges. By default, 0.0.

comprehensive_resultbool, optional

Whether to fix all problem areas individually. By default, False.

Returns:
RepairToolMessage

Message containing number of problem areas found/fixed, created and/or modified bodies.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_and_fix_simplify(bodies: list[ansys.geometry.core.designer.body.Body], comprehensive_result: bool = False) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Find and simplify the provided geometry.

This method simplifies the provided geometry.

Parameters:
bodieslist[Body]

List of bodies to be simplified.

comprehensive_resultbool, optional

Whether to fix all problem areas individually. By default, False.

Returns:
RepairToolMessage

Message containing number of problem areas found/fixed, created and/or modified bodies.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.find_and_fix_stitch_faces(bodies: list[ansys.geometry.core.designer.body.Body], max_distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None, allow_multiple_bodies: bool = False, maintain_components: bool = True, check_for_coincidence: bool = False, comprehensive_result: bool = False) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Find and fix the stitch face problem areas.

This method finds the stitchable faces and fixes them.

Parameters:
bodieslist[Body]

List of bodies that stitchable faces are investigated on.

max_distanceDistance | Quantity | Real, optional

The maximum distance between faces to be stitched. By default, 0.0001.

allow_multiple_bodiesbool, optional

Whether to allow multiple bodies in the result. By default, False.

maintain_componentsbool, optional

Whether to stitch bodies within the components. By default, True.

check_for_coincidencebool, optional

Whether coincidence surfaces are searched. By default, False.

comprehensive_resultbool, optional

Whether to fix all problem areas individually. By default, False.

Returns:
RepairToolMessage

Message containing number of problem areas found/fixed, created and/or modified bodies.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.inspect_geometry(bodies: list[ansys.geometry.core.designer.body.Body] = None) list[ansys.geometry.core.tools.check_geometry.InspectResult]#

Return a list of geometry issues organized by body.

This method inspects the geometry and returns a list of the issues grouped by the body where they are found.

Parameters:
bodieslist[Body]

List of bodies to inspect the geometry for. All bodies are inspected if the argument is not given.

Returns:
list[IssuesByBody]

List of objects representing geometry issues and the bodies where issues are found.

Warning

This method is only available starting on Ansys release 25R2.

RepairTools.repair_geometry(bodies: list[ansys.geometry.core.designer.body.Body] = None) ansys.geometry.core.tools.repair_tool_message.RepairToolMessage#

Attempt to repair the geometry for the given bodies.

This method inspects the geometry for the given bodies and attempts to repair them.

Parameters:
bodieslist[Body]

List of bodies where to attempt to repair the geometry. All bodies are repaired if the argument is not given.

Returns:
RepairToolMessage

Message containing success of the operation.

Warning

This method is only available starting on Ansys release 25R2.