コード例 #1
0
ファイル: CurvasAlabeadas.py プロジェクト: jpablo/geomdif
        self.showAxis(False)
        self.addChildren(curvas)
        self.setupAnimations([ AnimationGroup(curvas, (5000,0,len(curva)-1)) ])

class CurvasAlabeadas(Chapter):
    def __init__(self):
        Chapter.__init__(self, name="Curvas alabeadas")

        figuras = [
            #Exponencial,
            Alabeada,
            HeliceCircular,
            HeliceReflejada
        ]
        for f in figuras:
            self.addPage(f())

if __name__ == "__main__":
    import sys
    app = QtGui.QApplication(sys.argv)
    visor = Viewer()
    visor.book.addChapter(curvas_superficies())
    visor.whichChapter = 0
    visor.chapter.whichPage = 0
    visor.resize(400, 400)
    visor.show()
    visor.chaptersStack.show()
    visor.notesStack.show()
    sys.exit(app.exec_())

コード例 #2
0
        ## asymptotes
        self.addChild(Line([(-pi / 2, -5, 0), (-pi / 2, 5, 0)], color=(1, .5, .5)))
        self.addChild(Line([(pi / 2, -5, 0), (pi / 2, 5, 0)], color=(1, .5, .5)))

        # curve.attachField will create an arrow starting at the curve and ending in the vector given by derivative
        tangent_vector = curve.attachField("tangent", lambda t: Vec3(1, 1 / cos(t) ** 2, 0))
        # by default the arrow doesn't have a tail
        tangent_vector.add_tail(radius=0.08)
        # set up the default animations for this page (just the animation for the tangent_vector object in this case)
        self.setupAnimations([tangent_vector])


class PlaneCurves(Chapter):
    def __init__(self):
        Chapter.__init__(self, name="Plane Curve")
        self.addPage(Tangent())

if __name__ == "__main__":
    import sys
    from superficie.viewer.Viewer import Viewer
    app = QtGui.QApplication(sys.argv)
    visor = Viewer()
    visor.book.addChapter(PlaneCurves())
    visor.whichChapter = 0
    visor.chapter.whichPage = 0
    visor.resize(400, 400)
    visor.show()
    visor.chaptersStack.show()
    visor.notesStack.show()
    sys.exit(app.exec_())