gCAD3D 2.35
ut_msh.c File Reference

Mesh-Functions MSH_.. (using struct MemTab) 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_txt.h"
#include "../ut/ut_memTab.h"
#include "../ut/ut_tin.h"
#include "../ut/func_types.h"
#include "../ut/ut_os.h"
#include "../ut/ut_TX.h"
#include "../xa/xa_msg.h"
#include "../xa/xa_mem.h"
#include "../xa/xa.h"

Functions

int MSH_aload_pTab (char *lBuf, int bufSiz, FILE *fpi)
 
int MSH_aload_fTab (char *lBuf, int bufSiz, FILE *fpi)
 
int MSH_asav_pTabf (Point *pTab, int pNr, char *fNam, FILE *fpo)
 
int MSH_asav_fTabf (MemTab(Fac3)*fTab, MemTab(EdgeLine)*eTab, MemTab(int)*eDat, char *fNam, FILE *fpo)
 
int MSH_bsav_pTab (MemTab *pTab, char *mdlNam, int surNr)
 
int MSH_bsav_pTabf (MemTab *pTab, char *fNam)
 
int MSH_bsav_fTab (MemTab *fTab, MemTab *eTab, MemTab *eDat, char *mdlNam, int surNr)
 
int MSH_bsav_fTabf (MemTab *fTab, MemTab *eTab, MemTab *eDat, char *fNam)
 
int MSH_bload_fTab (MemTab(Fac3)*fTab, MemTab(EdgeLine)*eTab, MemTab(int)*eDat, char *mdlNam, int surNr)
 
int MSH_bload_fTabf (MemTab *fTab, MemTab *eTab, MemTab *eDat, char *fNam)
 
int MSH_bload_pTab (MemTab(Point)*pTab, char *mdlNam, int surNr)
 
int MSH_bload_pTabf (MemTab *pTab, char *fNam)
 
int MSH_ibnd_ptn (int *iba, int *ibNr, Point *pa, int pNr)
 
int MSH_ibnd_pt2n (int *iba, int *ibNr, Point2 *p2a, int p2Nr)
 
int MSH_pt_prjptmsh_ (Point *pto, Point *pti, int surMsh, int surPtab, double tol)
 
int MSH_pta_prjptmsh1 (int *ptNr, Point *pa1, int *ia1, Fac3 *fa, int fNr, Point *pa, Point2 *p2a, int pNr, double tol)
 
int MSH_pt_prjptmsh1 (int *io, int *ie, Point *pto, Point *pti, Fac3 *fa, int fNr, Point *pa, int pNr, double tol)
 
int MSH_npt_prjcvmsh_ (Point **paOut, int *paNr, Point *pPlg, int plgNr, MemTab(Fac3)*fTab, MemTab(Point)*pTab, MemTab(EdgeLine)*eTab, MemTab(int)*eDat, double *tol)
 
int MSH_eTab_fix (MemTab(EdgeLine)*eTab, MemTab(int)*eDat)
 

Detailed Description

Mesh-Functions MSH_.. (using struct MemTab)

=====================================================
List_functions_start:
MSH_bsav_pTab write pointTable binary > tmp/M#A#.ptab
MSH_bsav_pTabf write pointTable binary > tmp/M#A#.ptab
MSH_bsav_fTab write faceTable binary > tmp/M#A#.msh
MSH_bsav_fTabf write faceTable binary > tmp/M#A#.msh
MSH_bload_pTab load pointTable from binary file tmp/M#A#.ptab
MSH_bload_pTabf load pointTable from binary file tmp/M#A#.ptab
MSH_bdel_pTab
MSH_bload_fTab load faceTable from binary file tmp/M#A#.msh
MSH_bload_fTabf load faceTable from binary file tmp/M#A#.msh
MSH_bdel_fTab delete binary faceTableFile
MSH_asav_pTabf save pointTable ascii into open file
MSH_asav_fTabf save faceTable ascii into open file
MSH_aload_pTab load pointTable ascii from open file
MSH_aload_fTab load faceTable ascii from open file
MSH_ibnd_ptn find boundary of 3D-pTab
MSH_ibnd_pt2n find boundary of 2D-pTab
MSH_pt_prjptmsh_ prj point -> mesh (load mesh)
MSH_pt_prjptmsh1 prj point -> active mesh
MSH_pta_prjptmsh1 prj points -> active mesh
MSH_npt_prjcvmsh_ project curve > Mesh
MSH_eTab_fix recover EdgeLine-pointers ia
List_functions_end:
=====================================================
- see also:
../ut/ut_tin.c UFA Funktionen fuer Faces (Fac3)
../ut/ut_tria.c Triangle-functions (using struct Point)

Function Documentation

int MSH_aload_pTab ( char *  lBuf,
int  bufSiz,
FILE *  fpi 
)
MSH_aload_pTab load pointTable ascii from open file
Input:
all following ascii-lines from open file fpi; "SECTIONEND" = end.
Output:
write into binary file
int MSH_aload_fTab ( char *  lBuf,
int  bufSiz,
FILE *  fpi 
)
MSH_aload_fTab load faceTable ascii from open file
cbuf = buffer with line "SECTION MESH fNam"
int MSH_asav_pTabf ( Point pTab,
int  pNr,
char *  fNam,
FILE *  fpo 
)

MSH_asav_pTabf save pointTable ascii into open file

int MSH_asav_fTabf ( MemTab(Fac3)*  fTab,
MemTab(EdgeLine)*  eTab,
MemTab(int)*  eDat,
char *  fNam,
FILE *  fpo 
)

MSH_asav_fTabf save faceTable ascii into open file

int MSH_bsav_pTab ( MemTab pTab,
char *  mdlNam,
int  surNr 
)
MSH_bsav_pTab write pointTable binary > tmp/<mdlnam>_A#.ptab
write OutFile
OutFilename: M#A#.ptab
int MSH_bsav_pTabf ( MemTab pTab,
char *  fNam 
)
int MSH_bsav_fTab ( MemTab fTab,
MemTab eTab,
MemTab eDat,
char *  mdlNam,
int  surNr 
)
MSH_bsav_fTab write faceTable binary > tmp/M#A#.msh
write OutFile
OutFilename: M#A#.msh
int MSH_bsav_fTabf ( MemTab fTab,
MemTab eTab,
MemTab eDat,
char *  fNam 
)
int MSH_bload_fTab ( MemTab(Fac3)*  fTab,
MemTab(EdgeLine)*  eTab,
MemTab(int)*  eDat,
char *  mdlNam,
int  surNr 
)
MSH_bload_fTab load faceTable from binary file tmp/M#A#.msh
fTab is malloced; you must free it !
int MSH_bload_fTabf ( MemTab fTab,
MemTab eTab,
MemTab eDat,
char *  fNam 
)
MSH_bload_fTab load faceTable from binary file tmp/M#A#.msh
fTab is malloced; you must free it !
int MSH_bload_pTab ( MemTab(Point)*  pTab,
char *  mdlNam,
int  surNr 
)
MSH_bload_pTab load pointTable from binary file tmp/M#A#.ptab
pTab is malloced; you must free it !
int MSH_bload_pTabf ( MemTab pTab,
char *  fNam 
)
MSH_bload_pTabf load pointTable from binary file tmp/M#A#.ptab
pTab is malloced; you must free it !
int MSH_ibnd_ptn ( int *  iba,
int *  ibNr,
Point pa,
int  pNr 
)
MSH_ibnd_ptn get boundary (iTab) for n points (pTab)
ACHTUNG: memspc501 memspc201 memspc55 used !!
Input:
ibNr size of iba
Output:
iba memspc for the indices of the boundarypoints into pa
ibNr nr of indices
int MSH_ibnd_pt2n ( int *  iba,
int *  ibNr,
Point2 p2a,
int  p2Nr 
)
MSH_ibnd_pt2n get boundary (iTab) for n 2D-points (p2a)
Does not provide the closing-point (last point is not equal to first point !)
Input:
ibNr size of iba
Output:
iba memspc for the indices of the boundarypoints into p2a
ibNr nr of indices
int MSH_pt_prjptmsh_ ( Point pto,
Point pti,
int  surMsh,
int  surPtab,
double  tol 
)
project point > Mesh (load mesh)
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=edgeNr, pto=pnt
-1 point is not inside mesh
-2 Error in inputData
Output:
int MSH_pta_prjptmsh1 ( int *  ptNr,
Point pa1,
int *  ia1,
Fac3 fa,
int  fNr,
Point pa,
Point2 p2a,
int  pNr,
double  tol 
)
MSH_pta_prjptmsh1 prj points (Z=0) -> active mesh
if point.z == 0. then set Z to Z-value on mesh; else keep Z-value.
Deletes points outside mesh !
Input
ptNr nr of points
pta new points (compute Z if Z=0; else keep Z-value)
ia1 index of point if identical with existing point in pa
pa[pNr] existing points
Output
pNr modified
pta all points outside mesh are removed !
retCod nr of errors
int MSH_pt_prjptmsh1 ( int *  io,
int *  ie,
Point pto,
Point pti,
Fac3 fa,
int  fNr,
Point pa,
int  pNr,
double  tol 
)
project point > Mesh
using memspc501
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;
-1 point is not inside mesh
- transform points > 2D;
- check if point is in Triangle or on its boundary
- get Z-coord of point on 2D-Triangle
int MSH_npt_prjcvmsh_ ( Point **  paOut,
int *  paNr,
Point pPlg,
int  plgNr,
MemTab(Fac3)*  fTab,
MemTab(Point)*  pTab,
MemTab(EdgeLine)*  eTab,
MemTab(int)*  eDat,
double *  tol 
)
int MSH_eTab_fix ( MemTab(EdgeLine)*  eTab,
MemTab(int)*  eDat 
)
MSH_eTab_fix recover EdgeLine-pointers ia
(nach relocation) die pointers neu aufbauen