Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/1623.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create a full fillet between multiple faces
30 changes: 29 additions & 1 deletion src/ansys/geometry/core/designer/geometry_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from typing import TYPE_CHECKING, List, Union

from ansys.api.geometry.v0.commands_pb2 import ChamferRequest, FilletRequest
from ansys.api.geometry.v0.commands_pb2 import ChamferRequest, FilletRequest, FullFilletRequest
from ansys.api.geometry.v0.commands_pb2_grpc import CommandsStub
from ansys.geometry.core.connection import GrpcClient
from ansys.geometry.core.errors import protect_grpc
Expand Down Expand Up @@ -125,3 +125,31 @@ def fillet(
)

return result.success

@protect_grpc
@min_backend_version(25, 2, 0)
def full_fillet(self, faces: List["Face"]) -> bool:
"""Create a full fillet betweens a collection of faces.

Parameters
----------
faces : List[Face]
Faces to round.

Returns
-------
bool
``True`` when successful, ``False`` when failed.
"""
from ansys.geometry.core.designer.face import Face

check_type_all_elements_in_iterable(faces, Face)

for face in faces:
face.body._reset_tessellation_cache()

result = self._commands_stub.FullFillet(
FullFilletRequest(faces=[face._grpc_id for face in faces])
)

return result.success
17 changes: 17 additions & 0 deletions tests/integration/test_geometry_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,20 @@ def test_fillet(modeler: Modeler):
assert body2.volume.m == pytest.approx(
Quantity(0.9937293491873294, UNITS.m**3).m, rel=1e-6, abs=1e-8
)


def test_full_fillet(modeler: Modeler):
"""Test full fillet on faces."""
design = modeler.create_design("full_fillet")

body = design.extrude_sketch("box", Sketch().box(Point2D([0, 0]), 1, 1), 1)
assert len(body.faces) == 6
assert len(body.edges) == 12
assert body.volume.m == pytest.approx(Quantity(1, UNITS.m**3).m, rel=1e-6, abs=1e-8)

modeler.geometry_commands.full_fillet(body.faces[0:3])
assert len(body.faces) == 6
assert len(body.edges) == 12
assert body.volume.m == pytest.approx(
Quantity(0.8926990816987, UNITS.m**3).m, rel=1e-6, abs=1e-8
)
Loading