mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-25 17:00:35 +05:00
Manage Min / Max for locate Subhapes
This commit is contained in:
parent
de9595d5e5
commit
5340b002d3
@ -69,8 +69,31 @@ def run(args_dict, progress_emitter):
|
||||
|
||||
sleep(1)
|
||||
|
||||
logging.warning('The algo script is not implemented! Return default values...')
|
||||
limits = [0.0, 100.0]
|
||||
geom_builder_types = { GEOM.EDGE : 'EDGE', GEOM.FACE : 'FACE', GEOM.SOLID : 'SOLID' }
|
||||
type_str = geom_builder_types[selection_level]
|
||||
shape_type = geompy.ShapeType[type_str]
|
||||
|
||||
logging.info('Computing Min / Max...')
|
||||
if type_str == "EDGE":
|
||||
basicProp = 0
|
||||
elif type_str == "FACE":
|
||||
basicProp = 1
|
||||
elif type_str == "SOLID":
|
||||
basicProp = 2
|
||||
else :
|
||||
logging.info("Problème avec la définition du type d'élément !")
|
||||
return False
|
||||
|
||||
lElements = geompy.SubShapeAll(source_solid, shape_type)
|
||||
minSize = 1e7
|
||||
maxSize = -1
|
||||
for element in lElements:
|
||||
size = geompy.BasicProperties(element)[basicProp]
|
||||
if size < minSize :
|
||||
minSize = size
|
||||
if size > maxSize :
|
||||
maxSize = size
|
||||
limits = [minSize, maxSize]
|
||||
|
||||
logging.info('Done.')
|
||||
progress_emitter.emit()
|
||||
|
Loading…
Reference in New Issue
Block a user