Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4e3df20
beam service implemented
jacobrkerstetter Sep 10, 2025
cdbf47a
model_tools implemented
jacobrkerstetter Sep 10, 2025
96693f5
extrude faces/edges implemented
jacobrkerstetter Sep 11, 2025
1c8b496
patterns implemented and tested
jacobrkerstetter Sep 11, 2025
b050f16
moved face related geometry commands
jacobrkerstetter Sep 16, 2025
f1418d7
more face/edge commands
jacobrkerstetter Sep 16, 2025
d179f1b
assembly controls and round info
jacobrkerstetter Sep 17, 2025
69eeee7
final commands
jacobrkerstetter Sep 17, 2025
fb0dd89
Merge branch 'main' of https://github.com/ansys/pyansys-geometry into…
jacobrkerstetter Sep 17, 2025
efbb4d3
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Sep 17, 2025
0f02715
chore: adding changelog file 2234.added.md [dependabot-skip]
pyansys-ci-bot Sep 17, 2025
c2f2d71
Merge branch 'main' of https://github.com/ansys/pyansys-geometry into…
jacobrkerstetter Sep 18, 2025
53e2d4e
Merge branch 'main' into feat/geometry_commands_restructure
RobPasMue Sep 23, 2025
dbc6c19
beams fixes from comments on PR
jacobrkerstetter Sep 23, 2025
951bd99
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Sep 23, 2025
cd2a834
comment fix pt 2
jacobrkerstetter Sep 24, 2025
1ac9c0d
Merge branch 'main' into feat/geometry_commands_restructure
jacobrkerstetter Sep 24, 2025
7e7aa2b
fixes round 3
jacobrkerstetter Sep 24, 2025
926d4e2
Merge branch 'feat/geometry_commands_restructure' of https://github.c…
jacobrkerstetter Sep 24, 2025
c0efb27
Merge branch 'main' into feat/geometry_commands_restructure
jacobrkerstetter Sep 25, 2025
856a448
more comment fixes
jacobrkerstetter Sep 25, 2025
3a9118f
Merge branch 'main' of https://github.com/ansys/pyansys-geometry into…
jacobrkerstetter Sep 25, 2025
d97068e
fixing indent errors
jacobrkerstetter Sep 25, 2025
2295eeb
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Sep 25, 2025
0c78828
Merge branch 'main' into feat/geometry_commands_restructure
RobPasMue Sep 25, 2025
2c147db
reset image cache
jacobrkerstetter Sep 25, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
ANSRV_GEO_PORT: 700
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
GEO_CONT_NAME: ans_geo
RESET_IMAGE_CACHE: 6
RESET_IMAGE_CACHE: 7
IS_WORKFLOW_RUNNING: True
ARTIFACTORY_VERSION: v261

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/2234.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move geometry commands to versioned architecture
140 changes: 140 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@

from .._version import GeometryApiProtos, set_proto_version
from .base.admin import GRPCAdminService
from .base.assembly_controls import GRPCAssemblyControlsService
from .base.beams import GRPCBeamsService
from .base.bodies import GRPCBodyService
from .base.commands import GRPCCommandsService
from .base.coordinate_systems import GRPCCoordinateSystemService
from .base.dbuapplication import GRPCDbuApplicationService
from .base.designs import GRPCDesignsService
Expand All @@ -33,8 +36,10 @@
from .base.faces import GRPCFacesService
from .base.materials import GRPCMaterialsService
from .base.measurement_tools import GRPCMeasurementToolsService
from .base.model_tools import GRPCModelToolsService
from .base.named_selection import GRPCNamedSelectionService
from .base.parts import GRPCPartsService
from .base.patterns import GRPCPatternsService
from .base.prepare_tools import GRPCPrepareToolsService
from .base.repair_tools import GRPCRepairToolsService

Expand Down Expand Up @@ -78,7 +83,10 @@ def __init__(self, channel: grpc.Channel, version: GeometryApiProtos | str | Non

# Lazy load all the services
self._admin = None
self._assembly_controls = None
self._beams = None
self._bodies = None
self._commands = None
self._coordinate_systems = None
self._dbu_application = None
self._designs = None
Expand All @@ -87,8 +95,10 @@ def __init__(self, channel: grpc.Channel, version: GeometryApiProtos | str | Non
self._faces = None
self._materials = None
self._measurement_tools = None
self._model_tools = None
self._named_selection = None
self._parts = None
self._patterns = None
self._prepare_tools = None
self._repair_tools = None

Expand Down Expand Up @@ -118,6 +128,58 @@ def admin(self) -> GRPCAdminService:

return self._admin

@property
def assembly_controls(self) -> GRPCAssemblyControlsService:
"""
Get the assembly controls service for the specified version.

Returns
-------
GRPCAssemblyControlsService
The assembly controls service for the specified version.
"""
if not self._assembly_controls:
# Import the appropriate assembly controls service based on the version
from .v0.assembly_controls import GRPCAssemblyControlsServiceV0
from .v1.assembly_controls import GRPCAssemblyControlsServiceV1

if self.version == GeometryApiProtos.V0:
self._assembly_controls = GRPCAssemblyControlsServiceV0(self.channel)
elif self.version == GeometryApiProtos.V1: # pragma: no cover
# V1 is not implemented yet
self._assembly_controls = GRPCAssemblyControlsServiceV1(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._assembly_controls

@property
def beams(self) -> GRPCBeamsService:
"""
Get the Beams service for the specified version.

Returns
-------
GRPCBeamsService
The Beams service for the specified version.
"""
if not self._beams:
# Import the appropriate Beams service based on the version
from .v0.beams import GRPCBeamsServiceV0
from .v1.beams import GRPCBeamsServiceV1

if self.version == GeometryApiProtos.V0:
self._beams = GRPCBeamsServiceV0(self.channel)
elif self.version == GeometryApiProtos.V1: # pragma: no cover
# V1 is not implemented yet
self._beams = GRPCBeamsServiceV1(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._beams

@property
def bodies(self) -> GRPCBodyService:
"""
Expand All @@ -144,6 +206,32 @@ def bodies(self) -> GRPCBodyService:

return self._bodies

@property
def commands(self) -> GRPCCommandsService:
"""
Get the commands service for the specified version.

Returns
-------
GRPCCommandsService
The commands service for the specified version.
"""
if not self._commands:
# Import the appropriate commands service based on the version
from .v0.commands import GRPCCommandsServiceV0
from .v1.commands import GRPCCommandsServiceV1

if self.version == GeometryApiProtos.V0:
self._commands = GRPCCommandsServiceV0(self.channel)
elif self.version == GeometryApiProtos.V1: # pragma: no cover
# V1 is not implemented yet
self._commands = GRPCCommandsServiceV1(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._commands

@property
def coordinate_systems(self) -> GRPCCoordinateSystemService:
"""
Expand Down Expand Up @@ -352,6 +440,32 @@ def measurement_tools(self) -> GRPCMeasurementToolsService:

return self._measurement_tools

@property
def model_tools(self) -> GRPCModelToolsService:
"""
Get the model tools service for the specified version.

Returns
-------
GRPCModelToolsService
The model tools service for the specified version.
"""
if not self._model_tools:
# Import the appropriate model tools service based on the version
from .v0.model_tools import GRPCModelToolsServiceV0
from .v1.model_tools import GRPCModelToolsServiceV1

if self.version == GeometryApiProtos.V0:
self._model_tools = GRPCModelToolsServiceV0(self.channel)
elif self.version == GeometryApiProtos.V1:
# V1 is not implemented yet
self._model_tools = GRPCModelToolsServiceV1(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._model_tools

@property
def named_selection(self) -> GRPCNamedSelectionService:
"""
Expand Down Expand Up @@ -404,6 +518,32 @@ def parts(self) -> GRPCPartsService:

return self._parts

@property
def patterns(self) -> GRPCPatternsService:
"""
Get the patterns service for the specified version.

Returns
-------
GRPCPatternsService
The patterns service for the specified version.
"""
if not self._patterns:
# Import the appropriate patterns service based on the version
from .v0.patterns import GRPCPatternsServiceV0
from .v1.patterns import GRPCPatternsServiceV1

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

return self._patterns

@property
def prepare_tools(self) -> GRPCPrepareToolsService:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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 assembly controls service implementation (abstraction layer)."""

from abc import ABC, abstractmethod

import grpc


class GRPCAssemblyControlsService(ABC): # pragma: no cover
"""Assembly controls service for gRPC communication with the Geometry server.

Parameters
----------
channel : grpc.Channel
The gRPC channel to the server.
"""

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCAssemblyControls class."""
pass

@abstractmethod
def create_align_condition(self, **kwargs) -> dict:
"""Create an align condition between two geometry objects."""
pass

@abstractmethod
def create_tangent_condition(self, **kwargs) -> dict:
"""Create a tangent condition between two geometry objects."""
pass

@abstractmethod
def create_orient_condition(self, **kwargs) -> dict:
"""Create an orient condition between two geometry objects."""
pass
55 changes: 55 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/base/beams.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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 beams service implementation (abstraction layer)."""

from abc import ABC, abstractmethod

import grpc


class GRPCBeamsService(ABC): # pragma: no cover
"""Beams service for gRPC communication with the Geometry server.

Parameters
----------
channel : grpc.Channel
The gRPC channel to the server.
"""

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCBeamsService class."""
pass

@abstractmethod
def create_beam_segments(self, **kwargs) -> dict:
"""Create beam segments."""
pass

@abstractmethod
def create_descriptive_beam_segments(self, **kwargs) -> dict:
"""Create descriptive beam segments."""
pass

@abstractmethod
def delete_beam(self, **kwargs) -> dict:
"""Delete a beam."""
pass
5 changes: 5 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/base/bodies.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def boolean(self, **kwargs) -> dict:
"""Boolean operation."""
pass

@abstractmethod
def split_body(self, **kwargs) -> dict:
"""Split a body."""
pass

@abstractmethod
def create_body_from_loft_profiles_with_guides(self, **kwargs) -> dict:
"""Create a body from loft profiles with guides."""
Expand Down
45 changes: 45 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/base/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 commands service implementation (abstraction layer)."""

from abc import ABC, abstractmethod

import grpc


class GRPCCommandsService(ABC): # pragma: no cover
"""Commands service for gRPC communication with the Geometry server.

Parameters
----------
channel : grpc.Channel
The gRPC channel to the server.
"""

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCCommandsService class."""
pass

@abstractmethod
def set_name(self, **kwargs) -> dict:
"""Set the name of an object."""
pass
Loading
Loading