@@ -568,7 +568,7 @@ def copy(self, parent: "Component", name: str = None) -> "Body":
568568
569569 @abstractmethod
570570 def tessellate (
571- self , merge : bool = False , tessellation_options : TessellationOptions = None
571+ self , merge : bool = False , tess_options : TessellationOptions | None = None
572572 ) -> Union ["PolyData" , "MultiBlock" ]:
573573 """Tessellate the body and return the geometry as triangles.
574574
@@ -578,7 +578,7 @@ def tessellate(
578578 Whether to merge the body into a single mesh. When ``False`` (default), the
579579 number of triangles are preserved and only the topology is merged.
580580 When ``True``, the individual faces of the tessellation are merged.
581- tessellation_options : TessellationOptions, default: None
581+ tess_options : TessellationOptions | None , default: None
582582 A set of options to determine the tessellation quality.
583583
584584 Returns
@@ -1276,14 +1276,22 @@ def tessellate( # noqa: D102
12761276 self ,
12771277 merge : bool = False ,
12781278 transform : Matrix44 = IDENTITY_MATRIX44 ,
1279- tess_options : TessellationOptions = None ,
1279+ tess_options : TessellationOptions | None = None ,
12801280 ) -> Union ["PolyData" , "MultiBlock" ]:
12811281 # lazy import here to improve initial module load time
12821282 import pyvista as pv
12831283
12841284 if not self .is_alive :
12851285 return pv .PolyData () if merge else pv .MultiBlock ()
12861286
1287+ # If the server does not support tessellation options, ignore them
1288+ if tess_options is not None and self ._grpc_client .backend_version < (25 , 2 , 0 ):
1289+ self ._grpc_client .log .warning (
1290+ "Tessellation options are not supported by server"
1291+ f" version { self ._grpc_client .backend_version } . Ignoring options."
1292+ )
1293+ tess_options = None
1294+
12871295 self ._grpc_client .log .debug (f"Requesting tessellation for body { self .id } ." )
12881296
12891297 # cache tessellation
@@ -1319,7 +1327,11 @@ def tessellate( # noqa: D102
13191327 str (face_id ): tess_to_pd (face_tess )
13201328 for face_id , face_tess in resp .face_tessellation .items ()
13211329 }
1322- except Exception :
1330+ except Exception as err :
1331+ # Streaming is not supported in older versions...
1332+ if self ._grpc_client .backend_version < (25 , 2 , 0 ):
1333+ raise err
1334+
13231335 tessellation_map = {}
13241336 request = GetTessellationRequest (self ._grpc_id )
13251337 for response in self ._bodies_stub .GetTessellationStream (request ):
@@ -1854,7 +1866,7 @@ def copy(self, parent: "Component", name: str = None) -> "Body": # noqa: D102
18541866
18551867 @ensure_design_is_active
18561868 def tessellate ( # noqa: D102
1857- self , merge : bool = False , tess_options : TessellationOptions = None
1869+ self , merge : bool = False , tess_options : TessellationOptions | None = None
18581870 ) -> Union ["PolyData" , "MultiBlock" ]:
18591871 return self ._template .tessellate (
18601872 merge , self .parent_component .get_world_transform (), tess_options
0 commit comments