1. German Larrain
  2. ars

Commits

German Larrain  committed 9564ee9

collision.base.HeightfieldTrimesh.calc_faces: edited docstring considerably.

  • Participants
  • Parent commits 874189f
  • Branches dev

Comments (0)

Files changed (1)

File ars/model/collision/base.py

View file
  • Ignore whitespace
 
 	@staticmethod
 	def calc_faces(size_x, size_z):
-		"""Create the faces corresponding to a heightfield size 'size_x' by
-		'size_z'. Faces are triangular, so each is composed by 3 vertices.
+		"""Return the faces for a horizontal grid of ``size_x`` by ``size_z``
+		cells.
+
+		Faces are triangular, so each is composed by 3 vertices. Consequently,
+		each returned face is a length-3 sequence of the vertex indices.
+
+		:param size_x: number of cells along the X axis
+		:type size_x: positive int
+		:param size_z: number of cells along the Z axis
+		:type size_z: positive int
+		:return: faces for a heightfield trimesh based in a horizontal grid of
+			``size_x`` by ``size_z`` cells
+		:rtype: list of 3-tuple of ints
+
+		>>> HeightfieldTrimesh.calc_faces(2, 4)
+		[(0, 1, 4), (1, 5, 4), (1, 6, 5), (1, 2, 6), (2, 3, 6), (3, 7, 6)]
 
 		"""
 		# index of each square is calculated because it is needed to define faces