Exemplo n.º 1
0
    def charge_et_genere_3d(self, fichier):
        #print marshal.version
        f = open(fichier, 'rb')
        self.section_catalogue = marshal.load(f)
        obj = marshal.load(f)
        f.close()

        formecentre = self.__salome_genere_section_catalogue()

        newvolume = []
        repereglobal = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
        for a in obj:
            ori = geompy.MakeVertex(a[0][0], a[0][1], a[0][2])
            fin = geompy.MakeVertex(a[1][0], a[1][1], a[1][2])
            nouveaurepere = geompy.MakeMarker(a[0][0], a[0][1], a[0][2],
                                              a[2][0], a[2][1], a[2][2],
                                              a[3][0], a[3][1], a[3][2])
            basesurface = geompy.MakePosition(formecentre[a[4]], repereglobal,
                                              nouveaurepere)
            newvolume.append(geompy.MakePrism(basesurface, ori, fin))

        #for k,v in formecentre.iteritems():
        #    geompy.addToStudy(v,k)
        #for v in newvolume:
        #    geompy.addToStudy(v,"Volumique")
        outshape = geompy.MakeCompound(newvolume)
        geompy.addToStudy(outshape, "Volumique")
        #geompy.Export(outshape, "/home/fred/asteretude/kuwait/toto.stp", "STEP")
        salome.sg.updateObjBrowser(1)
Exemplo n.º 2
0
def CreateSalomeGeom(newnode, newline, groupline=[], groupnode=[]):
    """creation a la volle d une geometrie dans salome
    n'est disponible que depuis salome"""

    liennoeudsalome = []
    for i in range(0, newnode.shape[0]):
        liennoeudsalome.append(
            geompy.MakeVertex(newnode[i, 0], newnode[i, 1], newnode[i, 2]))

    lienlinesalome = []
    for i in range(0, len(newline)):
        lienlinesalome.append(
            geompy.MakeLineTwoPnt(liennoeudsalome[newline[i][0]],
                                  liennoeudsalome[newline[i][1]]))

    complist = []
    complist.extend(liennoeudsalome)
    complist.extend(lienlinesalome)
    outshape = geompy.MakeCompound(complist)
    sortie = geompy.addToStudy(outshape, "treilli")
    sortiegr = []
    #creation des groupes
    for groupe in groupline:
        if (len(groupe[1]) > 0):
            newgr = geompy.CreateGroup(outshape, geompy.ShapeType["EDGE"])
            for a in groupe[1]:
                lineid = geompy.GetSubShapeID(outshape, lienlinesalome[a])
                geompy.AddObject(newgr, lineid)
            sortiegr.append(
                geompy.addToStudyInFather(outshape, newgr, groupe[0]))

    #creation des groupes
    for groupe in groupnode:
        if (len(groupe[1]) > 0):
            newgr = geompy.CreateGroup(outshape, geompy.ShapeType["VERTEX"])
            for a in groupe[1]:
                noeudid = geompy.GetSubShapeID(outshape, liennoeudsalome[a])
                geompy.AddObject(newgr, noeudid)
            sortiegr.append(
                geompy.addToStudyInFather(outshape, newgr, groupe[0]))

    #gg = salome.ImportComponentGUI("GEOM")
    #
    #gg.createAndDisplayGO(sortie)
    #for a in sortiegr:
    #    gg.createAndDisplayGO(a)
    salome.sg.updateObjBrowser(1)
    print "salome geom done"
Exemplo n.º 3
0
    def charge_et_genere_3d(self, fichier, exportstl=None):
        #print marshal.version

        f = open(fichier, 'rb')
        self.section_catalogue = marshal.load(f)
        obj = marshal.load(f)
        f.close()

        formecentre = self.__salome_genere_section_catalogue()

        newvolume = []
        repereglobal = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
        for a in obj:
            #impression du nom de la forme debug
            #print a[4]

            ori = geompy.MakeVertex(a[0][0], a[0][1], a[0][2])
            fin = geompy.MakeVertex(a[1][0], a[1][1], a[1][2])
            nouveaurepere = geompy.MakeMarker(a[0][0], a[0][1], a[0][2],
                                              a[2][0], a[2][1], a[2][2],
                                              a[3][0], a[3][1], a[3][2])
            basesurface = geompy.MakePosition(formecentre[a[4]], repereglobal,
                                              nouveaurepere)
            newvolume.append(geompy.MakePrism(basesurface, ori, fin))

        #for k,v in formecentre.iteritems():
        #    geompy.addToStudy(v,k)
        #for v in newvolume:
        #    geompy.addToStudy(v,"Volumique")
        outshape = geompy.MakeCompound(newvolume)

        geompy.addToStudy(outshape, "Volumique")

        if exportstl != None:
            geompy.Export(outshape, exportstl, "STL_Bin")

        salome.sg.updateObjBrowser(1)
Exemplo n.º 4
0
Sommet_2 = geompy.MakeVertex(Lplq, 0, 0)
Sommet_3 = geompy.MakeVertex(Lplq, lfin, 0)
Sommet_4 = geompy.MakeVertex(Lplq, lplq, 0)
Sommet_5 = geompy.MakeVertex(0, lplq, 0)
Sommet_6 = geompy.MakeVertex(0, lfin, 0)

Ligne_1 = geompy.MakeLineTwoPnt(Sommet_1, Sommet_2)
Ligne_2 = geompy.MakeLineTwoPnt(Sommet_2, Sommet_3)
Ligne_3 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_6)
Ligne_4 = geompy.MakeLineTwoPnt(Sommet_1, Sommet_6)
Ligne_5 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_4)
Ligne_6 = geompy.MakeLineTwoPnt(Sommet_4, Sommet_5)
Ligne_7 = geompy.MakeLineTwoPnt(Sommet_5, Sommet_6)
Face_1 = geompy.MakeFaceWires([Ligne_1, Ligne_2, Ligne_3, Ligne_4], 1)
Face_2 = geompy.MakeFaceWires([Ligne_3, Ligne_5, Ligne_6, Ligne_7], 1)
Plaque = geompy.MakeCompound([Face_1, Face_2])
Sym = geompy.CreateGroup(Plaque, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Sym, [4])
gauche = geompy.CreateGroup(Plaque, geompy.ShapeType["EDGE"])
geompy.UnionIDs(gauche, [7])
droite = geompy.CreateGroup(Plaque, geompy.ShapeType["EDGE"])
geompy.UnionIDs(droite, [11])
Fin = geompy.CreateGroup(Plaque, geompy.ShapeType["FACE"])
geompy.UnionIDs(Fin, [2])
centre = geompy.CreateGroup(Plaque, geompy.ShapeType["EDGE"])
geompy.UnionIDs(centre, [4, 9])
ext = geompy.CreateGroup(Plaque, geompy.ShapeType["EDGE"])
geompy.UnionIDs(ext, [19])

geompy.addToStudy(O, 'O')
geompy.addToStudy(OX, 'OX')
Exemplo n.º 5
0
infbase = geompy.MakeFaceObjHW(newline, phibase, phibase)
infface = geompy.MakeFaceObjHW(newline, lx + phitop, ly + phitop)
inf = geompy.MakePartition([infface], [infbase], [], [],
                           geompy.ShapeType["FACE"], 0, [], 0)
#geompy.addToStudy( infbase, 'infbase' )
#geompy.addToStudy( infface, 'infface' )
#geompy.addToStudy( inf, 'inf' )

#groupe des faces qui ont un interet
grface = []
grface.append(infbase)
for a in facenodeup:
    for b in a:
        grface.append(b)

grfaceCompound = geompy.MakeCompound(grface)
#geompy.addToStudy( grfaceCompound, 'grfaceCompound' )

#solide final
globalsolid = geompy.MakePartition([Box_1], [grfaceCompound], [], [],
                                   geompy.ShapeType["SOLID"], 0, [], 1)
geompy.addToStudy(globalsolid, 'globalsolid')

#generation des groupes
groupe = []
#EDGE
#Rien

#FACE
#infbase groupe de face qui represente le pied de la structure
grinfbase = geompy.CreateGroup(globalsolid, geompy.ShapeType["FACE"])
Exemplo n.º 6
0
Barre_selle = geompy.MakeLineTwoPnt(Sommet_3, Sommet_4)
Arriere_bas_1 = geompy.MakeLineTwoPnt(Sommet_4, Sommet_5)
Arriere_bas_2 = geompy.MakeLineTwoPnt(Sommet_4, Sommet_6)
Arriere_bas_3 = geompy.MakeLineTwoPnt(Sommet_6, Sommet_10)
Arriere_bas_4 = geompy.MakeLineTwoPnt(Sommet_5, Sommet_9)
Arriere_haut_1 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_7)
Arriere_haut_2 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_8)
Arriere_haut_3 = geompy.MakeLineTwoPnt(Sommet_8, Sommet_10)
Arriere_haut_4 = geompy.MakeLineTwoPnt(Sommet_7, Sommet_9)

Renfort = geompy.MakeLineTwoPnt(Sommet_7, Sommet_8)

Fourche = geompy.MakeLineTwoPnt(Sommet_2, Sommet_11)
Cadre = geompy.MakeCompound([
    Direction, Barre_sup, Barre_inf, Barre_selle, Fourche, Arriere_bas_1,
    Arriere_bas_2, Arriere_bas_3, Arriere_bas_4, Arriere_haut_1,
    Arriere_haut_2, Arriere_haut_3, Arriere_haut_4, Renfort
])

geompy.addToStudy(Sommet_1, 'Sommet_1')
geompy.addToStudy(Sommet_2, 'Sommet_2')
geompy.addToStudy(Sommet_3, 'Sommet_3')
geompy.addToStudy(Sommet_4, 'Sommet_4')
geompy.addToStudy(Sommet_5, 'Sommet_5')
geompy.addToStudy(Sommet_6, 'Sommet_6')
geompy.addToStudy(Sommet_7, 'Sommet_7')
geompy.addToStudy(Sommet_8, 'Sommet_8')
geompy.addToStudy(Sommet_9, 'Sommet_9')
geompy.addToStudy(Sommet_10, 'Sommet_10')
geompy.addToStudy(Sommet_11, 'Sommet_11')
geompy.addToStudy(Direction, 'Direction')
Exemplo n.º 7
0
Sommet_6 = geompy.MakeVertex(3000, 1500, 0)
Sommet_7 = geompy.MakeVertex(5000, 1500, 0)
Ligne_1 = geompy.MakeLineTwoPnt(Sommet_1, Sommet_2)
Ligne_2 = geompy.MakeLineTwoPnt(Sommet_2, Sommet_3)
Ligne_3 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_4)
Ligne_4 = geompy.MakeLineTwoPnt(Sommet_4, Sommet_7)
Ligne_5 = geompy.MakeLineTwoPnt(Sommet_7, Sommet_3)
Ligne_6 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_6)
Ligne_7 = geompy.MakeLineTwoPnt(Sommet_6, Sommet_2)
Ligne_8 = geompy.MakeLineTwoPnt(Sommet_2, Sommet_5)
Ligne_1_vertex_2 = geompy.GetSubShape(Ligne_1, [2])
Ligne_9 = geompy.MakeLineTwoPnt(Sommet_5, Ligne_1_vertex_2)
Ligne_8_vertex_3 = geompy.GetSubShape(Ligne_8, [3])
Ligne_10 = geompy.MakeLineTwoPnt(Ligne_8_vertex_3, Sommet_6)
Ligne_11 = geompy.MakeLineTwoPnt(Sommet_6, Sommet_7)
Treillis = geompy.MakeCompound([Ligne_1, Ligne_2, Ligne_3, Ligne_4, Ligne_5, Ligne_6, Ligne_7, Ligne_8, Ligne_9, Ligne_10, Ligne_11])
listSubShapeIDs = geompy.SubShapeAllIDs(Treillis, geompy.ShapeType["SHAPE"])
geomObj_1 = geompy.GetSubShape(Treillis, [2])
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Sommet_1, 'Sommet_1' )
geompy.addToStudy( Sommet_2, 'Sommet_2' )
geompy.addToStudy( Sommet_3, 'Sommet_3' )
geompy.addToStudy( Sommet_4, 'Sommet_4' )
geompy.addToStudy( Sommet_5, 'Sommet_5' )
geompy.addToStudy( Sommet_6, 'Sommet_6' )
geompy.addToStudy( Sommet_7, 'Sommet_7' )
geompy.addToStudy( Ligne_1, 'Ligne_1' )
geompy.addToStudy( Ligne_2, 'Ligne_2' )
Exemplo n.º 8
0
def RebuildData(theStudy):
	geompy.init_geom(theStudy)

	global Edge_1, Edge_2, Vertex_3, Revolution_1, Vertex_5, Vertex_4, Vertex_6, Face_1, Cone_1, Edge_5, Edge_3, Cylinder_1, Edge_4, Translation_1, Y, Vertex_2, Common_1, Cut_1, Compound_1, Vector_1, Fillet_1, X, Box_1, Rotation_1, Partition_1, Cone_1_edge_7, Torus_1, Vertex_1, Circle_1
	Vertex_1 = geompy.MakeVertex(200, 200, 0)
	Vertex_2 = geompy.MakeVertexWithRef(Vertex_1, 0, 0, 200)
	Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2)
	Cone_1 = geompy.MakeConeR1R2H(100, 0, 300)
	Cylinder_1 = geompy.MakeCylinder(Vertex_2, Vector_1, 100, 100)
	geomObj_1 = geompy.GetSubShape(Cone_1, [7])
	Circle_1 = geompy.MakeCircle(Vertex_1, Vector_1, 100)
	Cone_1_edge_7 = geompy.GetSubShape(Cone_1, [7])
	Revolution_1 = geompy.MakeRevolution2Ways(Circle_1, Cone_1_edge_7, 45*math.pi/180.0)
	Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
	Torus_1 = geompy.MakeTorusRR(200, 75)
	Common_1 = geompy.MakeCommon(Torus_1, Box_1)
	Cut_1 = geompy.MakeCut(Torus_1, Box_1)
	Translation_1 = geompy.MakeTranslation(Torus_1, 190, 190, 0)
	Y = geompy.MakeVectorDXDYDZ(0, 100, 0)
	X = geompy.MakeVectorDXDYDZ(100, 0, 0)
	Rotation_1 = geompy.MakeRotation(Translation_1, Y, -90*math.pi/180.0)
	Compound_1 = geompy.MakeCompound([Translation_1, Torus_1, Rotation_1])
	Fillet_1 = geompy.MakeFilletAll(Box_1, 35)
	Vertex_3 = geompy.MakeVertex(0, 0, 0)
	Vertex_4 = geompy.MakeVertex(0, 0, 200)
	Vertex_5 = geompy.MakeVertex(200, 0, 200)
	Vertex_6 = geompy.MakeVertex(200, 0, 0)
	Edge_1 = geompy.MakeEdge(Vertex_3, Vertex_4)
	Edge_2 = geompy.MakeEdge(Vertex_4, Vertex_5)
	Edge_3 = geompy.MakeEdge(Vertex_5, Vertex_6)
	Edge_4 = geompy.MakeEdge(Vertex_6, Vertex_3)
	Face_1 = geompy.MakeFaceWires([Edge_1, Edge_2, Edge_3, Edge_4], 1)
	Edge_5 = geompy.MakeEdge(Vertex_3, Vertex_5)
	Partition_1 = geompy.MakePartition([Face_1], [Edge_5], [], [], geompy.ShapeType["FACE"], 0, [], 0)
	geompy.addToStudy( Vertex_1, "Vertex_1" )
	geompy.addToStudy( Vertex_2, "Vertex_2" )
	geompy.addToStudy( Vector_1, "Vector_1" )
	geompy.addToStudy( Cone_1, "Cone_1" )
	geompy.addToStudy( Cylinder_1, "Cylinder_1" )
	geompy.addToStudy( Circle_1, "Circle_1" )
	geompy.addToStudyInFather( Cone_1, Cone_1_edge_7, "Cone_1:edge_7" )
	geompy.addToStudy( Revolution_1, "Revolution_1" )
	geompy.addToStudy( Box_1, "Box_1" )
	geompy.addToStudy( Torus_1, "Torus_1" )
	geompy.addToStudy( Common_1, "Common_1" )
	geompy.addToStudy( Cut_1, "Cut_1" )
	geompy.addToStudy( Translation_1, "Translation_1" )
	geompy.addToStudy( Y, "Y" )
	geompy.addToStudy( X, "X" )
	geompy.addToStudy( Rotation_1, "Rotation_1" )
	geompy.addToStudy( Compound_1, "Compound_1" )
	geompy.addToStudy( Fillet_1, "Fillet_1" )
	geompy.addToStudy( Vertex_3, "Vertex_3" )
	geompy.addToStudy( Vertex_4, "Vertex_4" )
	geompy.addToStudy( Vertex_5, "Vertex_5" )
	geompy.addToStudy( Vertex_6, "Vertex_6" )
	geompy.addToStudy( Edge_1, "Edge_1" )
	geompy.addToStudy( Edge_2, "Edge_2" )
	geompy.addToStudy( Edge_3, "Edge_3" )
	geompy.addToStudy( Edge_4, "Edge_4" )
	geompy.addToStudy( Face_1, "Face_1" )
	geompy.addToStudy( Edge_5, "Edge_5" )
	geompy.addToStudy( Partition_1, "Partition_1" )

	### Store presentation parameters of displayed objects
	import iparameters
	ipar = iparameters.IParameters(theStudy.GetModuleParameters("Interface Applicative", "GEOM", 1))

	#Set up entries:
	# set up entry GEOM_11 (Cut_1) parameters
	ipar.setParameter("GEOM_11", "OCCViewer_0_Visibility", "On")
	ipar.setParameter("GEOM_11", "OCCViewer_0_DisplayMode", "1")
	ipar.setParameter("GEOM_11", "OCCViewer_0_Transparency", "0")
	ipar.setParameter("GEOM_11", "OCCViewer_0_Isos", "1:1")

	pass
Exemplo n.º 9
0
Sommet_8 = geompy.MakeVertex(4000, 1000, 0)
Sommet_9 = geompy.MakeVertex(2000, 500, 0)
Ligne_1 = geompy.MakeLineTwoPnt(Sommet_1, Sommet_2)
Ligne_2 = geompy.MakeLineTwoPnt(Sommet_2, Sommet_3)
Ligne_3 = geompy.MakeLineTwoPnt(Sommet_3, Sommet_4)
Ligne_4 = geompy.MakeLineTwoPnt(Sommet_4, Sommet_5)
Ligne_5 = geompy.MakeLineTwoPnt(Sommet_5, Sommet_6)
Ligne_6 = geompy.MakeLineTwoPnt(Sommet_6, Sommet_7)
Ligne_7 = geompy.MakeLineTwoPnt(Sommet_7, Sommet_8)
Ligne_8 = geompy.MakeLineTwoPnt(Sommet_8, Sommet_9)
Ligne_9 = geompy.MakeLineTwoPnt(Sommet_9, Sommet_1)
Ligne_10 = geompy.MakeLineTwoPnt(Sommet_2, Sommet_9)
Ligne_11 = geompy.MakeLineTwoPnt(Sommet_8, Sommet_3)
Ligne_12 = geompy.MakeLineTwoPnt(Sommet_7, Sommet_4)
Assemblage_1 = geompy.MakeCompound([
    Ligne_1, Ligne_2, Ligne_3, Ligne_4, Ligne_5, Ligne_6, Ligne_7, Ligne_8,
    Ligne_9, Ligne_10, Ligne_11, Ligne_12
])
geompy.addToStudy(O, 'O')
geompy.addToStudy(OX, 'OX')
geompy.addToStudy(OY, 'OY')
geompy.addToStudy(OZ, 'OZ')
geompy.addToStudy(O_1, 'O')
geompy.addToStudy(OX_1, 'OX')
geompy.addToStudy(OY_1, 'OY')
geompy.addToStudy(OZ_1, 'OZ')
geompy.addToStudy(Sommet_1, 'Sommet_1')
geompy.addToStudy(Sommet_2, 'Sommet_2')
geompy.addToStudy(Sommet_3, 'Sommet_3')
geompy.addToStudy(Sommet_4, 'Sommet_4')
geompy.addToStudy(Sommet_5, 'Sommet_5')
geompy.addToStudy(Sommet_6, 'Sommet_6')
Exemplo n.º 10
0
def CreateGEOM(injLens, injRads, injAngs, wallS):
	L1 = injLens[0]
	L2 = injLens[1]
	L3 = injLens[2]
	L4 = injLens[3]
	L5 = injLens[4]
	L6 = injLens[5]
	#
	R0 = injRads[0]
	R1 = injRads[1]
	R2 = injRads[2]
	R3 = injRads[3]
	R4 = injRads[4]
	#
	A1 = injAngs[0]
	#
	S  = wallS
	#
	# Printing input
	#
	LSUMM = L1 + L2 + L3 + L4 + L5 + L6
	DX1= math.tan(A1*math.pi/180.)*L3 + R3 - R0
	#
	print "Input Data"
	print "L1, L2, L3, L4, L5, L6"
	print L1, L2, L3, L4, L5, L6
	print "R0, R1, R2, R3, R4"
	print R0, R1, R2, R3, R4
	print "A1 = ", A1
	print "S = ", S
	#
	print "Intermediate variables: "
	print "LSUMM = ", LSUMM
	print "DX1 = ", DX1
	#
	#
	#
	#
	oXYZ = geompy.MakeVertex(0, 0, 0)
	xPnt = geompy.MakeVertex(1, 0, 0)
	yPnt = geompy.MakeVertex(0, 1, 0)
	zPnt = geompy.MakeVertex(0, 0, 1)
	oX   = geompy.MakeVector(oXYZ, xPnt)
	oY   = geompy.MakeVector(oXYZ, yPnt)
	oZ   = geompy.MakeVector(oXYZ, zPnt)
	#
	# Inlet and nozzle points and faces
	#
	P000 = geompy.MakeVertexWithRef(oXYZ, -(L1+L2), R1, 0)
	P001 = geompy.MakeVertexWithRef(oXYZ, -L2, R1, 0)
	P002 = geompy.MakeVertexWithRef(oXYZ, -L2, 0, 0)
	P003 = geompy.MakeVertexWithRef(oXYZ, -(L1+L2), 0, 0)
	#
	P004 = geompy.MakeVertexWithRef(oXYZ, 0, R2, 0)
	P005 = geompy.MakeVertexWithRef(oXYZ, 0, 0, 0)
	#
	P006 = geompy.MakeVertexWithRef(P000, 0, S, 0)
	P007 = geompy.MakeVertexWithRef(P006, L1,0, 0)
	P008 = geompy.MakeVertexWithRef(oXYZ, DX1,R0,0)
	P009 = geompy.MakeVertexWithRef(oXYZ, -(L1+L2), R0, 0)
	#
	F000 = geompy.MakeQuad4Vertices(P000, P001, P002, P003)
	F001 = geompy.MakeQuad4Vertices(P001, P002, P005, P004)
	F002 = geompy.MakeQuad4Vertices(P006, P007, P008, P009)
	#
	# Mixing chamber
	#
	P009 = geompy.MakeVertexWithRef(P004, 0, S, 0)
	P010 = geompy.MakeVertexWithRef(P005, L3,0, 0)
	P011 = geompy.MakeVertexWithRef(P010, 0,R3, 0)
	E000 = geompy.MakeLineTwoPnt(P008, P011)
	P012 = geompy.MakeVertexOnCurve(E000,0.9)
	P013 = geompy.MakeVertexWithRef(P010, L4, 0, 0)
	P014 = geompy.MakeVertexWithRef(P013, 0, R3, 0)
	#
	F003 = geompy.MakeQuad4Vertices(P009, P007, P008, P012)
	F004 = geompy.MakeQuad4Vertices(P004, P009, P012, P011)
	F005 = geompy.MakeQuad4Vertices(P004, P005, P010, P011)
	F006 = geompy.MakeQuad4Vertices(P010, P011, P014, P013)
	#
	# Diffusor and out tube
	#
	P015 = geompy.MakeVertexWithRef(P013, L5, 0, 0)
	P016 = geompy.MakeVertexWithRef(P015, 0, R4, 0)
	P017 = geompy.MakeVertexWithRef(P016, L6, 0, 0)
	P018 = geompy.MakeVertexWithRef(P017, 0, -R4,0)
	#
	F007 = geompy.MakeQuad4Vertices(P013, P014, P016, P015)
	F008 = geompy.MakeQuad4Vertices(P015, P016, P017, P018)
	#
	faceComp = geompy.MakeShell([F000, F001, F002, F003, F004, F005, F006, F007, F008])
	# 
	# Solid geomtry
	#
	sBase1 = geompy.MakeRotation(faceComp, oX, 0)
	sBase2 = geompy.MakeRotation(sBase1, oX, 45.*math.pi/180.)
	sBase3 = geompy.MakeRotation(sBase2, oX, 90.*math.pi/180.)
	#
	solid1 = geompy.MakeRevolution(sBase1, oX, 45.*math.pi/180.)
	solid2 = geompy.MakeRevolution(sBase2, oX, 90.*math.pi/180.)
	solid3 = geompy.MakeRevolution(sBase3, oX, 45.*math.pi/180.)
	#
	# Cutters
	#
	E002 = geompy.MakeLineTwoPnt(P005, P004)
	E003 = geompy.MakeRotation(E002, oX, 45.*math.pi/180.)
	E004 = geompy.MakeRotation(E003, oX, 90.*math.pi/180.)
	E005 = geompy.MakeRotation(E004, oX, 45.*math.pi/180.)
	P019 = geompy.MakeVertexOnCurve(E002,0.5)
	P020 = geompy.MakeVertexOnCurve(E003,0.5)
	P021 = geompy.MakeVertexOnCurve(E004,0.5)
	P022 = geompy.MakeVertexOnCurve(E005,0.5)
	zmin = geompy.PointCoordinates(oXYZ)[2]
	zmax = geompy.PointCoordinates(P020)[2]
	ymin = geompy.PointCoordinates(P022)[1]
	ymax = geompy.PointCoordinates(P019)[1]
	print "ymin, ymax, zmin, zmax"
	print ymin, ymax, zmin, zmax
	#
	E006 = geompy.MakeLineTwoPnt(P019, P020)
	E007 = geompy.MakeLineTwoPnt(P020, P021)
	E008 = geompy.MakeLineTwoPnt(P021, P022)
	E009 = geompy.MakeLineTwoPnt(P021, P022)
	edgeComp1 = geompy.MakeCompound([E006, E007, E008, E009])
	edgeComp2 = geompy.MakeTranslation(edgeComp1, -(2*L1 + 2*L2), 0, 0)
	cutter1 = geompy.MakePrismVecH(edgeComp2, oX, LSUMM*2)
	#
	# Hexa solid
	#
	solid1_hex_v1 = geompy.MakePartition([solid1], [cutter1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
	solid2_hex_v1 = geompy.MakePartition([solid2], [cutter1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
	solid3_hex_v1 = geompy.MakePartition([solid3], [cutter1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
	dom_v1 = geompy.MakeCompound([solid1_hex_v1, solid2_hex_v1, solid3_hex_v1])
	hsolids1 = geompy.SubShapeAll(dom_v1, geompy.ShapeType["SOLID"])
	nSolids = len(hsolids1)
	hsolids2 = []
	for jSolid in xrange(0,nSolids):
		solidCDG = geompy.MakeCDG(hsolids1[jSolid])
		coordCDG = geompy.PointCoordinates(solidCDG)
		ys = coordCDG[1]
		zs = coordCDG[2]
		zOk = (zs >= zmin) * (zs <= zmax)
		yOk = (ys >= ymin) * (ys <= ymax)
		if not(zOk and yOk):
			hsolids2.append(hsolids1[jSolid])
	
	# Creasting hexahedrons near the center
	sBase4 = geompy.MakeQuad4Vertices(P019, P020, P021, P022)
	sBase5 = geompy.MakeTranslation(sBase4, -(L1 + L2), 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase5, oX, L1))
	sBase6 = geompy.MakeTranslation(sBase5, L1, 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase6, oX, L2))
	sBase7 = geompy.MakeTranslation(sBase6, L2, 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase7, oX, L3))
	sBase8 = geompy.MakeTranslation(sBase7, L3, 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase8, oX, L4))
	sBase9 = geompy.MakeTranslation(sBase8, L4, 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase9, oX, L5))
	sBase10= geompy.MakeTranslation(sBase9,L5, 0, 0)
	hsolids2.append(geompy.MakePrismVecH(sBase10, oX, L6))
	#
	# Domain 
	#
	dom_v2   = geompy.MakeCompound(hsolids2)
	dom_comp = geompy.MakeGlueFaces(dom_v2,1.0E-6)
	return dom_comp
Exemplo n.º 11
0
Cercle_2 = geompy.MakeCircle(Ligne_5_vertex_2, Ligne_5, 40)
Ligne_4_vertex_2 = geompy.GetSubShape(Ligne_4, [2])
Cercle_3 = geompy.MakeCircle(Ligne_4_vertex_2, Ligne_4, 50)
Contour_1 = geompy.MakeWire([Ligne_1, Ligne_2, Ligne_3], 1e-07)
Tuyau_1 = geompy.MakePipe(Cercle_1, Contour_1)
Tuyau_2 = geompy.MakePipe(Cercle_2, Ligne_5)
Tuyau_3 = geompy.MakePipe(Cercle_3, Ligne_4)
Partition_1 = geompy.MakePartition([Tuyau_1], [Tuyau_2, Tuyau_3], [], [],
                                   geompy.ShapeType["SHELL"], 0, [], 0)
[joint, Partition_2, Face_2, Face_1, Face_5, Face_6,
 Face_7] = geompy.ExtractShapes(Partition_1, geompy.ShapeType["FACE"], True)
Partition_2 = geompy.MakePartition([Tuyau_2, Tuyau_3], [Partition_1], [], [],
                                   geompy.ShapeType["SHELL"], 0, [], 0)
[Face_1, Face_2, joint,
 geomObj_1] = geompy.ExtractShapes(Partition_2, geompy.ShapeType["FACE"], True)
joint = geompy.MakeCompound([Face_5, Face_6, Face_7, Face_1, Face_2])
geompy.addToStudy(O, 'O')
geompy.addToStudy(OX, 'OX')
geompy.addToStudy(OY, 'OY')
geompy.addToStudy(OZ, 'OZ')
geompy.addToStudy(Sommet_1, 'Sommet_1')
geompy.addToStudy(Sommet_2, 'Sommet_2')
geompy.addToStudy(Sommet_3, 'Sommet_3')
geompy.addToStudy(Sommet_4, 'Sommet_4')
geompy.addToStudy(Sommet_5, 'Sommet_5')
geompy.addToStudy(Sommet_6, 'Sommet_6')
geompy.addToStudy(Ligne_1, 'Ligne_1')
geompy.addToStudy(Ligne_2, 'Ligne_2')
geompy.addToStudy(Ligne_3, 'Ligne_3')
geompy.addToStudy(Ligne_4, 'Ligne_4')
geompy.addToStudy(Ligne_5, 'Ligne_5')
Exemplo n.º 12
0
Ligne_7 = geompy.MakeLineTwoPnt(Sommet_13, Sommet_14)
Ligne_8 = geompy.MakeLineTwoPnt(Sommet_14, Sommet_15)
Ligne_9 = geompy.MakeLineTwoPnt(Sommet_15, Sommet_16)
Ligne_10 = geompy.MakeLineTwoPnt(Sommet_16, Sommet_13)

Face_1 = geompy.MakeFaceWires([Cercle_1, Cercle_2], 1)
Face_15 = geompy.MakeFaceWires([Ligne_3, Ligne_4, Ligne_5, Ligne_6], 1)
Face_16 = geompy.MakeFaceWires([Ligne_7, Ligne_8, Ligne_9, Ligne_10], 1)

Partition_1 = geompy.MakePartition([Extrusion_1], [R_volution_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
[Partition_2,Face_3] = geompy.ExtractShapes(Partition_1, geompy.ShapeType["FACE"], True)
Partition_2 = geompy.MakePartition([R_volution_1], [Extrusion_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
[Face_2,Face_4,Partition_3,Face_5,Face_7] = geompy.ExtractShapes(Partition_2, geompy.ShapeType["FACE"], True)
Partition_3 = geompy.MakePartition([Face_15, Face_16], [Partition_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
[Face_5,Virole,Face_8,Fonds] = geompy.ExtractShapes(Partition_3, geompy.ShapeType["FACE"], True)
Virole = geompy.MakeCompound([Face_4])
Fonds = geompy.MakeCompound([Face_2, Face_7])
Piquage = geompy.MakeCompound([Face_1, Face_3])
Supports = geompy.MakeCompound([Face_5, Face_8])
ViroleS = geompy.MakeFuse(Virole, Supports)
Bidon = geompy.MakeCompound([Fonds, Piquage, ViroleS])
Encastre = geompy.CreateGroup(Bidon, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Encastre, [59])
Appui = geompy.CreateGroup(Bidon, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Appui, [66])
Fonds_1 = geompy.CreateGroup(Bidon, geompy.ShapeType["FACE"])
geompy.UnionIDs(Fonds_1, [3, 10])
Virole_1 = geompy.CreateGroup(Bidon, geompy.ShapeType["FACE"])
geompy.UnionIDs(Virole_1, [37])
Bride_1 = geompy.CreateGroup(Bidon, geompy.ShapeType["FACE"])
geompy.UnionIDs(Bride_1, [18])