Skip to content

feat: repair tools refactoring #1912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
51671c6
repair tools refactoring
umutsoysalansys Apr 14, 2025
e3e239d
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 14, 2025
709e57a
chore: adding changelog file 1912.added.md [dependabot-skip]
pyansys-ci-bot Apr 14, 2025
df56e2c
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys Apr 14, 2025
41e790a
repair tools
umutsoysalansys Apr 16, 2025
40b5941
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 16, 2025
e158532
remove repair stubs
umutsoysalansys Apr 16, 2025
539c33b
missing_face
umutsoysalansys Apr 16, 2025
6b1b9e1
merge
umutsoysalansys Apr 16, 2025
90b254a
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys Apr 16, 2025
0021a55
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 16, 2025
a671293
revert delete
umutsoysalansys Apr 16, 2025
1817fef
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 16, 2025
2dacd8b
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 16, 2025
0595318
implement missing methods
umutsoysalansys Apr 16, 2025
fddd6c2
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 16, 2025
81908d9
interference fix
umutsoysalansys Apr 17, 2025
c0dcca5
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 17, 2025
47479c4
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 17, 2025
be96550
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys Apr 17, 2025
4cad96a
precommit
umutsoysalansys Apr 17, 2025
6ce6e10
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 17, 2025
e90b1f5
doc fix
umutsoysalansys Apr 17, 2025
abe2353
decorator fix
umutsoysalansys Apr 17, 2025
f4e167d
doc fix
umutsoysalansys Apr 17, 2025
b4f930c
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 17, 2025
6a5c2d1
Update repair_tools.py
umutsoysalansys Apr 17, 2025
7e3bd01
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 17, 2025
63ce51e
docfix
umutsoysalansys Apr 17, 2025
088ed09
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys Apr 21, 2025
cac418a
doc fix
umutsoysalansys Apr 23, 2025
b4594f9
nits bits
umutsoysalansys Apr 23, 2025
53c09b3
bs
umutsoysalansys Apr 23, 2025
9c693bb
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 23, 2025
36d9136
bs
umutsoysalansys Apr 23, 2025
c2baffc
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 23, 2025
0b898dc
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys Apr 29, 2025
5a0f9f9
refactoring
umutsoysalansys Apr 30, 2025
4849d47
name
umutsoysalansys Apr 30, 2025
45a2403
Update repair_tools.py
umutsoysalansys Apr 30, 2025
5414cad
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 30, 2025
8646ad1
response refactor
umutsoysalansys Apr 30, 2025
56f5671
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Apr 30, 2025
2c650d5
further ref
umutsoysalansys Apr 30, 2025
984819e
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys Apr 30, 2025
10587e5
further refctrng
umutsoysalansys Apr 30, 2025
3e5589d
Update repair_tools.py
umutsoysalansys Apr 30, 2025
7e20d8e
blind push bc this test is not working in discovery
umutsoysalansys May 2, 2025
6b744f1
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 2, 2025
cc00bba
updates
umutsoysalansys May 2, 2025
0fe131b
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 2, 2025
7ad68f9
removal of unused files
umutsoysalansys May 2, 2025
cb9a20d
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 2, 2025
2d69f13
further simplifications
umutsoysalansys May 2, 2025
44ac1e4
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys May 2, 2025
68e1047
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 2, 2025
1b004b5
further simplifications
umutsoysalansys May 2, 2025
6d3d9b7
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys May 2, 2025
6116244
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 2, 2025
40f84ae
Update repair_tools.py
umutsoysalansys May 2, 2025
2fc6351
Merge branch 'feat/grpc-common-layer-refactoring' of https://github.c…
umutsoysalansys May 2, 2025
06e7fdf
Update src/ansys/geometry/core/_grpc/_services/base/repair_tools.py
umutsoysalansys May 6, 2025
966fbc4
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 6, 2025
38d0e04
Update src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py
umutsoysalansys May 6, 2025
2ae7674
Update src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py
umutsoysalansys May 6, 2025
1872350
Update src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py
umutsoysalansys May 6, 2025
a67f5df
Update src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py
umutsoysalansys May 6, 2025
f8e5454
Update src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py
umutsoysalansys May 6, 2025
b1e17da
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys May 6, 2025
c82e490
more refct
umutsoysalansys May 7, 2025
51e5c54
Merge branch 'main' into feat/grpc-common-layer-refactoring
umutsoysalansys May 7, 2025
c3e5c98
Update repair_tools.py
umutsoysalansys May 7, 2025
0362a17
Update repair_tools.py
umutsoysalansys May 7, 2025
8c49791
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] May 7, 2025
e9bd066
noqa
umutsoysalansys May 7, 2025
0504552
codality wtf
umutsoysalansys May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/1912.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repair tools refactoring
26 changes: 26 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from .base.measurement_tools import GRPCMeasurementToolsService
from .base.named_selection import GRPCNamedSelectionService
from .base.prepare_tools import GRPCPrepareToolsService
from .base.repair_tools import GRPCRepairToolsService


class _GRPCServices:
Expand Down Expand Up @@ -76,6 +77,7 @@ def __init__(self, channel: grpc.Channel, version: GeometryApiProtos | str | Non
self._dbu_application = None
self._named_selection = None
self._measurement_tools = None
self._repair_tools = None
self._prepare_tools = None
self._driving_dimensions = None
self._coordinate_systems = None
Expand Down Expand Up @@ -210,6 +212,30 @@ def measurement_tools(self) -> GRPCMeasurementToolsService:

return self._measurement_tools

@property
def repair_tools(self) -> GRPCRepairToolsService:
"""
Get the repair tools service for the specified version.

Returns
-------
RepairToolsServiceBase
The repair tools service for the specified version.
"""
if not self._repair_tools:
from .v0.repair_tools import GRPCRepairToolsServiceV0
from .v1.repair_tools import GRPCRepairToolsServiceV1

if self.version == GeometryApiProtos.V0:
self._repair_tools = GRPCRepairToolsServiceV0(self.channel)
elif self.version == GeometryApiProtos.V1: # pragma: no cover
# V1 is not implemented yet
self._repair_tools = GRPCRepairToolsServiceV1(self.channel)
else: # pragma: no cover
# This should never happen as the version is set in the constructor
raise ValueError(f"Unsupported version: {self.version}")
return self._repair_tools

@property
def prepare_tools(self) -> GRPCPrepareToolsService:
"""
Expand Down
124 changes: 124 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/base/repair_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module containing the repair tools service implementation (abstraction layer).

This module defines an abstract base class for a gRPC-based repair tools service.
The class provides a set of abstract methods for identifying and repairing various
geometry issues, such as split edges, extra edges, duplicate faces, and more.
"""

from abc import ABC, abstractmethod

import grpc


class GRPCRepairToolsService(ABC):
"""Abstract base class for gRPC-based repair tools service.

Parameters
----------
channel: grpc.Channel
The gRPC channel used to communicate with the service.
"""

def __init__(self, channel: grpc.Channel):
"""Initialize the gRPC repair tools service."""

@abstractmethod
def find_split_edges(self, **kwargs) -> dict:
"""Identify split edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_extra_edges(self, **kwargs) -> dict:
"""Identify extra edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_inexact_edges(self, **kwargs) -> dict:
"""Identify inexact edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_short_edges(self, **kwargs) -> dict:
"""Identify short edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_duplicate_faces(self, **kwargs) -> dict:
"""Identify duplicate faces in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_missing_faces(self, **kwargs) -> dict:
"""Identify missing faces in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_small_faces(self, **kwargs) -> dict:
"""Identify small faces in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_stitch_faces(self, **kwargs) -> dict:
"""Identify faces that can be stitched together in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_simplify(self, **kwargs) -> dict:
"""Identify areas in the geometry that can be simplified."""
pass # pragma: no cover

@abstractmethod
def find_interferences(self, **kwargs) -> dict:
"""Identify interferences in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_and_fix_short_edges(self, **kwargs) -> dict:
"""Identify and fix short edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_and_fix_extra_edges(self, **kwargs) -> dict:
"""Identify and fix extra edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_and_fix_split_edges(self, **kwargs) -> dict:
"""Identify and fix split edges in the geometry."""
pass # pragma: no cover

@abstractmethod
def find_and_fix_simplify(self, **kwargs) -> dict:
"""Identify and simplify areas in the geometry."""
pass # pragma: no cover

@abstractmethod
def inspect_geometry(self, **kwargs) -> dict:
"""Inspect the geometry for issues."""
pass # pragma: no cover

@abstractmethod
def repair_geometry(self, **kwargs) -> dict:
"""Repair the geometry by addressing identified issues."""
pass # pragma: no cover
Loading
Loading