Mod: strips part (error while creating)

This commit is contained in:
L-Nafaryus 2021-06-17 22:59:20 +05:00
parent ca1712e1d1
commit 7e1d16091a
No known key found for this signature in database
GPG Key ID: C76D8DCD2727DBB7

View File

@ -94,8 +94,10 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
grains = geompy.MakeFuseList(grains, False, False) grains = geompy.MakeFuseList(grains, False, False)
grains = geompy.MakeScaleTransform(grains, oo, scale) grains = geompy.MakeScaleTransform(grains, oo, scale)
grainsOrigin = None
if fillet: if fillet:
grainsOrigin = grains
grains = geompy.MakeFilletAll(grains, filletradius * scale) grains = geompy.MakeFilletAll(grains, filletradius * scale)
### ###
@ -103,11 +105,29 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
## ##
shape = geompy.MakeCutList(cubic, [grains]) shape = geompy.MakeCutList(cubic, [grains])
shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "simpleCubic") shape = geompy.MakeScaleTransform(shape, oo, 1 / scale, theName = "simpleCubic")
stripsShape = None
if grainsOrigin:
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)
print(stripsShape)
sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"]) sall = geompy.CreateGroup(shape, geompy.ShapeType["FACE"])
geompy.UnionIDs(sall, geompy.UnionIDs(sall,
geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"])) geompy.SubShapeAllIDs(shape, geompy.ShapeType["FACE"]))
strips = None
if stripsShape:
strips = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "strips")
geompy.UnionIDs(strips, geompy.SubShapeAll(
geompy.GetInPlace(shape, stripsShape, True), geompy.ShapeType["FACE"]))
inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet") inlet = geompy.CreateGroup(shape, geompy.ShapeType["FACE"], theName = "inlet")
inletshape = geompy.MakeCutList(inletface, [grains]) inletshape = geompy.MakeCutList(inletface, [grains])
inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale) inletshape = geompy.MakeScaleTransform(inletshape, oo, 1 / scale)
@ -128,11 +148,15 @@ def simpleCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
symetryshape = geompy.MakeScaleTransform(symetryshape, oo, 1 / scale) symetryshape = geompy.MakeScaleTransform(symetryshape, oo, 1 / scale)
geompy.UnionList(symetry[n], geompy.SubShapeAll( geompy.UnionList(symetry[n], geompy.SubShapeAll(
geompy.GetInPlace(shape, symetryshape, True), geompy.ShapeType["FACE"])) geompy.GetInPlace(shape, symetryshape, True), geompy.ShapeType["FACE"]))
groups = [] groups = []
groups.append(inlet) groups.append(inlet)
groups.append(outlet) groups.append(outlet)
groups.extend(symetry) groups.extend(symetry)
if strips:
groups.append(strips)
wall = geompy.CutListOfGroups([sall], groups, theName = "wall") wall = geompy.CutListOfGroups([sall], groups, theName = "wall")
groups.append(wall) groups.append(wall)