Skip to content

Commit 77adf4b

Browse files
Merge branch 'feat/stitch_bodies' of https://github.com/ansys/pyansys-geometry into feat/stitch_bodies
2 parents a46c65a + 5f87e61 commit 77adf4b

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump quarto-cli from 1.8.24 to 1.8.25

doc/changelog.d/2282.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Combine and merge bodies

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ doc = [
111111
"protobuf==6.32.1",
112112
"pygltflib==1.16.5",
113113
"pyvista[jupyter]==0.46.3",
114-
"quarto-cli==1.8.24",
114+
"quarto-cli==1.8.25",
115115
"requests==2.32.5",
116116
"scipy==1.15.3",
117117
"semver==3.0.4",

src/ansys/geometry/core/_grpc/_services/v0/bodies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,4 +904,4 @@ def combine_merge(self, **kwargs) -> dict: # noqa: D102
904904
_ = self.command_stub.CombineMergeBodies(request=request)
905905

906906
# Return the response - formatted as a dictionary
907-
return {}
907+
return {}

src/ansys/geometry/core/_grpc/_services/v1/bodies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def split_body(self, **kwargs) -> dict: # noqa: D102
203203
@protect_grpc
204204
def create_body_from_loft_profiles_with_guides(self, **kwargs) -> dict: # noqa: D102
205205
raise NotImplementedError
206-
206+
207207
@protect_grpc
208-
def combine_merge(self, **kwargs) -> dict: # noqa: D102
208+
def combine_merge(self, **kwargs) -> dict: # noqa: D102
209209
raise NotImplementedError

src/ansys/geometry/core/designer/body.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,10 @@ def unite(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False
818818
the united body is retained.
819819
"""
820820
return
821-
821+
822822
def combine_merge(self, other: Union["Body", list["Body"]]) -> None:
823823
"""Combine this body with another body or bodies, merging them into a single body.
824-
824+
825825
Parameters
826826
----------
827827
other : Union[Body, list[Body]]
@@ -1373,7 +1373,7 @@ def remove_faces(self, selection: Face | Iterable[Face], offset: Real) -> bool:
13731373
self._grpc_client.log.warning(f"Failed to remove faces from body {self.id}.")
13741374

13751375
return result.success
1376-
1376+
13771377
@min_backend_version(25, 2, 0)
13781378
@check_input_types
13791379
def combine_merge(self, other: Union["Body", list["Body"]]) -> None: # noqa: D102
@@ -1411,7 +1411,7 @@ def unite(self, other: Union["Body", Iterable["Body"]], keep_other: bool = False
14111411
raise NotImplementedError(
14121412
"MasterBody does not implement Boolean methods. Call this method on a body instead."
14131413
)
1414-
1414+
14151415
def __repr__(self) -> str:
14161416
"""Represent the master body as a string."""
14171417
lines = [f"ansys.geometry.core.designer.MasterBody {hex(id(self))}"]

src/ansys/geometry/core/designer/geometry_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,4 +1832,4 @@ def revolve_edges(
18321832
)
18331833

18341834
design = get_design_from_edge(edges[0])
1835-
design._update_design_inplace()
1835+
design._update_design_inplace()

tests/integration/test_design.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3910,6 +3910,7 @@ def test_write_body_facets_on_save(
39103910
missing = expected_files - namelist
39113911
assert not missing
39123912

3913+
39133914
def test_combine_merge(modeler: Modeler):
39143915
design = modeler.create_design("combine_merge")
39153916
box1 = design.extrude_sketch("box1", Sketch().box(Point2D([0, 0]), 1, 1), 1)
@@ -3931,4 +3932,4 @@ def test_combine_merge(modeler: Modeler):
39313932
box1.combine_merge([box3])
39323933
design._update_design_inplace()
39333934
assert len(design.bodies) == 1
3934-
assert box1.volume.m == pytest.approx(Quantity(2.5, UNITS.m**3).m, rel=1e-6, abs=1e-8)
3935+
assert box1.volume.m == pytest.approx(Quantity(2.5, UNITS.m**3).m, rel=1e-6, abs=1e-8)

0 commit comments

Comments
 (0)