main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
6 changed files with 15 additions and 12 deletions
Showing only changes of commit d64dfc4333 - Show all commits

View File

@ -222,7 +222,7 @@ struct Rows {
/** This pixel is directly affected by a brush and doesn't need to be solved. */ /** This pixel is directly affected by a brush and doesn't need to be solved. */
Brush, Brush,
SelectedForCloserExamination, SelectedForCloserExamination,
/** This pixel will be copid from another pixel to solve non-manifold edge bleeding. */ /** This pixel will be copied from another pixel to solve non-manifold edge bleeding. */
CopyFromClosestEdge, CopyFromClosestEdge,
}; };
@ -233,7 +233,7 @@ struct Rows {
/** /**
* Index of the edge in the list of non-manifold edges. * Index of the edge in the list of non-manifold edges.
* *
* The edge is kept to calculate athe mix factor between the two pixels that have chosen to * The edge is kept to calculate the mix factor between the two pixels that have chosen to
* be mixed. * be mixed.
*/ */
int64_t edge_index; int64_t edge_index;
@ -309,7 +309,7 @@ struct Rows {
* Look for a second source pixel that will be blended with the first source pixel to improve * Look for a second source pixel that will be blended with the first source pixel to improve
* the quality of the fix. * the quality of the fix.
* *
* - The second source pixel must be a neighbour pixel of the first source, or the same as the * - The second source pixel must be a neighbor pixel of the first source, or the same as the
* first source when no second pixel could be found. * first source when no second pixel could be found.
* - The second source pixel must be a pixel that is painted on by the brush. * - The second source pixel must be a pixel that is painted on by the brush.
* - The second source pixel must be the second closest pixel , or the first source * - The second source pixel must be the second closest pixel , or the first source

View File

@ -680,21 +680,21 @@ template<typename T = float> struct AngleFraction {
default: default:
BLI_assert_unreachable(); BLI_assert_unreachable();
} }
/* Resulting angle should be oscilating in [0..pi/4] range. */ /* Resulting angle should be oscillating in [0..pi/4] range. */
BLI_assert(a.numerator_ >= 0 && a.numerator_ <= a.denominator_ / 4); BLI_assert(a.numerator_ >= 0 && a.numerator_ <= a.denominator_ / 4);
T angle = T(M_PI) * (T(a.numerator_) / T(a.denominator_)); T angle = T(M_PI) * (T(a.numerator_) / T(a.denominator_));
x = math::cos(angle); x = math::cos(angle);
y = math::sin(angle); y = math::sin(angle);
/* Diagonal symetry "unfolding". */ /* Diagonal symmetry "unfolding". */
if (ELEM(octant, 1, 2)) { if (ELEM(octant, 1, 2)) {
std::swap(x, y); std::swap(x, y);
} }
} }
/* Y axis symetry. */ /* Y axis symmetry. */
if (octant >= 2) { if (octant >= 2) {
x = -x; x = -x;
} }
/* X axis symetry. */ /* X axis symmetry. */
if (is_negative) { if (is_negative) {
y = -y; y = -y;
} }

View File

@ -90,8 +90,10 @@ template<typename T> inline T floor(const T &a)
return std::floor(a); return std::floor(a);
} }
/* Repeats the sawtooth pattern even on negative numbers. /**
* ex: 'mod_periodic(-3, 4) = 1', 'mod(-3, 4)= -3' */ * Repeats the saw-tooth pattern even on negative numbers.
* ex: `mod_periodic(-3, 4) = 1`, `mod(-3, 4)= -3`
*/
template<typename T> inline T mod_periodic(const T &a, const T &b) template<typename T> inline T mod_periodic(const T &a, const T &b)
{ {
return a - (b * math::floor(a / b)); return a - (b * math::floor(a / b));

View File

@ -1379,8 +1379,8 @@ template<typename MatT> [[nodiscard]] MatT orthogonalize(const MatT &mat, const
/** /**
* The secondary axis is chosen as follow (X->Y, Y->X, Z->X). * The secondary axis is chosen as follow (X->Y, Y->X, Z->X).
* If this axis is coplanar try the third axis. * If this axis is co-planar try the third axis.
* If also coplanar, make up an axis by shuffling the primary axis coordinates (xyz > yzx). * If also co-planar, make up an axis by shuffling the primary axis coordinates (XYZ > YZX).
*/ */
switch (axis) { switch (axis) {
case Axis::X: case Axis::X:

View File

@ -271,7 +271,7 @@ TEST(math_rotation_types, AngleFraction)
EXPECT_NEAR(angle.cos(), cos((T(M_PI) * i) / 16), 1e-6f); EXPECT_NEAR(angle.cos(), cos((T(M_PI) * i) / 16), 1e-6f);
EXPECT_NEAR(angle.sin(), sin((T(M_PI) * i) / 16), 1e-6f); EXPECT_NEAR(angle.sin(), sin((T(M_PI) * i) / 16), 1e-6f);
/* Ensure symetry. */ /* Ensure symmetry. */
AngleCartesian angle_opposite(pi + pi * i / 16); AngleCartesian angle_opposite(pi + pi * i / 16);
EXPECT_EQ(angle.cos(), -angle_opposite.cos()); EXPECT_EQ(angle.cos(), -angle_opposite.cos());
EXPECT_EQ(angle.sin(), -angle_opposite.sin()); EXPECT_EQ(angle.sin(), -angle_opposite.sin());

View File

@ -141,6 +141,7 @@ dict_custom = {
"instantiable", "instantiable",
"instantiation", "instantiation",
"instantiations", "instantiations",
"interdependencies",
"interferences", "interferences",
"interocular", "interocular",
"invariant", "invariant",