00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #define RAD_360 6.2831853071795862319
00045 #define RAD_270 4.7123889803846896739
00046 #define RAD_225 3.92699081698724151736
00047 #define RAD_180 3.14159265358979323846
00048 #define RAD_135 2.3561944901923448368
00049 #define RAD_90 1.5707963267948965579
00050 #define RAD_60 1.0471975511965976313
00051 #define RAD_45 0.7853981633974482789
00052 #define RAD_30 0.5235987755982988156
00053 #define RAD_10 0.174532925199432954
00054 #define RAD_1 0.0174532925199432954
00055 #define RAD_01 0.0017453292519943295
00056 #define SR_3 1.7320508075688772
00057 #define SR_2 1.4142135623730951
00058 #define SR_PI 1.7724538509055159
00059
00060
00061 #define CCW 1
00062 #define CW -1
00063
00064
00065 #define YES 0
00066 #define NO 1
00067
00068 #define ON 0
00069 #define OFF 1
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #define Typ_Error 0
00091 #define Typ_VAR 1
00092 #define Typ_PT 2
00093 #define Typ_LN 3
00094 #define Typ_CI 4
00095 #define Typ_AC 5
00096 #define Typ_VC 6
00097 #define Typ_CV 7
00098 #define Typ_CVPOL 8
00099 #define Typ_CVPSP3 9
00100 #define Typ_CVBSP 10
00101 #define Typ_CVRBSP 11
00102 #define Typ_CVCCV 12
00103 #define Typ_CVELL 13
00104 #define Typ_CVBEZ 14
00105 #define Typ_CVRBEZ 15
00106 #define Typ_CVCLOT 16
00107
00108 #define Typ_APPOBJ 20
00109 #define Typ_PT2 22
00110 #define Typ_LN2 23
00111 #define Typ_AC2 24
00112 #define Typ_CI2 25
00113 #define Typ_VC2 26
00114 #define Typ_CV2 27
00115 #define Typ_CVPOL2 28
00116 #define Typ_CVPSP2 29
00117 #define Typ_CVBSP2 30
00118 #define Typ_CVRBSP2 31
00119 #define Typ_CVCCV2 32
00120 #define Typ_CVELL2 33
00121 #define Typ_CVBEZ2 34
00122
00123 #define Typ_PLN 70
00124
00125
00126 #define Typ_SOL 71
00127 #define Typ_SPH 72
00128 #define Typ_CON 73
00129 #define Typ_TOR 74
00130 #define Typ_CYL 75
00131
00132
00133 #define Typ_EdgeLine 169
00134
00135 #define Typ_Fac3 215
00136 #define Typ_QFac 163
00137 #define Typ_Tria 164
00138
00139
00140 #define Typ_SURBSP 158
00141 #define Typ_SURRBSP 159
00142 #define Typ_SURRU 153
00143 #define Typ_SURRV 154
00144 #define Typ_SURPLN 155
00145 #define Typ_SURPTAB 149
00146 #define Typ_SURCON 156
00147 #define Typ_SURTOR 157
00148 #define Typ_SURCIR 151
00149 #define Typ_SURSTRIP 152
00150
00151 #define Typ_SURTPS 162
00152 #define Typ_SURMSH 160
00153 #define Typ_SURHAT 161
00154
00155 #define Typ_SUR 150
00156
00157
00158
00159
00160
00161 #define Typ_GL_Sur 210
00162 #define Typ_GL_PP 211
00163 #define Typ_GL_CV 212
00164
00165
00166 #define Typ_ATXT 40
00167 #define Typ_GTXT 41
00168 #define Typ_Dimen 42
00169 #define Typ_Dim3 53
00170 #define Typ_Txt 43
00171 #define Typ_String 44
00172 #define Typ_SymB 45
00173 #define Typ_SymV 46
00174 #define Typ_StrDel 47
00175 #define Typ_StrDel1 48
00176 #define Typ_Tag 49
00177
00178
00179 #define Typ_Box 50
00180 #define Typ_TmpPT 51
00181 #define Typ_TmpLN 52
00182 #define Typ_TmpVC 54
00183 #define Typ_TmpSym 55
00184
00185 #define Typ_EyePT 56
00186
00187 #define Typ_TmpTRI 61
00188 #define Typ_TmpPLN 62
00189
00190
00191 #define Typ_goGeom 80
00192 #define Typ_goPrim 81
00193 #define Typ_lFig 82
00194 #define Typ_goGeo1 86
00195 #define Typ_goGeo2 87
00196 #define Typ_goGeo3 88
00197 #define Typ_goGeo4 89
00198 #define Typ_goGeo5 83
00199 #define Typ_goGeoSUSU 84
00200 #define Typ_goGeo6 85
00201 #define Typ_goGeo7 79
00202 #define Typ_goGeo8 78
00203 #define Typ_goAxis 77
00204 #define Typ_goRadius 76
00205
00206 #define Typ_Ditto 90
00207 #define Typ_Group 91
00208 #define Typ_Layer 92
00209 #define Typ_apDat 93
00210 #define Typ_TEXB 94
00211 #define Typ_TEXR 57
00212 #define Typ_Part 98
00213 #define Typ_SubModel 97
00214 #define Typ_Model 99
00215 #define Typ_Mock 95
00216
00217 #define Typ_Typ 106
00218 #define Typ_Address 107
00219 #define Typ_Size 96
00220 #define Typ_Index 100
00221 #define Typ_Name 101
00222 #define Typ_Color 102
00223 #define Typ_Ltyp 103
00224 #define Typ_Thick 104
00225 #define Typ_G_Att 105
00226 #define Typ_Tool 108
00227 #define Typ_Activ 109
00228
00229 #define Typ_Val 110
00230 #define Typ_ValX 124
00231 #define Typ_ValY 125
00232 #define Typ_ValZ 126
00233 #define Typ_XVal 111
00234 #define Typ_YVal 112
00235 #define Typ_ZVal 113
00236 #define Typ_Angle 114
00237 #define Typ_Rad 115
00238 #define Typ_Dist 116
00239 #define Typ_Par1 127
00240
00241 #define Typ_UVal 128
00242 #define Typ_VVal 129
00243 #define Typ_AngN 117
00244 #define Typ_AngP 118
00245 #define Typ_RadISO 119
00246 #define Typ_Conic 120
00247
00248
00249 #define Typ_DirS 123
00250
00251 #define Typ_Int1 135
00252 #define Typ_Int2 136
00253 #define Typ_Int4 137
00254 #define Typ_Float4 138
00255 #define Typ_Float8 139
00256
00257 #define Typ_Polynom1 165
00258 #define Typ_Polynom3 166
00259 #define Typ_Polynom_ 167
00260 #define Typ_polynom_d3 168
00261
00262 #define Typ_M3x2 145
00263 #define Typ_M3x3 146
00264 #define Typ_M4x3 147
00265 #define Typ_M4x4 148
00266
00267 #define Typ_Memspc 140
00268 #define Typ_MemTab 144
00269 #define Typ_ObjG2 141
00270 #define Typ_ObjG 142
00271 #define Typ_ObjGX 143
00272 #define Typ_ObjRange 250
00273
00274 #define Typ_Tra 130
00275 #define Typ_TraTra 131
00276 #define Typ_TraRot 132
00277 #define Typ_TraMat 133
00278
00279 #define Typ_ope_eq 221
00280 #define Typ_ope_ne 222
00281 #define Typ_ope_lt 223
00282 #define Typ_ope_gt 224
00283 #define Typ_ope_ge 225
00284 #define Typ_ope_le 226
00285
00286 #define Typ_cmdNCsub 170
00287 #define Typ_Subtyp 172
00288
00289 #define Typ_modif 175
00290 #define Typ_modCoord 176
00291 #define Typ_modCWCCW 177
00292 #define Typ_modAux 178
00293 #define Typ_modREV 179
00294 #define Typ_modCX 173
00295 #define Typ_modCTRL 174
00296 #define Typ_modHIX 180
00297 #define Typ_modLOX 181
00298 #define Typ_modHIY 182
00299 #define Typ_modLOY 183
00300 #define Typ_modHIZ 184
00301 #define Typ_modLOZ 185
00302 #define Typ_modCCW 186
00303 #define Typ_modCW 187
00304 #define Typ_modIN 188
00305 #define Typ_modOUT 189
00306
00307
00308 #define TYP_FuncInit 190
00309 #define TYP_FuncInit1 191
00310 #define TYP_FuncMod 192
00311 #define TYP_FuncAdd 193
00312 #define TYP_FuncDel 194
00313 #define TYP_FuncEnd 200
00314 #define TYP_FuncExit 201
00315
00316 #define TYP_EvMouseL 230
00317 #define TYP_EvMouseM 231
00318 #define TYP_EvMouseR 232
00319 #define TYP_EvMouse2L 233
00320
00321 #define TYP_FilNam 238
00322 #define Typ_CtlgPart 239
00323
00324 #define Typ_ALL 240
00325 #define Typ_Done 241
00326 #define Typ_NULL 241
00327
00328
00329 #define BCKPLN_XY 2
00330 #define BCKPLN_XZ 1
00331 #define BCKPLN_YZ 0
00332
00333 #define BCKVEC_Z 2
00334 #define BCKVEC_Y 1
00335 #define BCKVEC_X 0
00336
00337
00338 #define GL_TRIANGLE_NPFAN 16
00339
00340
00341
00342
00343 #define Mtyp_Gcad 0
00344 #define Mtyp_DXF 1
00345 #define Mtyp_Iges 2
00346 #define Mtyp_Step 3
00347 #define Mtyp_3DS 4
00348 #define Mtyp_LWO 5
00349 #define Mtyp_XML 6
00350 #define Mtyp_WRL 10
00351 #define Mtyp_WRL2 110
00352 #define Mtyp_OBJ 11
00353 #define Mtyp_STL 12
00354 #define Mtyp_TESS 13
00355 #define Mtyp_BMP 20
00356 #define Mtyp_JPG 21
00357
00358
00359
00360
00361
00362 #ifndef TimeStamp
00363 #define TimeStamp float
00364
00365 #endif
00366
00367
00368
00369 typedef double Mat_3x2[2][3];
00370 typedef double Mat_3x3[3][3];
00371 typedef double Mat_4x3[3][4];
00372 typedef double Mat_4x4[4][4];
00373
00375 typedef struct {double e0, e1, e2, e3;} Quat;
00376
00377 typedef struct {double a, b;} dcomplex;
00378 typedef struct {double a, b, c, d;} polcoeff_d3;
00379 typedef struct {double a, b, c, d, e;} polcoeff_d4;
00380 typedef struct {double a, b, c, d, e, f;} polcoeff_d5;
00381
00383 typedef struct {double u; polcoeff_d3 x, y, z;} polynom_d3;
00384
00385
00386
00388 typedef struct {int polNr; double *pol;} Polynom1;
00389
00390
00391
00393 typedef struct {int polNr; double *pol[3];} Polynom3;
00394
00395
00396
00398
00399
00400 typedef struct {int dim1, dim2; double *pol;} Polynom_;
00401
00402
00403
00404
00405
00406
00407
00409 typedef struct {double x, y;} Point2;
00410
00411
00413 typedef struct {double x, y, z;} Point;
00414
00415
00417 typedef struct {double dx, dy;} Vector2;
00418
00419
00421 typedef struct {double dx, dy, dz;} Vector;
00422
00423
00424 typedef struct {Point p; Vector v;} Ray;
00425
00427 typedef struct {Point2 p1, p2;} Line2;
00428
00430 typedef struct {Point p1, p2;} Line;
00431
00432
00433
00435 typedef struct {Point *pa[3];} Triangle;
00436
00437
00438
00448 typedef struct {Point2 p1, p2, pc; double rad, ango;} Circ2;
00449
00450
00451
00461 typedef struct {Point p1, p2, pc; Vector vz; double rad, ango;} Circ;
00462
00463
00464
00465
00466
00477 typedef struct {Point p1, p2, pc; Vector vz, va, vb; int dir;} CurvElli;
00478
00479
00480
00482 typedef struct {int typ, cvnr, ind1, ind2; Point p1, p2;
00483 long ID1, ID2;} Curv;
00484
00485
00494 typedef struct {int ptNr; double v0, v1, *lvTab; Point *cpTab;} CurvPoly;
00495
00496
00497
00507 typedef struct {int ptNr, deg; double v0, v1, *kvTab;
00508 Point *cpTab;} CurvBSpl;
00509
00510
00511
00522 typedef struct {int ptNr, deg; double v0, v1, *kvTab, *wTab;
00523 Point *cpTab;} CurvRBSpl;
00524
00525
00526
00528 typedef struct {int ptNr; Point2 *cptab; double va, vb;} CurvBez2;
00529
00530
00537 typedef struct {int ptNr; Point *cptab; double va, vb;} CurvBez;
00538
00539
00540
00548 typedef struct {int ptNr;Point *cptab;double *wtab;double va, vb;} CurvRBez;
00549
00550
00551
00552
00553
00554
00555
00566 typedef struct {Point stp; Vector stv, plv;
00567 double pc, cs, ce; int lr;} CurvClot;
00568
00569
00574 typedef struct {Point po; Vector vx, vy, vz; double p;} Plane;
00575
00576
00577
00583 typedef struct {int cvID; float off, dir;} SurHat;
00584
00585
00596 typedef struct {double ang1, ang2, v0, v1;
00597 long indCen, indCov; short typCen, typCov; } SurRev;
00598
00599
00606 typedef struct {long baseID, cvID;
00607 unsigned typ:8, cvTyp:8;} SurStd;
00608
00609
00615 typedef struct {long ptUNr, ptVNr, *ptiTab;} SurStripe;
00616
00617
00624 typedef struct {long ptUNr, ptVNr, degU, degV;
00625 double v0U, v1U, v0V, v1V, *kvTabU, *kvTabV;
00626 Point *cpTab;} SurBSpl;
00627
00628
00629
00637 typedef struct {long ptUNr, ptVNr, degU, degV;
00638 double v0U, v1U, v0V, v1V, *kvTabU, *kvTabV, *wTab;
00639 Point *cpTab;} SurRBSpl;
00640
00641
00642
00650 typedef struct {unsigned cr:8, cg:8, cb:8,
00651 unused:3, vtra:2, vsym:1, vtex:1, color:1;} ColRGB;
00652
00653
00654
00668 typedef struct {Point p1, p2; char *txt;
00669 float scl; char typ, col, ltyp;} AText;
00670
00671
00680 typedef struct {char *fnam;
00681 short xSiz, ySiz, texNr, keep;} TexBas;
00682
00683
00694 typedef struct {long ibas; float uscx, uscy, udx, udy, uar;
00695 float ssx, ssy, px, py, pz; Vector vx, vy;} TexRef;
00696
00697
00699 typedef struct {Point pt; float size, dir; char *txt;} GText;
00700
00701
00703 typedef struct {Point po; long ind, siz;} Ditto;
00704
00705
00712 typedef struct {char *mnam; long ind, siz;
00713 Point po; Vector vx, vz;} ModelMock;
00714
00715
00723 typedef struct {char *mnam; Point po; long DLind, DLsiz;
00724 short typ, seqNr;} ModelBas;
00725
00726
00733 typedef struct {char *mnam; int modNr; double scl;
00734 Point po; Vector vx, vz;} ModelRef;
00735
00736
00743 typedef struct {int mod, par, ind;} ModelNode;
00744
00745
00751 typedef struct {Point pc; double rad;} Sphere;
00752
00753
00754
00762 typedef struct {Plane pl; double r1, r2, h;} Conus;
00763
00764
00765
00774 typedef struct {Plane pl; double r1, r2;} Torus;
00775
00776
00777
00778
00779
00780
00787 typedef struct {Point2 p1, p2, p3; float a1, a2;
00788 char dtyp, hd, ld, uu; char *txt;} Dimen;
00789
00790
00796 typedef struct {long ip1, ip2, ipt;
00797 char dtyp, hd, ld, bp; char *txt;} Dim3;
00798
00799
00800
00801
00802
00803
00804 typedef struct {unsigned col:4, ltyp:4, lthick:4,
00805 unused:15, used:1;} GR_Att;
00806
00807
00808
00819 typedef struct {long ind;
00820 unsigned long iatt;
00821 unsigned lay:16, typ:8,
00822 unused:7, disp:1;} ObjAtt;
00823
00824
00825
00846 typedef struct {long ind, lNr, irs;
00847 unsigned long iatt;
00848 unsigned modInd:16, typ:8,
00849 disp:1, pick:1, hili:1, dim:1,
00850 grp_1:1, temp:1, unvis:1, sPar:1;} DL_Att;
00851
00852
00853
00860 typedef struct {Mat_4x3 ma; Vector vz; double angr;} TraRot;
00861
00862
00863
00869 typedef struct {int typ; long ind; char *data;} Activity;
00870
00871
00872
00873
00874
00875
00881 typedef struct {Point *pTab; int pNr; char *pTyp;} Verts;
00882
00883
00888 typedef struct {int *ipt; int *inf;} Face;
00889
00890
00895 typedef struct {int i1, i2, i3;} Fac3;
00896
00897
00904 typedef struct {void *fTab; int fNr; int fTyp;} Faces;
00905
00906
00918 typedef struct {int ip1, ip2, ip3, if1, if2, if3;} FacNf;
00919
00920
00922 typedef struct {int ipt[2];} Edge;
00923
00924
00926 typedef struct {int i1, i2;} Edg3;
00927
00928
00937 typedef struct {int *ia, iNr; char typ;} EdgeLine;
00938
00939
00948 typedef struct {Edge *eTab; int eNr; char *eTyp;} Edges;
00949
00950
00957 typedef struct {Verts *p; Faces *f; Edges *e; int mTyp;} Mesh;
00958
00959
00960
00961
00962
00963
00964 typedef struct {double dmr;} BTool;
00965
00966
00967
00968
00969
00970
00981 typedef struct {short typ, form; void *data;
00982 unsigned siz:24, dir:1, aux:7;} ObjGX;
00983
00984
00985
00991 typedef struct {int typ; long ind; unsigned char stat;} ObjGrp;
00992
00993
00998 typedef struct {int typ, att, ID, ID1; Point2 p1, p2, pc;
00999 double rad; long nam;} ObjG2;
01000
01001
01006 typedef struct {int typ, att; long ID; void *data;
01007 Point p1,p2,pc; Vector vz; double rad;} ObjG;
01008
01009
01014 typedef union {Point *pt; Line *ln; Vector *vc;
01015 Circ *ci; ObjGX *cv; CurvElli *el;
01016 CurvPoly *plg; CurvBSpl *bsp;
01017 void *vp;} ObjX;
01018
01019
01020
01022 typedef union {Point pt; Vector vc; Line ln; Circ ci;} ObjUX;
01023
01024
01036 typedef struct {Point *pa; Point *p2a; int iNr;
01037 Point p1, p2;
01038 unsigned char typ, use, dir, unused;} ContTab;
01039
01040
01041
01047 typedef struct {long ind; unsigned typ:8, oNr:24;} ObjRange;
01048
01049
01050
01059 typedef struct {void *start, *next, *end;
01060 unsigned char typ, incSiz, u3, u4;} Memspc;
01061
01062
01063
01064
01066 typedef union {long i4; short i2[2];} uni_i4i2;
01067
01069 typedef struct {short i20, i21;} stru_2i2;
01070
01072 typedef struct {unsigned b123:24, b4:8;} stru_c3c1;
01073
01074
01075
01076
01077
01078
01080 extern double UT_TOL_pt;
01082 extern double UT_TOL_cv;
01084 extern double UT_TOL_ln;
01086 extern double UT_DISP_cv;
01087
01088
01089
01090
01091
01092 extern double UT_TOL_min0;
01093 extern double UT_TOL_min1;
01094 extern double UT_TOL_min2;
01096 extern double UT_TOL_PAR;
01098 extern double UT_TOL_Ang1;
01099
01100
01101 extern const double UT_VAL_MIN;
01102 extern const double UT_VAL_MAX;
01103 extern const double UT_DB_LEER;
01104 extern const double UT_DB_NULL;
01105 extern const int UT_INT_MAX;
01106 extern const int UT_I2_MAX;
01107 extern const char UT_CHR_NULL;
01108
01109
01110 extern const Point2 UT2D_PT_NUL;
01111 extern const Point UT3D_PT_NUL;
01112
01113 extern const Vector2 UT2D_VECTOR_NUL;
01114 extern const Vector2 UT2D_VECTOR_X;
01115 extern const Vector2 UT2D_VECTOR_Y;
01116
01117 extern const Vector UT3D_VECTOR_NUL;
01118
01119 extern const Vector UT3D_VECTOR_X;
01120 extern const Vector UT3D_VECTOR_Y;
01121 extern const Vector UT3D_VECTOR_Z;
01122
01123 extern const Vector UT3D_VECTOR_IX;
01124 extern const Vector UT3D_VECTOR_IY;
01125 extern const Vector UT3D_VECTOR_IZ;
01126
01127 extern const Mat_3x3 UT3D_MAT_3x3;
01128 extern const Mat_4x3 UT3D_MAT_4x3;
01129 extern const Mat_4x4 UT3D_MAT_4x4;
01130
01131
01132
01133 #define OBJ_SIZ_MAX 160
01134
01135 #define UT_BEZDEG_MAX 50
01136
01137
01138
01139
01140
01141
01142
01143
01145 #define ATT_BIT_ABS 1
01146
01147
01148
01149
01150
01151
01152
01153
01155 #define ATT_BIT_LIM 2
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165 int MEM_swap__ (void *stru1, void* stru2, long strSiz);
01166 int MEM_swap_int (int *i1, int *i2);
01167 int MEM_swap_2db (double *d1, double *d2);
01168
01169
01170 int MEM_ins_rec (void *insPos, long movSiz, void *insDat, long insSiz);
01171 int MEM_chg_rec (void *datStart, long *datSiz,
01172 void *insDat, long insSiz,
01173 void *delPos, long delSiz);
01174 int MEM_ins_nrec (int *recNr, void *recTab,
01175 int ipos, void *insDat, int insRecNr, int sizRec);
01176 int MEM_del_nrec (int *recNr, void *recTab,
01177 int ipos, int delRecNr, int sizRec);
01178 int MEM_del_IndRec (int *recNr, void *recTab, int ipos);
01179 int MEM_del_DbRec (int *recNr, void *recTab, int ipos);
01180
01181
01182
01183 int UTP_comp_0 (double);
01184 int UTP_compdb0 (double, double);
01185 int UTP_comp2db (double, double, double);
01186 int UTP_comp2x2db (double d11,double d12,double d21,double d22,double tol);
01187 int UTP_db_ck_in2db (double v, double v1, double v2);
01188 int UTP_db_ck_in2dbTol (double v, double v1, double v2, double tol);
01189 int UTP_db_cknear_2db (double *db, double *d1, double *d2);
01190 int UTP_db_cknear_ndb (double db1, int dbNr, double *dbTab);
01191 double UTP_db_rnd1sig (double);
01192 double UTP_db_rnd2sig (double);
01193
01194
01195 int UT1D_ndb_npt_bp (double *da, Point *pa, int pNr, int bp);
01196
01197 double UT_DEGREES (double);
01198 double UT_RADIANS (double);
01199
01200 int UT2D_sidPerp_3pt (Point2 *p1, Point2 *p2, Point2 *p3);
01201
01202 int UT2D_angr_set (double *angr);
01203 int UT2D_2angr_set (double *ang1, double *ang2, int irot);
01204 double UT2D_angr_2angr (double ang1, double ang2, int irot);
01205 int UT2D_ptNr_ci (double rdc, double ao, double tol);
01206
01207 int UT2D_solvtriri_a (double *a, double b, double c);
01208 int UT2D_solvtriri_ac (double *,double *,double,double);
01209 int UT2D_solvtri_abc (double *,double *,double,double,double);
01210
01211 int UT2D_ckBoxinBox1 (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p4);
01212 int UT2D_ckBoxinBox2 (Point2*, Point2*, Point2*, Point2*, double);
01213
01214 double UT2D_skp_2vc (Vector2 *, Vector2 *);
01215 double UT2D_skp_vc2pt (Vector2 *, Point2 *, Point2 *);
01216 double UT2D_acos_2vc (Vector2 *, Vector2 *);
01217 double UT2D_sar_2vc (Vector2 *, Vector2 *);
01218 double UT2D_acos_vc2pt (Vector2 *, Point2 *, Point2 *);
01219 double UT2D_crossprod_2vc (Vector2 *, Vector2 *);
01220
01221 double UT2D_angd_angr (double);
01222 double UT2D_angd_invert (double *andi);
01223 double UT2D_angr_angd (double);
01224 double UT2D_angr_triri_ab (double, double);
01225 double UT2D_angr_ptpt (Point2 *, Point2 *);
01226 double UT2D_angr_vc (Vector2 *);
01227 double UT2D_angr_2ln (Line2 *, Line2 *);
01228 double UT3D_angr_vc2pt (Point *pz, Vector *vz, Point *p1, Point *p2);
01229 double UT3D_angr_vcpl (Plane *pl1, Vector *vc1);
01230 double UT3D_angr_2pl (Plane* pl1, Plane* pl2);
01231 double UT2D_angr_2vc (Vector2 *, Vector2 *);
01232 double UT2D_angr_3ptdr (Point2 *, Point2 *, Point2 *, int);
01233 double UT3D_angr_4pt (Point *p11, Point *p12, Point *p21, Point *p22);
01234 double UT2D_angr_ci (Point2 *pa,Point2 *pe,Point2 *pc,double rad_in);
01235 double UT3D_angr_cipt (Circ *ci1, Point *pti);
01236 double UT2D_angr_perpangr (double*);
01237
01238 double UT2D_len_vc (Vector2 *);
01239 double UT2D_lenq_vc (Vector2 *);
01240 void UT2D_lenq_2pt (double *lq, Point2 *p1, Point2 *p2);
01241 double UT2D_len_2pt (Point2 *,Point2 *);
01242 double UT2D_lenB_2pt (Point2 *p1, Point2 *p2);
01243 int UT2D_minLenB_4pt (double *dp,Point2*,Point2*,Point2*,Point2*);
01244 int UT3D_minLen_3pt (double*,Point*,Point*,Point*);
01245 int UT3D_minLen_4pt (double*,Point*,Point*,Point*,Point*);
01246 double UT2D_len_ptln (Point2 *pt, Point2 *pa, Point2 *pe);
01247 int UT2D_3len_ptln (double*, double*, double*, Point2*, Point2*, Point2*);
01248 int UT2D_slenq_ptptvc (double *qlen, Point2 *pa, Point2 *pb, Point2 *pc);
01249 double UT2D_slen_nor3pt (Point2 *p1, Point2 *p2, Point2 *p3);
01250 double UT2D_slen_norvc2pt (Vector2 *v1, Point2 *p1, Point2 *p2);
01251 double UT2D_len_ptlnX (Point2 *pt, Point2 *pl, Vector2 *vl);
01252 double UT2D_len_ptlnY (Point2 *pt, Point2 *pl, Vector2 *vl);
01253 void UT2D_2len_ptvc (double*,double*,Point2*,Point2*,Vector2*);
01254
01255 int UT2D_irot_r (double r);
01256 int UT2D_sid_2vc (Vector *v1, Vector *v2);
01257 int UT2D_sidPerp_2vc (Vector *v1, Vector *v2);
01258 int UT2D_sid_3pt (Point2 *pt, Point2 *p1, Point2 *p2);
01259 int UT2D_sidPerp_3pt (Point2 *p1, Point2 *p2, Point2 *p3);
01260 int UT2D_sid_ptvc (Point2*, Point2*, Vector2*);
01261 int UT2D_sidPerp_ptvc (Point2 *pt, Point2 *pl, Vector2 *vl);
01262
01263 int UT3D_sid_2vc (Vector *v1, Vector *v2);
01264 int UT3D_sid_3pt (Point *p1, Point *p2, Point *p3);
01265 int UT3D_sid_ptpl (Point *pt, Plane *pl);
01266 int UT3D_sid_ptptvc (Point *ptx, Point *pto, Vector *vz);
01267
01268 int UT2D_parLn_pt2pt (double *d1, Point2 *p1, Point2 *p2, Point2 *px);
01269
01270 double UT2D_ar_3pt (Point2 *p1, Point2 *p2, Point2 *p3);
01271
01272 int UT2D_comp2pt (Point2*, Point2*, double);
01273 int UT2D_comp4pt (Point2*, Point2*, Point2*, Point2*, double);
01274 int UT2D_pt_ck_int4pt (Point2*, Point2*, Point2*, Point2*);
01275 int UT2D_pt_ck_onLine (Point2 *po, Point2 *p1,Point2 *p2,Point2 *p3);
01276 int UT2D_pt_ck_inLine (Point2 *p1, Point2 *p2, Point2 *p3, double tol);
01277 int UT2D_pt_ck_inplg (Point2 * pTab, int pNr, Point2 *ptx);
01278 int UT2D_pt_ck_linear (int np, Point2 *ptab, double tol);
01279 int UT2D_pt_ck_inBox (Point2 *p1, Point2 *p2, Point2 *p);
01280 int UT2D_pt_ck_inBoxTol (Point2 *p1, Point2 *p2, Point2 *p, double tol);
01281 int UT2D_pt_ck_inAc (Point2 *pt, Circ2 *ci);
01282 int UT2D_pt_ck_inTriangle (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p);
01283 int UT2D_pt_ck_inCv3 (Point *ptx, int pNr, Point *pTab);
01284 int UT2D_pt_cknear_npt (Point2 *p0, Point2 *ptTab, int ptNr);
01285
01286 void UT2D_swap2pt (Point2 *p1, Point2 *p2);
01287 Point2 UT2D_pt_pt3 (Point *);
01288 void UT2D_pt_2db (Point2 *, double, double);
01289 int UT3D_pt_pt2bp (Point *p3, Point2 *p2, int bp);
01290 void UT2D_pt_addpt (Point2 *, Point2 *);
01291 void UT2D_pt_opp2pt (Point2 *, Point2 *, Point2 *);
01292 void UT2D_pt_mid2pt (Point2 *, Point2 *, Point2 *);
01293
01294 void UT2D_pt_tra2ptlen (Point2 *, Point2 *, Point2 *, double);
01295 void UT2D_pt_traPtPtPar (Point2 *po, Point2 *p1, Point2 *p2, double d1);
01296 void UT2D_pt_tra3ptlen (Point2 *, Point2 *, Point2 *, Point2 *,double);
01297 void UT2D_pt_tra2pt2len (Point2 *,Point2 *,Point2 *,double,double);
01298 void UT2D_pt_tra2pt3len (Point2 *,Point2 *,Point2 *,double,double,double);
01299 void UT2D_pt_traptvclen (Point2 *,Point2 *,Vector2 *,double);
01300 void UT2D_pt_traptangrlen (Point2 *,Point2 *,double,double);
01301 void UT2D_pt_tranor2ptlen (Point2 *,Point2 *,Point2 *,double);
01302 void UT2D_pt_tranorptvclen (Point2 *, Point2 *, Vector2 *, double);
01303 void UT2D_pt_traptvc2len (Point2 *,Point2 *,Vector2 *,double,double);
01304 void UT2D_pt_tracirlen (Point2 *, Point2 *, Point2 *, double, double);
01305 void UT2D_pt_rotptangr (Point2*,Point2*,Point2*,double);
01306 int UT2D_pt_projptptvc (Point2 *, Point2 *, Point2 *, Vector2 *);
01307 int UT2D_pt_projpt2pt(Point2 *pp, double *len,
01308 Point2 *pt, Point2 *p1, Point2 *p2);
01309 int UT2D_pt_projptln (Point2 *, Point2 *, Line2 *);
01310 void UT2D_2pt_projptci (Point2*,Point2*,Point2*,Point2*,double);
01311 int UT2D_pt_projptci (Point2 *pp, Point2 *pt, Circ2 *ci1);
01312 int UT3D_ptDi_intptvcptvc (Point *ip, double *dist, Point *ptl, Vector *vcl,
01313 Point *ptp, Vector *vcp);
01314 int UT3D_ptDi_intptvcpln (Point *ip, double *dist,
01315 Plane *pl, Point *pt, Vector *vln);
01316 int UT2D_pt_int4pt (Point2*,double*,double*,Point2*,Point2*,Point2*,Point2*);
01317 int UT2D_pt_int2ln (Point2*, Line2*, Line2*);
01318 int UT2D_pt_intptvcy (Point2 *pto, Point2 *ptl, Vector2 *vcl, double yVal);
01319 int UT2D_pt_intlny (Point2 *pto, Point2 *lp1, Point2 *lp2, double yVal);
01320 int UT2D_pt_int2pt2vc (Point2 *ip, Point2 *pt1, Vector2 *vc1,
01321 Point2 *pt2, Vector2 *vc2);
01322 int UT2D_pt_int2vc2pt (Point2 *, Point2 *, Vector2 *, Point2 *, Vector2 *);
01323 int UT2D_2pt_intciptvc (Point2*,Point2*,Point2*,double,Point2*,Vector2*);
01324 int UT2D_2pt_intlnci (Point2 *ip1, Point2 *ip2,
01325 Line2 *ln, int lnMode, Circ2 *ci, int ciMode);
01326 int UT2D_2pt_intcici (Point2*,Point2*,Point2*,double,Point2*,double);
01327 int UT2D_2pt_int2ci (Point2 *ip1, Point2 *ip2,
01328 Circ2 *ci1, int ci1Mode, Circ2 *ci2, int ci2Mode);
01329 void UT2D_pt_traptm2 (Point2 *, Mat_3x2, Point2 *);
01330 Point2 UT2D_pt_obj2 (ObjG2 *obj1);
01331
01332 void UT2D_ln_ptpt (Line2*, Point2*, Point2*);
01333 void UT2D_ln_ptvc (Line2*, Point2*, Vector2*);
01334 void UT2D_ln_ln3 (Line2 *ln2, Line *ln3);
01335 void UT2D_ln_inv (Line2 *ln1);
01336 void UT2D_ln_4db (Line2 *ln2, double xs, double ys, double xe, double ye);
01337 Line2 UT2D_ln_obj2 (ObjG2*);
01338 int UT2D_lncoe_ln (double *k, double *d, Line2 *ln);
01339 int UT2D_ln_pts_dmax (Line2 *ln, int np, Point2 *ptab, double tol);
01340
01341 int UT2D_comp2vc (Vector2*, Vector2*, double);
01342 int UT2D_comp2vc_p (Vector2*, Vector2*, double);
01343 int UT2D_ckvc_in2vc (Vector *v1, Vector *v2, Vector *v3);
01344 int UT2D_2parvc_3vc(double*,double*,Vector2*,Vector2*,Vector2*);
01345 void UT2D_vc_2db (Vector2 *, double, double);
01346 void UT2D_vc_angr (Vector2 *, double);
01347 void UT2D_vc_angrlen (Vector2 *, double, double);
01348 void UT2D_vc_2pt (Vector2 *, Point2 *, Point2 *);
01349 void UT2D_vc_2pt3 (Vector2 *vc, Point *p1, Point *p2);
01350 int UT2D_vc_2pt3_bp (Vector2 *vo, Point *p1, Point *p2, int bp);
01351 void UT2D_vc_2ptlen (Vector2 *, Point2 *, Point2 *, double);
01352 void UT2D_vc_ln (Vector2 *, Line2 *);
01353 void UT2D_vc_invert (Vector2 *, Vector2 *);
01354 int UT3D_vc_Zup (Vector *v2, Vector *v1);
01355 void UT2D_vc_perpvc (Vector2 *, Vector2 *);
01356 void UT2D_vc_perp2pt (Vector2 *, Point2 *, Point2 *);
01357 void UT2D_vc_normalize (Vector2*,Vector2*);
01358 void UT2D_vc_setLength (Vector2 *, Vector2 *, double);
01359 void UT2D_vc_mid2vc (Vector2*,Vector2*,Vector2*);
01360 void UT2D_vc_merge2vc (Vector2 *vm, Vector2 *v1, Vector2 *v2);
01361 void UT2D_vc_rotangr (Vector2 *,Vector2 *,double);
01362 void UT2D_vc_travcm2 (Vector2 *vo, Mat_3x2 mata, Vector2 *vi);
01363
01364 double UT2D_angr_ciSec (double hc, double radc);
01365 double UT2D_len_ciSec (double hSec, double rCi);
01366 double UT2D_len_cia (double rad, double ango);
01367 double UT2D_len_cir (double *angOpe,
01368 Point2 *pa,Point2 *pe,Point2 *pc,double rad_in);
01369 int UT2D_compPtOnAc (double, double, double, int);
01370 Circ2 UT2D_ci_obj2 (ObjG2 *);
01371 int UT2D_ci_ptrd (Circ2 *ci, Point2 *ptc, double rdc);
01372 int UT2D_ci_ci3 (Circ2 *ci2, Circ *ci3);
01373 int UT2D_ci_2vc2ptrd (Point2*,Point2*,Vector2*,Point2*,Vector2*,double);
01374 int UT2D_ci_ciptvcrd (Point2*,Point2*,double,int,Point2*,Vector2*,double);
01375 int UT2D_ci_ptvcpt (Point2 *,double *,Point2 *,Vector2 *,Point2 *);
01376
01377 int UT2D_obj_obj3 (ObjGX *oo, ObjGX *oi, Memspc *memSeg);
01378
01379 ObjG2 UT2D_obj_pt3 (Point*);
01380 ObjG2 UT2D_obj_ln3 (Line*);
01381 ObjG2 UT2D_obj_ci2 (Circ2*);
01382 ObjG2 UT2D_obj_ci3 (Circ*);
01383 ObjG2 UT2D_obj_cv3 (Curv *);
01384
01385 int UT2D_void_obj2 (void *memObj, unsigned long *oSiz, ObjG2 *og2);
01386
01387 void UT2D_cv_ci360 (Point2 *cv, int ptNr, double rd, Point2 *ptCen);
01388 int UT2D_cv_ln (Point2 *cv, int ptAnz, Point2 *p1, Point2 *p2);
01389 int UT2D_npt_ci (Point2 *pa, int pNr, Circ2 *ci1);
01390 int UT2D_cv_ci (Point2[],int*,Point2*,Point2*,Point2*,int);
01391 int UT2D_cv3_linear (int *pNr, Point *pTab, double tol);
01392 int UT2D_srar_polc (double *aro, int ptNr, Point2 *pa);
01393
01394
01395 void UT2D_m2_load (Mat_3x2, Vector2 *, Point2 *);
01396 void UT2D_m2_loadtravcm2 (Mat_3x2 ma, Vector2 *vx, Vector2 *vy, Vector2 *vt);
01397 int UT2D_m2_invtravcm2 (Mat_3x2 im1, Mat_3x2 m1);
01398 void UT2D_m2_init_rot (Mat_3x2 ma, double angle);
01399
01400
01401
01402
01403
01404 int UT3D_stru_dump (int typ, void *data, char *txt, ...);
01405
01406
01407 double UT3D_len_vc (Vector *);
01408 double UT3D_lenq_vc (Vector *);
01409 int UT3D_bplen_vc (double *lnv, Vector *vc1);
01410 double UT3D_lenB_2pt (Point *p1, Point *p2);
01411 double UT3D_len_2pt (Point*,Point*);
01412 double UT3D_lenq_PtPt (Point *p1, Point *p2);
01413 int UT3D_lenq_PtLn (double *lenq, Point *p, Point *p1, Point *p2);
01414 double UT3D_len_ln (Line *);
01415 double UT3D_len_ci (Circ *ci1);
01416 double UT3D_slen_3pt (Point *pt, Point *p1, Point *p2);
01417 double UT3D_slen_projvcvc (Vector *vc1, Vector *vc2);
01418 double UT3D_slenq_projvcvc (Vector *vc1, Vector *vc2);
01419 double UT3D_slenq_2ptvc (Point *p1, Point *p2, Vector *vc);
01420 double UT3D_nlen_projvcvc (Vector *vc1, Vector *vc2);
01421 double UT3D_slen_2ptvc (Point *p1, Point *p2, Vector *vc);
01422 double UT3D_slen_ptpl (Point *pt, Plane *pl);
01423 double UT3D_nlen_2ptvc (Point *p1, Point *pv, Vector *vc);
01424 double UT3D_nlen_3pt (Point *p1, Point *p2, Point *p3);
01425 int UT3D_parpt_objpt (double *po, Point *pti, int oTyp, void *oDat);
01426 int UT3D_parpt_3pt (double *pl, Point *ptx, Point *pl1, Point *pl2);
01427 int UT3D_parpt_ptvc (double *pl, Point *ptx, Point *pt1, Vector *vc1);
01428 double UT3D_parpt_lnbp (Point *pti, Line *ln1, int bp);
01429 double UT3D_parpt_cipt (Point *pti, Circ *ci1);
01430
01431 int UT3D_pt_ck_npt (Point *p0, Point *pTab, int pNr, double tol);
01432 int UT3D_ipt_cknear_npt (Point *p0, Point *ptTab, int ptNr);
01433 int UT3D_ipt_ckfar_npt (Point *p0, Point *ptTab, int ptNr);
01434 int UT3D_ipt_cknearn_npt (Point *p0, Point *ptTab, int ptNr, int distNr);
01435 int UT3D_ipt2_nptvc (Point *pt1, Point *pt2, int mode,
01436 Point *pta, int iNr, Vector *vc);
01437 int UT3D_pt_ck_onel (Point *pt, CurvElli *el);
01438 int UT3D_pt_ck_ptvc (Point *pt, Point *pl, Vector *vl, double tol);
01439 int UT3D_pt_ck_2pt (Point *pt, Point *pl1, Point *pl2, double tol);
01440 int UT3D_pt_ck_onLine (Point *p1, Point *p2, Point *p3, double tol);
01441 int UT3D_pt_ck_inLine (Point *p1, Point *p2, Point *p3, double tol);
01442 int UT3D_pt_ck_on_pta (Point *pTab, int ptNr, Point *pt1, double tol);
01443 int UT3D_pt_ck_in2pt (Point *p1,Point *p2,Point *p3, double tol);
01444 int UT3D_pt_ck_inCirc (Circ *ci1, Point *pt1, double tol);
01445 int UT3D_pt_ck_inSph (Point *pt, Point *ps, double rs);
01446
01447 void UT3D_swap2pt (Point *p1, Point *p2);
01448
01449 int UT3D_comp4pt (Point *p1a,Point *p1e,Point *p2a,Point *p2e,double tol);
01450 int UT3D_compptpl (Point*, Plane*);
01451 Point UT3D_pt_pt2 (Point2 *);
01452 Point UT3D_pt_pt2z (Point2 *pt20, double zVal);
01453 void UT3D_pt_3db (Point *, double, double, double);
01454 void UT3D_pt_txt (Point *, char *);
01455 void UT3D_pt_mid2pt (Point *, Point *, Point *);
01456 int UT3D_pt_mid_pta (Point *pto, Point *pTab, int ptNr);
01457 void UT3D_pt_midci (Point *, Circ *);
01458 void UT3D_pt_opp2pt (Point *, Point *, Point *);
01459 int UT3D_pt_oppptptvc (Point *po, Point *pi, Point *pl, Vector *vl);
01460 int UT3D_2pt_oppptvclen (Point*,Point*,Point*,Vector*,double);
01461 void UT3D_pt_addpt (Point *, Point *);
01462 void UT3D_pt_add2pt (Point *, Point *, Point *);
01463
01464 void UT3D_pt_traptvclen (Point *po,Point *pi,Vector *vc,double dist);
01465 void UT3D_pt_traptvc1len (Point *po,Point *pi,Vector *vc,double dist);
01466 void UT3D_pt_trapt2vc (Point *po,Point *pi,Vector *vc1, Vector *vc2);
01467 void UT3D_pt_trapt2vc2len (Point *,Point *,Vector *,double,Vector *,double);
01468 void UT3D_pt_trapt3vc3len (Point *po,Point *pi,
01469 Vector *vx,double dx, Vector *vy,double dy, Vector *vz,double dz);
01470 void UT3D_pt_traptptlen (Point *po,Point *pi,Point *pDir,double lenv);
01471 void UT3D_pt_trapt2pt (Point *po, Point *pi, Point *p1, Point *p2);
01472 int UT3D_pt_tracirlen (Point *pto, Point *pti, Circ *cii, double clen);
01473 int UT3D_pt_rotptptangr (Point *pto, Point *ptc, Point *pti, double *ar);
01474 void UT3D_pt_rotptptvcangr (Point *pto,
01475 Point *pti,Point *ptc,Vector *vz,double angr);
01476 int UT3D_pt_rotptm3 (Point *p2, Point *p1, Mat_4x3 ma);
01477 int UT3D_pt_rotciangr (Point *pto, double angr, Circ *ci1);
01478 int UT3D_pt_projpt2pt (Point *pp,double *len,Point *pt,Point *p1,Point *p2);
01479 int UT3D_pt_projptln (Point *, double *, Point *, Line *);
01480 int UT3D_pt_projptci (Point *pto, Point *pt1, Circ *ci1);
01481 int UT3D_pt_projptptvc(Point *pp,double *len,Point *pt,Point *pl,Vector *vl);
01482 int UT3D_pt_projptel (int *numpe, Point *pe, CurvElli *ell, Point *pt);
01483 int UT3D_pt_projptbspl (int *nxp, Point *ptab, double *ttab, Memspc *memSeg1,
01484 CurvBSpl *bspl, Point *pt);
01485 int UT3D_pt_projptptnvc (Point *po, Point *pi, Point *plo, Vector *plz);
01486 void UT3D_pt_projptpl (Point *, Plane *, Point *);
01487 int UT3D_pt_int2pt2vc (Point *ip1, Point *ip2, double *dist,
01488 Point *ptu, Vector *vcu, Point *ptv, Vector *vcv);
01489 int UT3D_pt_intptvcplx (Point *px, Point *pl, Vector *vl, double plx);
01490 int UT3D_pt_intptvcply (Point *px, Point *pl, Vector *vl, double ply);
01491 int UT3D_pt_intptvcplz (Point *px, Point *pl, Vector *vl, double plz);
01492 int UT3D_pt_intptvcln (Point *ip1, Point *ip2, double *dist,
01493 Point *pt1, Vector *vc1, Line *ln2);
01494 int UT3D_pt_intptvcxpln (Point *pti, Point *ptl,
01495 Point *ptpl, Vector *vcpl);
01496 int UT3D_pt_intptvcypln (Point *pti, Point *ptl,
01497 Point *ptpl, Vector *vcpl);
01498 int UT3D_pt_intptvczpln (Point *pti, Point *ptl,
01499 Point *ptpl, Vector *vcpl);
01500 int UT3D_pt_intptvcsph (Point *pa, Point *pl, Vector *vl,
01501 Point *ps, double rs);
01502 int UT3D_pt_int2ln (Point*,Point*,double*,Line*,Line*);
01503 int UT3D_pt_intperp2ln (Point *po,Point *p1,Vector *v1,Point *p2,Vector *v2);
01504 int UT3D_pt_intlnci__ (int *np, Point xp[], Line *ln, Circ *ci1);
01505 int UT3D_pt_intlnci_p (int *np, Point xp[], Line *ln, Circ *ci1);
01506 int UT3D_pt_intlnsph (Line *ln1, Point *ps, double rs);
01507 int UT3D_pt_intcici (int *np, Point xp[], Circ *ci1, Circ *ci2);
01508 int UT3D_pt_intplnln (Point *ip, double *dist, Plane *pl, Line *ln);
01509 int UT3D_pt_intlnpl (Point *, Plane *, Line *);
01510 int UT3D_pt_intlnpl1 (Point*, double*, Point*, Point*, double, double);
01511 int UT3D_pt_intptvcpln (Point *pti,
01512 Point *ptl, Vector *vcl, Point *ptpl, Vector *vcpl);
01513 int UT3D_pt_intplci (int *np, Point xp[], Plane *pl, Circ *ci);
01514 int UT3D_pt_intcidpln (int *np, Point xp[],
01515 Point *pc, Point *p1, Vector *vz, double dx);
01516 int UT3D_pt_intptvcpl_ (Point *, Plane *, Point *, Vector *);
01517 int UT3D_pt_intlnel__ (int *np, Point xp[], Line *ln, CurvElli *el);
01518 int UT3D_pt_intlnel_p (int *np, Point xp[], Line *ln, CurvElli *el);
01519 int UT3D_pt_ipl_2ptpt2 (Point *pi3, Point *p1, Point *p2, Point2 *pi2);
01520 int UT3D_pt_mirptpl (Point *pto, Point *pti, Plane *pln);
01521 int UT3D_pt_tangptci (Point *po1, Point *po2, Point *pt1, Circ *ci1);
01522 int UT3D_pt_elfoc (Point *fp1, Point *fp2, CurvElli *el);
01523
01524 int UT3D_pt_evparln (Point *pto, double lpar, Line *ln1);
01525 int UT3D_pt_evparci (Point *pto, double lpar, Circ *ci1);
01526
01527 int UT3D_pt_m3 (Point *pto, Mat_4x3 ma);
01528 void UT2D_pt_traptm3 (Point2 *p2, Mat_4x3 mata, Point2 *p1);
01529 void UT3D_pt_traptm3 (Point*, Mat_4x3, Point*);
01530 void UT3D_pt_traptm4 (Point *p2, Mat_4x4 ma, Point *p1);
01531
01532 int UT2D_ptvc_ck_int2pt (int mode, Point2 *p1s, Vector2 *v1,
01533 Point2 *p2s, Point2 *p2e);
01534 int UT3D_ptvc_int2pl (Point *pt, Vector *vc, Plane *pl1, Plane *pl2);
01535 int UT3D_ptvc_int2pln (Point *pti, Vector *vci,
01536 Point *pl1pt, Vector *pl1vz, Point *pl2pt, Vector *pl2vz);
01537 int UT3D_ptvc_ox (Point *pta, Vector *vca, ObjGX *oxi);
01538
01539
01540
01541 double UT3D_angr_3pt (Point *p1, Point *pc, Point *p2);
01542 double UT3D_angr_2vc (Vector*,Vector*);
01543 double UT3D_angr_3vc (Vector *vz, Vector *v1, Vector *v2);
01544 double UT3D_angr_ci (Circ *ci1);
01545 int UT3D_2angr_vc (double *az, double *ay, Vector *vc1);
01546 int UT3D_atan_vcpl (double *kvc, Vector *vci, Plane *pli);
01547
01548 int UT3D_compvc0 (Vector *v1, double tol);
01549 int UT3D_comp2vc_d (Vector *, Vector *, double);
01550 int UT3D_comp2vc_p (Vector *, Vector *, double);
01551 int UT3D_vc_ck_parpl (Vector *vci, Plane *pli, double tol);
01552 int UT3D_vc_ckperp_2vc1 (Vector *vc1, Vector *vc2, double tol);
01553 int UT3D_parvc_2vcbp (double *dl, int mainPln, Vector *v1, Vector *v2);
01554 int UT3D_2parvc_3vcbp (double*,double*,int,Vector*,Vector*,Vector*);
01555
01556
01557
01558 void UT3D_vc_txt (Vector *vc, char *txt);
01559
01560 void UT3D_vc_2ptlen (Vector *, Point *, Point *, double);
01561 void UT3D_vc_angr (Vector *vc, double angr);
01562 void UT3D_vc_2angr (Vector *, double, double);
01563 void UT3D_vc_2vc (Vector *, Vector *, Vector *);
01564 void UT3D_vc_ln (Vector *, Line *);
01565 int UT3D_vc_bp (Vector *vn, int bp);
01566 void UT3D_vc_invert (Vector*, Vector*);
01567
01568
01569 void UT3D_vc_perp1vc (Vector *vp, Vector *vi);
01570 void UT3D_vc_perp2vc (Vector *, Vector *, Vector *);
01571 int UT3D_vc_perpvc2pt (Vector *vp, Vector *vx, Point *pc, Point *py);
01572 int UT3D_vc_perp3pt (Vector *vp, Point *ptc, Point *ptx, Point *pty);
01573 int UT3D_vc_perp4pt (Vector *vp, Point *p1, Point *p2, Point *p3, Point *p4);
01574 void UT3D_vc_perpTria (Vector *vn, Triangle *tri);
01575 void UT3D_vc_perpvcplXY (Vector *, Vector *);
01576 int UT3D_vc_perppta (Vector *vcn, int pNr, Point *pa);
01577 void UT3D_vc_normalize (Vector*,Vector*);
01578 void UT3D_vc_setLength (Vector *, Vector *, double);
01579 int UT3D_vc_setLenLen (Vector *vco,Vector *vci,double newLen,double actLen);
01580 void UT3D_vc_tangci (Vector *vs, Circ *ci1, double u);
01581 int UT3D_vc_tangcipt (Vector *vt, Point *p1, Circ *ci);
01582 int UT3D_vc_rotangr (Vector *vco, Vector *vci, double *ar);
01583 void UT3D_vc_rot3angr (Vector *,Vector *, double, double, double);
01584 int UT3D_vc_rotvcvcangr (Vector *vo, Vector *va, Vector *vi, double angr);
01585 int UT3D_vc_projvcvc (Vector *v3, Vector *v1, Vector *v2);
01586 int UT3D_vc_projvc2vc (Vector *vo, Vector *vi, Vector *v1, Vector *v2);
01587 int UT3D_vc_projvcnvc (Vector *vo, Vector *vi, Vector *vz);
01588 void UT3D_vc_projvcpl (Vector *, Plane *, Vector *);
01589 int UT3D_vc_mirvcpl (Vector *vco, Vector *vci, Plane *pln);
01590 void UT3D_vc_travcm3 (Vector *b, Mat_4x3 ma, Vector *a);
01591 void UT3D_vc_travcm4 (Vector *b, Mat_4x4 ma, Vector *a);
01592
01593 int UT3D_comp2ln (Line *pa1, Line *pa2, double tol);
01594 int UT3D_ln_ck_on_ln (Point*,Point*,Point*,Point*,Point*,Point*,double tol);
01595 int UT3D_ln_ck_parpl (double *dist, Line *ln, Plane *pl, double tol);
01596 void UT3D_ln_6db (Line*, double, double, double, double, double, double);
01597 void UT3D_ln_2pt2 (Line *ln1, Point2 *pta, Point2 *pte);
01598 int UT3D_ln_int2pl (Line *ln, Plane *pl1, Plane *pl2);
01599 int UT3D_ln_tangcici (Line *ln1, Circ *ci1, Circ *ci2, int sNr);
01600 int UT3D_ln_parl2ln (Point*, Point*, Point*, Point*, Point*, Point*);
01601 int UT3D_ln_pts_dmax (Line *ln, int np, Point *ptab, double tol);
01602 int UT3D_ln_setLen (Line *lno, Point *pc, double lnlg, Line *lni);
01603 void UT3D_ln_inv (Line *ln1);
01604 void UT3D_ln_ln2 (Line*, Line2*);
01605
01606 int UT3D_rdc_3pt (double *rdc, Point *pp1, Point *pp2, Point *pp3);
01607 int UT3D_ck_ci180 (Circ *ci1);
01608 int UT3D_ck_ci360 (Circ *ci1);
01609 int UT3D_ci_cip1 (Circ *ci1, Point *p1);
01610 int UT3D_ci_ptvcr (Circ *ci1, Point *pc, Vector *vz, double rc);
01611 int UT3D_ci_pt2vcr (Circ *ci1, Point *pc, Vector *vz, Vector *vx, double rc);
01612 int UT3D_ci_cip2 (Circ *ci1, Point *p2);
01613 int UT3D_ci_cip3 (Circ *ci1, Point *p1, Point *p2);
01614 int UT3D_ci_ciangr (Circ *ci, double ao2);
01615 void UT3D_ci_setangr (Circ *ci1);
01616 int UT3D_ci_ptptvcangr (Circ *ci,Point *pc,Point *p1,Vector *vz,double ao);
01617 int UT3D_ci_ptptvcrd (Circ *ci,
01618 Point *p1,Point *p2,double rd,Vector *vz,int siz);
01619 int UT3D_ci_cipt180 (Circ *ci1, Point *p1);
01620 int UT3D_ci_cipt360 (Circ *ci1, Point *p1);
01621 int UT3D_ci_pcvzpt180 (Circ *ci1,Point *pc,Vector *vz,Point *p1,int dreh);
01622 int UT3D_ptNr_ci (Circ *ci1, double tol);
01623 int UT3D_ci_inv1 (Circ *ci1);
01624 int UT3D_ci_inv2 (Circ *ci1);
01625 int UT3D_ci_inv3 (Circ *ci1);
01626 Circ UT3D_ci_ci2 (Circ2*);
01627 Circ UT3D_ci_obj2 (ObjG2 *);
01628 Circ UT3D_ci_obj (ObjG *ci_in);
01629 int UT3D_ci_ptvcrd (Circ *ci, Point *ps, Vector *vs, double rd,
01630 Vector *vz, double a1);
01631 int UT3D_ci_2ptvcrd (Circ *cia,Point *pp1,Point *pp2,Vector *vz,double rdc);
01632 int UT3D_ci_3pt (Circ *cpo, Point *pp1, Point *pp2, Point *pp3);
01633 int UT3D_civz_ci (Circ *ci1);
01634 int UT3D_ci_ptptrd (Circ ca[], Point *pt1, Point *pt2, double radi);
01635 int UT3D_ci_lnptrd (Circ ca[], Line *ln1,Point *pt1,Vector *vz,double rdc);
01636 int UT3D_ci_ciptrd (Circ ca[], Circ *ci1, Point *pt1, double rdc);
01637 int UT3D_ci_2lnrd (Circ ca[], Line *ln1, Line *ln2, double rdc, int);
01638 int UT3D_ci_cicird (Circ ca[], Circ *ci1, Circ *ci2, double rdc, int);
01639 int UT3D_ci_lncird (Circ ca[], Line *ln1, Circ *ci1, double rdc, int);
01640 int UT3D_ci_intplsph (Circ *cio, Plane *pli, Sphere *spi);
01641 int UT3D_ci_ptrd2vc2angr (Circ *ci, Point *pc, double rd,
01642 Vector *vz, Vector *vx,
01643 double a1, double a2);
01644 int UT3D_ci_ptvcpt2angr (Circ *ci,
01645 Point *pc, Point *p1, Vector *vz,
01646 double a1, double a2);
01647
01648
01649 int UT3D_ck_el360 (CurvElli *el1);
01650 int UT3D_el_elpt180 (CurvElli *el1, Point *p1);
01651 double UT3D_angr_elpt (Point *pti,Point *ptc,Vector *va,Vector *vb);
01652 int UT2D_pt_elangd (Point2 *pto, double lx, double ly, double angr);
01653 int UT3D_pt_elangd (Point *pto,Point *ptc,Vector *va,Vector *vb,double angr);
01654 int UT3D_el_pt2vc2a (CurvElli *el, Point *ptc, Vector *vcx, Vector *vcy,
01655 double a1, double a2, int idir);
01656 int UT3D_el_projcipl (CurvElli *el, Plane *pl, Circ *ci);
01657 int UT3D_el_projelpl (CurvElli *elo, Plane *pl, CurvElli *eli);
01658 int UT3D_el_elcoe(CurvElli *,polcoeff_d5 *,Point2 *pa,Point2 *pe,double zt);
01659 int UT3D_elcoe_el(polcoeff_d5*, CurvElli*);
01660
01661
01662 int UT3D_pta_ck_planar (int pNr, Point *pTab, Point *pPln, Vector *vc);
01663 int UT3D_rMin_pta (double *rMin, int pNr, Point *pTab);
01664 int UT3D_sr_polc (int ptNr, Point *pa, Vector *vcn, int plMain);
01665 int UT3D_pta_dbo (Point **pTab, int *pNr, int typ, long ind, double tol);
01666 Curv UT3D_cv_obj2 (ObjG2 *);
01667 void UT3D_cv_ln (Point *cv, int *ptAnz, Point *p1, Point *p2);
01668 int UT3D_npt_ci (Point *pa, int pNr, Circ *ci1);
01669 void UT3D_cv_ci (Point cv[], int *ptanz, Circ *ci1, int ptmax, double tol);
01670 int UT3D_cv_ell (Point cv[],int *numpt,CurvElli *el,int ptmax,double stol);
01671 int UT3D_cv_delia (int *pNr, Point *pTab, char *ptStat);
01672 int UT3D_cv3_linear (int *pNr, Point *pTab, double tol);
01673
01674 int UT3D_obj_dump (ObjG *el);
01675
01676 ObjG UT3D_obj_ln (Line*);
01677
01678 ObjG UT3D_obj_ci (Circ*);
01679
01680
01681 int UT3D_bp_2pt (Point *pt1, Point *pt2);
01682 int UT3D_bp_vc_ (Vector*);
01683 int UT3D_bp_vcz (Vector*);
01684 void UT3D_pl_XYZ (Plane *pl1);
01685 int UT3D_pl_bpdb (Plane *plo, int bp, double dbc);
01686 int UT3D_pl_3pt (Plane *, Point *, Point *, Point *);
01687 void UT3D_pl_ptvcvc (Plane *pl1, Point *po, Vector *vx, Vector *vz);
01688 void UT3D_pl_pt2vc (Plane *, Point *, Vector *, Vector *);
01689 int UT3D_pl_ptvc (Plane *, Point *, Vector *);
01690 void UT3D_pl_ptvcpt (Plane *pl1, Point *po, Vector *vz, Point *ptx);
01691 int UT3D_pl_ln (Plane *pln, Line *lna);
01692 void UT3D_pl_2ln (Plane *pl1, Line *ln1, Line *ln2);
01693 int UT3D_pl_ci (Plane *pl1, Circ *ci1);
01694 int UT3D_pl_nobj (Plane *pl1, int oNr, ObjGX *oTab);
01695 void UT3D_pl_invert (Plane *pl);
01696 int UT3D_pl_rotpt (Plane *plo, Plane *pli, Point *ptx);
01697 void UT3D_pl_ptpl (Plane *pl, Point *pt1);
01698 int UT3D_pl_plcoe (Plane *pl, polcoeff_d3 *co);
01699 int UT3D_plcoe_pl (polcoeff_d3 *co, Plane *pl);
01700
01701 double UT3D_plg_lvTab (double *lvTab, Point *pta, int ptNr);
01702 int UT3D_pta_plg (int *ptNr, Point *pta, CurvPoly *plg);
01703
01704
01705 int UT2D_box_ini0 (Point2 *pt1, Point2 *pt2);
01706 int UT2D_box_extend (Point2 *pb1, Point2 *pb2, Point2 *pt1);
01707 int UT2D_rect_pts (Point2 *pmin, Point2 *pmax, int nump, Point2 *ptab);
01708 int UT2D_ckBoxinBox1 (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p4);
01709 int UT2D_ckBoxinBox2 (Point2 *p1, Point2 *p2,Point2 *p3, Point2 *p4, double tol);
01710 int UT2D_pt_ck_inBox (Point2 *p1, Point2 *p2, Point2 *p);
01711 int UT2D_pt_ck_inBoxTol (Point2 *p1, Point2 *p2, Point2 *p, double tol);
01712
01713 int UT3D_cv_boxxy (Point* pb1,double x1,double x2,double y1,double y2);
01714 int UT2D_box_ini0 (Point2 *pt1, Point2 *pt2);
01715 int UT3D_box_extend (Point* pb1, Point* pb2, Point* pt1);
01716 int UT3D_box_2pt (Point *pb1, Point *pb2, Point *pt1, Point *pt2);
01717 int UT3D_box_2pttol (Point *pb1, Point *pb2, Point *pt1, Point *pt2,double tol);
01718 int UT3D_box_pts (Point *pmin, Point *pmax, int nump, Point *ptab);
01719 int UT3D_box_tria (Point *pb1, Point *pb2, Triangle *tr, double tol);
01720 int UT3D_box_addTol (Point *pb1, Point *pb2, double tol);
01721 int UT3D_ck_ptInBox (Point *p1, Point *p2, Point *px);
01722 int UT3D_ckBoxinBox1 (Point *p1, Point *p2, Point *p3, Point *p4);
01723 int UT3D_box_ck_intLn (Line *ln, Point *pmin, Point *pmax, double tol);
01724 int UT3D_box_ck_intpl (Plane *pln, Point *p1, Point *p2, double tol);
01725 int UT3D_rbox_loadxy (Point* pb1,double x1,double x2,double y1,double y2);
01726 int UT3D_ptvc_intbox (Point *pl, Vector *vl, Point *bp1, Point *bp2);
01727 int UT3D_ln_intbox (Line *ln1, Point *bp1, Point *bp2);
01728
01729
01730 void UT3D_tria_pta_fac(Triangle*, Fac3*, Point*);
01731
01732 int UT3D_m3_inirot (Mat_4x3 ma, Point *pa, Vector *va, double angr);
01733 void UT3D_m3_loadpl (Mat_4x3, Plane *);
01734 void UT3D_m3_load (Mat_4x3, Vector *, Vector *, Vector *);
01735 void UT3D_m3_load_povxvy (Mat_4x3 ma, Point *ori, Vector *vx, Vector *vy);
01736 void UT3D_m3_load_povxvz (Mat_4x3 ma, Point *ori, Vector *vx, Vector *vz);
01737 void UT3D_m3_load_o (Mat_4x3, Point *);
01738
01739
01740 int UT3D_m3_invm3 (Mat_4x3, Mat_4x3);
01741 void UT3D_m3_multm3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2);
01742 int UT3D_m3_tram3m3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2);
01743
01744 void UT3D_m4_init (Mat_4x4 ma);
01745 void UT3D_m4_init_ori (Mat_4x4 ma, double px, double py, double pz);
01746 void UT3D_m4_init_rot (Mat_4x4 ma, double angle, Vector *axis);
01747 void UT3D_m4_loadpl (Mat_4x4 m1, Plane *pl1);
01748 void UT3D_m4_addrot (Mat_4x4 mo, Mat_4x4 ma, Mat_4x4 mb);
01749 void UT3D_m4_addtra (Mat_4x4 ma, double px, double py, double pz );
01750
01751 double UT3D_sbs_ck_planar (SurBSpl *su1);
01752 double UT3D_sru_ck_planar (ObjGX *ru1);
01753
01754
01755 void OGX_SET_OBJ (ObjGX *ox, int oTyp, int oForm, int oSiz, void *oDat);
01756
01757
01758
01759
01760
01761 #define IABS(i) (((i)<0)?-(i):(i))
01762 #define ISIGN(i) ((i>=0)?(1):(-1))
01763 #define ICHG01(i) (((i)>0)?(0):(1))
01764
01765 #define IMIN(x,y) (((x)<(y))?(x):(y))
01766 #define IMAX(x,y) (((x)>(y))?(x):(y))
01767
01769 #define ILIM2(x,lo,hi) (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))
01770
01771 #define ICHAR(x) ((x) & 15) // char --> int; auch x-48
01772
01777 #define UTI_iNr_chrNr(i1) (((i1) >> 2) + 1) // (((i1) + 4) / 4)
01778
01779
01780 #define DMIN(x,y) (((x)<(y))?(x):(y))
01781 #define DMAX(x,y) (((x)>(y))?(x):(y))
01782
01784 #define DLIM2(x,lo,hi) (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))
01785 #define DSIGN(d) ((d>=0.)?(1):(-1))
01786 #define DSIGTOL(d,t) ((d>t)?(1):((d<-(t))?(-1):(0)))
01787
01788 #define ACOS(dCos) ((dCos>=1.)?(0.):((dCos<=-1.)?(RAD_180):acos(dCos)))
01789
01790 #define UT_RADIANS(angle) ((angle)*(RAD_1))
01791 #define UT_DEGREES(angle) ((angle)/(RAD_1))
01792
01793 #define UT3D_vc_crossprod2vc UT3D_vc_perp2vc
01794 #define UT2D_acos_innerprod2vc UT2D_acos_2vc
01795
01796
01797
01803 #define UTP_comp_0(db) (fabs(db) < UT_TOL_min1)
01804
01805
01811 #define UTP_comp2db(d1,d2,tol) (fabs(d2-d1) < (tol))
01812
01817 #define UTP_px_paramp0p1px(p0,p1,par)\
01818 ((p1) - (p0)) * (par) + (p0);
01819
01820
01821
01823 #define BIT_SET(i,b) (i)|=(b)
01824
01826 #define BIT_CLR(i,b) (i)&=~(b)
01827
01829 #define BIT_GET(i,b) ((i)&(b))
01830
01831
01832
01834 #define UT2D_irot_r(rd) (((rd) > 0.) ? CCW : CW)
01835
01837 #define UT2D_lenq_vc(vc) ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy)
01838
01840 #define UT2D_len_vc(vc) (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy))
01841
01843 #define UT2D_lenq_2pt(lq,p1,p2){\
01844 double _dx = (p2)->x - (p1)->x;\
01845 double _dy = (p2)->y - (p1)->y;\
01846 *(lq) = _dx * _dx + _dy * _dy;}
01847
01853 #define UT2D_comp2pt(p1,p2,tol)\
01854 ((fabs((p2)->x - (p1)->x) < tol) &&\
01855 (fabs((p2)->y - (p1)->y) < tol))
01856
01861 #define UT2D_swap2pt(p1,p2){\
01862 Point2 p3 = *(p1); *(p1) = *(p2); *(p2) = p3;}
01863
01865 #define UT2D_pt_2db(pt2,dx,dy){\
01866 (pt2)->x = dx; (pt2)->y = dy;}
01867
01869 #define UT2D_pt_pt3(pt3)\
01870 (*(Point2*)pt3)
01871
01873 #define UT2D_pt_pt(pt2,pt3) (memcpy((pt2), (pt3), sizeof(Point2)))
01874
01876 #define UT2D_pt_pt3bp(p2o,p3i,bpi) {\
01877 if (bpi == BCKPLN_XY) {(p2o)->x = (p3i)->x; (p2o)->y = (p3i)->y;} \
01878 else if(bpi == BCKPLN_XZ) {(p2o)->x = (p3i)->x; (p2o)->y = (p3i)->z;} \
01879 else if(bpi == BCKPLN_YZ) {(p2o)->x = (p3i)->y; (p2o)->y = (p3i)->z;}}
01880
01882 #define UT2D_pt_addpt(po,p1){\
01883 (po)->x = (po)->x + (p1)->x;\
01884 (po)->y = (po)->y + (p1)->y;}
01885
01887 #define UT2D_pt_opp2pt(po,p1,p2){\
01888 (po)->x = (p1)->x - ((p2)->x - (p1)->x);\
01889 (po)->y = (p1)->y - ((p2)->y - (p1)->y);}
01890
01892 #define UT2D_pt_mid2pt(po,p1,p2){\
01893 (po)->x = ((p1)->x + (p2)->x) / 2.0;\
01894 (po)->y = ((p1)->y + (p2)->y) / 2.0;}
01895
01897 #define UT2D_pt_traptvc(po,pi,vc){\
01898 (po)->x = (pi)->x + (vc)->dx;\
01899 (po)->y = (pi)->y + (vc)->dy;}
01900
01901
01903 #define UT2D_acos_2vc UT2D_skp_2vc
01904 #define UT2D_skp_2vc(v1,v2)\
01905 ((v1)->dx*(v2)->dx + (v1)->dy*(v2)->dy)
01906
01908 #define UT2D_sar_2vc(v1,v2)\
01909 ((v1)->dx*(v2)->dy - (v1)->dy*(v2)->dx)
01910
01912 #define UT2D_acos_vc2pt UT2D_skp_vc2pt
01913 #define UT2D_skp_vc2pt(v1,p1,p2)\
01914 ((v1)->dx * ((p2)->x - (p1)->x) +\
01915 (v1)->dy * ((p2)->y - (p1)->y))
01916
01918 #define UT2D_crossprod_2vc(vc1,vc2)\
01919 (((vc1)->dx * (vc2)->dy) - ((vc2)->dx * (vc1)->dy))
01920
01922 #define UT2D_vc_2db(vc,dx,dy){\
01923 (vc)->dx = (dx);\
01924 (vc)->dy = (dy);}
01925
01927 #define UT2D_vc_invert(vo,vi){\
01928 (vo)->dx = -(vi)->dx;\
01929 (vo)->dy = -(vi)->dy;}
01930
01932 #define UT2D_vc_add2vc(v3,v1,v2){\
01933 (v3)->dx = (v1)->dx + (v2)->dx;\
01934 (v3)->dy = (v1)->dy + (v2)->dy;}
01935
01937 #define UT2D_vc_sub2vc(v3,v1,v2){\
01938 (v3)->dx = (v1)->dx - (v2)->dx;\
01939 (v3)->dy = (v1)->dy - (v2)->dy;}
01940
01942 #define UT2D_vc_multvc(vo,vi,d){\
01943 (vo)->dx = (vi)->dx * (d);\
01944 (vo)->dy = (vi)->dy * (d);}
01945
01947 #define UT2D_vc_perpvc(vo,vi){\
01948 double _dx = (vi)->dx; (vo)->dx = -(vi)->dy; (vo)->dy = _dx;}
01949
01951 #define UT2D_vc_perp2pt(vo,p1,p2){\
01952 (vo)->dx = (p1)->y - (p2)->y;\
01953 (vo)->dy = (p2)->x - (p1)->x;}
01954
01956 #define UT2D_vc_angr(vc,angr){\
01957 (vc)->dx = cos(angr);\
01958 (vc)->dy = sin(angr);}
01959
01961 #define UT2D_vc_vc3bp(v2o,v3i,bpi) {\
01962 if (bpi == BCKPLN_XY) {(v2o)->dx = (v3i)->dx; (v2o)->dy = (v3i)->dy;} \
01963 else if(bpi == BCKPLN_XZ) {(v2o)->dx = (v3i)->dx; (v2o)->dy = (v3i)->dz;} \
01964 else if(bpi == BCKPLN_YZ) {(v2o)->dx = (v3i)->dy; (v2o)->dy = (v3i)->dz;}}
01965
01967 #define UT2D_vc_2pt(vc,p1,p2){\
01968 (vc)->dx = (p2)->x - (p1)->x;\
01969 (vc)->dy = (p2)->y - (p1)->y;;}
01970
01972 #define UT2D_vc_ln(vc,ln){\
01973 (vc)->dx = (ln)->p2.x - (ln)->p1.x;\
01974 (vc)->dy = (ln)->p2.y - (ln)->p1.y;}
01975
01976
01977
01978
01979
01980 #define UT2D_ln_ptpt(ln1,pt1,pt2){\
01981 (ln1)->p1 = *(pt1);\
01982 (ln1)->p2 = *(pt2);}
01983
01985 #define UT2D_ln_ptvc(ln,pt,vc){\
01986 (ln)->p1 = *(pt);\
01987 (ln)->p2.x = (pt)->x + (vc)->dx;\
01988 (ln)->p2.y = (pt)->y + (vc)->dy;}
01989
01991 #define UT2D_ln_ln3(ln2,ln3){\
01992 (ln2)->p1.x = (ln3)->p1.x;\
01993 (ln2)->p1.y = (ln3)->p1.y;\
01994 (ln2)->p2.x = (ln3)->p2.x;\
01995 (ln2)->p2.y = (ln3)->p2.y;}
01996
01998 #define UT2D_len_cia(radius, ango) (fabs((radius)*(ango)))
01999
02001 #define UT2D_ln_inv(ln){\
02002 Point2 _pt = (ln)->p1; (ln)->p1 = (ln)->p2; (ln)->p2 = _pt;}
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02020 #define UT3D_lenq_vc(vc)\
02021 ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz)
02022
02024 #define UT3D_len_vc(vc)\
02025 (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz))
02026
02031 #define UT3D_skp_2vc(v1,v2)\
02032 ((v1)->dx*(v2)->dx + (v1)->dy*(v2)->dy + (v1)->dz*(v2)->dz)
02033
02034 #define UT3D_skp_vc2pt(v1,p1,p2)\
02035 ((v1)->dx * ((p2)->x - (p1)->x) +\
02036 (v1)->dy * ((p2)->y - (p1)->y) +\
02037 (v1)->dz * ((p2)->z - (p1)->z))
02038
02040 #define UT3D_acos_2vc UT3D_skp_2vc
02041 #define UT3D_acos_vc2pt UT3D_skp_vc2pt
02042
02043
02044
02046 #define UT3D_pt_pt(pt3,pt2,zVal){\
02047 memcpy((pt3), (pt2), sizeof(Point)); (pt3)->z = (zVal);}
02048
02050 #define UT3D_pt_multpt(po,pi,d){\
02051 (po)->x = (pi)->x * (d);\
02052 (po)->y = (pi)->y * (d);\
02053 (po)->z = (pi)->z * (d);}
02054
02059 #define UT3D_pt_LinComb2Pts(po,a1,p1,a2,p2){\
02060 (po)->x = a1 * (p1)->x + a2 * (p2)->x;\
02061 (po)->y = a1 * (p1)->y + a2 * (p2)->y;\
02062 (po)->z = a1 * (p1)->z + a2 * (p2)->z;}
02063
02065 #define UT3D_pt_addpt(po,p1){\
02066 (po)->x += (p1)->x;\
02067 (po)->y += (p1)->y;\
02068 (po)->z += (p1)->z;}
02069
02071 #define UT3D_pt_add2pt(po,p1,p2){\
02072 (po)->x = (p1)->x + (p2)->x;\
02073 (po)->y = (p1)->y + (p2)->y;\
02074 (po)->z = (p1)->z + (p2)->z;}
02075
02080 #define UT3D_swap2pt(p1,p2){\
02081 Point p3 = *(p1); *(p1) = *(p2); *(p2) = p3;}
02082
02084 #define UT3D_pt_vc(pt,vc) (memcpy((pt), (vc), sizeof(Point)))
02085
02087 #define UT3D_pt_traptvc(po,pi,vc){\
02088 (po)->x = (pi)->x + (vc)->dx;\
02089 (po)->y = (pi)->y + (vc)->dy;\
02090 (po)->z = (pi)->z + (vc)->dz;}
02091
02093 #define UT3D_pt_traptivc(po,pi,vc){\
02094 (po)->x = (pi)->x - (vc)->dx; \
02095 (po)->y = (pi)->y - (vc)->dy;\
02096 (po)->z = (pi)->z - (vc)->dz;}
02097
02099 #define UT3D_pt_evparptcv(pto,par,ptl,vcl){\
02100 (pto)->x = (ptl)->x + (vcl)->dx * (par);\
02101 (pto)->y = (ptl)->y + (vcl)->dy * (par);\
02102 (pto)->z = (ptl)->z + (vcl)->dz * (par);}
02103
02104
02109 #define u3d_LinComb2Pts(po,a1,p1,a2,p2){\
02110 (po)->x = a1 * (p1)->x + a2 * (p2)->x;\
02111 (po)->y = a1 * (p1)->y + a2 * (p2)->y;\
02112 (po)->z = a1 * (p1)->z + a2 * (p2)->z;}
02113
02114
02116 #define UT3D_vc_vc2(v3o,v2i){\
02117 (v3o)->dx = (v2i)->dx;\
02118 (v3o)->dy = (v2i)->dy;\
02119 (v3o)->dz = UT_DB_NULL;}
02120
02122 #define UT3D_vc_3db(vc,x,y,z){\
02123 (vc)->dx = (x);\
02124 (vc)->dy = (y);\
02125 (vc)->dz = (z);}
02126
02128 #define UT3D_vc_pt(vc,pt) (memcpy((vc), (pt), sizeof(Point)))
02129
02131 #define UT3D_vc_2pt(vc,p1,p2){\
02132 (vc)->dx = (p2)->x - (p1)->x;\
02133 (vc)->dy = (p2)->y - (p1)->y;\
02134 (vc)->dz = (p2)->z - (p1)->z;}
02135
02137 #define UT3D_vc_perpTria(vn,tri)\
02138 UT3D_vc_perp3pt ((vn),(tri)->pa[0],(tri)->pa[1],(tri)->pa[2])
02139
02141 #define UT3D_vc_invert(vio,vii){\
02142 (vio)->dx = -(vii)->dx;\
02143 (vio)->dy = -(vii)->dy;\
02144 (vio)->dz = -(vii)->dz;}
02145
02147 #define UT3D_vc_addvc(vo,vi){\
02148 (vo)->dx += (vi)->dx;\
02149 (vo)->dy += (vi)->dy;\
02150 (vo)->dz += (vi)->dz;}
02151
02153 #define UT3D_vc_add2vc(v3,v1,v2){\
02154 (v3)->dx = (v1)->dx + (v2)->dx;\
02155 (v3)->dy = (v1)->dy + (v2)->dy;\
02156 (v3)->dz = (v1)->dz + (v2)->dz;}
02157
02159 #define UT3D_vc_addvc2pt(v3,v1,p1,p2){\
02160 (v3)->dx = (v1)->dx + (p2)->x - (p1)->x;\
02161 (v3)->dy = (v1)->dy + (p2)->y - (p1)->y;\
02162 (v3)->dz = (v1)->dz + (p2)->z - (p1)->z;}
02163
02165 #define UT3D_vc_add3vc(vo,v1,v2,v3){\
02166 (vo)->dx = (v1)->dx + (v2)->dx + (v3)->dx;\
02167 (vo)->dy = (v1)->dy + (v2)->dy + (v3)->dy;\
02168 (vo)->dz = (v1)->dz + (v2)->dz + (v3)->dz;}
02169
02171 #define UT3D_vc_sub2vc(v3,v1,v2){\
02172 (v3)->dx = (v1)->dx - (v2)->dx;\
02173 (v3)->dy = (v1)->dy - (v2)->dy;\
02174 (v3)->dz = (v1)->dz - (v2)->dz;}
02175
02177 #define UT3D_vc_multvc(vo,vi,d){\
02178 (vo)->dx = (vi)->dx * (d);\
02179 (vo)->dy = (vi)->dy * (d);\
02180 (vo)->dz = (vi)->dz * (d);}
02181
02183 #define UT3D_vc_merge2vc(vo,v1,v2){\
02184 (vo)->dx = ((v1)->dx + (v2)->dx) / 2.;\
02185 (vo)->dy = ((v1)->dy + (v2)->dy) / 2.;\
02186 (vo)->dz = ((v1)->dz + (v2)->dz) / 2.;}
02187
02195 #define UT3D_comp2pt(p1,p2,tol)\
02196 ((fabs((p2)->x - (p1)->x) < tol) &&\
02197 (fabs((p2)->y - (p1)->y) < tol) &&\
02198 (fabs((p2)->z - (p1)->z) < tol))
02199
02200
02201
02202
02203
02205 #define UT3D_ln_inv(ln)\
02206 {Point _pt = (ln)->p1; (ln)->p1 = (ln)->p2; (ln)->p2 = _pt;}
02207
02209 #define UT3D_ln_ptpt(ln1,pt1,pt2)\
02210 {(ln1)->p1 = *(pt1);\
02211 (ln1)->p2 = *(pt2);}
02212
02214 #define UT3D_ln_ptvc(ln,pt,vc)\
02215 {(ln)->p1 = *(pt);\
02216 (ln)->p2.x = (pt)->x + (vc)->dx;\
02217 (ln)->p2.y = (pt)->y + (vc)->dy;\
02218 (ln)->p2.z = (pt)->z + (vc)->dz;}
02219
02221 #define UT3D_ln_ln2(ln3,ln2)\
02222 {(ln3)->p1.x = (ln2)->p1.x;\
02223 (ln3)->p1.y = (ln2)->p1.y;\
02224 (ln3)->p1.z = UT_DB_NULL;\
02225 (ln3)->p2.x = (ln2)->p2.x;\
02226 (ln3)->p2.y = (ln2)->p2.y;\
02227 (ln3)->p2.z = UT_DB_NULL;}
02228
02229
02230
02231
02232
02237 #define UT3D_ck_triaOrientI(i0,i1)\
02238 (((((i0)==0)&&((i1)==1))||(((i0)==1)&&((i1)==2))||(((i0)==2)&&((i1)==0))) ? CCW : CW)
02239
02244 #define UT3D_ck_triaOrientV(i0,i1)\
02245 (((((i0)==1)&&((i1)==2))||(((i0)==2)&&((i1)==4))||(((i0)==4)&&((i1)==1))) ? CCW : CW)
02246
02250 #define UT3D_ind3Tria_2ind(i1,i2) (IABS((i1)+(i2)-3))
02251
02253 #define UT3D_tria_pta_fac(tri,fac,pTab){\
02254 (tri)->pa[0] = &(pTab)[(fac)->i1];\
02255 (tri)->pa[1] = &(pTab)[(fac)->i2];\
02256 (tri)->pa[2] = &(pTab)[(fac)->i3];}
02257
02258
02259
02260
02262 #define OGX_SET_OBJ(ox,oTyp,oForm,oSiz,oDat){\
02263 (ox)->typ = (oTyp);\
02264 (ox)->form = (oForm);\
02265 (ox)->siz = (oSiz);\
02266 (ox)->data = (oDat);\
02267 (ox)->dir = 0;}
02268
02273 #define OGX_SET_INDEX(dbTyp,dbInd,ox){\
02274 (ox)->typ = (dbTyp);\
02275 (ox)->form = Typ_Index;\
02276 (ox)->siz = 1;\
02277 (ox)->data = (void*)(dbInd);}
02278
02283 #define OGX_GET_INDEX(ox)\
02284 (long)(ox)->data
02285
02286
02287
02288 #define MEM_swap_int(i1,i2){\
02289 int _i3 = *(i1); *(i1) = *(i2); *(i2) = _i3;}
02290
02291 #define MEM_swap_2vp(v1,v2){\
02292 void *_v3 = *(v1); *(v1) = *(v2); *(v2) = _v3;}
02293
02294
02295 #define MEM_swap_2db(d1,d2){\
02296 double _d3 = *(d1); *(d1) = *(d2); *(d2) = _d3;}
02297
02298
02299
02300
02301