Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Gilbert <ascotan@gmail.com>2005-09-26 19:06:28 +0400
committerJoseph Gilbert <ascotan@gmail.com>2005-09-26 19:06:28 +0400
commit9656e8be02972740055f3614590645535840acc9 (patch)
tree68c2ef13b4a77769a801ecec60fb502a48da1d18 /source/blender/python/api2_2x/doc/Mathutils.py
parentb6ecdb8c354233c33dcd1282ddf8bc7e68120c37 (diff)
Theeth's mathutils patch
- adds intersections for lines - triangle area - tracking quaternion from vector - some helpful normal calculators
Diffstat (limited to 'source/blender/python/api2_2x/doc/Mathutils.py')
-rw-r--r--source/blender/python/api2_2x/doc/Mathutils.py95
1 files changed, 95 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py
index 0319553c6e6..0255f031ccc 100644
--- a/source/blender/python/api2_2x/doc/Mathutils.py
+++ b/source/blender/python/api2_2x/doc/Mathutils.py
@@ -39,6 +39,81 @@ def Rand (high = 1, low = 0):
@param low: The lower range.
"""
+def Intersect(vec1, vec2, vec3, ray, orig, clip=1):
+ """
+ Return the intersection between a ray and a triangle, if possible, return None otherwise.
+ @type vec1: Vector object.
+ @param vec1: A 3d vector, one corner of the triangle.
+ @type vec2: Vector object.
+ @param vec2: A 3d vector, one corner of the triangle.
+ @type vec3: Vector object.
+ @param vec3: A 3d vector, one corner of the triangle.
+ @type ray: Vector object.
+ @param ray: A 3d vector, the orientation of the ray.
+ @type orig: Vector object.
+ @param orig: A 3d vector, the origin of the ray.
+ @type clip: integer
+ @param clip: if 0, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
+ @rtype: Vector object
+ @return: The intersection between a ray and a triangle, if possible, None otherwise.
+ """
+
+def TriangleArea(vec1, vec2, vec3):
+ """
+ Return the area size of the 2D or 3D triangle defined.
+ @type vec1: Vector object.
+ @param vec1: A 2d or 3d vector, one corner of the triangle.
+ @type vec2: Vector object.
+ @param vec2: A 2d or 3d vector, one corner of the triangle.
+ @type vec3: Vector object.
+ @param vec3: A 2d or 3d vector, one corner of the triangle.
+ @rtype: float
+ @return: The area size of the 2D or 3D triangle defined.
+ """
+
+def TriangleNormal(vec1, vec2, vec3):
+ """
+ Return the normal of the 3D triangle defined.
+ @type vec1: Vector object.
+ @param vec1: A 3d vector, one corner of the triangle.
+ @type vec2: Vector object.
+ @param vec2: A 3d vector, one corner of the triangle.
+ @type vec3: Vector object.
+ @param vec3: A 3d vector, one corner of the triangle.
+ @rtype: float
+ @return: The normal of the 3D triangle defined.
+ """
+
+def QuadNormal(vec1, vec2, vec3, vec4):
+ """
+ Return the normal of the 3D quad defined.
+ @type vec1: Vector object.
+ @param vec1: A 3d vector, the first vertex of the quad.
+ @type vec2: Vector object.
+ @param vec2: A 3d vector, the second vertex of the quad.
+ @type vec3: Vector object.
+ @param vec3: A 3d vector, the third vertex of the quad.
+ @type vec4: Vector object.
+ @param vec4: A 3d vector, the fourth vertex of the quad.
+ @rtype: float
+ @return: The normal of the 3D quad defined.
+ """
+
+def LineIntersect(vec1, vec2, vec3, vec4):
+ """
+ Return a tuple with the points on each line respectively closest to the other (when both lines intersect, both vector hold the same value).
+ @type vec1: Vector object.
+ @param vec1: A 3d vector, one point on the first line.
+ @type vec2: Vector object.
+ @param vec2: A 3d vector, another point on the first line.
+ @type vec3: Vector object.
+ @param vec3: A 3d vector, one point on the second line.
+ @type vec4: Vector object.
+ @param vec4: A 3d vector, another point on the second line.
+ @rtype: (Vector object, Vector object)
+ @return: A tuple with the points on each line respectively closest to the other.
+ """
+
def CopyVec(vector):
"""
Create a copy of the Vector object.
@@ -356,6 +431,26 @@ class Vector:
Resize the vector to 4d.
"""
+ def toTrackQuat(track, up):
+ """
+ Return a quaternion rotation from the vector and the track and up axis.
+ @type track: String.
+ @param track: Possible values:
+ - "x - x-axis up"
+ - "y - y-axis up"
+ - "z - z-axis up"
+ - "-x - negative x-axis up"
+ - "-y - negative y-axis up"
+ - "-z - negative z-axis up"
+ @type up: String.
+ @param up: Possible values:
+ - "x - x-axis up"
+ - "y - y-axis up"
+ - "z - z-axis up"
+ @rtype: Quaternion
+ @return: Return a quaternion rotation from the vector and the track and up axis.
+ """
+
class Euler:
"""
The Euler object