Fix: strips part

This commit is contained in:
L-Nafaryus 2021-06-18 23:38:59 +05:00
parent 7e1d16091a
commit b2bb93a178
No known key found for this signature in database
GPG Key ID: C76D8DCD2727DBB7
3 changed files with 123 additions and 5 deletions

View File

@ -106,8 +106,10 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -115,11 +117,28 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
##
shape = geompy.MakeCutList(cubic, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "bodyCenteredCubic")
stripsShape = None
if fillet:
shapeOrigin = geompy.MakeCutList(cubic, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -145,6 +164,10 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.append(inlet)
groups.append(outlet)
groups.extend(symetry)
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)
@ -239,8 +262,10 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -248,11 +273,29 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
##
shape = geompy.MakeCutList(hexagonPrism, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "bodyCenteredCubic")
stripsShape = None
if fillet:
shapeOrigin = geompy.MakeCutList(hexagonPrism, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -278,6 +321,11 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
groups.append(inlet)
groups.append(outlet)
groups.extend(symetry)
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)

View File

@ -105,8 +105,10 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -114,11 +116,29 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
##
shape = geompy.MakeCutList(cubic, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "faceCenteredCubic")
stripsShape = None
if fillet:
shapeOrigin = geompy.MakeCutList(cubic, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -144,6 +164,10 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.append(inlet)
groups.append(outlet)
groups.extend(symetry)
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)
@ -236,8 +260,10 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -245,11 +271,29 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
##
shape = geompy.MakeCutList(hexagonPrism, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "faceCenteredCubic")
stripsShape = None
if fillet:
shapeOrigin = geompy.MakeCutList(hexagonPrism, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -275,6 +319,10 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
groups.append(inlet)
groups.append(outlet)
groups.extend(symetry)
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)

View File

@ -107,7 +107,7 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "simpleCubic")
stripsShape = None
if grainsOrigin:
if fillet:
shapeOrigin = geompy.MakeCutList(cubic, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
@ -115,7 +115,6 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
print(stripsShape)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
@ -123,9 +122,9 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if stripsShape:
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionIDs(strips, geompy.SubShapeAll(
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
@ -154,7 +153,7 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.append(outlet)
groups.extend(symetry)
if strips:
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
@ -240,8 +239,10 @@ def simpleHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1, 1]):
grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -249,11 +250,28 @@ def simpleHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1, 1]):
##
shape = geompy.MakeCutList(hexagonPrism, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "simpleCubic")
stripsShape = None
if fillet:
shapeOrigin = geompy.MakeCutList(hexagonPrism, [grainsOrigin])
shapeOrigin = geompy.MakeScaleTransform(shapeOrigin, oo, 1 / scale)
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
shapeOriginShell = geompy.ExtractShapes(shapeOrigin, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], shapeOriginShell)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -279,6 +297,10 @@ def simpleHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1, 1]):
groups.append(inlet)
groups.append(outlet)
groups.extend(symetry)
if fillet:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)