Comments: notes on polyfill2d, minor corrections

This commit is contained in:
2017-02-15 14:10:42 +11:00
parent af1e48e8ab
commit 402b0aa59b
3 changed files with 17 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ static bool test_path(char *targetpath, const char *path_base, const char *path_
if (path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep);
else BLI_strncpy(tmppath, path_base, sizeof(tmppath));
/* rare cases folder_name is omitted (when looking for ~/.blender/2.xx dir only) */
/* rare cases folder_name is omitted (when looking for ~/.config/blender/2.xx dir only) */
if (folder_name)
BLI_make_file_string("/", targetpath, tmppath, folder_name);
else

View File

@@ -21,8 +21,15 @@
/** \file blender/blenlib/intern/polyfill2d.c
* \ingroup bli
*
* A simple implementation of the ear cutting algorithm
* to triangulate simple polygons without holes.
* An ear clipping algorithm to triangulate single boundary polygons.
*
* Details:
*
* - The algorithm guarantees all triangles are assigned (number of coords - 2)
* and that triangles will have non-overlapping indices (even for degenerate geometry).
* - Self-intersections are considered degenerate (resulting triangles will overlap).
* - While multiple polygons aren't supported, holes can still be defined using *key-holes*
* (where the polygon doubles back on its self with *exactly* matching coordinates).
*
* \note
*
@@ -74,6 +81,12 @@ typedef signed char eSign;
#ifdef USE_KDTREE
/**
* Spatial optimization for point-in-triangle intersection checks.
* The simple version of this algorithm is ``O(n^2)`` complexity
* (every point needing to check the triangle defined by every other point),
* Using a binary-tree reduces the complexity to ``O(n log n)``
* plus some overhead of creating the tree.
*
* This is a single purpose KDTree based on BLI_kdtree with some modifications
* to better suit polyfill2d.
*

View File

@@ -78,7 +78,7 @@
* - write #TEST (#RenderInfo struct. 128x128 blend file preview is optional).
* - write #GLOB (#FileGlobal struct) (some global vars).
* - write #DNA1 (#SDNA struct)
* - write #USER (#UserDef struct) if filename is ``~/X.XX/config/startup.blend``.
* - write #USER (#UserDef struct) if filename is ``~/.config/blender/X.XX/config/startup.blend``.
*/