diff --git a/salomepl/simple.py b/salomepl/simple.py index 76cc61d..a708205 100644 --- a/salomepl/simple.py +++ b/salomepl/simple.py @@ -94,8 +94,10 @@ def simpleCubic(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) ### @@ -103,11 +105,29 @@ 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 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"]) geompy.UnionIDs(sall, 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") inletshape = geompy.MakeCutList(inletface, [grains]) 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) geompy.UnionList(symetry[n], geompy.SubShapeAll( geompy.GetInPlace(shape, symetryshape, True), geompy.ShapeType["FACE"])) - + groups = [] groups.append(inlet) groups.append(outlet) groups.extend(symetry) + + if strips: + groups.append(strips) + wall = geompy.CutListOfGroups([sall], groups, theName = "wall") groups.append(wall)