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:
authorJacques Lucke <jacques@blender.org>2022-04-05 16:24:12 +0300
committerJacques Lucke <jacques@blender.org>2022-04-05 16:24:12 +0300
commit190334b47df46f0e912c873077163e6129e4cbae (patch)
tree23972d3063cdd88204b4d55f7204349767ddc000 /source/blender/blenlib/BLI_math_geom.h
parente40b0d52cfcc44486fe3c2a96c5746dd1c8f4471 (diff)
Curves: new Grow/Shrink brush
This adds a new Grow/Shrink brush which is similar to the Length brush in the old hair system. * It's possible to switch between growing and shrinking by hold down ctrl and/or by changing the direction enum. * 3d brush is supported. * Different brush falloffs are supported. * Supports scaling curves uniformly or shrinking/extrapolating them. Extrapolation is linear only in this patch. * A minimum length settings helps to avoid creating zero-sized curves. Differential Revision: https://developer.blender.org/D14474
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r--source/blender/blenlib/BLI_math_geom.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 9e65093a05f..5c1b6c8d774 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -329,6 +329,24 @@ float closest_to_line_segment_v2(float r_close[2],
const float p[2],
const float l1[2],
const float l2[2]);
+
+/**
+ * Finds the points where two line segments are closest to each other.
+ *
+ * `lambda_*` is a value between 0 and 1 for each segment that indicates where `r_closest_*` is on
+ * the corresponding segment.
+ *
+ * \return Squared distance between both segments.
+ */
+float closest_seg_seg_v2(float r_closest_a[2],
+ float r_closest_b[2],
+ float *r_lambda_a,
+ float *r_lambda_b,
+ const float a1[2],
+ const float a2[2],
+ const float b1[2],
+ const float b2[2]);
+
/**
* Point closest to v1 on line v2-v3 in 3D.
*