Skip to content

Commit c28e504

Browse files
utilizing get_raw_tessellation for regular body tessellate method
fixing inheritance issue for design/component tessellate
1 parent c4e0935 commit c28e504

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,18 +1333,8 @@ def tessellate( # noqa: D102
13331333

13341334
# cache tessellation
13351335
if not self._tessellation:
1336-
if tess_options is not None:
1337-
response = self._grpc_client.services.bodies.get_tesellation_with_options(
1338-
id=self.id,
1339-
options=tess_options,
1340-
)
1341-
else:
1342-
response = self._grpc_client.services.bodies.get_tesellation(
1343-
id=self.id,
1344-
backend_version=self._grpc_client.backend_version,
1345-
)
1346-
1347-
self._tessellation = response.get("tessellation")
1336+
response = self.get_raw_tessellation(tess_options)
1337+
self._tessellation = response
13481338

13491339
pdata = [tess.transform(transform, inplace=False) for tess in self._tessellation.values()]
13501340
comp = pv.MultiBlock(pdata)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ def insert_file(
10401040
@min_backend_version(26, 1, 0)
10411041
@check_input_types
10421042
@graphics_required
1043-
def tessellate(self, tess_options: TessellationOptions | None = None) -> dict:
1043+
def get_raw_tessellation(self, tess_options: TessellationOptions | None = None) -> dict:
10441044
"""Tessellate the entire design and return the geometry as triangles.
10451045
10461046
Parameters

tests/integration/test_tessellation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_get_design_tessellation(modeler: Modeler):
171171
box = design.extrude_sketch("box", Sketch().box(Point2D([0, 0]), 2, 2), 2)
172172
cyl = design.extrude_sketch("cylinder", Sketch().circle(Point2D([1, 0]), 0.5), 2)
173173

174-
design_tess = design.tessellate()
174+
design_tess = design.get_raw_tessellation()
175175
assert isinstance(design_tess, dict)
176176
assert len(design_tess) == 2 # Two bodies in the design
177177

@@ -199,7 +199,7 @@ def test_get_design_tessellation(modeler: Modeler):
199199
def test_get_body_raw_tessellation(modeler: Modeler):
200200
"""Test getting the raw tessellation from a body."""
201201
import pyvista as pv
202-
202+
203203
design = modeler.create_design("revolve_edges")
204204
box = design.extrude_sketch("box", Sketch().box(Point2D([0, 0]), 2, 2), 2)
205205
cylinder = design.extrude_sketch("cylinder", Sketch().circle(Point2D([1, 0]), 0.5), 2)

0 commit comments

Comments
 (0)