3535@pytest .mark .skipif (
3636 not are_graphics_available (), reason = "Skipping due to graphics requirements missing"
3737)
38- @pytest .mark .skip (reason = "Skipping to promote new CS package" )
3938def test_body_tessellate (modeler : Modeler ):
4039 """Test the body tessellation."""
4140 sketch_1 = Sketch ()
@@ -75,33 +74,59 @@ def test_body_tessellate(modeler: Modeler):
7574 blocks_2 = body_2 .tessellate ()
7675 assert "MultiBlock" in str (blocks_2 )
7776 assert blocks_2 .n_blocks == 3
78- if not BackendType .is_core_service (modeler .client .backend_type ):
79- assert blocks_2 .bounds == pytest .approx (
80- [0.019999999999999997 , 0.04 , 0.02000513783799312 , 0.03999486216200688 , 0.0 , 0.03 ],
81- rel = 1e-6 ,
82- abs = 1e-8 ,
83- )
77+ if modeler ._grpc_client .backend_version < (26 , 1 , 0 ):
78+ if not BackendType .is_core_service (modeler .client .backend_type ):
79+ assert blocks_2 .bounds == pytest .approx (
80+ [0.019999999999999997 , 0.04 , 0.020151922469877917 , 0.03984807753012208 , 0.0 , 0.03 ],
81+ rel = 1e-6 ,
82+ abs = 1e-8 ,
83+ )
84+ else :
85+ assert blocks_2 .bounds == pytest .approx (
86+ [0.019999999999999997 , 0.04 , 0.020151922469877917 , 0.03984807753012208 , 0.0 , 0.03 ],
87+ rel = 1e-6 ,
88+ abs = 1e-8 ,
89+ )
8490 else :
85- assert blocks_2 .bounds == pytest .approx (
86- [0.019999999999999997 , 0.04 , 0.02000513783799312 , 0.03999486216200688 , 0.0 , 0.03 ],
87- rel = 1e-6 ,
88- abs = 1e-8 ,
89- )
91+ if not BackendType .is_core_service (modeler .client .backend_type ):
92+ assert blocks_2 .bounds == pytest .approx (
93+ [0.019999999999999997 , 0.04 , 0.02000513783799312 , 0.03999486216200688 , 0.0 , 0.03 ],
94+ rel = 1e-6 ,
95+ abs = 1e-8 ,
96+ )
97+ else :
98+ assert blocks_2 .bounds == pytest .approx (
99+ [0.019999999999999997 , 0.04 , 0.02000513783799312 , 0.03999486216200688 , 0.0 , 0.03 ],
100+ rel = 1e-6 ,
101+ abs = 1e-8 ,
102+ )
90103
91104 assert blocks_2 .center == pytest .approx ([0.03 , 0.03 , 0.015 ], rel = 1e-6 , abs = 1e-8 )
92105
93106 # Tessellate the body merging the individual faces
94107 mesh_2 = body_2 .tessellate (merge = True )
95- if not BackendType .is_core_service (modeler .client .backend_type ):
96- assert "PolyData" in str (mesh_2 )
97- assert mesh_2 .n_cells == 392
98- assert mesh_2 .n_points == 396
99- assert mesh_2 .n_arrays == 0
108+ if modeler ._grpc_client .backend_version < (26 , 1 , 0 ):
109+ if not BackendType .is_core_service (modeler .client .backend_type ):
110+ assert "PolyData" in str (mesh_2 )
111+ assert mesh_2 .n_cells == 72
112+ assert mesh_2 .n_points == 76
113+ assert mesh_2 .n_arrays == 0
114+ else :
115+ assert "PolyData" in str (mesh_2 )
116+ assert mesh_2 .n_cells == 72
117+ assert mesh_2 .n_points == 76
118+ assert mesh_2 .n_arrays == 0
100119 else :
101- assert "PolyData" in str (mesh_2 )
102- assert mesh_2 .n_cells == 392
103- assert mesh_2 .n_points == 396
104- assert mesh_2 .n_arrays == 0
120+ if not BackendType .is_core_service (modeler .client .backend_type ):
121+ assert "PolyData" in str (mesh_2 )
122+ assert mesh_2 .n_cells == 392
123+ assert mesh_2 .n_points == 396
124+ assert mesh_2 .n_arrays == 0
125+ else :
126+ assert "PolyData" in str (mesh_2 )
127+ assert mesh_2 .n_cells == 392
128+ assert mesh_2 .n_points == 396
129+ assert mesh_2 .n_arrays == 0
105130
106131 # Make sure instance body tessellation is the same as original
107132 comp_1_instance = design .add_component ("Component_1_Instance" , comp_1 )
@@ -176,7 +201,6 @@ def test_body_tessellate_with_edges(modeler: Modeler):
176201@pytest .mark .skipif (
177202 not are_graphics_available (), reason = "Skipping due to graphics requirements missing"
178203)
179- @pytest .mark .skip (reason = "Skipping to promote new CS package" )
180204def test_component_tessellate (modeler : Modeler ):
181205 """Test the component tessellation."""
182206 # Create a sketch
@@ -200,24 +224,44 @@ def test_component_tessellate(modeler: Modeler):
200224 mesh = comp .tessellate ()
201225 comp .plot ()
202226 assert "PolyData" in str (mesh )
203- if not BackendType .is_core_service (modeler .client .backend_type ):
204- assert mesh .n_cells == 976
205- assert mesh .n_arrays == 0
206- assert mesh .n_points == 996
207- assert mesh .bounds == pytest .approx (
208- [- 25.0 , 25.0 , - 24.991140278086316 , 24.991140278086316 , 0.0 , 20.0 ],
209- rel = 1e-6 ,
210- abs = 1e-8 ,
211- )
227+ if modeler ._grpc_client .backend_version < (26 , 1 , 0 ):
228+ if not BackendType .is_core_service (modeler .client .backend_type ):
229+ assert mesh .n_cells == 3280
230+ assert mesh .n_arrays == 0
231+ assert mesh .n_points == 3300
232+ assert mesh .bounds == pytest .approx (
233+ [- 25.0 , 25.0 , - 24.999251562526105 , 24.999251562526105 , 0.0 , 20.0 ],
234+ rel = 1e-6 ,
235+ abs = 1e-8 ,
236+ )
237+ else :
238+ assert mesh .n_cells == 3280
239+ assert mesh .n_arrays == 0
240+ assert mesh .n_points == 3300
241+ assert mesh .bounds == pytest .approx (
242+ [- 25.0 , 25.0 , - 24.999251562526105 , 24.999251562526105 , 0.0 , 20.0 ],
243+ rel = 1e-6 ,
244+ abs = 1e-8 ,
245+ )
212246 else :
213- assert mesh .n_cells == 976
214- assert mesh .n_arrays == 0
215- assert mesh .n_points == 996
216- assert mesh .bounds == pytest .approx (
217- [- 25.0 , 25.0 , - 24.991140278086316 , 24.991140278086316 , 0.0 , 20.0 ],
218- rel = 1e-6 ,
219- abs = 1e-8 ,
220- )
247+ if not BackendType .is_core_service (modeler .client .backend_type ):
248+ assert mesh .n_cells == 976
249+ assert mesh .n_arrays == 0
250+ assert mesh .n_points == 996
251+ assert mesh .bounds == pytest .approx (
252+ [- 25.0 , 25.0 , - 24.991140278086316 , 24.991140278086316 , 0.0 , 20.0 ],
253+ rel = 1e-6 ,
254+ abs = 1e-8 ,
255+ )
256+ else :
257+ assert mesh .n_cells == 976
258+ assert mesh .n_arrays == 0
259+ assert mesh .n_points == 996
260+ assert mesh .bounds == pytest .approx (
261+ [- 25.0 , 25.0 , - 24.991140278086316 , 24.991140278086316 , 0.0 , 20.0 ],
262+ rel = 1e-6 ,
263+ abs = 1e-8 ,
264+ )
221265
222266
223267def test_get_design_tessellation (modeler : Modeler ):
0 commit comments