Geometry Utilities (mathutils.geometry)

The Blender geometry module

mathutils.geometry.BarycentricTransform()

Undocumented (contribute)

mathutils.geometry.BezierInterp()

Undocumented (contribute)

mathutils.geometry.BoxPack2D()

Undocumented (contribute)

mathutils.geometry.ClosestPointOnLine(pt, line_p1, line_p2)

Takes a point and a line and returns a tuple with the closest point on the line and its distance from the first point of the line as a percentage of the length of the line.

Return type:

(mathutils.Vector, float)

Parameters:
mathutils.geometry.Intersect(v1, v2, v3, ray, orig, clip=True)

Returns the intersection between a ray and a triangle, if possible, returns None otherwise.

Return type:

boolean

Parameters:
mathutils.geometry.LineIntersect(v1, v2, v3, v4)

Returns a tuple with the points on each line respectively closest to the other.

Return type:

tuple with elements being of type mathutils.Vector

Parameters:
mathutils.geometry.LineIntersect2D(lineA_p1, lineA_p2, lineB_p1, lineB_p2)

Takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None.

Return type:

mathutils.Vector

Parameters:
mathutils.geometry.PointInQuad2D(pt, quad_p1, quad_p2, quad_p3, quad_p4)

Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad, only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.

Return type:

int

Parameters:
mathutils.geometry.PointInTriangle2D(pt, tri_p1, tri_p2, tri_p3)

Takes 4 vectors (using only the x and y coordinates): one is the point and the next 3 define the triangle. Returns 1 if the point is within the triangle, otherwise 0.

Return type:

int

Parameters:
mathutils.geometry.PolyFill(veclist_list)

Takes a list of polylines (each point a vector) and returns the point indicies for a polyline filled with triangles.

Return type:

list

Parameters:
  • veclist_list – list of polylines
mathutils.geometry.QuadNormal(v1, v2, v3, v4)

Returns the normal of the 3D quad defined.

Return type:

mathutils.Vector

Parameters:
mathutils.geometry.TriangleArea(v1, v2, v3)

Returns the area size of the 2D or 3D triangle defined.

Return type:

float

Parameters:
mathutils.geometry.TriangleNormal(v1, v2, v3)

Returns the normal of the 3D triangle defined.

Return type:

mathutils.Vector

Parameters:

Previous topic

Math Types & Utilities (mathutils)

Next topic

Font Drawing (blf)