Cleanup: whicespace
This commit is contained in:
6
extern/curve_fit_nd/curve_fit_nd.h
vendored
6
extern/curve_fit_nd/curve_fit_nd.h
vendored
@@ -25,8 +25,8 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SPLINE_FIT__
|
#ifndef __CURVE_FIT_ND_H__
|
||||||
#define __SPLINE_FIT__
|
#define __CURVE_FIT_ND_H__
|
||||||
|
|
||||||
/** \file curve_fit_nd.h
|
/** \file curve_fit_nd.h
|
||||||
* \ingroup curve_fit
|
* \ingroup curve_fit
|
||||||
@@ -159,4 +159,4 @@ int curve_fit_corners_detect_fl(
|
|||||||
unsigned int **r_corners,
|
unsigned int **r_corners,
|
||||||
unsigned int *r_corners_len);
|
unsigned int *r_corners_len);
|
||||||
|
|
||||||
#endif /* __SPLINE_FIT__ */
|
#endif /* __CURVE_FIT_ND_H__ */
|
||||||
|
@@ -382,9 +382,9 @@ int curve_fit_corners_detect_db(
|
|||||||
uint i_best = i_span_start;
|
uint i_best = i_span_start;
|
||||||
while (i_next < points_len) {
|
while (i_next < points_len) {
|
||||||
if ((points_angle[i_next] == 0.0) ||
|
if ((points_angle[i_next] == 0.0) ||
|
||||||
(len_squared_vnvn(
|
(len_squared_vnvn(
|
||||||
&points[(i_next - 1) * dims],
|
&points[(i_next - 1) * dims],
|
||||||
&points[i_next * dims], dims) > radius_min_sq))
|
&points[i_next * dims], dims) > radius_min_sq))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
12
extern/curve_fit_nd/intern/curve_fit_cubic.c
vendored
12
extern/curve_fit_nd/intern/curve_fit_cubic.c
vendored
@@ -46,7 +46,7 @@
|
|||||||
#define USE_LENGTH_CACHE
|
#define USE_LENGTH_CACHE
|
||||||
|
|
||||||
/* store the indices in the cubic data so we can return the original indices,
|
/* store the indices in the cubic data so we can return the original indices,
|
||||||
* useful when the caller has data assosiated with the curve. */
|
* useful when the caller has data associated with the curve. */
|
||||||
#define USE_ORIG_INDEX_DATA
|
#define USE_ORIG_INDEX_DATA
|
||||||
|
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
@@ -291,7 +291,7 @@ static void cubic_calc_acceleration(
|
|||||||
double r_v[])
|
double r_v[])
|
||||||
{
|
{
|
||||||
CUBIC_VARS_CONST(cubic, dims, p0, p1, p2, p3);
|
CUBIC_VARS_CONST(cubic, dims, p0, p1, p2, p3);
|
||||||
const double s = 1.0 - t;
|
const double s = 1.0 - t;
|
||||||
for (uint j = 0; j < dims; j++) {
|
for (uint j = 0; j < dims; j++) {
|
||||||
r_v[j] = 6.0 * ((p2[j] - 2.0 * p1[j] + p0[j]) * s +
|
r_v[j] = 6.0 * ((p2[j] - 2.0 * p1[j] + p0[j]) * s +
|
||||||
(p3[j] - 2.0 * p2[j] + p1[j]) * t);
|
(p3[j] - 2.0 * p2[j] + p1[j]) * t);
|
||||||
@@ -735,10 +735,10 @@ static double points_calc_coord_length(
|
|||||||
* \note Return value may be `nan` caller must check for this.
|
* \note Return value may be `nan` caller must check for this.
|
||||||
*/
|
*/
|
||||||
static double cubic_find_root(
|
static double cubic_find_root(
|
||||||
const Cubic *cubic,
|
const Cubic *cubic,
|
||||||
const double p[],
|
const double p[],
|
||||||
const double u,
|
const double u,
|
||||||
const uint dims)
|
const uint dims)
|
||||||
{
|
{
|
||||||
/* Newton-Raphson Method. */
|
/* Newton-Raphson Method. */
|
||||||
/* all vectors */
|
/* all vectors */
|
||||||
|
10
extern/curve_fit_nd/intern/curve_fit_inline.h
vendored
10
extern/curve_fit_nd/intern/curve_fit_inline.h
vendored
@@ -57,7 +57,7 @@ MINLINE double max(const double a, const double b)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
MINLINE void zero_vn(
|
MINLINE void zero_vn(
|
||||||
double v0[], const uint dims)
|
double v0[], const uint dims)
|
||||||
{
|
{
|
||||||
for (uint j = 0; j < dims; j++) {
|
for (uint j = 0; j < dims; j++) {
|
||||||
v0[j] = 0.0;
|
v0[j] = 0.0;
|
||||||
@@ -65,7 +65,7 @@ MINLINE void zero_vn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
MINLINE void flip_vn_vnvn(
|
MINLINE void flip_vn_vnvn(
|
||||||
double v_out[], const double v0[], const double v1[], const uint dims)
|
double v_out[], const double v0[], const double v1[], const uint dims)
|
||||||
{
|
{
|
||||||
for (uint j = 0; j < dims; j++) {
|
for (uint j = 0; j < dims; j++) {
|
||||||
v_out[j] = v0[j] + (v0[j] - v1[j]);
|
v_out[j] = v0[j] + (v0[j] - v1[j]);
|
||||||
@@ -194,7 +194,7 @@ MINLINE void imul_vn_fl(double v0[], const double f, const uint dims)
|
|||||||
|
|
||||||
|
|
||||||
MINLINE double len_squared_vnvn(
|
MINLINE double len_squared_vnvn(
|
||||||
const double v0[], const double v1[], const uint dims)
|
const double v0[], const double v1[], const uint dims)
|
||||||
{
|
{
|
||||||
double d = 0.0;
|
double d = 0.0;
|
||||||
for (uint j = 0; j < dims; j++) {
|
for (uint j = 0; j < dims; j++) {
|
||||||
@@ -220,14 +220,14 @@ MINLINE double len_vnvn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
MINLINE double len_vn(
|
MINLINE double len_vn(
|
||||||
const double v0[], const uint dims)
|
const double v0[], const uint dims)
|
||||||
{
|
{
|
||||||
return sqrt(len_squared_vn(v0, dims));
|
return sqrt(len_squared_vn(v0, dims));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special case, save us negating a copy, then getting the length */
|
/* special case, save us negating a copy, then getting the length */
|
||||||
MINLINE double len_squared_negated_vnvn(
|
MINLINE double len_squared_negated_vnvn(
|
||||||
const double v0[], const double v1[], const uint dims)
|
const double v0[], const double v1[], const uint dims)
|
||||||
{
|
{
|
||||||
double d = 0.0;
|
double d = 0.0;
|
||||||
for (uint j = 0; j < dims; j++) {
|
for (uint j = 0; j < dims; j++) {
|
||||||
|
Reference in New Issue
Block a user