MeshLib C Docs
Loading...
Searching...
No Matches
MRTriMath.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRVector3.h>
4#include <MRCMisc/exports.h>
7
8#include <stdbool.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_Vector2d MR_Vector2d; // Defined in `#include <MRCMesh/MRVector2.h>`.
15typedef struct MR_Vector2f MR_Vector2f; // Defined in `#include <MRCMesh/MRVector2.h>`.
16typedef struct MR_std_optional_MR_Plane3d MR_std_optional_MR_Plane3d; // Defined in `#include <MRCMisc/std_optional_MR_Plane3d.h>`.
17typedef struct MR_std_optional_MR_Plane3f MR_std_optional_MR_Plane3f; // Defined in `#include <MRCMisc/std_optional_MR_Plane3f.h>`.
18typedef struct MR_std_optional_MR_Vector2d MR_std_optional_MR_Vector2d; // Defined in `#include <MRCMisc/std_optional_MR_Vector2d.h>`.
19typedef struct MR_std_optional_MR_Vector2f MR_std_optional_MR_Vector2f; // Defined in `#include <MRCMisc/std_optional_MR_Vector2f.h>`.
20typedef struct MR_std_optional_MR_Vector3d MR_std_optional_MR_Vector3d; // Defined in `#include <MRCMisc/std_optional_MR_Vector3d.h>`.
21typedef struct MR_std_optional_MR_Vector3f MR_std_optional_MR_Vector3f; // Defined in `#include <MRCMisc/std_optional_MR_Vector3f.h>`.
22typedef struct MR_std_optional_double MR_std_optional_double; // Defined in `#include <MRCMisc/std_optional_double.h>`.
23typedef struct MR_std_optional_float MR_std_optional_float; // Defined in `#include <MRCMisc/std_optional_float.h>`.
24
25
32
39
46
53
61
69
75
81
88
95
104MRC_API bool MR_circumballCenters_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float radius, MR_Vector3f *centerPos, MR_Vector3f *centerNeg);
105
114MRC_API bool MR_circumballCenters_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double radius, MR_Vector3d *centerPos, MR_Vector3d *centerNeg);
115
122
129
135
141
148
155
160
165
171
177
184
191
197
203
210
217
222
227
234
240MRC_API double MR_dblAreaSq_double(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r);
241
246
251
258
265
272
279
286
293
300
307
312
317
324
331
340MRC_API float MR_dihedralAngleSin_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm, const MR_Vector3f *edgeVec);
341
350MRC_API double MR_dihedralAngleSin_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm, const MR_Vector3d *edgeVec);
351
359MRC_API float MR_dihedralAngleCos_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm);
360
368MRC_API double MR_dihedralAngleCos_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm);
369
379MRC_API float MR_dihedralAngle_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm, const MR_Vector3f *edgeVec);
380
390MRC_API double MR_dihedralAngle_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm, const MR_Vector3d *edgeVec);
391
398
405
411MRC_API MR_std_optional_float *MR_quadrangleOtherDiagonal_float(float a, float b, float c, float a1, float b1);
412
418MRC_API MR_std_optional_double *MR_quadrangleOtherDiagonal_double(double a, double b, double c, double a1, double b1);
419
424MRC_API float MR_tanSqOfHalfAngle_float(float a, float b, float c);
425
430MRC_API double MR_tanSqOfHalfAngle_double(double a, double b, double c);
431
437MRC_API float MR_cotan_float_2(const MR_std_array_MR_Vector3f_3 *t, const float *absMaxVal);
438
444MRC_API double MR_cotan_double_2(const MR_std_array_MR_Vector3d_3 *t, const double *absMaxVal);
445
450MRC_API float MR_cotan_float_3(float a, float b, float c);
451
456MRC_API double MR_cotan_double_3(double a, double b, double c);
457
465
473
481MRC_API MR_std_optional_MR_Vector3f *MR_gradientInTri_float_6(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float va, float vb, float vc);
482
490MRC_API MR_std_optional_MR_Vector3d *MR_gradientInTri_double_6(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double va, double vb, double vc);
491
492// consider triangle 0BC, where gradient of linear scalar field is given;
493// computes the intersection of the ray (org=0, dir=-grad) with the open line segment BC
500
501// consider triangle 0BC, where gradient of linear scalar field is given;
502// computes the intersection of the ray (org=0, dir=-grad) with the open line segment BC
509
521
533
545MRC_API MR_std_optional_MR_Plane3f *MR_tangentPlaneToSpheres_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float ra, float rb, float rc);
546
558MRC_API MR_std_optional_MR_Plane3d *MR_tangentPlaneToSpheres_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double ra, double rb, double rc);
559
560#ifdef __cplusplus
561} // extern "C"
562#endif
struct MR_std_optional_MR_Vector3f MR_std_optional_MR_Vector3f
Definition MRAddVisualPropertiesMixin.h:33
struct MR_std_optional_float MR_std_optional_float
Definition MRBestFitPolynomial.h:14
struct MR_std_optional_double MR_std_optional_double
Definition MRBestFitPolynomial.h:13
struct MR_std_optional_MR_Vector2f MR_std_optional_MR_Vector2f
Definition MRCNCMachineSettings.h:15
MRC_API float MR_tanSqOfHalfAngle_float(float a, float b, float c)
MRC_API MR_std_optional_double * MR_findTriExitPos_double(const MR_Vector3d *b, const MR_Vector3d *c, const MR_Vector3d *grad)
MRC_API MR_Vector3f MR_dirDblArea_float_1(const MR_std_array_MR_Vector3f_3 *t)
struct MR_std_optional_MR_Vector3d MR_std_optional_MR_Vector3d
Definition MRTriMath.h:20
MRC_API float MR_dihedralAngleSin_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm, const MR_Vector3f *edgeVec)
MRC_API MR_std_optional_MR_Plane3d * MR_tangentPlaneToSpheres_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double ra, double rb, double rc)
MRC_API float MR_dblArea_float_3_MR_Vector3f(const MR_Vector3f *p, const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API float MR_cotan_float_2(const MR_std_array_MR_Vector3f_3 *t, const float *absMaxVal)
MRC_API bool MR_circumballCenters_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double radius, MR_Vector3d *centerPos, MR_Vector3d *centerNeg)
MRC_API double MR_area_double_MR_Vector3d(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API float MR_mincircleDiameterSq_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API MR_std_optional_double * MR_quadrangleOtherDiagonal_double(double a, double b, double c, double a1, double b1)
MRC_API double MR_circumcircleDiameterSq_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API MR_Vector3f MR_normal_float_1(const MR_std_array_MR_Vector3f_3 *t)
MRC_API float MR_triangleAspectRatio_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API MR_std_optional_MR_Vector3f * MR_tangentPlaneNormalToSpheres_float(const MR_Vector3f *b, const MR_Vector3f *c, float rb, float rc)
MRC_API MR_std_optional_float * MR_findTriExitPos_float(const MR_Vector3f *b, const MR_Vector3f *c, const MR_Vector3f *grad)
MRC_API MR_Vector3f MR_normal_float_2(const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API double MR_area_double_MR_Vector2d(const MR_Vector2d *p, const MR_Vector2d *q, const MR_Vector2d *r)
MRC_API double MR_circumcircleDiameter_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API float MR_dblAreaSq_float(const MR_Vector3f *p, const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API double MR_dihedralAngle_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm, const MR_Vector3d *edgeVec)
MRC_API MR_Vector3d MR_dirDblArea_double_2(const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API double MR_tanSqOfHalfAngle_double(double a, double b, double c)
MRC_API MR_Vector3d MR_circumcircleCenter_double_3(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API double MR_mincircleDiameterSq_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API MR_std_optional_float * MR_quadrangleOtherDiagonal_float(float a, float b, float c, float a1, float b1)
MRC_API MR_Vector3d MR_normal_double_3(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API MR_Vector3f MR_circumcircleCenter_float_3(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API double MR_cotan_double_2(const MR_std_array_MR_Vector3d_3 *t, const double *absMaxVal)
MRC_API MR_std_array_MR_Vector3d_3 MR_makeDegenerate_double(const MR_std_array_MR_Vector3d_3 *t)
MRC_API float MR_area_float_MR_Vector2f(const MR_Vector2f *p, const MR_Vector2f *q, const MR_Vector2f *r)
MRC_API MR_std_optional_MR_Vector3f * MR_gradientInTri_float_6(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float va, float vb, float vc)
MRC_API MR_Vector3d MR_normal_double_1(const MR_std_array_MR_Vector3d_3 *t)
MRC_API float MR_cotan_float_3(float a, float b, float c)
MRC_API MR_std_array_MR_Vector3d_3 MR_triangleWithNormal_double(const MR_std_array_MR_Vector3d_3 *t, const MR_Vector3d *n)
MRC_API MR_Vector3d MR_normal_double_2(const MR_Vector3d *q, const MR_Vector3d *r)
struct MR_std_optional_MR_Plane3d MR_std_optional_MR_Plane3d
Definition MRTriMath.h:16
MRC_API MR_Vector3f MR_dirDblArea_float_3(const MR_Vector3f *p, const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API float MR_dblArea_float_1(const MR_std_array_MR_Vector3f_3 *t)
MRC_API float MR_minTriangleAngleSin_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API float MR_circumcircleDiameter_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API MR_std_optional_MR_Vector3d * MR_gradientInTri_double_6(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c, double va, double vb, double vc)
MRC_API MR_std_array_MR_Vector3f_3 MR_makeDegenerate_float(const MR_std_array_MR_Vector3f_3 *t)
MRC_API bool MR_circumballCenters_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float radius, MR_Vector3f *centerPos, MR_Vector3f *centerNeg)
struct MR_std_optional_MR_Plane3f MR_std_optional_MR_Plane3f
Definition MRTriMath.h:17
MRC_API double MR_minTriangleAngle_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API double MR_minTriangleAngleSin_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API MR_std_optional_MR_Vector3d * MR_tangentPlaneNormalToSpheres_double(const MR_Vector3d *b, const MR_Vector3d *c, double rb, double rc)
MRC_API float MR_minTriangleAngle_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API MR_std_optional_MR_Vector3d * MR_gradientInTri_double_4(const MR_Vector3d *b, const MR_Vector3d *c, double vb, double vc)
MRC_API float MR_dihedralAngleCos_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm)
MRC_API double MR_cotan_double_3(double a, double b, double c)
struct MR_std_optional_MR_Vector2d MR_std_optional_MR_Vector2d
Definition MRTriMath.h:18
MRC_API MR_Vector3f MR_normal_float_3(const MR_Vector3f *p, const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API MR_std_array_MR_Vector3f_3 MR_triangleWithNormal_float(const MR_std_array_MR_Vector3f_3 *t, const MR_Vector3f *n)
MRC_API MR_Vector3d MR_circumcircleCenter_double_2(const MR_Vector3d *a, const MR_Vector3d *b)
MRC_API float MR_circumcircleDiameterSq_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c)
MRC_API MR_Vector3d MR_dirDblArea_double_3(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API float MR_dblArea_float_3_MR_Vector2f(const MR_Vector2f *p, const MR_Vector2f *q, const MR_Vector2f *r)
MRC_API MR_Vector3d MR_dirDblArea_double_1(const MR_std_array_MR_Vector3d_3 *t)
MRC_API MR_std_optional_MR_Plane3f * MR_tangentPlaneToSpheres_float(const MR_Vector3f *a, const MR_Vector3f *b, const MR_Vector3f *c, float ra, float rb, float rc)
MRC_API double MR_dblArea_double_1(const MR_std_array_MR_Vector3d_3 *t)
MRC_API MR_Vector3f MR_circumcircleCenter_float_2(const MR_Vector3f *a, const MR_Vector3f *b)
MRC_API double MR_triangleAspectRatio_double(const MR_Vector3d *a, const MR_Vector3d *b, const MR_Vector3d *c)
MRC_API double MR_dblArea_double_3_MR_Vector2d(const MR_Vector2d *p, const MR_Vector2d *q, const MR_Vector2d *r)
MRC_API double MR_dblAreaSq_double(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API float MR_area_float_MR_Vector3f(const MR_Vector3f *p, const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API MR_std_optional_MR_Vector3f * MR_gradientInTri_float_4(const MR_Vector3f *b, const MR_Vector3f *c, float vb, float vc)
MRC_API MR_Vector3f MR_dirDblArea_float_2(const MR_Vector3f *q, const MR_Vector3f *r)
MRC_API double MR_dihedralAngleCos_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm)
MRC_API MR_std_optional_MR_Vector2d * MR_posFromTriEdgeLengths_double(double a, double b, double c)
MRC_API double MR_dihedralAngleSin_double(const MR_Vector3d *leftNorm, const MR_Vector3d *rightNorm, const MR_Vector3d *edgeVec)
MRC_API MR_std_optional_MR_Vector2f * MR_posFromTriEdgeLengths_float(float a, float b, float c)
MRC_API double MR_dblArea_double_3_MR_Vector3d(const MR_Vector3d *p, const MR_Vector3d *q, const MR_Vector3d *r)
MRC_API float MR_dihedralAngle_float(const MR_Vector3f *leftNorm, const MR_Vector3f *rightNorm, const MR_Vector3f *edgeVec)
#define MRC_API
Definition include/MRCMisc/exports.h:11
Generated from class MR::Vector2d.
Definition MRVector2.h:43
Generated from class MR::Vector2f.
Definition MRVector2.h:36
Generated from class MR::Vector3d.
Definition MRVector3.h:55
Generated from class MR::Vector3f.
Definition MRVector3.h:47
A fixed-size array of MR::Vector3d of size 3.
Definition std_array_MR_Vector3d_3.h:12
A fixed-size array of MR::Vector3f of size 3.
Definition std_array_MR_Vector3f_3.h:12