|
Blender V4.3
|
#include <Python.h>#include "mathutils.hh"#include "mathutils_geometry.hh"#include "BKE_curve.hh"#include "BKE_displist.h"#include "BLI_blenlib.h"#include "BLI_boxpack_2d.h"#include "BLI_convexhull_2d.h"#include "BLI_delaunay_2d.hh"#include "MEM_guardedalloc.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "../generic/py_capi_utils.hh"#include "../generic/python_utildefines.hh"Go to the source code of this file.
Classes | |
| struct | PointsInPlanes_UserData |
Functions | |
| PyDoc_STRVAR (M_Geometry_doc, "The Blender geometry module") | |
| PyDoc_STRVAR (M_Geometry_intersect_ray_tri_doc, ".. function:: intersect_ray_tri(v1, v2, v3, ray, orig, clip=True)\n" "\n" " Returns the intersection between a ray and a triangle, if possible, returns None " "otherwise.\n" "\n" " :arg v1: Point1\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Point2\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: Point3\n" " :type v3: :class:`mathutils.Vector`\n" " :arg ray: Direction of the projection\n" " :type ray: :class:`mathutils.Vector`\n" " :arg orig: Origin\n" " :type orig: :class:`mathutils.Vector`\n" " :arg clip: When False, don't restrict the intersection to the area of the " "triangle, use the infinite plane defined by the triangle.\n" " :type clip: bool\n" " :return: The point of intersection or None if no intersection is found\n" " :rtype: :class:`mathutils.Vector` | None\n") | |
| static PyObject * | M_Geometry_intersect_ray_tri (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_line_line_doc, ".. function:: intersect_line_line(v1, v2, v3, v4)\n" "\n" " Returns a tuple with the points on each line respectively closest to the other.\n" "\n" " :arg v1: First point of the first line\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Second point of the first line\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: First point of the second line\n" " :type v3: :class:`mathutils.Vector`\n" " :arg v4: Second point of the second line\n" " :type v4: :class:`mathutils.Vector`\n" " :return: The intersection on each line or None when the lines are co-linear.\n" " :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | None\n") | |
| static PyObject * | M_Geometry_intersect_line_line (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_sphere_sphere_2d_doc, ".. function:: intersect_sphere_sphere_2d(p_a, radius_a, p_b, radius_b)\n" "\n" " Returns 2 points on between intersecting circles.\n" "\n" " :arg p_a: Center of the first circle\n" " :type p_a: :class:`mathutils.Vector`\n" " :arg radius_a: Radius of the first circle\n" " :type radius_a: float\n" " :arg p_b: Center of the second circle\n" " :type p_b: :class:`mathutils.Vector`\n" " :arg radius_b: Radius of the second circle\n" " :type radius_b: float\n" " :return: 2 points on between intersecting circles or None when there is no intersection.\n" " :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | tuple[None, " "None]\n") | |
| static PyObject * | M_Geometry_intersect_sphere_sphere_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_tri_tri_2d_doc, ".. function:: intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n" "\n" " Check if two 2D triangles intersect.\n" "\n" " :rtype: bool\n") | |
| static PyObject * | M_Geometry_intersect_tri_tri_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_normal_doc, ".. function:: normal(vectors)\n" "\n" " Returns the normal of a 3D polygon.\n" "\n" " :arg vectors: 3 or more vectors to calculate normals.\n" " :type vectors: Sequence[Sequence[float]]\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | M_Geometry_normal (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_area_tri_doc, ".. function:: area_tri(v1, v2, v3)\n" "\n" " Returns the area size of the 2D or 3D triangle defined.\n" "\n" " :arg v1: Point1\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Point2\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: Point3\n" " :type v3: :class:`mathutils.Vector`\n" " :rtype: float\n") | |
| static PyObject * | M_Geometry_area_tri (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_volume_tetrahedron_doc, ".. function:: volume_tetrahedron(v1, v2, v3, v4)\n" "\n" " Return the volume formed by a tetrahedron (points can be in any order).\n" "\n" " :arg v1: Point1\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Point2\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: Point3\n" " :type v3: :class:`mathutils.Vector`\n" " :arg v4: Point4\n" " :type v4: :class:`mathutils.Vector`\n" " :rtype: float\n") | |
| static PyObject * | M_Geometry_volume_tetrahedron (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_line_line_2d_doc, ".. function:: intersect_line_line_2d(lineA_p1, lineA_p2, lineB_p1, lineB_p2)\n" "\n" " Takes 2 segments (defined by 4 vectors) and returns a vector for their point of " "intersection or None.\n" "\n" " .. warning:: Despite its name, this function works on segments, and not on lines.\n" "\n" " :arg lineA_p1: First point of the first line\n" " :type lineA_p1: :class:`mathutils.Vector`\n" " :arg lineA_p2: Second point of the first line\n" " :type lineA_p2: :class:`mathutils.Vector`\n" " :arg lineB_p1: First point of the second line\n" " :type lineB_p1: :class:`mathutils.Vector`\n" " :arg lineB_p2: Second point of the second line\n" " :type lineB_p2: :class:`mathutils.Vector`\n" " :return: The point of intersection or None when not found\n" " :rtype: :class:`mathutils.Vector` | None\n") | |
| static PyObject * | M_Geometry_intersect_line_line_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_line_plane_doc, ".. function:: intersect_line_plane(line_a, line_b, plane_co, plane_no, no_flip=False)\n" "\n" " Calculate the intersection between a line (as 2 vectors) and a plane.\n" " Returns a vector for the intersection or None.\n" "\n" " :arg line_a: First point of the first line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the first line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg plane_co: A point on the plane\n" " :type plane_co: :class:`mathutils.Vector`\n" " :arg plane_no: The direction the plane is facing\n" " :type plane_no: :class:`mathutils.Vector`\n" " :return: The point of intersection or None when not found\n" " :rtype: :class:`mathutils.Vector` | None\n") | |
| static PyObject * | M_Geometry_intersect_line_plane (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_plane_plane_doc, ".. function:: intersect_plane_plane(plane_a_co, plane_a_no, plane_b_co, plane_b_no)\n" "\n" " Return the intersection between two planes\n" "\n" " :arg plane_a_co: Point on the first plane\n" " :type plane_a_co: :class:`mathutils.Vector`\n" " :arg plane_a_no: Normal of the first plane\n" " :type plane_a_no: :class:`mathutils.Vector`\n" " :arg plane_b_co: Point on the second plane\n" " :type plane_b_co: :class:`mathutils.Vector`\n" " :arg plane_b_no: Normal of the second plane\n" " :type plane_b_no: :class:`mathutils.Vector`\n" " :return: The line of the intersection represented as a point and a vector or None if the " "intersection can't be calculated\n" " :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | tuple[None, " "None]\n") | |
| static PyObject * | M_Geometry_intersect_plane_plane (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_line_sphere_doc, ".. function:: intersect_line_sphere(line_a, line_b, sphere_co, sphere_radius, clip=True)\n" "\n" " Takes a line (as 2 points) and a sphere (as a point and a radius) and\n" " returns the intersection\n" "\n" " :arg line_a: First point of the line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg sphere_co: The center of the sphere\n" " :type sphere_co: :class:`mathutils.Vector`\n" " :arg sphere_radius: Radius of the sphere\n" " :type sphere_radius: float\n" " :return: The intersection points as a pair of vectors or None when there is no " "intersection\n" " :rtype: tuple[:class:`mathutils.Vector` | None, :class:`mathutils.Vector` | None]\n") | |
| static PyObject * | M_Geometry_intersect_line_sphere (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_line_sphere_2d_doc, ".. function:: intersect_line_sphere_2d(line_a, line_b, sphere_co, sphere_radius, clip=True)\n" "\n" " Takes a line (as 2 points) and a sphere (as a point and a radius) and\n" " returns the intersection\n" "\n" " :arg line_a: First point of the line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg sphere_co: The center of the sphere\n" " :type sphere_co: :class:`mathutils.Vector`\n" " :arg sphere_radius: Radius of the sphere\n" " :type sphere_radius: float\n" " :return: The intersection points as a pair of vectors or None when there is no " "intersection\n" " :rtype: tuple[:class:`mathutils.Vector` | None, :class:`mathutils.Vector` | None]\n") | |
| static PyObject * | M_Geometry_intersect_line_sphere_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_point_line_doc, ".. function:: intersect_point_line(pt, line_p1, line_p2)\n" "\n" " 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.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg line_p1: First point of the line\n" " :type line_p1: :class:`mathutils.Vector`\n" " :arg line_p1: Second point of the line\n" " :type line_p1: :class:`mathutils.Vector`\n" " :rtype: tuple[:class:`mathutils.Vector`, float]\n") | |
| static PyObject * | M_Geometry_intersect_point_line (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_point_tri_doc, ".. function:: intersect_point_tri(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " Takes 4 vectors: one is the point and the next 3 define the triangle. Projects " "the point onto the triangle plane and checks if it is within the triangle.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg tri_p1: First point of the triangle\n" " :type tri_p1: :class:`mathutils.Vector`\n" " :arg tri_p2: Second point of the triangle\n" " :type tri_p2: :class:`mathutils.Vector`\n" " :arg tri_p3: Third point of the triangle\n" " :type tri_p3: :class:`mathutils.Vector`\n" " :return: Point on the triangles plane or None if its outside the triangle\n" " :rtype: :class:`mathutils.Vector` | None\n") | |
| static PyObject * | M_Geometry_intersect_point_tri (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_closest_point_on_tri_doc, ".. function:: closest_point_on_tri(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " Takes 4 vectors: one is the point and the next 3 define the triangle.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg tri_p1: First point of the triangle\n" " :type tri_p1: :class:`mathutils.Vector`\n" " :arg tri_p2: Second point of the triangle\n" " :type tri_p2: :class:`mathutils.Vector`\n" " :arg tri_p3: Third point of the triangle\n" " :type tri_p3: :class:`mathutils.Vector`\n" " :return: The closest point of the triangle.\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | M_Geometry_closest_point_on_tri (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_point_tri_2d_doc, ".. function:: intersect_point_tri_2d(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " 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.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg tri_p1: First point of the triangle\n" " :type tri_p1: :class:`mathutils.Vector`\n" " :arg tri_p2: Second point of the triangle\n" " :type tri_p2: :class:`mathutils.Vector`\n" " :arg tri_p3: Third point of the triangle\n" " :type tri_p3: :class:`mathutils.Vector`\n" " :rtype: int\n") | |
| static PyObject * | M_Geometry_intersect_point_tri_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_intersect_point_quad_2d_doc, ".. function:: intersect_point_quad_2d(pt, quad_p1, quad_p2, quad_p3, quad_p4)\n" "\n" " Takes 5 vectors (using only the x and y coordinates): one is the point and the " "next 4 define the quad,\n" " only the x and y are used from the vectors. Returns 1 if the point is within the " "quad, otherwise 0.\n" " Works only with convex quads without singular edges.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg quad_p1: First point of the quad\n" " :type quad_p1: :class:`mathutils.Vector`\n" " :arg quad_p2: Second point of the quad\n" " :type quad_p2: :class:`mathutils.Vector`\n" " :arg quad_p3: Third point of the quad\n" " :type quad_p3: :class:`mathutils.Vector`\n" " :arg quad_p4: Fourth point of the quad\n" " :type quad_p4: :class:`mathutils.Vector`\n" " :rtype: int\n") | |
| static PyObject * | M_Geometry_intersect_point_quad_2d (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_distance_point_to_plane_doc, ".. function:: distance_point_to_plane(pt, plane_co, plane_no)\n" "\n" " Returns the signed distance between a point and a plane " " (negative when below the normal).\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg plane_co: A point on the plane\n" " :type plane_co: :class:`mathutils.Vector`\n" " :arg plane_no: The direction the plane is facing\n" " :type plane_no: :class:`mathutils.Vector`\n" " :rtype: float\n") | |
| static PyObject * | M_Geometry_distance_point_to_plane (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_barycentric_transform_doc, ".. function:: barycentric_transform(point, tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n" "\n" " Return a transformed point, the transformation is defined by 2 triangles.\n" "\n" " :arg point: The point to transform.\n" " :type point: :class:`mathutils.Vector`\n" " :arg tri_a1: source triangle vertex.\n" " :type tri_a1: :class:`mathutils.Vector`\n" " :arg tri_a2: source triangle vertex.\n" " :type tri_a2: :class:`mathutils.Vector`\n" " :arg tri_a3: source triangle vertex.\n" " :type tri_a3: :class:`mathutils.Vector`\n" " :arg tri_b1: target triangle vertex.\n" " :type tri_b1: :class:`mathutils.Vector`\n" " :arg tri_b2: target triangle vertex.\n" " :type tri_b2: :class:`mathutils.Vector`\n" " :arg tri_b3: target triangle vertex.\n" " :type tri_b3: :class:`mathutils.Vector`\n" " :return: The transformed point\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | M_Geometry_barycentric_transform (PyObject *, PyObject *args) |
| static void | points_in_planes_fn (const float co[3], int i, int j, int k, void *user_data_p) |
| PyDoc_STRVAR (M_Geometry_points_in_planes_doc, ".. function:: points_in_planes(planes, epsilon_coplanar=1e-4, epsilon_isect=1e-6)\n" "\n" " Returns a list of points inside all planes given and a list of index values for " "the planes used.\n" "\n" " :arg planes: List of planes (4D vectors).\n" " :type planes: list[:class:`mathutils.Vector`]\n" " :arg epsilon_coplanar: Epsilon value for interpreting plane pairs as co-plannar.\n" " :type epsilon_coplanar: float\n" " :arg epsilon_isect: Epsilon value for intersection.\n" " :type epsilon_isect: float\n" " :return: Two lists, once containing the 3D coordinates inside the planes, " "another containing the plane indices used.\n" " :rtype: tuple[list[:class:`mathutils.Vector`], list[int]]\n") | |
| static PyObject * | M_Geometry_points_in_planes (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_interpolate_bezier_doc, ".. function:: interpolate_bezier(knot1, handle1, handle2, knot2, resolution)\n" "\n" " Interpolate a bezier spline segment.\n" "\n" " :arg knot1: First bezier spline point.\n" " :type knot1: :class:`mathutils.Vector`\n" " :arg handle1: First bezier spline handle.\n" " :type handle1: :class:`mathutils.Vector`\n" " :arg handle2: Second bezier spline handle.\n" " :type handle2: :class:`mathutils.Vector`\n" " :arg knot2: Second bezier spline point.\n" " :type knot2: :class:`mathutils.Vector`\n" " :arg resolution: Number of points to return.\n" " :type resolution: int\n" " :return: The interpolated points.\n" " :rtype: list[:class:`mathutils.Vector`]\n") | |
| static PyObject * | M_Geometry_interpolate_bezier (PyObject *, PyObject *args) |
| PyDoc_STRVAR (M_Geometry_tessellate_polygon_doc, ".. function:: tessellate_polygon(polylines)\n" "\n" " Takes a list of polylines (each point a pair or triplet of numbers) and returns " "the point indices for a polyline filled with triangles. Does not handle degenerate " "geometry (such as zero-length lines due to consecutive identical points).\n" "\n" " :arg polylines: Polygons where each polygon is a sequence of 2D or 3D points.\n" " :type polylines: Sequence[Sequence[Sequence[float]]]" " :return: A list of triangles.\n" " :rtype: list[tuple[int, int, int]]\n") | |
| static PyObject * | M_Geometry_tessellate_polygon (PyObject *, PyObject *polyLineSeq) |
| static int | boxPack_FromPyObject (PyObject *value, BoxPack **r_boxarray) |
| static void | boxPack_ToPyObject (PyObject *value, const BoxPack *boxarray) |
| PyDoc_STRVAR (M_Geometry_box_pack_2d_doc, ".. function:: box_pack_2d(boxes)\n" "\n" " Returns a tuple with the width and height of the packed bounding box.\n" "\n" " :arg boxes: list of boxes, each box is a list where the first 4 items are " "[X, Y, width, height, ...] other items are ignored. " "The X & Y values in this list are modified to set the packed positions.\n" " :type boxes: list[list[float, float, float, float, ...]]\n" " :return: The width and height of the packed bounding box.\n" " :rtype: tuple[float, float]\n") | |
| static PyObject * | M_Geometry_box_pack_2d (PyObject *, PyObject *boxlist) |
| PyDoc_STRVAR (M_Geometry_box_fit_2d_doc, ".. function:: box_fit_2d(points)\n" "\n" " Returns an angle that best fits the points to an axis aligned rectangle\n" "\n" " :arg points: Sequence of 2D points.\n" " :type points: Sequence[Sequence[float]]\n" " :return: angle\n" " :rtype: float\n") | |
| static PyObject * | M_Geometry_box_fit_2d (PyObject *, PyObject *pointlist) |
| PyDoc_STRVAR (M_Geometry_convex_hull_2d_doc, ".. function:: convex_hull_2d(points)\n" "\n" " Returns a list of indices into the list given\n" "\n" " :arg points: Sequence of 2D points.\n" " :type points: Sequence[Sequence[float]]\n" " :return: a list of indices\n" " :rtype: list[int]\n") | |
| static PyObject * | M_Geometry_convex_hull_2d (PyObject *, PyObject *pointlist) |
| static PyObject * | list_of_lists_from_arrays (const blender::Span< blender::Vector< int > > data) |
| PyDoc_STRVAR (M_Geometry_delaunay_2d_cdt_doc, ".. function:: delaunay_2d_cdt(vert_coords, edges, faces, output_type, epsilon, " "need_ids=True)\n" "\n" " Computes the Constrained Delaunay Triangulation of a set of vertices,\n" " with edges and faces that must appear in the triangulation.\n" " Some triangles may be eaten away, or combined with other triangles,\n" " according to output type.\n" " The returned verts may be in a different order from input verts, may be moved\n" " slightly, and may be merged with other nearby verts.\n" " The three returned orig lists give, for each of verts, edges, and faces, the list of\n" " input element indices corresponding to the positionally same output element.\n" " For edges, the orig indices start with the input edges and then continue\n" " with the edges implied by each of the faces (n of them for an n-gon).\n" " If the need_ids argument is supplied, and False, then the code skips the preparation\n" " of the orig arrays, which may save some time.\n" "\n" " :arg vert_coords: Vertex coordinates (2d)\n" " :type vert_coords: Sequence[:class:`mathutils.Vector`]\n" " :arg edges: Edges, as pairs of indices in ``vert_coords``\n" " :type edges: Sequence[Sequence[int, int]]\n" " :arg faces: Faces, each sublist is a face, as indices in `vert_coords` (CCW oriented)\n" " :type faces: Sequence[Sequence[int]]\n" " :arg output_type: What output looks like. 0 => triangles with convex hull. " "1 => triangles inside constraints. " "2 => the input constraints, intersected. " "3 => like 2 but detect holes and omit them from output. " "4 => like 2 but with extra edges to make valid BMesh faces. " "5 => like 4 but detect holes and omit them from output.\n" " :type output_type: int\n" " :arg epsilon: For nearness tests; should not be zero\n" " :type epsilon: float\n" " :arg need_ids: are the orig output arrays needed?\n" " :type need_args: bool\n" " :return: Output tuple, (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)\n" " :rtype: tuple[" "list[:class:`mathutils.Vector`], " "list[tuple[int, int]], " "list[list[int]], " "list[list[int]], " "list[list[int]], " "list[list[int]]]\n" "\n") | |
| static PyObject * | M_Geometry_delaunay_2d_cdt (PyObject *, PyObject *args) |
| PyMODINIT_FUNC | PyInit_mathutils_geometry () |
Variables | |
| static PyMethodDef | M_Geometry_methods [] |
| static PyModuleDef | M_Geometry_module_def |
Definition at line 1398 of file mathutils_geometry.cc.
References float, len, MEM_freeN(), and MEM_mallocN.
Referenced by M_Geometry_box_pack_2d().
|
static |
Definition at line 1447 of file mathutils_geometry.cc.
References len.
Referenced by M_Geometry_box_pack_2d().
|
static |
Definition at line 1592 of file mathutils_geometry.cc.
References ret.
Referenced by M_Geometry_delaunay_2d_cdt().
|
static |
Definition at line 404 of file mathutils_geometry.cc.
References area_tri_v2(), area_tri_v3(), len, mathutils_array_parse(), UNPACK3, and UNPACK3_EX.
|
static |
Definition at line 1102 of file mathutils_geometry.cc.
References ARRAY_SIZE, mathutils_array_parse(), MU_ARRAY_SPILL, transform_point_by_tri_v3(), UNPACK3, UNPACK3_EX, and Vector_CreatePyObject().
|
static |
Definition at line 1518 of file mathutils_geometry.cc.
References BLI_convexhull_aabb_fit_points_2d(), float, len, and mathutils_array_parse_alloc_v().
|
static |
Definition at line 1475 of file mathutils_geometry.cc.
References BLI_box_pack_2d(), boxPack_FromPyObject(), boxPack_ToPyObject(), len, MEM_freeN(), PyTuple_SET_ITEMS, and ret.
|
static |
Definition at line 927 of file mathutils_geometry.cc.
References ARRAY_SIZE, closest_on_tri_to_point_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, UNPACK3, UNPACK3_EX, and Vector_CreatePyObject().
|
static |
Definition at line 1551 of file mathutils_geometry.cc.
References BLI_convexhull_2d(), float, len, mathutils_array_parse_alloc_v(), MEM_freeN(), MEM_mallocN, and ret.
|
static |
Definition at line 1654 of file mathutils_geometry.cc.
References BLI_SCOPED_DEFER, double(), blender::meshintersect::CDT_result< T >::edge, blender::meshintersect::CDT_result< T >::edge_orig, blender::meshintersect::CDT_result< T >::face, blender::meshintersect::CDT_result< T >::face_orig, faces, blender::Array< T, InlineBufferCapacity, Allocator >::first(), float, blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), int, list_of_lists_from_arrays(), mathutils_array_parse_alloc_v(), mathutils_array_parse_alloc_vi(), mathutils_array_parse_alloc_viseq(), blender::Array< T, InlineBufferCapacity, Allocator >::size(), Vector_CreatePyObject(), blender::meshintersect::CDT_input< T >::vert, blender::meshintersect::CDT_result< T >::vert, blender::meshintersect::CDT_result< T >::vert_orig, and verts.
|
static |
Definition at line 1056 of file mathutils_geometry.cc.
References dist_signed_to_plane_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, and plane_from_point_normal_v3().
|
static |
Definition at line 1238 of file mathutils_geometry.cc.
References BKE_curve_forward_diff_bezier(), mathutils_array_parse(), max_ii(), MEM_callocN, MEM_freeN(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, UNPACK4_EX, and Vector_CreatePyObject().
|
static |
Definition at line 169 of file mathutils_geometry.cc.
References closest_to_line_v3(), isect_line_line_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, PyTuple_SET_ITEMS, result, UNPACK4, UNPACK4_EX, and Vector_CreatePyObject().
|
static |
Definition at line 481 of file mathutils_geometry.cc.
References ARRAY_SIZE, isect_seg_seg_v2_point(), mathutils_array_parse(), MU_ARRAY_SPILL, UNPACK4, UNPACK4_EX, and Vector_CreatePyObject().
|
static |
Definition at line 524 of file mathutils_geometry.cc.
References isect_line_plane_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, PyC_ParseBool(), and Vector_CreatePyObject().
|
static |
Definition at line 651 of file mathutils_geometry.cc.
References isect_line_sphere_v3(), line_point_factor_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, PyC_ParseBool(), PyTuple_SET_ITEMS, ret, and Vector_CreatePyObject().
|
static |
Definition at line 742 of file mathutils_geometry.cc.
References isect_line_sphere_v2(), line_point_factor_v2(), mathutils_array_parse(), MU_ARRAY_SPILL, PyC_ParseBool(), PyTuple_SET_ITEMS, ret, and Vector_CreatePyObject().
|
static |
Definition at line 580 of file mathutils_geometry.cc.
References isect_plane_plane_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, normalize_v3(), plane_from_point_normal_v3(), PyTuple_SET_ITEMS, ret, and Vector_CreatePyObject().
|
static |
Definition at line 828 of file mathutils_geometry.cc.
References closest_to_line_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, PyTuple_SET_ITEMS, ret, and Vector_CreatePyObject().
|
static |
Definition at line 1018 of file mathutils_geometry.cc.
References ARRAY_SIZE, isect_point_quad_v2(), mathutils_array_parse(), MU_ARRAY_SPILL, quad, UNPACK4, and UNPACK4_EX.
|
static |
Definition at line 879 of file mathutils_geometry.cc.
References ARRAY_SIZE, isect_point_tri_v3(), mathutils_array_parse(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, UNPACK3, UNPACK3_EX, and Vector_CreatePyObject().
|
static |
Definition at line 973 of file mathutils_geometry.cc.
References ARRAY_SIZE, isect_point_tri_v2(), mathutils_array_parse(), MU_ARRAY_SPILL, UNPACK3, and UNPACK3_EX.
|
static |
Definition at line 63 of file mathutils_geometry.cc.
References add_v3_v3v3(), ARRAY_SIZE, cross_v3_v3v3(), dot_v3v3(), mathutils_array_parse(), MU_ARRAY_SPILL, MU_ARRAY_ZERO, mul_v3_fl(), normalize_v3(), PyC_ParseBool(), sub_v3_v3v3(), UNPACK3_EX, v, and Vector_CreatePyObject().
|
static |
Definition at line 249 of file mathutils_geometry.cc.
References fabsf, len_v2(), mathutils_array_parse(), powf, PyTuple_SET_ITEMS, ret, sub_v2_v2v2(), and Vector_CreatePyObject().
|
static |
Definition at line 315 of file mathutils_geometry.cc.
References isect_tri_tri_v2(), mathutils_array_parse(), MU_ARRAY_SPILL, ret, and UNPACK3.
|
static |
Definition at line 357 of file mathutils_geometry.cc.
References float, mathutils_array_parse_alloc_v(), MU_ARRAY_SPILL, normal_poly_v3(), ret, and Vector_CreatePyObject().
|
static |
Definition at line 1167 of file mathutils_geometry.cc.
References float, isect_planes_v3_fn(), mathutils_array_parse_alloc_v(), points_in_planes_fn(), PointsInPlanes_UserData::py_verts, PyTuple_SET_ITEMS, and ret.
|
static |
Definition at line 1297 of file mathutils_geometry.cc.
References BKE_displist_fill(), BKE_displist_free(), BLI_addtail(), DispList::col, DL_POLY, ListBase::first, DispList::index, mathutils_array_parse(), MEM_callocN, MEM_mallocN, MU_ARRAY_SPILL, DispList::nr, DispList::parts, PyC_Tuple_Pack_I32(), DispList::type, UNLIKELY, and DispList::verts.
|
static |
Definition at line 441 of file mathutils_geometry.cc.
References ARRAY_SIZE, mathutils_array_parse(), MU_ARRAY_SPILL, UNPACK4, UNPACK4_EX, and volume_tetrahedron_v3().
|
static |
Definition at line 1141 of file mathutils_geometry.cc.
References PointsInPlanes_UserData::planes_used, PointsInPlanes_UserData::py_verts, and Vector_CreatePyObject().
Referenced by M_Geometry_points_in_planes().
| PyDoc_STRVAR | ( | M_Geometry_area_tri_doc | , |
| ".. function:: area_tri(v1, v2, v3)\n" "\n" " Returns the area size of the 2D or 3D triangle defined.\n" "\n" " :arg v1: Point1\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Point2\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: Point3\n" " :type v3: :class:`mathutils.Vector`\n" " :rtype: float\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_barycentric_transform_doc | , |
| ".. function:: barycentric_transform(point, tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n" "\n" " Return a transformed | point, | ||
| the transformation is defined by 2 triangles.\n" "\n" " :arg point:The point to transform.\n" " :type point::class:`mathutils.Vector`\n" " :arg tri_a1:source triangle vertex.\n" " :type tri_a1::class:`mathutils.Vector`\n" " :arg tri_a2:source triangle vertex.\n" " :type tri_a2::class:`mathutils.Vector`\n" " :arg tri_a3:source triangle vertex.\n" " :type tri_a3::class:`mathutils.Vector`\n" " :arg tri_b1:target triangle vertex.\n" " :type tri_b1::class:`mathutils.Vector`\n" " :arg tri_b2:target triangle vertex.\n" " :type tri_b2::class:`mathutils.Vector`\n" " :arg tri_b3:target triangle vertex.\n" " :type tri_b3::class:`mathutils.Vector`\n" " :return:The transformed point\n" " :rtype::class:`mathutils.Vector`\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_box_fit_2d_doc | , |
| ".. function:: box_fit_2d(points)\n" "\n" " Returns an angle that best fits the points to an axis aligned rectangle\n" "\n" " :arg points: Sequence of 2D points.\n" " :type points: Sequence]\n" " :return: angle\n" " :rtype: float\n" | [Sequence[float] ) |
| PyDoc_STRVAR | ( | M_Geometry_box_pack_2d_doc | , |
| ".. function:: box_pack_2d(boxes)\n" "\n" " Returns a tuple with the width and height of the packed bounding box.\n" "\n" " :arg boxes: list of | boxes, | ||
| each box is a list where the first 4 items are " " other items are ignored. " "The X &Y values in this list are modified to set the packed positions.\n" " :type boxes:list]\n" " :return:The width and height of the packed bounding box.\n" " :rtype:tuple\n" | [X, Y, width, height,...][list[float, float, float, float,...][float, float] ) |
| PyDoc_STRVAR | ( | M_Geometry_closest_point_on_tri_doc | , |
| ".. function:: closest_point_on_tri(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " Takes 4 vectors: one is the point and the next 3 define the triangle.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg tri_p1: First point of the triangle\n" " :type tri_p1: :class:`mathutils.Vector`\n" " :arg tri_p2: Second point of the triangle\n" " :type tri_p2: :class:`mathutils.Vector`\n" " :arg tri_p3: Third point of the triangle\n" " :type tri_p3: :class:`mathutils.Vector`\n" " :return: The closest point of the triangle.\n" " :rtype: :class:`mathutils.Vector`\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_convex_hull_2d_doc | , |
| ".. function:: convex_hull_2d(points)\n" "\n" " Returns a list of indices into the list given\n" "\n" " :arg points: Sequence of 2D points.\n" " :type points: Sequence]\n" " :return: a list of indices\n" " :rtype: list\n" | [Sequence[float][int] ) |
| PyDoc_STRVAR | ( | M_Geometry_delaunay_2d_cdt_doc | , |
| ".. function:: delaunay_2d_cdt(vert_coords, edges, faces, output_type, epsilon, " "need_ids=True)\n" "\n" " Computes the Constrained Delaunay Triangulation of a set of | vertices, | ||
| \n" " with edges and faces that must appear in the triangulation.\n" " Some triangles may be eaten | away, | ||
| or combined with other | triangles, | ||
| \n" " according to output type.\n" " The returned verts may be in a different order from input | verts, | ||
| may be moved\n" " | slightly, | ||
| and may be merged with other nearby verts.\n" " The three returned orig lists | give, | ||
| for each of | verts, | ||
| edges | , | ||
| and | faces, | ||
| the list of\n" " input element indices corresponding to the positionally same output element.\n" " For | edges, | ||
| the orig indices start with the input edges and then continue\n" " with the edges implied by each of the faces(n of them for an n-gon).\n" " If the need_ids argument is | supplied, | ||
| and | False, | ||
| then the code skips the preparation\n" " of the orig | arrays, | ||
| which may save some time.\n" "\n" " :arg vert_coords:Vertex coordinates(2d)\n" " :type vert_coords:Sequence\n" " :arg edges:Edges | [:class:`mathutils.Vector`], | ||
| as pairs of indices in ``vert_coords``\n" " :type edges:Sequence]\n" " :arg faces:Faces | [Sequence[int, int], | ||
| each sublist is a | face, | ||
| as indices in `vert_coords`(CCW oriented)\n" " :type faces:Sequence]\n" " :arg output_type:What output looks like. | 0[Sequence[int], | ||
| triangles with convex hull. " " | 1, | ||
| triangles inside constraints. " " | 2, | ||
| the input | constraints, | ||
| intersected. " " | 3, | ||
| like 2 but detect holes and omit them from output. " " | 4, | ||
| like 2 but with extra edges to make valid BMesh faces. " " | 5, | ||
| like 4 but detect holes and omit them from output.\n" " :type output_type:int\n" " :arg epsilon:For nearness tests;should not be zero\n" " :type epsilon:float\n" " :arg need_ids:are the orig output arrays needed?\n" " :type need_args:bool\n" " :return:Output | tuple, | ||
| (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)\n" " :rtype:tuple | [" "list[:class:`mathutils.Vector`], | ||
| " "list] | [tuple[int, int], | ||
| " "list] | [list[int], | ||
| " "list] | [list[int], | ||
| " "list] | [list[int], | ||
| " "list]]\n" "\n" | [list[int] ) |
| PyDoc_STRVAR | ( | M_Geometry_distance_point_to_plane_doc | , |
| ".. function:: distance_point_to_plane(pt, plane_co, plane_no)\n" "\n" " Returns the signed distance between a point and a plane " " (negative when below the normal).\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg plane_co: A point on the plane\n" " :type plane_co: :class:`mathutils.Vector`\n" " :arg plane_no: The direction the plane is facing\n" " :type plane_no: :class:`mathutils.Vector`\n" " :rtype: float\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_doc | , |
| "The Blender geometry module" | ) |
| PyDoc_STRVAR | ( | M_Geometry_interpolate_bezier_doc | , |
| ".. function:: interpolate_bezier(knot1, handle1, handle2, knot2, resolution)\n" "\n" " Interpolate a bezier spline segment.\n" "\n" " :arg knot1: First bezier spline point.\n" " :type knot1: :class:`mathutils.Vector`\n" " :arg handle1: First bezier spline handle.\n" " :type handle1: :class:`mathutils.Vector`\n" " :arg handle2: Second bezier spline handle.\n" " :type handle2: :class:`mathutils.Vector`\n" " :arg knot2: Second bezier spline point.\n" " :type knot2: :class:`mathutils.Vector`\n" " :arg resolution: Number of points to return.\n" " :type resolution: int\n" " :return: The interpolated points.\n" " :rtype: list\n" | [:class:`mathutils.Vector`] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_line_line_2d_doc | , |
| ".. function:: intersect_line_line_2d(lineA_p1, lineA_p2, lineB_p1, lineB_p2)\n" "\n" " Takes 2 segments (defined by 4 vectors) and returns a vector for their point of " "intersection or None.\n" "\n" " .. warning:: Despite its | name, | ||
| this function works on | segments, | ||
| and not on lines.\n" "\n" " :arg lineA_p1:First point of the first line\n" " :type lineA_p1::class:`mathutils.Vector`\n" " :arg lineA_p2:Second point of the first line\n" " :type lineA_p2::class:`mathutils.Vector`\n" " :arg lineB_p1:First point of the second line\n" " :type lineB_p1::class:`mathutils.Vector`\n" " :arg lineB_p2:Second point of the second line\n" " :type lineB_p2::class:`mathutils.Vector`\n" " :return:The point of intersection or None when not found\n" " :rtype::class:`mathutils.Vector`|None\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_line_line_doc | , |
| ".. function:: intersect_line_line(v1, v2, v3, v4)\n" "\n" " Returns a tuple with the points on each line respectively closest to the other.\n" "\n" " :arg v1: First point of the first line\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Second point of the first line\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: First point of the second line\n" " :type v3: :class:`mathutils.Vector`\n" " :arg v4: Second point of the second line\n" " :type v4: :class:`mathutils.Vector`\n" " :return: The intersection on each line or None when the lines are co-linear.\n" " :rtype: tuple | None\n" | [:class:`mathutils.Vector`, :class:`mathutils.Vector`] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_line_plane_doc | , |
| ".. function:: intersect_line_plane(line_a, line_b, plane_co, plane_no, no_flip=False)\n" "\n" " Calculate the intersection between a line (as 2 vectors) and a plane.\n" " Returns a vector for the intersection or None.\n" "\n" " :arg line_a: First point of the first line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the first line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg plane_co: A point on the plane\n" " :type plane_co: :class:`mathutils.Vector`\n" " :arg plane_no: The direction the plane is facing\n" " :type plane_no: :class:`mathutils.Vector`\n" " :return: The point of intersection or None when not found\n" " :rtype: :class:`mathutils.Vector` | None\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_line_sphere_2d_doc | , |
| ".. function:: intersect_line_sphere_2d(line_a, line_b, sphere_co, sphere_radius, clip=True)\n" "\n" " Takes a line (as 2 points) and a sphere (as a point and a radius) and\n" " returns the intersection\n" "\n" " :arg line_a: First point of the line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg sphere_co: The center of the sphere\n" " :type sphere_co: :class:`mathutils.Vector`\n" " :arg sphere_radius: Radius of the sphere\n" " :type sphere_radius: float\n" " :return: The intersection points as a pair of vectors or None when there is no " "intersection\n" " :rtype: tuple\n" | [:class:`mathutils.Vector`|None, :class:`mathutils.Vector`|None] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_line_sphere_doc | , |
| ".. function:: intersect_line_sphere(line_a, line_b, sphere_co, sphere_radius, clip=True)\n" "\n" " Takes a line (as 2 points) and a sphere (as a point and a radius) and\n" " returns the intersection\n" "\n" " :arg line_a: First point of the line\n" " :type line_a: :class:`mathutils.Vector`\n" " :arg line_b: Second point of the line\n" " :type line_b: :class:`mathutils.Vector`\n" " :arg sphere_co: The center of the sphere\n" " :type sphere_co: :class:`mathutils.Vector`\n" " :arg sphere_radius: Radius of the sphere\n" " :type sphere_radius: float\n" " :return: The intersection points as a pair of vectors or None when there is no " "intersection\n" " :rtype: tuple\n" | [:class:`mathutils.Vector`|None, :class:`mathutils.Vector`|None] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_plane_plane_doc | , |
| ".. function:: intersect_plane_plane(plane_a_co, plane_a_no, plane_b_co, plane_b_no)\n" "\n" " Return the intersection between two planes\n" "\n" " :arg plane_a_co: Point on the first plane\n" " :type plane_a_co: :class:`mathutils.Vector`\n" " :arg plane_a_no: Normal of the first plane\n" " :type plane_a_no: :class:`mathutils.Vector`\n" " :arg plane_b_co: Point on the second plane\n" " :type plane_b_co: :class:`mathutils.Vector`\n" " :arg plane_b_no: Normal of the second plane\n" " :type plane_b_no: :class:`mathutils.Vector`\n" " :return: The line of the intersection represented as a point and a vector or None if the " "intersection can't be calculated\n" " :rtype: tuple | tuple\n" | [:class:`mathutils.Vector`, :class:`mathutils.Vector`][None, " "None] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_point_line_doc | , |
| ".. function:: intersect_point_line(pt, line_p1, line_p2)\n" "\n" " 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.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg line_p1: First point of the line\n" " :type line_p1: :class:`mathutils.Vector`\n" " :arg line_p1: Second point of the line\n" " :type line_p1: :class:`mathutils.Vector`\n" " :rtype: tuple\n" | [:class:`mathutils.Vector`, float] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_point_quad_2d_doc | , |
| ".. function:: intersect_point_quad_2d(pt, quad_p1, quad_p2, quad_p3, quad_p4)\n" "\n" " Takes 5 vectors (using only the x and y coordinates): one is the point and the " "next 4 define the | quad, | ||
| \n" " only the x and y are used from the vectors. Returns 1 if the point is within the " " | quad, | ||
| otherwise 0.\n" " Works only with convex quads without singular edges.\n" "\n" " :arg pt:Point\n" " :type pt::class:`mathutils.Vector`\n" " :arg quad_p1:First point of the quad\n" " :type quad_p1::class:`mathutils.Vector`\n" " :arg quad_p2:Second point of the quad\n" " :type quad_p2::class:`mathutils.Vector`\n" " :arg quad_p3:Third point of the quad\n" " :type quad_p3::class:`mathutils.Vector`\n" " :arg quad_p4:Fourth point of the quad\n" " :type quad_p4::class:`mathutils.Vector`\n" " :rtype:int\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_point_tri_2d_doc | , |
| ".. function:: intersect_point_tri_2d(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " 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.\n" "\n" " :arg pt:Point\n" " :type pt::class:`mathutils.Vector`\n" " :arg tri_p1:First point of the triangle\n" " :type tri_p1::class:`mathutils.Vector`\n" " :arg tri_p2:Second point of the triangle\n" " :type tri_p2::class:`mathutils.Vector`\n" " :arg tri_p3:Third point of the triangle\n" " :type tri_p3::class:`mathutils.Vector`\n" " :rtype:int\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_point_tri_doc | , |
| ".. function:: intersect_point_tri(pt, tri_p1, tri_p2, tri_p3)\n" "\n" " Takes 4 vectors: one is the point and the next 3 define the triangle. Projects " "the point onto the triangle plane and checks if it is within the triangle.\n" "\n" " :arg pt: Point\n" " :type pt: :class:`mathutils.Vector`\n" " :arg tri_p1: First point of the triangle\n" " :type tri_p1: :class:`mathutils.Vector`\n" " :arg tri_p2: Second point of the triangle\n" " :type tri_p2: :class:`mathutils.Vector`\n" " :arg tri_p3: Third point of the triangle\n" " :type tri_p3: :class:`mathutils.Vector`\n" " :return: Point on the triangles plane or None if its outside the triangle\n" " :rtype: :class:`mathutils.Vector` | None\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_ray_tri_doc | , |
| ".. function:: intersect_ray_tri(v1, v2, v3, ray, orig, clip=True)\n" "\n" " Returns the intersection between a ray and a | triangle, | ||
| if | possible, | ||
| returns None " "otherwise.\n" "\n" " :arg v1:Point1\n" " :type v1::class:`mathutils.Vector`\n" " :arg v2:Point2\n" " :type v2::class:`mathutils.Vector`\n" " :arg v3:Point3\n" " :type v3::class:`mathutils.Vector`\n" " :arg ray:Direction of the projection\n" " :type ray::class:`mathutils.Vector`\n" " :arg orig:Origin\n" " :type orig::class:`mathutils.Vector`\n" " :arg clip:When | False, | ||
| don 't restrict the intersection to the area of the " " | triangle, | ||
| use the infinite plane defined by the triangle.\n" " :type clip:bool\n" " :return:The point of intersection or None if no intersection is found\n" " :rtype::class:`mathutils.Vector`|None\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_sphere_sphere_2d_doc | , |
| ".. function:: intersect_sphere_sphere_2d(p_a, radius_a, p_b, radius_b)\n" "\n" " Returns 2 points on between intersecting circles.\n" "\n" " :arg p_a: Center of the first circle\n" " :type p_a: :class:`mathutils.Vector`\n" " :arg radius_a: Radius of the first circle\n" " :type radius_a: float\n" " :arg p_b: Center of the second circle\n" " :type p_b: :class:`mathutils.Vector`\n" " :arg radius_b: Radius of the second circle\n" " :type radius_b: float\n" " :return: 2 points on between intersecting circles or None when there is no intersection.\n" " :rtype: tuple | tuple\n" | [:class:`mathutils.Vector`, :class:`mathutils.Vector`][None, " "None] ) |
| PyDoc_STRVAR | ( | M_Geometry_intersect_tri_tri_2d_doc | , |
| ".. function:: intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n" "\n" " Check if two 2D triangles intersect.\n" "\n" " :rtype: bool\n" | ) |
| PyDoc_STRVAR | ( | M_Geometry_normal_doc | , |
| ".. function:: normal(vectors)\n" "\n" " Returns the normal of a 3D polygon.\n" "\n" " :arg vectors: 3 or more vectors to calculate normals.\n" " :type vectors: Sequence]\n" " :rtype: :class:`mathutils.Vector`\n" | [Sequence[float] ) |
| PyDoc_STRVAR | ( | M_Geometry_points_in_planes_doc | , |
| ".. function:: points_in_planes(planes, epsilon_coplanar=1e-4, epsilon_isect=1e-6)\n" "\n" " Returns a list of points inside all planes given and a list of index values for " "the planes used.\n" "\n" " :arg planes: List of planes (4D vectors).\n" " :type planes: list\n" " :arg epsilon_coplanar: Epsilon value for interpreting plane pairs as co-plannar.\n" " :type epsilon_coplanar: float\n" " :arg epsilon_isect: Epsilon value for intersection.\n" " :type epsilon_isect: float\n" " :return: Two | lists[:class:`mathutils.Vector`], | ||
| once containing the 3D coordinates inside the | planes, | ||
| " "another containing the plane indices used.\n" " :rtype:tuple | [list[:class:`mathutils.Vector`], | ||
| list]\n" | [int] ) |
| PyDoc_STRVAR | ( | M_Geometry_tessellate_polygon_doc | , |
| ".. function:: tessellate_polygon(polylines)\n" "\n" " Takes a list of polylines (each point a pair or triplet of numbers) and returns " "the point indices for a polyline filled with triangles. Does not handle degenerate " "geometry (such as zero-length lines due to consecutive identical points).\n" "\n" " :arg polylines: Polygons where each polygon is a sequence of 2D or 3D points.\n" " :type polylines: Sequence]]" " :return: A list of triangles.\n" " :rtype: list]\n" | [Sequence[Sequence[float][tuple[int, int, int] ) |
| PyDoc_STRVAR | ( | M_Geometry_volume_tetrahedron_doc | , |
| ".. function:: volume_tetrahedron(v1, v2, v3, v4)\n" "\n" " Return the volume formed by a tetrahedron (points can be in any order).\n" "\n" " :arg v1: Point1\n" " :type v1: :class:`mathutils.Vector`\n" " :arg v2: Point2\n" " :type v2: :class:`mathutils.Vector`\n" " :arg v3: Point3\n" " :type v3: :class:`mathutils.Vector`\n" " :arg v4: Point4\n" " :type v4: :class:`mathutils.Vector`\n" " :rtype: float\n" | ) |
| PyMODINIT_FUNC PyInit_mathutils_geometry | ( | ) |
Definition at line 1878 of file mathutils_geometry.cc.
References M_Geometry_module_def.
Referenced by PyInit_mathutils().
|
static |
Definition at line 1766 of file mathutils_geometry.cc.
|
static |
Definition at line 1864 of file mathutils_geometry.cc.
Referenced by PyInit_mathutils_geometry().