Commit Graph

189 Commits

Author SHA1 Message Date
Campbell Barton
409fb4da0c Code cleanup: remove redundant matrix initialization 2014-04-29 18:13:20 +10:00
Campbell Barton
e73d0f57a3 Code cleanup: use 'const' for arrays (python) 2014-04-27 00:25:15 +10:00
Campbell Barton
dc847607b6 Change Vector.slerp to accept nonunit vectors 2014-04-18 20:49:39 +10:00
Campbell Barton
55f83e36cc Py API: Vector.slerp(). also added interp_v3_v3v3_slerp(_safe) functions 2014-03-31 13:28:37 +11:00
Campbell Barton
6aa75d3b2c Fix for error in normalize_vn_vn(), add len_squared_vn 2014-03-31 11:19:32 +11:00
Campbell Barton
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
Bastien Montagne
e9a64e2770 Fix T39392: Python bindings for geometry.box_pack_2d() return invalid total height 2014-03-24 17:39:54 +01:00
Campbell Barton
7da2175271 KDTree: deprecate 'normal' argument
Normals for each kdtree node were allocated but never used,
and search args only use in particles/boids code.
2014-03-18 09:14:47 +11:00
Campbell Barton
a47137a2db Python API: add Vector.orthogonal() method 2014-03-18 00:39:46 +11:00
Campbell Barton
06b6cd8345 PyAPI: mathutils.Vector.cross now works for 2d vectors (returns a float)
also fixed crash when running on large vectors (raises exception now)
2014-02-05 23:36:30 +11:00
Campbell Barton
ab6157a06a PyAPI: noise.seed_set(), note that zero is a special case. 2014-01-30 17:56:07 +11:00
Campbell Barton
bd697dd4d7 Fix T38402: invalid message for bad type assignments (Quat, Vector) 2014-01-30 16:45:20 +11:00
Campbell Barton
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
Campbell Barton
63ccb26303 Code Cleanup: spelling 2014-01-17 17:35:03 +11:00
Campbell Barton
61ff3dfdda Code Cleanup: spelling 2014-01-13 15:31:57 +11:00
Campbell Barton
da6bc87b57 Fix T38138: incorrect API docs 2014-01-09 21:49:11 +11:00
Denis Declara
55f7a4aebc Fix T38104: mathutils.cell_vector() always returns (0,0,0)
Reviewed By: brecht
2014-01-08 23:03:09 +01:00
Campbell Barton
cdeb3c3922 Fix for incorrect use of abs() in intersect_sphere_sphere_2d 2014-01-09 03:15:59 +11:00
Campbell Barton
2dba2e72b7 Code Cleanup: de-duplicate text pasting which only used the first line 2014-01-08 17:39:12 +11:00
Campbell Barton
4b30b22ecf Fix for recent kdtree py module with MSVC
also remove submodule includes from mathutils.h
2014-01-07 00:53:52 +11:00
Campbell Barton
4848f9029a Patch D133: Python wrapper for BLI_kdtree (adds mathutils.kdtree)
Originally by Dan Eicher, with my own fixes and adjustments (see patch page for details).

For details there are unit tests and api example usage.

	doc/python_api/sphinx-in-tmp/menu_id.png
2014-01-06 20:32:34 +11:00
Campbell Barton
eb4090dadf Fix missing check if isect_plane_plane_v3 fails to find an intersection. 2013-12-29 12:51:27 +11:00
Benoit Bolsee
c35fb528c5 Fix intersect_line_plane bug causing crash on Motion trail and other
similar potential bugs in mathutils_geometry

marking no_flip as TODO
2013-12-11 10:28:30 -02:00
Campbell Barton
2ef3f6159c Fix T37715: Incorrect docstring 2013-12-10 00:02:37 +11:00
Campbell Barton
3e49787b01 Python API: give a better error message when creating a Matrix fails 2013-11-29 09:48:42 +11:00
Campbell Barton
4da651c8f0 Fix T37472: crash when packing UV islands. 2013-11-19 11:20:57 +11:00
Campbell Barton
b6db417ee4 code cleanup: use const's for vector args. 2013-10-12 02:19:37 +00:00
Campbell Barton
1576565932 minor changes needed for building standalone mathutils. 2013-09-14 00:30:56 +00:00
Campbell Barton
2f6c748bb9 fix [#36020] SmartUV Project is messy on a cube
was using very simple/stupid check to rotate us islands, replace with box_fit_2d() function.

missed docstring last commit.
2013-09-11 07:10:15 +00:00
Campbell Barton
d2d1025e4a add mathutils.geometry.box_fit_2d() to wrap BLI_convexhull_aabb_fit_points_2d() 2013-09-11 06:56:51 +00:00
Campbell Barton
ab8d88ac18 add angle_to_mat2 utility function. 2013-09-10 20:45:47 +00:00
Campbell Barton
92d94ccb08 misc minor changes
- make cmake osx use of -ftemplate-depth match scons.
- use array size within sizeof(), more compact.
- replace AT with __func__ where the function is unique enough.
- BLI_box_pack_2D -> 2d to match other functions.
- rename new mesh normal calculation to mesh.calc_normals_split()
2013-09-10 19:23:39 +00:00
Campbell Barton
5dbe17cc12 add 2d convex hull utility function, BLI_convexhull_2d(), and python api mathutils.geometry.convex_hull_2d()
uses Andrew's monotone chain 2D convex hull algorithm.
2013-09-10 07:52:10 +00:00
Campbell Barton
8e46cf637c tweak mempool loop comparisons when we know there is no chance for skipping past the last value.
also correct typo.
2013-08-31 02:12:31 +00:00
Campbell Barton
11c988ba00 Simplify line/plane intersection, add line_plane_factor_v3().
Remove no_flip option for isect_line_plane_v3(), its quite specific and only used for ED_view3d_win_to_3d().
2013-08-31 02:06:23 +00:00
Campbell Barton
09ff49755f math api edits - replace point-normal form for a plane with dist_to_plane_v3()
also correct python mathutils api, was missing vector checks.
2013-08-23 14:37:22 +00:00
Campbell Barton
f3654ce6b6 fix incorrect docs [#36518] Vector.rotate() does not return value as documented 2013-08-20 08:41:34 +00:00
Campbell Barton
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
Campbell Barton
418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
Campbell Barton
04a9c0e28a bump mathutils callback slot size. 2013-05-17 07:10:40 +00:00
Campbell Barton
5018ea5e29 real fix for [#35097], (curve cap flipping).
previous commit was incorrect, the face flipping depended on the orientation of the curve.

fix by passing the bevel direction to the fill function so we can have a reliable front/back.

This also gives some speedup for all curve filling since we can avoid calculating the normal since its already known.
2013-04-26 21:04:12 +00:00
Campbell Barton
c667f1ff10 utility function volume_tetrahedron(), for mathutils and BLI math. 2013-04-21 13:24:45 +00:00
Campbell Barton
a120049c3b use psys->seed for smoke random number generator, increase size of MATHUTILS_TOT_CB and reduce float->double conversions. 2013-04-16 09:04:34 +00:00
Campbell Barton
eb66c45301 correct pyapi function intersect_line_sphere_2d() using 3d vecs when only 2d are needed. 2013-04-14 11:57:35 +00:00
Thomas Dinges
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
Sergey Sharybin
18d2dd7e3a Merging r55547 through r55594 from trunk into soc-2008-mxcurioni 2013-03-26 09:09:31 +00:00
Campbell Barton
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
Campbell Barton
0397cc0bab fix for assert(), were not enough mathutils slots. 2013-03-18 22:53:58 +00:00
Campbell Barton
16b82845ee code cleanup: add 'const' to headers to quiet msvc warnings, also remove (char *) casts that aren't needed now we're on Python3.3 2013-03-17 18:30:31 +00:00
Campbell Barton
f9f7070336 add STREQ macro (commonly used macro like CLAMP, MAX2, STRINGIFY). Use for some areas of the python api, bmesh. 2013-03-10 06:18:03 +00:00