← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2430: (Antons changes)

 

------------------------------------------------------------
revno: 2430
committer: Chiara Modenese <chia@engs-018373>
branch nick: trunk
timestamp: Fri 2010-09-10 12:30:21 +0100
message:
  (Antons changes)
  1. angleRange parameter is added to facetCylinder to create "semi-cylinders", "quarter-cylinders" etc.
  2. Prepare Sconstruct for compiling in Fedora (partly)
modified:
  SConstruct
  py/utils.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'SConstruct'
--- SConstruct	2010-09-09 09:51:23 +0000
+++ SConstruct	2010-09-10 11:30:21 +0000
@@ -148,7 +148,7 @@
 	('chunkSize','Maximum files to compile in one translation unit when building plugins. (unlimited if <= 0, per-file linkage is used if 1)',7,None,int),
 	('version','Yade version (if not specified, guess will be attempted)',None),
 	('realVersion','Revision (usually bzr revision); guessed automatically unless specified',None),
-	('CPPPATH', 'Additional paths for the C preprocessor (colon-separated)','/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2'), # hardy has vtk-5.0
+	('CPPPATH', 'Additional paths for the C preprocessor (colon-separated)','/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2:/usr/include/vtk'), # hardy has vtk-5.0
 	('LIBPATH','Additional paths for the linker (colon-separated)',None),
 	('libstdcxx','Specify libstdc++ location by hand (opened dynamically at startup); only needed when compiling with clang',None),
 	('QT4DIR','Directory where Qt4 is installed','/usr/share/qt4'),

=== modified file 'py/utils.py'
--- py/utils.py	2010-09-09 09:51:23 +0000
+++ py/utils.py	2010-09-10 11:30:21 +0000
@@ -341,7 +341,7 @@
 	if wallMask&32: ret+=doWall(E,H,G,F)
 	return ret
 	
-def facetCylinder(center,radius,height,orientation=Quaternion.Identity,segmentsNumber=10,wallMask=7,closed=1,**kw):
+def facetCylinder(center,radius,height,orientation=Quaternion.Identity,segmentsNumber=10,wallMask=7,angleRange=2.0*math.pi,**kw):
 	"""
 	Create arbitrarily-aligned cylinder composed of facets, with given center, radius, height and orientation.
 	Return List of facets forming the cylinder;
@@ -359,6 +359,7 @@
 				number of edges on the cylinder surface (>=5)
 			`wallMask`: bitmask
 				determines which walls will be created, in the order up (1), down (2), side (4). The numbers are ANDed; the default 7 means to create all walls;
+			`angleRange`: this variable allows to create only part of cylinder, 2.0*math.pi means the whole cylinder, 1.0*math.pi - the half etc;
 			`**kw`: (unused keyword arguments)
 				passed to utils.facet;
 	"""
@@ -375,7 +376,7 @@
 		wallMask=7
 	# ___________________________
 	import numpy
-	anglesInRad = numpy.linspace(0, 2.0*math.pi, segmentsNumber+1, endpoint=True)
+	anglesInRad = numpy.linspace(0, angleRange, segmentsNumber+1, endpoint=True)
 	P1=[]; P2=[]
 	P1.append(Vector3(0,0,-height/2))
 	P2.append(Vector3(0,0,+height/2))