Avoid using GEOM operations directly, not via geompy

This commit is contained in:
eap 2015-02-17 17:51:03 +03:00
parent 7cb44e9fe0
commit c30422ed1f

View File

@ -36,10 +36,6 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
th = 4.0 th = 4.0
### BlocksOp ###
BlocksOp = geompy.BlocksOp
### Basic points and directions ### ### Basic points and directions ###
p0 = geompy.MakeVertex(0., 0., 0.) p0 = geompy.MakeVertex(0., 0., 0.)
@ -279,17 +275,21 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
Face22h = geompy.GetOppositeFace(Block2h, Face21h) Face22h = geompy.GetOppositeFace(Block2h, Face21h)
id_face22h = geompy.addToStudyInFather(Block2h, Face22h, "Face 2") id_face22h = geompy.addToStudyInFather(Block2h, Face22h, "Face 2")
Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face21h]) try:
if BlocksOp.IsDone() == 0: Block3h = geompy.GetBlockByParts(Handle, [Face11h, Face21h])
Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face22h]) except RuntimeError:
if BlocksOp.IsDone() == 0: try:
Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face21h]) Block3h = geompy.GetBlockByParts(Handle, [Face11h, Face22h])
if BlocksOp.IsDone() == 0: except RuntimeError:
Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face22h]) try:
if BlocksOp.IsDone() == 0: Block3h = geompy.GetBlockByParts(Handle, [Face12h, Face21h])
print "ERROR: BlocksOp.GetBlockByParts() failed : ", BlocksOp.GetErrorCode() except RuntimeError:
else: try:
id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle") Block3h = geompy.GetBlockByParts(Handle, [Face12h, Face22h])
except RuntimeError:
print "ERROR: BlocksOp.GetBlockByParts() failed : ", geompy.BlocksOp.GetErrorCode()
else:
id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle")
### The whole shape ### ### The whole shape ###
@ -299,7 +299,7 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
### Check the Spanner ### ### Check the Spanner ###
isCompOfBlocks6 = BlocksOp.CheckCompoundOfBlocks(Spanner) isCompOfBlocks6 = geompy.CheckCompoundOfBlocks(Spanner)
if isCompOfBlocks6 == 0: if isCompOfBlocks6 == 0:
print "Spanner is not a compound of hexahedral solids" print "Spanner is not a compound of hexahedral solids"
(NonBlocks, NonQuads) = geompy.GetNonBlocks(Spanner) (NonBlocks, NonQuads) = geompy.GetNonBlocks(Spanner)