diff --git a/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py b/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py index 45125712..f86af187 100644 --- a/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py +++ b/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py @@ -434,7 +434,7 @@ def point_inside(solid): BBox = solid.optimalBoundingBox(False) box = [BBox.XMin, BBox.XMax, BBox.YMin, BBox.YMax, BBox.ZMin, BBox.ZMax] - boxes, centers = cut_box(box) + boxes, centers = divide_box(box) n = 0 while True: @@ -446,7 +446,7 @@ def point_inside(solid): subbox = [] centers = [] for b in boxes: - btab, ctab = cut_box(b) + btab, ctab = divide_box(b) subbox.extend(btab) centers.extend(ctab) boxes = subbox @@ -458,7 +458,7 @@ def point_inside(solid): # divide a box into 8 smaller boxes -def cut_box(Box): +def divide_box(Box): xmid = (Box[1] + Box[0]) * 0.5 ymid = (Box[3] + Box[2]) * 0.5 zmid = (Box[5] + Box[4]) * 0.5 diff --git a/src/geouned/GEOReverse/Modules/splitFunction.py b/src/geouned/GEOReverse/Modules/splitFunction.py index 99c4e8b3..dcfb44d3 100644 --- a/src/geouned/GEOReverse/Modules/splitFunction.py +++ b/src/geouned/GEOReverse/Modules/splitFunction.py @@ -163,7 +163,7 @@ def point_inside(solid): BBox = solid.optimalBoundingBox(False) box = [BBox.XMin, BBox.XMax, BBox.YMin, BBox.YMax, BBox.ZMin, BBox.ZMax] - boxes, centers = cut_box(box) + boxes, centers = divide_box(box) n = 0 while True: @@ -175,7 +175,7 @@ def point_inside(solid): subbox = [] centers = [] for b in boxes: - btab, ctab = cut_box(b) + btab, ctab = divide_box(b) subbox.extend(btab) centers.extend(ctab) boxes = subbox @@ -188,7 +188,7 @@ def point_inside(solid): # divide a box into 8 smaller boxes -def cut_box(Box): +def divide_box(Box): xmid = (Box[1] + Box[0]) * 0.5 ymid = (Box[3] + Box[2]) * 0.5 zmid = (Box[5] + Box[4]) * 0.5 diff --git a/src/geouned/GEOUNED/conversion/cell_definition.py b/src/geouned/GEOUNED/conversion/cell_definition.py index f67403cc..e0ab524d 100644 --- a/src/geouned/GEOUNED/conversion/cell_definition.py +++ b/src/geouned/GEOUNED/conversion/cell_definition.py @@ -856,7 +856,7 @@ def no_overlapping_cell(metaList, surfaces, options): CT = build_c_table_from_solids( box, (tuple(t_def.get_surfaces_numbers()), Surfs), - option="diag", + "diag", options=options, ) @@ -866,7 +866,7 @@ def no_overlapping_cell(metaList, surfaces, options): CT = build_c_table_from_solids( box, (tuple(new_def.get_surfaces_numbers()), Surfs), - option="full", + "full", options=options, ) diff --git a/src/geouned/GEOUNED/core.py b/src/geouned/GEOUNED/core.py index a8a4faf5..5f1ffa59 100644 --- a/src/geouned/GEOUNED/core.py +++ b/src/geouned/GEOUNED/core.py @@ -681,8 +681,8 @@ def start(self): if c.Definition.level == 0 or c.IsEnclosure: continue logger.info(f"simplify cell {c.__id__}") - Box = UF.get_box(c) - CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs), option="full") + Box = UF.get_box(c, self.options.enlargeBox) + CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs), "full", options=self.options) c.Definition.simplify(CT) c.Definition.clean() if type(c.Definition.elements) is bool: diff --git a/src/geouned/GEOUNED/utils/boolean_solids.py b/src/geouned/GEOUNED/utils/boolean_solids.py index 82591f76..be69ea97 100644 --- a/src/geouned/GEOUNED/utils/boolean_solids.py +++ b/src/geouned/GEOUNED/utils/boolean_solids.py @@ -239,7 +239,7 @@ def combine_diag_elements(d1, d2): return CTelement((0, 0, 1, 0)) -def build_c_table_from_solids(Box, SurfInfo, option, options): +def build_c_table_from_solids(Box, SurfInfo, simplification_mode, options): if type(SurfInfo) is dict: surfaces = SurfInfo @@ -260,7 +260,7 @@ def build_c_table_from_solids(Box, SurfInfo, option, options): surfaces[s].buildShape(Box.BoundBox) CTable = ConstraintTable() - if option == "diag": + if simplification_mode == "diag": CTable.diagonal = True else: CTable.diagonal = False @@ -270,7 +270,7 @@ def build_c_table_from_solids(Box, SurfInfo, option, options): # res,splitRegions = split_solid_fast(Box,Surfaces.get_surface(s1),True) CTable.add_element(s1, s1, CTelement(res, s1, s1)) - if option == "diag": + if simplification_mode == "diag": continue if splitRegions is None: continue # loop, no region to be split by s2 @@ -309,7 +309,7 @@ def build_c_table_from_solids(Box, SurfInfo, option, options): CTable.add_element(s1, s2, CTelement(val, s1, s2)) # if some surfaces don't cross the box some elements in Constraint table are not filled - if option != "diag": + if simplification_mode != "diag": CTable.fill_missing_elements() return CTable @@ -460,7 +460,7 @@ def point_inside(solid): BBox = solid.optimalBoundingBox(False) box = [BBox.XMin, BBox.XMax, BBox.YMin, BBox.YMax, BBox.ZMin, BBox.ZMax] - boxes, centers = cut_box(box) + boxes, centers = divide_box(box) n = 0 while True: @@ -472,7 +472,7 @@ def point_inside(solid): subbox = [] centers = [] for b in boxes: - btab, ctab = cut_box(b) + btab, ctab = divide_box(b) subbox.extend(btab) centers.extend(ctab) boxes = subbox @@ -515,7 +515,7 @@ def point_from_surface(solid): # divide a box into 8 smaller boxes -def cut_box(Box): +def divide_box(Box): xmid = (Box[1] + Box[0]) * 0.5 ymid = (Box[3] + Box[2]) * 0.5 zmid = (Box[5] + Box[4]) * 0.5 diff --git a/src/geouned/GEOUNED/void/void_box_class.py b/src/geouned/GEOUNED/void/void_box_class.py index b3d3ae9f..bc9a55af 100644 --- a/src/geouned/GEOUNED/void/void_box_class.py +++ b/src/geouned/GEOUNED/void/void_box_class.py @@ -271,7 +271,7 @@ def get_void_complementary(self, Surfaces, options, tolerances, numeric_format, surfaceDict = {} for i in surfList: surfaceDict[i] = Surfaces.get_surface(i) - CTable = build_c_table_from_solids(Box, surfaceDict, option=simplify, options=options) + CTable = build_c_table_from_solids(Box, surfaceDict, simplify, options=options) else: if res is True: return None, None