gCAD3D 2.40
ut_tria.c File Reference

triangles (using struct Point - UTRI_) More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/gl.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_memTab.h"
#include "../ut/ut_itmsh.h"
#include "../xa/xa_mem.h"
#include "../ut/gr_types.h"

Functions

int UTRI_tria_3pt (Triangle *triTab, int *triNr, int triSiz, Point *p1, Point *p2, Point *p3)
 
int UTRI_ntria_patch (Triangle *tTab, int *tSiz, Point *pTab, int pNr, int pTyp)
 
int UTRI_triaNr_patch (int ptNr, int patchTyp)
 
int UT2D_orient_3pt (Point2 *p1, Point2 *p2, Point2 *p3)
 
int UT3D_pt_projPtTria (Point *pto, Point *pti, Triangle *trii)
 
int UTRI_pt_prjZpt3pt (Point *pto, Point *pti, Point *p1, Point *p2, Point *p3)
 
int UT3D_lenq_PtTria (double *lenq, Point *p, Point *p1, Point *p2, Point *p3)
 
int UT3D_lenq_PlnTria (double *lenq, Point *plnO, Vector *plnZ, Point *p1, Point *p2, Point *p3)
 
int UT3D_indTria2ccw (int *i1, int *i2)
 
int UT3D_tria_inv (Triangle *tr)
 
int UT3D_tria_pta (Triangle *tr, Point *pa)
 
int UT3D_pt_gcp_tria (Point *ps, Triangle *tri)
 
int UT2D_pt_gcp_3pt (Point2 *ps, Point2 *p1, Point2 *p2, Point2 *p3)
 
int UTRI_radi_3pt (double *rdi, Point2 *p1, Point2 *p2, Point2 *p3)
 
int UTRI_rado_3pt (double *rdo, Point2 *p1, Point2 *p2, Point2 *p3)
 
int UTRI_ptCC_3pt (Point2 *pum, Point2 *p1, Point2 *p2, Point2 *p3)
 
int UT3D_pt_gcp_3pt (Point *ps, Point *p1, Point *p2, Point *p3)
 
int UT3D_pt_intTriaLnu (Point *ptx, Triangle *tri, Point *ptl, Vector *vcl)
 
int UTRI_ln_int_LnFac (Point *ip, Point *pf1, Point *pf2, Point *pf3, Point *pl1, Point *pl2)
 
int UT3D_ln_intTriaPln (Line *lni, Triangle *tria, Plane *pln)
 
int UT3D_ln_int_tria_pln (Line *lni, Plane *pln, Point *p0, Point *p1, Point *p2)
 
int UT3D_ln_intTriaTria (Line *lni, Triangle *tri1, Triangle *tri2)
 
int UT3D_pl1_tria (Plane *plt1, Triangle *tri1)
 
int UT2D_2pt_tngLnCiY (Point2 *ps, Point2 *py, Point2 *ls, Point2 *le, double yy, double rc)
 
int UT3D_2ln_tngTriPlSph (Line *lnt, Line *lnp, double *aDiff, Triangle *tria, Plane *pls, double rs)
 
int UT2D_ck_pt_in_tria__ (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *px)
 
int UT3D_ck_pt_in_tria (Point *p1, Point *p2, Point *p3, Point *px)
 
int UT3D_ck_pt_prj_tria (Point *p1, Point *p2, Point *p3, Point *px)
 

Detailed Description

triangles (using struct Point - UTRI_)

=====================================================
List_functions_start:
UT3D_tria_pta create triangle from 3 points
UTRI_tria_3pt create triangle from 3 points
UT3D_tria_fac create triangle from Fac3 INLINE
UTRI_ntria_patch get triangles from opengl-patch (pTab, pNr, pTyp)
UTRI_triaNr_patch get nr of triangles for [indexed-]opengl-patch
UT2D_orient_3pt orientation of triangle (CW or CCW)
UT3D_ck_triaOrientV get orientation from indices INLINE
UT2D_2pt_tngLnCiY Beruehrung Kreis (pc auf horiz. Gerade) - LineSeg
UT3D_vc_perpTria vector = perpendic. to Triangle (crossprod)
UTRI_radi_3pt inkreisradius
UTRI_rado_3pt radius circumCircle umkreisradius
UTRI_ptCC_3pt center of circumCircle UmkreisMittelpunkt
UTRI_ar_3pt area of triangle see UT2D_ar_3pt
UT3D_indTria2ccw 3EckIndices CCW orientieren
UT3D_ind3Tria_2ind give index of 3.point of triangle (0/1/2) INLINE
UT3D_lenq_PtTria minimum (quadr) distance Point-Triangle
UT3D_lenq_PlnTria minimum (quadr) distance Plane-Triangle
UT3D_ck_pt_in_tria check if point is inside Triangle
UT3D_ck_pt_prj_tria check if projection of point is inside Triangle
UT2D_pt_gcp_3pt gravity-centerPoint of triangle
UT3D_pt_gcp_3pt gravity-centerPoint of triangle
UT3D_pt_gcp_tria gravity-centerPoint of triangle
UT3D_tria_inv Umlaufsinn umdrehen
UT3D_pt_projPtTria project point onto triangle
UTRI_pt_prjZpt3pt project point to face along Z-vec
UT3D_pt_intTriaLnu Point from intersect Triangle - LineUnlimited
UT3D_ln_int_tria_pln Line = intersect Triangle (3 points) - Plane
UT3D_2ln_tngTriPlSph Kugel in Ebene an 3Eck abrollen
List_functions_end:
=====================================================
- see also:
TSU_ntria_bMsh__ triangles from binary-mesh
statt UT3D_vc_perptria use UT3D_vc_perp3pt Normalvektor auf 3Eck
../ut/ut_face.c UFA Funktionen fuer Faces (Fac3)
../ut/ut_msh.c MSH Funktionen fuer Meshes
- test functions:
UT3D_tria_tst_load load testTriangles

Function Documentation

int UTRI_tria_3pt ( Triangle triTab,
int *  triNr,
int  triSiz,
Point p1,
Point p2,
Point p3 
)
int UTRI_ntria_patch ( Triangle tTab,
int *  tSiz,
Point pTab,
int  pNr,
int  pTyp 
)
int UTRI_triaNr_patch ( int  ptNr,
int  patchTyp 
)
* UTRI_triaNr_patch get nr of triangles for [indexed-]opengl-patch
* Input:
* ptNr nr of points
* patchTyp GL_TRIANGLE_STRIP|GL_TRIANGLE_FAN|GL_QUAD_STRIP
*
*
int UT2D_orient_3pt ( Point2 p1,
Point2 p2,
Point2 p3 
)
int UT3D_pt_projPtTria ( Point pto,
Point pti,
Triangle trii 
)
int UTRI_pt_prjZpt3pt ( Point pto,
Point pti,
Point p1,
Point p2,
Point p3 
)
int UT3D_lenq_PtTria ( double *  lenq,
Point p,
Point p1,
Point p2,
Point p3 
)
int UT3D_lenq_PlnTria ( double *  lenq,
Point plnO,
Vector plnZ,
Point p1,
Point p2,
Point p3 
)
int UT3D_indTria2ccw ( int *  i1,
int *  i2 
)
int UT3D_tria_inv ( Triangle tr)
int UT3D_tria_pta ( Triangle tr,
Point pa 
)
int UT3D_pt_gcp_tria ( Point ps,
Triangle tri 
)
int UT2D_pt_gcp_3pt ( Point2 ps,
Point2 p1,
Point2 p2,
Point2 p3 
)
int UTRI_radi_3pt ( double *  rdi,
Point2 p1,
Point2 p2,
Point2 p3 
)
int UTRI_rado_3pt ( double *  rdo,
Point2 p1,
Point2 p2,
Point2 p3 
)
int UTRI_ptCC_3pt ( Point2 pum,
Point2 p1,
Point2 p2,
Point2 p3 
)
int UT3D_pt_gcp_3pt ( Point ps,
Point p1,
Point p2,
Point p3 
)
int UT3D_pt_intTriaLnu ( Point ptx,
Triangle tri,
Point ptl,
Vector vcl 
)
int UTRI_ln_int_LnFac ( Point ip,
Point pf1,
Point pf2,
Point pf3,
Point pl1,
Point pl2 
)
int UT3D_ln_intTriaPln ( Line lni,
Triangle tria,
Plane pln 
)
int UT3D_ln_int_tria_pln ( Line lni,
Plane pln,
Point p0,
Point p1,
Point p2 
)
int UT3D_ln_intTriaTria ( Line lni,
Triangle tri1,
Triangle tri2 
)
int UT3D_pl1_tria ( Plane plt1,
Triangle tri1 
)
int UT2D_2pt_tngLnCiY ( Point2 ps,
Point2 py,
Point2 ls,
Point2 le,
double  yy,
double  rc 
)
int UT3D_2ln_tngTriPlSph ( Line lnt,
Line lnp,
double *  aDiff,
Triangle tria,
Plane pls,
double  rs 
)
int UT2D_ck_pt_in_tria__ ( Point2 p1,
Point2 p2,
Point2 p3,
Point2 px 
)
int UT3D_ck_pt_in_tria ( Point p1,
Point p2,
Point p3,
Point px 
)
int UT3D_ck_pt_prj_tria ( Point p1,
Point p2,
Point p3,
Point px 
)