gCAD3D 2.35
ut_tin.c File Reference

faces (using struct Fac3 - UFA_) More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_msh.h"
#include "../ut/ut_memTab.h"
#include "../ut/ut_tin.h"
#include "../ut/ut_txt.h"
#include "../ut/func_types.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_os.h"

Functions

int UFA_fac_dump_f (Fac3 *fa, int fNr, char *fnExt, char *txt,...)
 
int UFA_if_find_ptmsh (int *iFac, Point *pt1, Fac3 *fa, int fNr, Point *pa, int pNr)
 
int UFA_if_find_ip1 (int *ie, int ipt, Fac3 *fa, int fNr)
 
int UFA_if_find_ipIn (int *io, int *ie, Point *pt1, Point *pa, Fac3 *fa, int fNr)
 
int UFA_if_findSegP (int *iFac, int *iEdg, int ips, int ipe, Point *ps2, Fac3 *fa, int fNr, Point *pa)
 
int UFA_mod_delPt (MemTab(Fac3)*fTab, int ip)
 
int UFA_ife_getNf_ife (int *nfc, int *nec, int iFac, int iEdg, Fac3 *fac, Fac3 *fnb)
 
int UFA_if_getNf_ife (int iFac, int iEdg, Fac3 *fnb)
 
int UFA_fnb_init__ (Fac3 *fnb, Fac3 *fa, int fNr)
 
int UFA_fnb_init_t (int ifac, int esn, int ie1, int ie2, int ifn, Fac3 *fnb, Fac3 *fa, int fNr)
 
int UFA_fnb_set_if_es (Fac3 *fnb, int iFac, int esn, int ival)
 
int UFA_fnb_upd (Fac3 *fnb, Fac3 *fa, int fNr)
 
int UFA_fnb_init_1 (int ifac, Fac3 *fnb, Fac3 *fa, int fNr)
 
int UFA_opt__ (Fac3 *fa, Fac3 *fnb, int fNr, Point2 *p2a)
 
int UFA_opt_ckOpt (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p4)
 
int UFA_opt_ckCvx (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p4)
 
int UFA_2fac_flip (int if1, int esn1, int if2, int esn2, Fac3 *fa, Fac3 *fnb)
 
int UFA_fnb_set_esn (int ifc, int ips, int ifnb, Fac3 *fa, Fac3 *fnb)
 
int UFA_fnb_mod_val (Fac3 *fnb1, int valNew, int valOld)
 
int UFA_fnb_set_val (Fac3 *fnb1, int esn, int ifnb)
 
int UFA_esn_ipe (Fac3 *fac1, int ipe)
 
int UFA_esn_ips (Fac3 *fac1, int ipi)
 
int UFA_pFac3_esn (int **ip1, int **ip2, int **ip3, Fac3 *f, int esn)
 
int UFA_fnb_dump_f (Fac3 *fac, Fac3 *fnb, int fNr, char *fnExt, char *inf)
 
int UFA_fnb_dump__ (Fac3 *fa, Fac3 *fnb, int fNr, char *inf)
 
int UFA_fnb_dump_1 (Fac3 *fac, Fac3 *fnb, char *txt,...)
 
int UFA_ipOpp_facpt (int *ipOpp, Fac3 *fc, int ip)
 
int UFA_ipOpp_facedg (int *ipOpp, int *esn, Fac3 *fac1, int ips)
 
int UFA_2ip_ck_ptfac (int *ip2, int *ip3, Fac3 *fc, int ip1)
 
int UFA_fnb_get_2ip (Fac3 *fa, int fNr, int ie1, int ie2)
 
int UFA_2fac_facpt (MemTab(Fac3)*fTab, Fac3 *fnb, int ipt, int ifc, int ie)
 
int UFA_3fac_facpt (MemTab(Fac3)*fTab, Fac3 *fnb, int ipt, int ifc)
 
int UFA_facpt_chg_psn (Fac3 *fac1, int ival, int esn)
 
int UFA_facpt_chg__ (Fac3 *fa, int fNr, int i1, int i2, int i3)
 
int UFA_fac_dump_ (Fac3 *fa, int fNr, char *txt)
 
int UFA_fac_dump1 (Fac3 *fa, char *txt,...)
 
int UFA_fac_ck_sr_1 (int ifc, Fac3 *fac, Point *pa)
 
int UFA_fac_ck_sr__ (Fac3 *fa, Point *pa, int fNr, char *txt,...)
 
int UFA_add_fac (MemTab(Fac3)*fTab, int i1, int i2, int i3)
 
int UFA_2ip_fac_esn (int *i1, int *i2, int esn, Fac3 *fc1)
 
int UFA_2ip_fac_ip (int *ip1, int *ip2, Fac3 *fc1, int ipt)
 
int UFA_2if_find_2ip (int *if1, int *ie1, int *if2, int *ie2, int ip1, int ip2, Fac3 *fa, int fNr)
 
int UFA_ifac_ck_edgo (int *if1, int *ie1, int ip1, int ip2, Fac3 *fa, int fNr)
 
int UFA_nifac_ck_pt (int *iTab, char *psna, int *iNr, int ipt, Fac3 *fa, int fNr)
 
int UFA_fac_chg_sr (Fac3 *fc)
 
int UFA_fac_srar2 (double *ar, Fac3 *fc, Point2 *p2a)
 
int UFA_fac_srar (double *ar, Fac3 *fc, Point *pa)
 
int UFA_psn_1fac_ip (Fac3 *fac, int ip)
 
int UFA_ip_fac_psn (Fac3 *fac, int psn)
 
int UFA_ipe_fac_esn (Fac3 *fac, int psn)
 
int UFA_ipOpp_fac_esn (int *ipOpp, int *psn, Fac3 *fac1, int esn)
 
int UFA_int_fac_ln2 (int *ieo, int iei, Point2 *ptl, Vector2 *vcl, Fac3 *fac, Point *pa)
 
int UFA_2pt2_fac_esn (Point2 *pe1, Point2 *pe2, int esn, Fac3 *fac, Point *pa)
 
int UFA_ck_2ip_ipa (int ip1, int ip2, int *ipa, int ipNr)
 
int UFA_2esn_comm2fac (int *esn1, int *esn2, Fac3 *fac1, Fac3 *fac2)
 
int UFA_fnb_init_el (MemTab(EdgeLine)*eTab, Fac3 *fnb, Fac3 *fa, int fNr)
 
int UFA_nfb_ck_1 (int ifc, int ec, Fac3 *fa, Fac3 *fnb)
 
int UFA_nfb_ck_f (int ifc, Fac3 *fa, Fac3 *fnb)
 
int UFA_nfb_ck__ (Fac3 *fa, Fac3 *fnb, int fNr, char *txt,...)
 

Detailed Description

faces (using struct Fac3 - UFA_)

=====================================================
List_functions_start:
UFA_add_fac add face to MemTab(Fac3)
UFA_facpt_chg_psn set 1 pointer in face (seqnr) from esn
UFA_2fac_facpt create 2 new Faces from 1 face (point on edge)
UFA_3fac_facpt create 3 new Faces from 1 face
UFA_mod_delPt change all face-pointers >= ip to ip-1
UFA_fac_dump1 dump 1 face
UFA_fac_dump_f dump faces into file
UFA_fac_ck_sr__ test sense-of-rotation of all faces
UFA_fac_ck_sr_1 test sense-of-rotation of a face
UFA_fac_srar get (signed) area of face and sense-of-rotation (3D-points)
UFA_fac_srar2 get (signed) area of face 2D
UFA_fac_chg_sr change sr of face
UFA_2if_find_2ip find (1|2) faces from unoriented Edge (2 ipt's)
UFA_ifac_ck_edgo find face from oriented Edge (2 ipt's)
UFA_if_findSegP find face with LineSegment ips-ps2 inside
UFA_if_find_ptmsh find faceNr of point (2D-test point inside face)
UFA_if_find_ip1 test if point ipt is already meshed
UFA_if_find_ipIn find face covering point ipt
UFA_if_getNf_ife get neighbourface for face, edge
UFA_ife_getNf_ife get neighbour and esn for face,esn
UFA_nifac_ck_pt get all faces going tru point with index ipt
UFA_esn_ips get EdgeSequenceNumber of face from (start-)pointNr
UFA_esn_ipe get EdgeSequenceNumber of face from (end-)pointNr
UFA_esn_nxt get Edge|PointSeqNr of next Edge|Point (CCW) INLINE
UFA_esn_prv get Edge|PointSeqNr of previous Edge|Point (CCW) INLINE
UFA_esn_opp_psn get EdgeSeqNr of Edge opposite to PointSeqNr INLINE
UFA_2esn_comm2fac get common edges of 2 faces with common edge
UFA_ipOpp_fac_esn get point opposite to edge
UFA_ipOpp_facedg get point opposite to edge (ip3 & ptNr from ip1)
UFA_ip_fac_psn get pointIndex from face, edgeSeqNr
UFA_ipe_fac_esn get pointIndex of end of edge from face, edgeSeqNr
UFA_2ip_ck_ptfac ck if ip1 is used in face; get ip2, ip3.
UFA_2ip_fac_esn get pointNrs for Edge from face + EdgeSeqNr
UFA_2ip_fac_ip get the 2 opposite points from face and point
UFA_2pt2_fac_esn get 2D-points of edge of face + EdgeSeqNr
UFA_ck_2ip_ipa test if edge ip1-ip2 is on polygon; oriented, closed.
UFA_psn_1fac_ip get pointSeqNr of pointNr in face
UFA_opt_diag check common edge for optimize
UFA_opt__ test 2 common Edges
UFA_opt_saf
UFA_opt_ckCvx check if 2 faces with common edge are convex
UFA_opt_ckOpt Check Delaunay triangulation
UFA_int_fac_ln2 intersect face - 2D-line
UFA_2fac_flip flip 2 faces with common edge
UFA_pFac3_esn get pointers into Face
UFA_fnb_init__ create neighbourfaces for mesh
UFA_fnb_init_1 update fnb[ifac]
UFA_fnb_init_el set NeighbourFacNr -2, if Edge is a BreakLine
UFA_fnb_upd update fnb (faces to be updated are marked -16)
UFA_fnb_BL_reset reset all reset all fnb-values -2 (BreakLines)
UFA_fnb_set_if_es set 1 fnb-link from iFac and esn
UFA_fnb_get_2ip find neighbourface for edge from 2 points
UFA_fnb_set_esn set face-neighbour from startpoint
UFA_fnb_set_val set face-neighbour
UFA_fnb_mod_val modify face-neighbour
UFA_nfb_ck__ check all nfb-structs
UFA_nfb_ck_f check single nfb-struct
UFA_nfb_ck_1 check single edge of nfb-struct
UFA_fnb_dump_1 dump face and its neighbours
UFA_fnb_dump__ dump faces and neighbours
UFA_fnb_dump_f dump faces and neighbours into file
List_functions_end:
=====================================================
- see also:
../ut/ut_tria.c Triangle-functions (using struct Point)
../ut/ut_msh.c MSH Funktionen fuer Meshes (MemTab)

Function Documentation

int UFA_fac_dump_f ( Fac3 fa,
int  fNr,
char *  fnExt,
char *  txt,
  ... 
)

UFA_fac_dump_f dump faces into file

int UFA_if_find_ptmsh ( int *  iFac,
Point pt1,
Fac3 fa,
int  fNr,
Point pa,
int  pNr 
)
int UFA_if_find_ip1 ( int *  ie,
int  ipt,
Fac3 fa,
int  fNr 
)
int UFA_if_find_ipIn ( int *  io,
int *  ie,
Point pt1,
Point pa,
Fac3 fa,
int  fNr 
)

Output: io rc=0: faceNr; rc=1: pointIndex pto rc=0: pti on face (Z fixed); rc=1: NULL retCod 0 OK; inside_face, on_face_edge: io=faceNr, pto=point 1 OK; pti is on_edge; io=faceNr, ie=edgeNr, pto=point 2 OK; pti is identical_with_point: io=pointIndex; ie=ptSeqNr -1 point is not inside mesh

int UFA_if_findSegP ( int *  iFac,
int *  iEdg,
int  ips,
int  ipe,
Point ps2,
Fac3 fa,
int  fNr,
Point pa 
)
int UFA_mod_delPt ( MemTab(Fac3)*  fTab,
int  ip 
)

UFA_mod_delPt change all face-pointers >= ip to ip-1

int UFA_ife_getNf_ife ( int *  nfc,
int *  nec,
int  iFac,
int  iEdg,
Fac3 fac,
Fac3 fnb 
)
int UFA_if_getNf_ife ( int  iFac,
int  iEdg,
Fac3 fnb 
)
int UFA_fnb_init__ ( Fac3 fnb,
Fac3 fa,
int  fNr 
)
Zu den Faces fa eine Parallelstructur fnb aufbauen,
in denen die NachbarFacNrs gespeichert sind.
(Fac3*)fnb: fnb[f].i1 = Index zum Nachbarface der Kante 1 (p0-p1)
fnb[f].i2 = Index zum Nachbarface der Kante 2 (p1-p2)
fnb[f].i3 = Index zum Nachbarface der Kante 3 (p2-p0)
(Kante 1 geht von Punkt 1 zu Punkt 2) usw.
-1 = this edge is unresolved
breaklines are not marked; see UFA_fnb_init_el
int UFA_fnb_init_t ( int  ifac,
int  esn,
int  ie1,
int  ie2,
int  ifn,
Fac3 fnb,
Fac3 fa,
int  fNr 
)
int UFA_fnb_set_if_es ( Fac3 fnb,
int  iFac,
int  esn,
int  ival 
)

UFA_fnb_set_if_es set 1 fnb-link from iFac and esn

int UFA_fnb_upd ( Fac3 fnb,
Fac3 fa,
int  fNr 
)

UFA_fnb_upd update fnb (faces to be updated are marked -16)

int UFA_fnb_init_1 ( int  ifac,
Fac3 fnb,
Fac3 fa,
int  fNr 
)
int UFA_opt__ ( Fac3 fa,
Fac3 fnb,
int  fNr,
Point2 p2a 
)
int UFA_opt_ckOpt ( Point2 p1,
Point2 p2,
Point2 p3,
Point2 p4 
)
int UFA_opt_ckCvx ( Point2 p1,
Point2 p2,
Point2 p3,
Point2 p4 
)
int UFA_2fac_flip ( int  if1,
int  esn1,
int  if2,
int  esn2,
Fac3 fa,
Fac3 fnb 
)

change diagonalLine; common Edge is p1-p2; change to p3-p4. Output: fa modied fnb modied

int UFA_fnb_set_esn ( int  ifc,
int  ips,
int  ifnb,
Fac3 fa,
Fac3 fnb 
)

set the neighbour of edge starting with point ips of Face ifc to ifnb Input: ifc index of fnb to modify ips index point where edge starts ifnb index neigbourface; new value

see UFA_fnb_set_if_es

int UFA_fnb_mod_val ( Fac3 fnb1,
int  valNew,
int  valOld 
)
int UFA_fnb_set_val ( Fac3 fnb1,
int  esn,
int  ifnb 
)
int UFA_esn_ipe ( Fac3 fac1,
int  ipe 
)

UFA_esn_ipe get EdgeSequenceNumber of face from (end-)pointNr get esn of single face from pointIndex

int UFA_esn_ips ( Fac3 fac1,
int  ipi 
)

get EdgeSequenceNumber of the Edge starting with point ipi get esn of single face from pointIndex

int UFA_pFac3_esn ( int **  ip1,
int **  ip2,
int **  ip3,
Fac3 f,
int  esn 
)
int UFA_fnb_dump_f ( Fac3 fac,
Fac3 fnb,
int  fNr,
char *  fnExt,
char *  inf 
)
int UFA_fnb_dump__ ( Fac3 fa,
Fac3 fnb,
int  fNr,
char *  inf 
)
int UFA_fnb_dump_1 ( Fac3 fac,
Fac3 fnb,
char *  txt,
  ... 
)
int UFA_ipOpp_facpt ( int *  ipOpp,
Fac3 fc,
int  ip 
)
int UFA_ipOpp_facedg ( int *  ipOpp,
int *  esn,
Fac3 fac1,
int  ips 
)
int UFA_2ip_ck_ptfac ( int *  ip2,
int *  ip3,
Fac3 fc,
int  ip1 
)
int UFA_fnb_get_2ip ( Fac3 fa,
int  fNr,
int  ie1,
int  ie2 
)
int UFA_2fac_facpt ( MemTab(Fac3)*  fTab,
Fac3 fnb,
int  ipt,
int  ifc,
int  ie 
)
int UFA_3fac_facpt ( MemTab(Fac3)*  fTab,
Fac3 fnb,
int  ipt,
int  ifc 
)
int UFA_facpt_chg_psn ( Fac3 fac1,
int  ival,
int  esn 
)
int UFA_facpt_chg__ ( Fac3 fa,
int  fNr,
int  i1,
int  i2,
int  i3 
)
int UFA_fac_dump_ ( Fac3 fa,
int  fNr,
char *  txt 
)
int UFA_fac_dump1 ( Fac3 fa,
char *  txt,
  ... 
)
int UFA_fac_ck_sr_1 ( int  ifc,
Fac3 fac,
Point pa 
)

Output: RetCod = 1 = CCW -1 = CW

int UFA_fac_ck_sr__ ( Fac3 fa,
Point pa,
int  fNr,
char *  txt,
  ... 
)

UFA_fac_ck_sr__ test sense-of-rotation of all faces 3D print all faces not CCW

int UFA_add_fac ( MemTab(Fac3)*  fTab,
int  i1,
int  i2,
int  i3 
)
int UFA_2ip_fac_esn ( int *  i1,
int *  i2,
int  esn,
Fac3 fc1 
)
int UFA_2ip_fac_ip ( int *  ip1,
int *  ip2,
Fac3 fc1,
int  ipt 
)
int UFA_2if_find_2ip ( int *  if1,
int *  ie1,
int *  if2,
int *  ie2,
int  ip1,
int  ip2,
Fac3 fa,
int  fNr 
)
int UFA_ifac_ck_edgo ( int *  if1,
int *  ie1,
int  ip1,
int  ip2,
Fac3 fa,
int  fNr 
)
int UFA_nifac_ck_pt ( int *  iTab,
char *  psna,
int *  iNr,
int  ipt,
Fac3 fa,
int  fNr 
)
int UFA_fac_chg_sr ( Fac3 fc)
int UFA_fac_srar2 ( double *  ar,
Fac3 fc,
Point2 p2a 
)

Output: RetCod = 1 = CCW -1 = CW

int UFA_fac_srar ( double *  ar,
Fac3 fc,
Point pa 
)

Output: RetCod = 1 = CCW -1 = CW

int UFA_psn_1fac_ip ( Fac3 fac,
int  ip 
)
int UFA_ip_fac_psn ( Fac3 fac,
int  psn 
)
int UFA_ipe_fac_esn ( Fac3 fac,
int  psn 
)
int UFA_ipOpp_fac_esn ( int *  ipOpp,
int *  psn,
Fac3 fac1,
int  esn 
)
int UFA_int_fac_ln2 ( int *  ieo,
int  iei,
Point2 ptl,
Vector2 vcl,
Fac3 fac,
Point pa 
)
int UFA_2pt2_fac_esn ( Point2 pe1,
Point2 pe2,
int  esn,
Fac3 fac,
Point pa 
)
int UFA_ck_2ip_ipa ( int  ip1,
int  ip2,
int *  ipa,
int  ipNr 
)
int UFA_2esn_comm2fac ( int *  esn1,
int *  esn2,
Fac3 fac1,
Fac3 fac2 
)
int UFA_fnb_init_el ( MemTab(EdgeLine)*  eTab,
Fac3 fnb,
Fac3 fa,
int  fNr 
)
int UFA_nfb_ck_1 ( int  ifc,
int  ec,
Fac3 fa,
Fac3 fnb 
)
int UFA_nfb_ck_f ( int  ifc,
Fac3 fa,
Fac3 fnb 
)
int UFA_nfb_ck__ ( Fac3 fa,
Fac3 fnb,
int  fNr,
char *  txt,
  ... 
)