Skip to content
Open
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/1192.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix as_polydata to remove duplicate entities
18 changes: 12 additions & 6 deletions src/ansys/meshing/prime/core/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,21 @@ def update_pd(self, part_ids) -> Dict[int, Dict[str, list[(pv.PolyData, Part)]]]
splines = part.get_splines()
part_polydata = {}
face_polydata_list = [
self.get_face_polydata(part_id, face_fet_result, j)
for face_fet_result in facet_result.face_connectivity_result_per_part
for j in range(0, len(face_fet_result.face_zonelet_ids))
self.get_face_polydata(
part_id, facet_result.face_connectivity_result_per_part[i], j
)
for j in range(
0, len(facet_result.face_connectivity_result_per_part[i].face_zonelet_ids)
)
]
Comment on lines 522 to 529
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression facet_result.face_connectivity_result_per_part[i] is accessed twice per iteration. Consider storing it in a variable before the list comprehension to avoid redundant indexing operations.

Copilot uses AI. Check for mistakes.

edge_polydata_list = [
self.get_edge_polydata(part_id, edge_facet_result, j)
for edge_facet_result in facet_result.edge_connectivity_result_per_part
for j in range(0, len(edge_facet_result.edge_zonelet_ids))
self.get_edge_polydata(
part_id, facet_result.edge_connectivity_result_per_part[i], j
)
for j in range(
0, len(facet_result.edge_connectivity_result_per_part[i].edge_zonelet_ids)
)
]
Comment on lines 531 to 538
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression facet_result.edge_connectivity_result_per_part[i] is accessed twice per iteration. Consider storing it in a variable before the list comprehension to avoid redundant indexing operations.

Copilot uses AI. Check for mistakes.

spline_cp_polydata_list = [self.get_spline_cp_polydata(part_ids[i], j) for j in splines]
Expand Down
Loading