Exemplo n.º 1
0
C = (A - L1) / 2  #Largeur de la partie haut(Largura da parte)
E = (L1 - L2) / 2  #Largeur de la partie inférieure(Largura da parte fundo)

###
### SHAPER component
###

from SketchAPI import *

from salome.shaper import model

#Sketch construction
model.begin()
partSet = model.moduleDocument()
Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOZ"))
SketchLine_1 = Sketch_1.addLine(Xi, Zi, Xi, Zi + B)
SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
SketchLine_2 = Sketch_1.addLine(Xi, Zi + B, Xi + C, Zi + B)
SketchConstraintCoincidence_1 = Sketch_1.setCoincident(
    SketchLine_1.endPoint(), SketchLine_2.startPoint())
SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
SketchLine_3 = Sketch_1.addLine(Xi + C, Zi + B, Xi + C, Zi + B - D)
SketchConstraintCoincidence_2 = Sketch_1.setCoincident(
    SketchLine_2.endPoint(), SketchLine_3.startPoint())
SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
SketchLine_4 = Sketch_1.addLine(Xi + C, Zi + B - D, Xi + C + E, Zi + B - D)
SketchConstraintCoincidence_3 = Sketch_1.setCoincident(
    SketchLine_3.endPoint(), SketchLine_4.startPoint())
SketchLine_5 = Sketch_1.addLine(Xi + C + E, Zi + B - D, Xi + C + E, Zi + B)
SketchConstraintCoincidence_4 = Sketch_1.setCoincident(
Exemplo n.º 2
0
Arquivo: twod.py Projeto: mfkiwl/femus
sys.path.insert(
    0, r'/home/gbornia/software/femus/applications/OptimalControl/pddm/input')

###
### SHAPER component
###

from salome.shaper import model

model.begin()
partSet = model.moduleDocument()
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()
Point_2 = model.addPoint(Part_1_doc, 0, 0, 0)
Point_3 = model.addPoint(Part_1_doc, 1, 1, 0)
Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
SketchLine_1 = Sketch_1.addLine(1, 0, 0, 0)
SketchProjection_1 = Sketch_1.addProjection(
    model.selection("VERTEX", "Point_1"), False)
SketchPoint_1 = SketchProjection_1.createdFeature()
SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(),
                                                       SketchPoint_1.result())
SketchLine_2 = Sketch_1.addLine(0, 0, 0, 1)
SketchLine_3 = Sketch_1.addLine(0, 1, 1, 1)
SketchLine_4 = Sketch_1.addLine(1, 1, 1, 0)
SketchConstraintCoincidence_2 = Sketch_1.setCoincident(
    SketchLine_4.endPoint(), SketchLine_1.startPoint())
SketchConstraintCoincidence_3 = Sketch_1.setCoincident(
    SketchLine_1.endPoint(), SketchLine_2.startPoint())
SketchConstraintCoincidence_4 = Sketch_1.setCoincident(
    SketchLine_2.endPoint(), SketchLine_3.startPoint())