Skip to content

Commit a2876b6

Browse files
authored
Merge branch 'main' into chore/v1_impl_cleanup
2 parents 64110c1 + 6a57201 commit a2876b6

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Build: bump numpydoc from 1.9.0 to 1.10.0 in the docs-deps group
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Chore: v1 fix imprint curves

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ doc = [
8282
"nbconvert==7.16.6",
8383
"nbsphinx==0.9.8",
8484
"notebook==7.5.0",
85-
"numpydoc==1.9.0",
85+
"numpydoc==1.10.0",
8686
"pdf2image==1.17.0",
8787
"quarto-cli==1.8.25",
8888
"sphinx==8.2.3",

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,14 @@ def imprint_curves(self, **kwargs) -> dict: # noqa: D102
12321232
ImprintCurvesRequestData,
12331233
)
12341234

1235+
# Convert sketch and trimmed curves to gRPC format
1236+
sketch = kwargs["sketch"]
1237+
curves = (
1238+
from_sketch_shapes_to_grpc_geometries(sketch.plane, sketch.edges, sketch.faces)
1239+
if sketch
1240+
else None
1241+
)
1242+
12351243
# Convert trimmed curves to gRPC format
12361244
trimmed_curves = []
12371245
if kwargs.get("tc"):
@@ -1242,17 +1250,36 @@ def imprint_curves(self, **kwargs) -> dict: # noqa: D102
12421250
request_data=[
12431251
ImprintCurvesRequestData(
12441252
body_ids=build_grpc_id(kwargs["id"]),
1253+
curves=curves,
12451254
face_ids=[build_grpc_id(id) for id in kwargs["face_ids"]],
1255+
plane=from_plane_to_grpc_plane(sketch.plane) if sketch else None,
12461256
trimmed_curves=trimmed_curves,
12471257
)
12481258
]
12491259
)
12501260

12511261
# Call the gRPC service
1252-
_ = self.edit_stub.ImprintCurves(request=request)
1262+
response = self.edit_stub.ImprintCurves(request=request).response_data[0]
12531263

12541264
# Return the response - formatted as a dictionary
1255-
return {}
1265+
return {
1266+
"edges": [
1267+
{
1268+
"id": edge.id,
1269+
"curve_type": edge.curve_type,
1270+
"is_reversed": edge.is_reversed,
1271+
}
1272+
for edge in response.created_entities.edges
1273+
],
1274+
"faces": [
1275+
{
1276+
"id": face.id,
1277+
"surface_type": face.surface_type,
1278+
"is_reversed": face.is_reversed,
1279+
}
1280+
for face in response.created_entities.faces
1281+
],
1282+
}
12561283

12571284
@protect_grpc
12581285
def project_curves(self, **kwargs) -> dict: # noqa: D102

0 commit comments

Comments
 (0)