Skip to content

Commit a159f21

Browse files
committed
fixed planar_face_tolerance context bug
1 parent 34ecc84 commit a159f21

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

flow360/component/simulation/validation/validation_context.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,16 @@ def _get_global_bounding_box(cls, param_as_dict: dict):
226226

227227
@classmethod
228228
def _get_planar_face_tolerance(cls, param_as_dict: dict):
229-
planar_face_tolerance = get_value_with_path(
230-
param_as_dict, ["meshing", "defaults", "planar_face_tolerance"]
231-
)
229+
planar_face_tolerance = None
230+
if "meshing" in param_as_dict and param_as_dict["meshing"]:
231+
if param_as_dict["meshing"]["type"] == "MeshingParams":
232+
planar_face_tolerance = get_value_with_path(
233+
param_as_dict, ["meshing", "defaults", "planar_face_tolerance"]
234+
)
235+
else:
236+
planar_face_tolerance = get_value_with_path(
237+
param_as_dict, ["meshing", "volume_meshing", "planar_face_tolerance"]
238+
)
232239
return planar_face_tolerance
233240

234241
@classmethod

0 commit comments

Comments
 (0)