Blender  V2.93
BLI_math_boolean.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "BLI_double2.hh"
25 #include "BLI_double3.hh"
26 
27 #ifdef WITH_GMP
28 # include "BLI_math_mpq.hh"
29 # include "BLI_mpq2.hh"
30 # include "BLI_mpq3.hh"
31 #endif
32 
33 namespace blender {
34 
35 /* #orient2d gives the exact result, using multi-precision arithmetic when result
36  * is close to zero. orient3d_fast just uses double arithmetic, so may be
37  * wrong if the answer is very close to zero.
38  * Similarly, for #incircle and #incircle_fast. */
39 int orient2d(const double2 &a, const double2 &b, const double2 &c);
40 int orient2d_fast(const double2 &a, const double2 &b, const double2 &c);
41 
42 int incircle(const double2 &a, const double2 &b, const double2 &c, const double2 &d);
43 int incircle_fast(const double2 &a, const double2 &b, const double2 &c, const double2 &d);
44 
45 /* #orient3d gives the exact result, using multi-precision arithmetic when result
46  * is close to zero. orient3d_fast just uses double arithmetic, so may be
47  * wrong if the answer is very close to zero.
48  * Similarly, for #insphere and #insphere_fast. */
49 int orient3d(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
50 int orient3d_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
51 
52 int insphere(
53  const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e);
54 int insphere_fast(
55  const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e);
56 
57 #ifdef WITH_GMP
58 int orient2d(const mpq2 &a, const mpq2 &b, const mpq2 &c);
59 int incircle(const mpq2 &a, const mpq2 &b, const mpq2 &c, const mpq2 &d);
60 int orient3d(const mpq3 &a, const mpq3 &b, const mpq3 &c, const mpq3 &d);
61 #endif
62 } // namespace blender
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
static unsigned c
Definition: RandGen.cpp:97
static unsigned a[3]
Definition: RandGen.cpp:92
int orient3d_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d)
int orient2d(const double2 &a, const double2 &b, const double2 &c)
int incircle(const double2 &a, const double2 &b, const double2 &c, const double2 &d)
int orient3d(const double3 &a, const double3 &b, const double3 &c, const double3 &d)
int incircle_fast(const double2 &a, const double2 &b, const double2 &c, const double2 &d)
int orient2d_fast(const double2 &a, const double2 &b, const double2 &c)
int insphere_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e)
int insphere(const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e)