[cgkit-commits] cgkit2/cgkit torus.py,NONE,1.1 torusgeom.py,NONE,1.1 __init__.py,1.6,1.7
Brought to you by:
mbaas
From: Matthias B. <mb...@us...> - 2005-03-08 20:24:45
|
Update of /cvsroot/cgkit/cgkit2/cgkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17881/cgkit Modified Files: __init__.py Added Files: torus.py torusgeom.py Log Message: Initial torus geometry implementation (which is still a bit rough around the edges) --- NEW FILE: torus.py --- ########################################################################### # cgkit - Python Computer Graphics Kit # Copyright (C) 2004 Matthias Baas (ba...@ir...) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # cgkit homepage: http://cgkit.sourceforge.net ########################################################################### # $Id: torus.py,v 1.1 2005/03/08 20:24:34 mbaas Exp $ ## \file torus.py ## Contains the Torus class. from cgtypes import vec3 from Interfaces import * from worldobject import WorldObject from torusgeom import TorusGeom from slots import * import protocols # Torus class Torus(WorldObject): protocols.advise(instancesProvide=[ISceneItem]) def __init__(self, name = "Torus", major = 1.0, minor = 0.1, segmentsu = 16, segmentsv = 8, **params): WorldObject.__init__(self, name=name, **params) self.geom = TorusGeom(major, minor, segmentsu, segmentsv) def protocols(self): return [ISceneItem] Index: __init__.py =================================================================== RCS file: /cvsroot/cgkit/cgkit2/cgkit/__init__.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** __init__.py 3 Mar 2005 15:30:37 -0000 1.6 --- __init__.py 8 Mar 2005 20:24:34 -0000 1.7 *************** *** 58,61 **** --- 58,62 ---- from spheregeom import SphereGeom from ccylindergeom import CCylinderGeom + from torusgeom import TorusGeom from boxgeom import BoxGeom from planegeom import PlaneGeom *************** *** 67,70 **** --- 68,72 ---- from quadrics import Sphere from ccylinder import CCylinder + from torus import Torus from box import Box from plane import Plane --- NEW FILE: torusgeom.py --- ########################################################################### # cgkit - Python Computer Graphics Kit # Copyright (C) 2004 Matthias Baas (ba...@ir...) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # cgkit homepage: http://cgkit.sourceforge.net ########################################################################### # $Id: torusgeom.py,v 1.1 2005/03/08 20:24:34 mbaas Exp $ ## \file torusgeom.py ## Contains the TorusGeom class. import _core # TorusGeom class TorusGeom(_core.TorusGeom): def __init__(self, major=1.0, minor=0.1, segmentsu=16, segmentsv=8): _core.TorusGeom.__init__(self, major, minor, segmentsu, segmentsv) |