Fix: strips works now

This commit is contained in:
L-Nafaryus 2021-06-20 17:26:11 +05:00
parent 8547d026ba
commit c7678a2f0d
No known key found for this signature in database
GPG Key ID: C76D8DCD2727DBB7
5 changed files with 59 additions and 120 deletions

View File

@ -27,7 +27,7 @@ directions = [
[0, 0, 1],
[1, 1, 1]
]
fillet = false
fillet = true
[simple.mesh]
fineness = 3
@ -66,7 +66,7 @@ directions = [
[0, 0, 1],
[1, 1, 1]
]
fillet = false
fillet = true
[bodyCentered.mesh]
fineness = 3
@ -104,7 +104,7 @@ directions = [
[0, 0, 1],
[1, 1, 1]
]
fillet = false
fillet = true
[faceCentered.mesh]
fineness = 3

View File

@ -148,6 +148,21 @@ patches
constructFrom patches;
patches (symetry5_);
}
{
name strips;
patchInfo
{
type wall;
inGroups (wall);
}
constructFrom patches;
patches (strips_);
}
);
// ************************************************************************* //

View File

@ -109,7 +109,7 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -117,28 +117,11 @@ 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)
@ -166,8 +149,13 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)
@ -265,7 +253,7 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -273,29 +261,11 @@ 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)
@ -323,9 +293,13 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall)

View File

@ -108,7 +108,7 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -116,29 +116,11 @@ 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)
@ -166,6 +148,11 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
@ -263,7 +250,7 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -271,29 +258,11 @@ 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)
@ -321,6 +290,11 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")

View File

@ -97,7 +97,7 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -105,28 +105,11 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
##
shape = geompy.MakeCutList(cubic, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "simpleCubic")
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)
@ -154,6 +137,11 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
@ -242,7 +230,7 @@ def simpleHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1, 1]):
grainsOrigin = None
if fillet:
grainsOrigin = grains
grainsOrigin = geompy.MakeScaleTransform(grains, oo, 1 / scale)
grains = geompy.MakeFilletAll(grains, filletradius * scale)
###
@ -250,28 +238,11 @@ 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)
@ -299,6 +270,11 @@ def simpleHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1, 1]):
groups.extend(symetry)
if fillet:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
shapeShell = geompy.ExtractShapes(shape, geompy.ShapeType["SHELL"], True)
stripsShape = geompy.MakeCutList(shapeShell[0], groups + [grainsOrigin])
geompy.UnionList(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall")