def curva(t): # return par(t,0.0) p = par(t, 0.0) return (0.98 * p[0], 0.98 * p[1], 0.0) def puntos(u): return Vec3(cos(u) * sin(u / 2.0), sin(u / 2.0) * sin(u), -cos(u / 2.0)) cm = Curve3D(curva, (-pi, pi, 200), color=_1(255, 255, 255), width=3) aceleracion_cm = cm.attachField("aceleracion", puntos).setLengthFactor(1).setWidthFactor(0.5) aceleracion_cm.animation.setDuration(12000) self.addChild(mobius) self.addChild(cm) self.addChild(Arrow((-1, 0, 0), (0, 0, 0), 0.02)) self.setupAnimations([aceleracion_cm]) class Superficies4(Chapter): def __init__(self): super(Superficies4, self).__init__(u"Isometría y orientación de superficies") figuras = [Helicoide, Catenoide, Mobius] for f in figuras: self.addPage(f()) if __name__ == "__main__": visor = main(Superficies4)
self.parent.setDrawStyle(SoQtViewer.VIEW_AS_IS) def getGui(self): return self.gui def setupGui(self): pass def setupPages(self): ## ============== ## Una clase de python ## con un atributo root de openinventor cubo = Cubo() self.objetos.append(cubo) ## ================== ## un objeto de openinventor directamente esfera = SoSphere() self.objetos.append(esfera) if __name__ == "__main__": app = main(sys.argv) window = Simetrias3D() window.resize(700,700) window.rotor.on = False window.show() window.ui.show() SoQt.mainLoop()
tangent_arrow.animateArrow(t) curvature_arrow.animateArrow(t) Slider(rangep=('t', 0,1.0,0,40),func=setSyncParam, duration=4000, parent=self) #self.setupAnimations( [ AnimationGroup( objects, (1000,0,999) ) ] ) class CurvaturasNormales(Chapter): def __init__(self): Chapter.__init__(self, name="Curvatura y secciones normales") figuras = [ Elipsoide1, Elipsoide2, Elipsoide3, Cilindro, Hiperboloide, Toro1, Toro2, Toro3 ] for f in figuras: self.addPage(f()) if __name__ == "__main__": visor = main(CurvaturasNormales)
params = [stereo, stereo2] ## no queremos los controles for i, p in enumerate(params): p.parameters['t%d' % (i + 1)].hide() anims = [ p.parameters['t%d' % (i + 1)].asAnimation() for i, p in enumerate(params) ] self.setupAnimations(anims) class Superficies1(Chapter): def __init__(self): super(Superficies1, self).__init__("Superficies y sus parametrizaciones") figuras = [ Plano1, ParaboloideEliptico, ParaboloideHiperbolico, LasilladelMono, Superficiecuartica, Conoderevolucion, Esfera, EsferaCasquetes ] for f in figuras: self.addPage(f()) if __name__ == "__main__": visor = main(Superficies1)