def draw(win):
    win.scene.clear()
    win.image.fill(black)
    tx = win.dial_x.value()
    ty = win.dial_y.value()
    tz = win.dial_z.value()

    if win.funcs.currentText() == "- sin(x**2 + y**2)":
        f = f1

    if win.funcs.currentText(
    ) == "(sin(sqrt(x**2 + y**2)))/(sqrt(x**2 + y**2))":
        f = f2

    if win.funcs.currentText() == "exp((- x**2 - y**2) * x)":
        f = f3

    if win.funcs.currentText(
    ) == "sqrt(x**2 + y**2) + 3 * (cos(sqrt(x**2 + y**2))) + 5":
        f = f4

    win.image = float_horizon(win.scene.width(), win.scene.height(),
                              win.x_min.value(), win.x_max.value(),
                              win.dx.value(), win.z_min.value(),
                              win.z_max.value(), win.dz.value(), tx, ty, tz, f,
                              win.image)

    pix = QPixmap()
    pix.convertFromImage(win.image)
    win.scene.addPixmap(pix)
Beispiel #2
0
def draw(win):
    win.scene.clear()
    win.image.fill(black)
    tx = win.dial_x.value()
    ty = win.dial_y.value()
    tz = win.dial_z.value()

    if win.funcs.currentText() == "cos(x) * sin(z)":
        f = f1

    if win.funcs.currentText() == "2 * cos(x * z)":
        f = f2

    if win.funcs.currentText() == "exp(sin(sqrt(x^2 + z^2)))":
        f = f3

    if win.funcs.currentText() == "x^2 / 20 + z^2 / 20":
        f = f4

    if win.funcs.currentText() == "|sin(x) * sin(z)|":
        f = f5

    win.image = float_horizon(win.scene.width(), win.scene.height(),
                              win.x_min.value(), win.x_max.value(),
                              win.dx.value(), win.z_min.value(),
                              win.z_max.value(), win.dz.value(), tx, ty, tz, f,
                              win.image)

    pix = QPixmap()
    pix.convertFromImage(win.image)
    win.scene.addPixmap(pix)
Beispiel #3
0
def mainfunc():
    selectModel()
    canvasField.delete("all")
    float_horizon(WIDTH + 1, HEIGHT + 1, XFrom, XTo, XStep, ZFrom, ZTo, ZStep,
                  rx, -ry, rz, f, canvasField)