New simple-cubic structure
This commit is contained in:
parent
5a756fb95a
commit
e5369321a4
214
src/simpleCubic.py
Normal file
214
src/simpleCubic.py
Normal file
@ -0,0 +1,214 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import salome, GEOM, SMESH, SALOMEDS
|
||||
from salome.geom import geomBuilder
|
||||
from salome.smesh import smeshBuilder
|
||||
import math
|
||||
import os, sys
|
||||
|
||||
class simpleCubic:
|
||||
def __init__(self, name = None):
|
||||
self.name = name if type(name) != None else "simpleCubic"
|
||||
self.geometry = None
|
||||
self.mesh = None
|
||||
self.boundary = None
|
||||
|
||||
def geometryCreate(self, alpha):
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
#
|
||||
R_0 = 1
|
||||
R = R_0 / (1 - alpha)
|
||||
R_fillet = 0.1
|
||||
|
||||
# xyz axes
|
||||
axes = [
|
||||
geompy.MakeVectorDXDYDZ(1, 0, 0),
|
||||
geompy.MakeVectorDXDYDZ(0, 1, 0),
|
||||
geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
]
|
||||
|
||||
# Main box
|
||||
box = geompy.MakeBoxDXDYDZ(2 * math.sqrt(2), 2 * math.sqrt(2), 2)
|
||||
box = geompy.MakeRotation(box, axes[2], 45 * math.pi / 180.0)
|
||||
box = geompy.MakeTranslation(box, 2, 0, 0)
|
||||
|
||||
vtx = [
|
||||
geompy.MakeVertex(2, 0, 0),
|
||||
geompy.MakeVertex(2, 2, 0),
|
||||
geompy.MakeVertex(2, 2, 2)
|
||||
]
|
||||
|
||||
line = geompy.MakeLineTwoPnt(vtx[1], vtx[2])
|
||||
|
||||
# Spheres for cutting
|
||||
sphere = geompy.MakeSpherePntR(vtx[0], R)
|
||||
sphere = geompy.MakeMultiTranslation2D(sphere, None, 2, 3, None, 2, 3)
|
||||
sphere = geompy.MakeTranslation(sphere, -2, 0, 0)
|
||||
sphere2 = geompy.MakeTranslation(sphere, 0, 0, 2)
|
||||
|
||||
sphere = geompy.ExtractShapes(sphere, geompy.ShapeType["SOLID"], True)
|
||||
sphere2 = geompy.ExtractShapes(sphere2, geompy.ShapeType["SOLID"], True)
|
||||
|
||||
sphere = geompy.MakeFuseList(sphere + sphere2, True, True)
|
||||
sphere = geompy.MakeFilletAll(sphere, R_fillet)
|
||||
|
||||
self.geometry = geompy.MakeCutList(box, [sphere], True)
|
||||
|
||||
geompy.addToStudy(self.geometry, self.name)
|
||||
|
||||
def boundaryCreate(self, direction):
|
||||
geompy = geomBuilder.New()
|
||||
#
|
||||
# D /\ B A(1, 1, 0) \vec{n}(1, 1, 0)
|
||||
# / \ B(3, 3, 0) \vec{n}(1, 1, 0)
|
||||
# \ / C(3, 1, 0) \vec{n}(-1, 1, 0)
|
||||
# A \/ C D(1, 3, 0) \vec{n}(-1, 1, 0)
|
||||
#
|
||||
|
||||
center = geompy.MakeVertex(2, 2, 1)
|
||||
rot = [0, 0, 45]
|
||||
|
||||
if direction == "100":
|
||||
norm = geompy.MakeVector(center,
|
||||
geompy.MakeVertexWithRef(center, 0, 0, 1))
|
||||
vstep = math.sqrt(2)
|
||||
hstep = 1
|
||||
|
||||
elif direction == "001":
|
||||
norm = geompy.MakeVector(center,
|
||||
geompy.MakeVertexWithRef(center, 1, 0, 0))
|
||||
vstep = 1
|
||||
hstep = math.sqrt(2)
|
||||
|
||||
def createGroup(shape, name):
|
||||
group = geompy.CreateGroup(self.geometry,
|
||||
geompy.ShapeType["FACE"], name)
|
||||
gip = geompy.GetInPlace(self.geometry, shape, True)
|
||||
faces = geompy.SubShapeAll(gip, geompy.ShapeType["FACE"])
|
||||
geompy.UnionList(group, faces)
|
||||
|
||||
return group
|
||||
|
||||
# xyz axes
|
||||
axes = [
|
||||
geompy.MakeVectorDXDYDZ(1, 0, 0),
|
||||
geompy.MakeVectorDXDYDZ(0, 1, 0),
|
||||
geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
]
|
||||
|
||||
# Main box
|
||||
box = geompy.MakeBoxDXDYDZ(2 * math.sqrt(2), 2 * math.sqrt(2), 2)
|
||||
box = geompy.MakeRotation(box, axes[2], 45 * math.pi / 180.0)
|
||||
box = geompy.MakeTranslation(box, 2, 0, 0)
|
||||
planes = geompy.ExtractShapes(box,
|
||||
geompy.ShapeType["FACE"], True)
|
||||
planecommon = []
|
||||
|
||||
for plane in planes:
|
||||
planecommon.append(geompy.MakeCommonList([self.geometry, plane], True))
|
||||
|
||||
planegroup = geompy.CreateGroup(self.geometry, geompy.ShapeType["FACE"])
|
||||
for planecom in planecommon:
|
||||
faces = geompy.SubShapeAllIDs(planecom, geompy.ShapeType["FACE"])
|
||||
geompy.UnionIDs(planegroup, faces)
|
||||
|
||||
|
||||
# Prepare faces
|
||||
#vtx.append(geompy.MakeVertex(2, 2, 2))
|
||||
#vtx.append(geompy.MakeVertexWithRef(vtx[3], 0, 0, 1))
|
||||
#vec2 = geompy.MakeVector(vtx[3], vtx[4])
|
||||
plane = geompy.MakePlane(center, norm, 5)
|
||||
|
||||
plane2 = geompy.MakeTranslationVectorDistance(plane, norm, vstep)
|
||||
common2 = geompy.MakeCommonList([self.geometry, plane2], True)
|
||||
inlet = createGroup(common2, "inlet")
|
||||
|
||||
plane3 = geompy.MakeTranslationVectorDistance(plane, norm, -vstep)
|
||||
common3 = geompy.MakeCommonList([self.geometry, plane3], True)
|
||||
outlet = createGroup(common3, "outlet")
|
||||
|
||||
symetryPlane = geompy.CutListOfGroups([planegroup], [inlet, outlet])
|
||||
|
||||
PoreGroup = geompy.CreateGroup(self.geometry, geompy.ShapeType["FACE"])
|
||||
faces = geompy.SubShapeAllIDs(self.geometry, geompy.ShapeType["FACE"])
|
||||
geompy.UnionIDs(PoreGroup, faces)
|
||||
|
||||
wall = geompy.CutListOfGroups([PoreGroup], [inlet, outlet, symetryPlane])
|
||||
|
||||
self.boundary = {
|
||||
"inlet": inlet,
|
||||
"outlet": outlet,
|
||||
"symetryPlane": symetryPlane,
|
||||
"wall": wall
|
||||
}
|
||||
|
||||
return self.boundary
|
||||
|
||||
def meshCreate(self):
|
||||
smesh = smeshBuilder.New()
|
||||
|
||||
|
||||
mesh = smesh.Mesh(geomObj)
|
||||
netgen = mesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||
|
||||
param = netgen.Parameters()
|
||||
param.SetSecondOrder( 0 )
|
||||
param.SetOptimize( 1 )
|
||||
param.SetChordalError( -1 )
|
||||
param.SetChordalErrorEnabled( 0 )
|
||||
param.SetUseSurfaceCurvature( 1 )
|
||||
param.SetFuseEdges( 1 )
|
||||
param.SetCheckChartBoundary( 0 )
|
||||
param.SetMinSize( 0.01 )
|
||||
param.SetMaxSize( 0.1 )
|
||||
param.SetFineness( 4 )
|
||||
#param.SetGrowthRate( 0.1 )
|
||||
#param.SetNbSegPerEdge( 5 )
|
||||
#param.SetNbSegPerRadius( 10 )
|
||||
param.SetQuadAllowed( 0 )
|
||||
|
||||
vlayer = netgen.ViscousLayers(0.025, 2, 1.1, [],
|
||||
1, smeshBuilder.NODE_OFFSET)
|
||||
|
||||
mesh.GroupOnGeom(bc[0], 'inlet', SMESH.FACE)
|
||||
mesh.GroupOnGeom(bc[1], 'outlet', SMESH.FACE)
|
||||
mesh.GroupOnGeom(bc[2], 'wall', SMESH.FACE)
|
||||
|
||||
self.mesh = mesh
|
||||
|
||||
return self.mesh
|
||||
|
||||
def meshCompute(self):
|
||||
status = self.mesh.Compute()
|
||||
|
||||
if status:
|
||||
print("Mesh succesfully computed.")
|
||||
|
||||
else:
|
||||
print("Mesh is not computed.")
|
||||
|
||||
def meshExport(self, path):
|
||||
exportpath = os.path.join(path, "{}.unv".format(self.name))
|
||||
|
||||
try:
|
||||
self.mesh.ExportUNV(exportpath)
|
||||
|
||||
except:
|
||||
print("Error: Cannot export mesh to '{}'".format(exportpath))
|
||||
|
||||
if __name__ == "__main__":
|
||||
buildpath = str(sys.argv[1])
|
||||
alpha = float(sys.argv[2])
|
||||
direction = str(sys.argv[3])
|
||||
|
||||
salome.salome_init()
|
||||
sc = simpleCubic("simpleCubic-{}-{}".format(direction, alpha))
|
||||
sc.geometryCreate(alpha)
|
||||
sc.boundaryCreate(direction)
|
||||
#sc.meshCreate()
|
||||
#sc.meshCompute()
|
||||
#sc.meshExport(build)
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser()
|
75
worksheet/cube_020320.py
Normal file
75
worksheet/cube_020320.py
Normal file
@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
###
|
||||
### This file is generated automatically by SALOME v9.6.0 with dump python functionality
|
||||
###
|
||||
|
||||
import sys
|
||||
import salome
|
||||
|
||||
salome.salome_init()
|
||||
import salome_notebook
|
||||
notebook = salome_notebook.NoteBook()
|
||||
sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet')
|
||||
|
||||
###
|
||||
### GEOM component
|
||||
###
|
||||
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
import math
|
||||
import SALOMEDS
|
||||
|
||||
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0)
|
||||
geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0)
|
||||
geomObj_7 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_8 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_9 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9)
|
||||
geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111)
|
||||
geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3)
|
||||
geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True)
|
||||
geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2)
|
||||
geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True)
|
||||
geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0)
|
||||
geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True)
|
||||
geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2)
|
||||
simpleCubic_100_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True)
|
||||
Sphere_1 = geompy.MakeSphereR(1)
|
||||
Translation_1 = geompy.MakeTranslation(Sphere_1, 1.9, 0, 0)
|
||||
geomObj_19 = geompy.MakeGlueFaces([Sphere_1, Translation_1], 1e-07)
|
||||
Fuse_1 = geompy.MakeFuseList([Sphere_1, Translation_1], True, True)
|
||||
Fillet_1 = geompy.MakeFilletAll(Fuse_1, 0.1)
|
||||
Multi_Translation_1 = geompy.MakeMultiTranslation2D(Sphere_1, None, 1.9, 3, None, 1.9, 3)
|
||||
[Solid_1,Solid_2,Solid_3,Solid_4,Solid_5,Solid_6,Solid_7,Solid_8,Solid_9] = geompy.ExtractShapes(Multi_Translation_1, geompy.ShapeType["SOLID"], True)
|
||||
Fuse_2 = geompy.MakeFuseList([Solid_1, Solid_2, Solid_3, Solid_4, Solid_5, Solid_6, Solid_7, Solid_8, Solid_9], True, True)
|
||||
Fillet_2 = geompy.MakeFilletAll(Fuse_2, 0.1)
|
||||
geompy.addToStudy( simpleCubic_100_0_1, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Sphere_1, 'Sphere_1' )
|
||||
geompy.addToStudy( Translation_1, 'Translation_1' )
|
||||
geompy.addToStudy( Fuse_1, 'Fuse_1' )
|
||||
geompy.addToStudy( Fillet_1, 'Fillet_1' )
|
||||
geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_1, 'Solid_1' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_2, 'Solid_2' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_3, 'Solid_3' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_4, 'Solid_4' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_5, 'Solid_5' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_6, 'Solid_6' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_7, 'Solid_7' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_8, 'Solid_8' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_9, 'Solid_9' )
|
||||
geompy.addToStudy( Fuse_2, 'Fuse_2' )
|
||||
geompy.addToStudy( Fillet_2, 'Fillet_2' )
|
||||
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser()
|
247
worksheet/cube_020320_2.py
Normal file
247
worksheet/cube_020320_2.py
Normal file
@ -0,0 +1,247 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
###
|
||||
### This file is generated automatically by SALOME v9.6.0 with dump python functionality
|
||||
###
|
||||
|
||||
import sys
|
||||
import salome
|
||||
|
||||
salome.salome_init()
|
||||
import salome_notebook
|
||||
notebook = salome_notebook.NoteBook()
|
||||
sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet')
|
||||
|
||||
###
|
||||
### GEOM component
|
||||
###
|
||||
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
import math
|
||||
import SALOMEDS
|
||||
|
||||
|
||||
geompy = geomBuilder.New()
|
||||
|
||||
geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0)
|
||||
geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0)
|
||||
geomObj_7 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_8 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_9 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9)
|
||||
geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111)
|
||||
geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3)
|
||||
geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True)
|
||||
geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2)
|
||||
geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True)
|
||||
geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0)
|
||||
geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True)
|
||||
geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2)
|
||||
simpleCubic_100_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True)
|
||||
Sphere_1 = geompy.MakeSphereR(1)
|
||||
Translation_1 = geompy.MakeTranslation(Sphere_1, 1.9, 0, 0)
|
||||
geomObj_19 = geompy.MakeGlueFaces([Sphere_1, Translation_1], 1e-07)
|
||||
Fuse_1 = geompy.MakeFuseList([Sphere_1, Translation_1], True, True)
|
||||
Fillet_1 = geompy.MakeFilletAll(Fuse_1, 0.1)
|
||||
Multi_Translation_1 = geompy.MakeMultiTranslation2D(Sphere_1, None, 1.9, 3, None, 1.9, 3)
|
||||
[Solid_1,Solid_2,Solid_3,Solid_4,Solid_5,Solid_6,Solid_7,Solid_8,Solid_9] = geompy.ExtractShapes(Multi_Translation_1, geompy.ShapeType["SOLID"], True)
|
||||
Fuse_2 = geompy.MakeFuseList([Solid_1, Solid_2, Solid_3, Solid_4, Solid_5, Solid_6, Solid_7, Solid_8, Solid_9], True, True)
|
||||
Fillet_2 = geompy.MakeFilletAll(Fuse_2, 0.1)
|
||||
geomObj_20 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_21 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_22 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_23 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_24 = geompy.MakeRotation(geomObj_23, geomObj_22, 45*math.pi/180.0)
|
||||
geomObj_25 = geompy.MakeTranslation(geomObj_24, 2, 0, 0)
|
||||
geomObj_26 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_27 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_28 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_29 = geompy.MakeLineTwoPnt(geomObj_27, geomObj_28)
|
||||
geomObj_30 = geompy.MakeSpherePntR(geomObj_26, 1.111111111111111)
|
||||
geomObj_31 = geompy.MakeMultiTranslation1D(geomObj_30, geomObj_21, 2, 3)
|
||||
[geomObj_32,geomObj_33,geomObj_34] = geompy.ExtractShapes(geomObj_31, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_35 = geompy.MakeFuseList([geomObj_32, geomObj_33, geomObj_34], True, True)
|
||||
geomObj_36 = geompy.MakeFilletAll(geomObj_35, 0.1)
|
||||
geomObj_37 = geompy.MakeCutList(geomObj_25, [geomObj_36], True)
|
||||
geomObj_38 = geompy.MakeTranslation(geomObj_36, 0, 0, 2)
|
||||
geomObj_39 = geompy.MakeCutList(geomObj_37, [geomObj_38], True)
|
||||
geomObj_40 = geompy.MakeRotation(geomObj_36, geomObj_29, 90*math.pi/180.0)
|
||||
geomObj_41 = geompy.MakeCutList(geomObj_39, [geomObj_40], True)
|
||||
geomObj_42 = geompy.MakeTranslation(geomObj_40, 0, 0, 2)
|
||||
simpleCubic_100_0_1_1 = geompy.MakeCutList(geomObj_41, [geomObj_42], True)
|
||||
Multi_Translation_2 = geompy.MakeMultiTranslation1D(Sphere_1, None, 2, 3)
|
||||
geomObj_43 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_44 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_45 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_46 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_47 = geompy.MakeRotation(geomObj_46, geomObj_45, 45*math.pi/180.0)
|
||||
geomObj_48 = geompy.MakeTranslation(geomObj_47, 2, 0, 0)
|
||||
geomObj_49 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_50 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_51 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_52 = geompy.MakeLineTwoPnt(geomObj_50, geomObj_51)
|
||||
geomObj_53 = geompy.MakeSpherePntR(geomObj_49, 1.111111111111111)
|
||||
geomObj_54 = geompy.MakeMultiTranslation1D(geomObj_53, geomObj_44, 2, 3)
|
||||
[geomObj_55,geomObj_56,geomObj_57] = geompy.ExtractShapes(geomObj_54, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_58 = geompy.MakeFuseList([geomObj_55, geomObj_56, geomObj_57], True, True)
|
||||
sphere = geompy.MakeFilletAll(geomObj_58, 0.1)
|
||||
geomObj_59 = geompy.MakeCutList(geomObj_48, [sphere], True)
|
||||
sphere2 = geompy.MakeTranslation(sphere, 0, 0, 2)
|
||||
geomObj_60 = geompy.MakeCutList(geomObj_59, [sphere2], True)
|
||||
sphere3 = geompy.MakeRotation(sphere, geomObj_52, 90*math.pi/180.0)
|
||||
geomObj_61 = geompy.MakeCutList(geomObj_60, [sphere3], True)
|
||||
sphere4 = geompy.MakeTranslation(sphere3, 0, 0, 2)
|
||||
simpleCubic_100_0_1_2 = geompy.MakeCutList(geomObj_61, [sphere4], True)
|
||||
Sphere_2 = geompy.MakeSphereR(1.111111)
|
||||
Multi_Translation_3 = geompy.MakeMultiTranslation2D(Sphere_2, None, 2, 3, None, 2, 3)
|
||||
Translation_2 = geompy.MakeTranslation(Multi_Translation_3, 0, 0, 2)
|
||||
geomObj_62 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_63 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_64 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_65 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_66 = geompy.MakeRotation(geomObj_65, geomObj_64, 45*math.pi/180.0)
|
||||
geomObj_67 = geompy.MakeTranslation(geomObj_66, 2, 0, 0)
|
||||
geomObj_68 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_69 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_70 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_71 = geompy.MakeLineTwoPnt(geomObj_69, geomObj_70)
|
||||
geomObj_72 = geompy.MakeSpherePntR(geomObj_68, 1.111111111111111)
|
||||
geomObj_73 = geompy.MakeMultiTranslation2D(geomObj_72, None, 2, 3, None, 2, 3)
|
||||
geomObj_74 = geompy.MakeTranslation(geomObj_73, 0, 0, 2)
|
||||
[geomObj_75,geomObj_76,geomObj_77,geomObj_78,geomObj_79,geomObj_80,geomObj_81,geomObj_82,geomObj_83] = geompy.ExtractShapes(geomObj_74, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_84 = geompy.MakeFuseList([geomObj_75, geomObj_76, geomObj_77, geomObj_78, geomObj_79, geomObj_80, geomObj_81, geomObj_82, geomObj_83], True, True)
|
||||
sphere_1 = geompy.MakeFilletAll(geomObj_84, 0.1)
|
||||
simpleCubic_100_0_1_3 = geompy.MakeCutList(geomObj_67, [sphere_1], True)
|
||||
geomObj_85 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_86 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_87 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_88 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_89 = geompy.MakeRotation(geomObj_88, geomObj_87, 45*math.pi/180.0)
|
||||
geomObj_90 = geompy.MakeTranslation(geomObj_89, 2, 0, 0)
|
||||
geomObj_91 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_92 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_93 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_94 = geompy.MakeLineTwoPnt(geomObj_92, geomObj_93)
|
||||
geomObj_95 = geompy.MakeSpherePntR(geomObj_91, 1.111111111111111)
|
||||
geomObj_96 = geompy.MakeMultiTranslation2D(geomObj_95, None, 2, 3, None, 2, 3)
|
||||
[geomObj_97,geomObj_98,geomObj_99,geomObj_100,geomObj_101,geomObj_102,geomObj_103,geomObj_104,geomObj_105] = geompy.ExtractShapes(geomObj_96, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_106 = geompy.MakeTranslation(geomObj_96, 0, 0, 2)
|
||||
[geomObj_107,geomObj_108,geomObj_109,geomObj_110,geomObj_111,geomObj_112,geomObj_113,geomObj_114,geomObj_115] = geompy.ExtractShapes(geomObj_106, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_116 = geompy.MakeFuseList([geomObj_97, geomObj_98, geomObj_99, geomObj_100, geomObj_101, geomObj_102, geomObj_103, geomObj_104, geomObj_105, geomObj_107, geomObj_108, geomObj_109, geomObj_110, geomObj_111, geomObj_112, geomObj_113, geomObj_114, geomObj_115], True, True)
|
||||
sphere_2 = geompy.MakeFilletAll(geomObj_116, 0.1)
|
||||
simpleCubic_100_0_1_4 = geompy.MakeCutList(geomObj_90, [sphere_2], True)
|
||||
Translation_3 = geompy.MakeTranslation(sphere_2, -2, 0, 0)
|
||||
geomObj_117 = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
geomObj_118 = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
geomObj_119 = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
geomObj_120 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2)
|
||||
geomObj_121 = geompy.MakeRotation(geomObj_120, geomObj_119, 45*math.pi/180.0)
|
||||
geomObj_122 = geompy.MakeTranslation(geomObj_121, 2, 0, 0)
|
||||
geomObj_123 = geompy.MakeVertex(2, 0, 0)
|
||||
geomObj_124 = geompy.MakeVertex(2, 2, 0)
|
||||
geomObj_125 = geompy.MakeVertex(2, 2, 2)
|
||||
geomObj_126 = geompy.MakeLineTwoPnt(geomObj_124, geomObj_125)
|
||||
geomObj_127 = geompy.MakeSpherePntR(geomObj_123, 1.111111111111111)
|
||||
geomObj_128 = geompy.MakeMultiTranslation2D(geomObj_127, None, 2, 3, None, 2, 3)
|
||||
geomObj_129 = geompy.MakeTranslation(geomObj_128, -2, 0, 0)
|
||||
[geomObj_130,geomObj_131,geomObj_132,geomObj_133,geomObj_134,geomObj_135,geomObj_136,geomObj_137,geomObj_138] = geompy.ExtractShapes(geomObj_129, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_139 = geompy.MakeTranslation(geomObj_129, 0, 0, 2)
|
||||
[geomObj_140,geomObj_141,geomObj_142,geomObj_143,geomObj_144,geomObj_145,geomObj_146,geomObj_147,geomObj_148] = geompy.ExtractShapes(geomObj_139, geompy.ShapeType["SOLID"], True)
|
||||
geomObj_149 = geompy.MakeFuseList([geomObj_130, geomObj_131, geomObj_132, geomObj_133, geomObj_134, geomObj_135, geomObj_136, geomObj_137, geomObj_138, geomObj_140, geomObj_141, geomObj_142, geomObj_143, geomObj_144, geomObj_145, geomObj_146, geomObj_147, geomObj_148], True, True)
|
||||
sphere_3 = geompy.MakeFilletAll(geomObj_149, 0.1)
|
||||
simpleCubic_100_0_1_5 = geompy.MakeCutList(geomObj_122, [sphere_3], True)
|
||||
[geomObj_150,geomObj_151,geomObj_152,geomObj_153,geomObj_154,geomObj_155,geomObj_156,geomObj_157,geomObj_158,Common_1,from_Face_4,inlet,geomObj_159,geomObj_160,Group_1,geomObj_161,geomObj_162,geomObj_163,geomObj_164,Group_2,geomObj_165,geomObj_166,geomObj_167,geomObj_168,geomObj_169,geomObj_170,geomObj_171,geomObj_172,geomObj_173,geomObj_174,geomObj_175,geomObj_176,geomObj_177,geomObj_178,geomObj_179,geomObj_180,geomObj_181,geomObj_182,geomObj_183,geomObj_184,geomObj_185,geomObj_186,geomObj_187,geomObj_188] = geompy.ExtractShapes(simpleCubic_100_0_1_5, geompy.ShapeType["FACE"], True)
|
||||
geomObj_189 = geompy.MakeVertex(0, 0, 0)
|
||||
geomObj_190 = geompy.MakeVertex(5, 5, 5)
|
||||
Vertex_1 = geompy.MakeVertex(2, 2, 0)
|
||||
Vertex_2 = geompy.MakeVertex(2, 2, 2)
|
||||
Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2)
|
||||
O = geompy.MakeVertex(0, 0, 0)
|
||||
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
Rotation_1 = geompy.MakeRotationThreePoints(Vector_1, Vertex_1, O, O)
|
||||
Box_1 = geompy.MakeBoxDXDYDZ(2.828427, 2.828427, 2)
|
||||
Rotation_2 = geompy.MakeRotation(Box_1, OZ, -45*math.pi/180.0)
|
||||
Translation_4 = geompy.MakeTranslation(Rotation_2, 0, 2, 0)
|
||||
[Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.ExtractShapes(Translation_4, geompy.ShapeType["FACE"], True)
|
||||
[geomObj_162] = geompy.SubShapeAll(Face_1, geompy.ShapeType["FACE"])
|
||||
[geomObj_163] = geompy.SubShapeAll(Face_1, geompy.ShapeType["FACE"])
|
||||
Common_1 = geompy.MakeCommonList([simpleCubic_100_0_1_5, Face_4], True)
|
||||
geompy.addToStudy( simpleCubic_100_0_1, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Sphere_1, 'Sphere_1' )
|
||||
geompy.addToStudy( Translation_1, 'Translation_1' )
|
||||
geompy.addToStudy( Fuse_1, 'Fuse_1' )
|
||||
geompy.addToStudy( Fillet_1, 'Fillet_1' )
|
||||
geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_1, 'Solid_1' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_2, 'Solid_2' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_3, 'Solid_3' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_4, 'Solid_4' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_5, 'Solid_5' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_6, 'Solid_6' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_7, 'Solid_7' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_8, 'Solid_8' )
|
||||
geompy.addToStudyInFather( Multi_Translation_1, Solid_9, 'Solid_9' )
|
||||
geompy.addToStudy( Fuse_2, 'Fuse_2' )
|
||||
geompy.addToStudy( Fillet_2, 'Fillet_2' )
|
||||
geompy.addToStudy( simpleCubic_100_0_1_1, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Multi_Translation_2, 'Multi-Translation_2' )
|
||||
geompy.addToStudy( sphere, 'sphere' )
|
||||
geompy.addToStudy( sphere2, 'sphere2' )
|
||||
geompy.addToStudy( sphere3, 'sphere3' )
|
||||
geompy.addToStudy( sphere4, 'sphere4' )
|
||||
geompy.addToStudy( simpleCubic_100_0_1_2, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Sphere_2, 'Sphere_2' )
|
||||
geompy.addToStudy( Multi_Translation_3, 'Multi-Translation_3' )
|
||||
geompy.addToStudy( Translation_2, 'Translation_2' )
|
||||
geompy.addToStudy( sphere_1, 'sphere' )
|
||||
geompy.addToStudy( simpleCubic_100_0_1_3, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( sphere_2, 'sphere' )
|
||||
geompy.addToStudy( simpleCubic_100_0_1_4, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Translation_3, 'Translation_3' )
|
||||
geompy.addToStudy( sphere_3, 'sphere' )
|
||||
geompy.addToStudy( simpleCubic_100_0_1_5, 'simpleCubic-100-0.1' )
|
||||
geompy.addToStudy( Vertex_1, 'Vertex_1' )
|
||||
geompy.addToStudy( Vertex_2, 'Vertex_2' )
|
||||
geompy.addToStudy( Vector_1, 'Vector_1' )
|
||||
geompy.addToStudy( OX, 'OX' )
|
||||
geompy.addToStudy( O, 'O' )
|
||||
geompy.addToStudy( OY, 'OY' )
|
||||
geompy.addToStudy( OZ, 'OZ' )
|
||||
geompy.addToStudy( Rotation_1, 'Rotation_1' )
|
||||
geompy.addToStudy( Box_1, 'Box_1' )
|
||||
geompy.addToStudy( Rotation_2, 'Rotation_2' )
|
||||
geompy.addToStudy( Translation_4, 'Translation_4' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_2, 'Face_2' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_1, 'Face_1' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_3, 'Face_3' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_4, 'Face_4' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_5, 'Face_5' )
|
||||
geompy.addToStudyInFather( Translation_4, Face_6, 'Face_6' )
|
||||
geompy.addToStudy( Common_1, 'Common_1' )
|
||||
geompy.addToStudyInFather( Common_1, from_Face_4, 'from_Face_4' )
|
||||
geompy.addToStudyInFather( Common_1, inlet, 'inlet' )
|
||||
geompy.addToStudyInFather( Translation_4, Group_1, 'Group_1' )
|
||||
geompy.addToStudyInFather( Translation_4, Group_2, 'Group_2' )
|
||||
[from_Face_4] = geompy.RestoreGivenSubShapes(Common_1, [Face_4], GEOM.FSM_GetInPlace, False, True)
|
||||
inlet = geompy.CreateGroup(Common_1, geompy.ShapeType["FACE"])
|
||||
geompy.UnionIDs(inlet, [2, 16, 30, 44])
|
||||
geomObj_159 = geompy.GetInPlace(simpleCubic_100_0_1_5, Face_1, True)
|
||||
[geomObj_160] = geompy.SubShapeAll(geomObj_159, geompy.ShapeType["FACE"])
|
||||
[geomObj_161] = geompy.SubShapeAll(geomObj_159, geompy.ShapeType["FACE"])
|
||||
Group_1 = geompy.CreateGroup(Translation_4, geompy.ShapeType["FACE"])
|
||||
geompy.UnionIDs(Group_1, [3])
|
||||
geomObj_150 = geompy.GetInPlace(Translation_4, Face_6, True)
|
||||
[geomObj_164] = geompy.SubShapeAll(geomObj_150, geompy.ShapeType["FACE"])
|
||||
Group_2 = geompy.CreateGroup(Translation_4, geompy.ShapeType["FACE"])
|
||||
geompy.UnionIDs(Group_2, [23, 3, 31, 33, 13, 27])
|
||||
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser()
|
Loading…
Reference in New Issue
Block a user