forked from romanzes637/gmsh_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
complex_union.py
32 lines (28 loc) · 988 Bytes
/
complex_union.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import json
import gmsh
from boolean import complex_self
from complex import Complex
from support import check_file
class ComplexUnion(Complex):
def __init__(self, factory, inputs):
from complex_factory import ComplexFactory
if factory == 'occ':
factory_object = gmsh.model.occ
else:
factory_object = gmsh.model.geo
primitives = list()
for i in inputs:
result = check_file(i)
with open(result['path']) as f:
input_data = json.load(f)
input_data['arguments']['factory'] = factory
c = ComplexFactory.new(input_data)
primitives.extend(c.primitives)
Complex.__init__(self, factory, primitives)
print('Synchronize')
factory_object.synchronize()
print('Evaluate')
self.evaluate_coordinates()
self.evaluate_bounding_box()
print('Self Boolean')
complex_self(factory_object, self)