2012-10-19 07:20:37 +00:00
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __BLI_QUADRIC_H__
|
|
|
|
|
#define __BLI_QUADRIC_H__
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bli
|
2012-10-19 07:20:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
typedef struct Quadric {
|
2019-04-17 06:17:24 +02:00
|
|
|
double a2, ab, ac, ad, b2, bc, bd, c2, cd, d2;
|
2012-10-19 07:20:37 +00:00
|
|
|
} Quadric;
|
|
|
|
|
|
|
|
|
|
/* conversion */
|
2019-04-17 06:17:24 +02:00
|
|
|
void BLI_quadric_from_plane(Quadric *q, const double v[4]);
|
|
|
|
|
void BLI_quadric_to_vector_v3(const Quadric *q, double v[3]);
|
2012-10-19 07:20:37 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
void BLI_quadric_clear(Quadric *q);
|
2012-10-19 07:20:37 +00:00
|
|
|
|
|
|
|
|
/* math */
|
2019-04-17 06:17:24 +02:00
|
|
|
void BLI_quadric_add_qu_qu(Quadric *a, const Quadric *b);
|
|
|
|
|
void BLI_quadric_add_qu_ququ(Quadric *r, const Quadric *a, const Quadric *b);
|
|
|
|
|
void BLI_quadric_mul(Quadric *a, const double scalar);
|
2012-10-19 07:20:37 +00:00
|
|
|
|
|
|
|
|
/* solve */
|
2016-06-14 16:47:05 +10:00
|
|
|
double BLI_quadric_evaluate(const Quadric *q, const double v[3]);
|
2019-04-17 06:17:24 +02:00
|
|
|
bool BLI_quadric_optimize(const Quadric *q, double v[3], const double epsilon);
|
2012-10-19 07:20:37 +00:00
|
|
|
|
|
|
|
|
#endif /* __BLI_QUADRIC_H__ */
|