gCAD3D 2.35
ut_geo.h File Reference
#include "../ut/ut_types.h"
#include "../ut/gr_types.h"
#include "../ut/AP_types.h"
#include "../ut/ut_mem.h"
#include "../ut/ut_umem.h"

Go to the source code of this file.

Data Structures

struct  Obj_Geo_Unknown
 OBJ_UNKNOWN get memoryspace for any type of object (has maximum size) More...
 
union  uni_i4i2
 union long / short[2] More...
 
struct  stru_2i2
 int = short + short More...
 
struct  stru_c3c1
 int = char[4] + char More...
 
struct  Quat
 quaternion More...
 
struct  dcomplex
 
struct  polcoeff_d3
 
struct  polcoeff_d4
 
struct  polcoeff_d5
 
struct  polynom_d3
 Typ_polynom_d3 Typ_CVPSP3. More...
 
struct  Polynom1
 Typ_Polynom1. More...
 
struct  Polynom3
 Typ_Polynom3. More...
 
struct  Polynom_
 Typ_Polynom_. More...
 
struct  Point2
 2D-point, Typ_PT2 More...
 
struct  Pointf
 
struct  Point
 3D-point, Typ_PT More...
 
struct  wPoint
 3D-weighted-point, Typ_WPT More...
 
struct  Vector2
 2D-vector, Typ_VC2 More...
 
struct  Vector
 3D-vector, Typ_VC More...
 
struct  IndTab
 Index-table; Typ_IndTab. More...
 
struct  ObjGX
 Typ_ObjGX. More...
 
struct  ObjDB
 Typ_Group DB-Objects Typ_ObjDB. More...
 
struct  ObjSRC
 Typ_ObjSRC sourceObject. More...
 
struct  ObjTXTSRC
 ObjTXTSRC type of expression of sourceObject. More...
 
struct  ObjAto
 atomicObjects More...
 
struct  ObjG2
 
struct  ObjG
 DO NOT USE; replaced by ObjGX. More...
 
struct  ObjBin
 
struct  ContTab
 ContourCurve. More...
 
struct  ObjRange
 group of consecutive objects More...
 
struct  Line2
 2D-line, Typ_LN2 More...
 
struct  Line
 3D-line, Typ_LN More...
 
struct  Triangle
 triangle, Typ_Tria More...
 
struct  Circ2
 2D-circle, Typ_CI2, Typ_CI2 More...
 
struct  Circ2C
 2D-circle in centerPosition, Typ_CI2C More...
 
struct  Circ
 3D-circle, Typ_CI More...
 
struct  CurvEll2C
 2D-ellipse in centerPosition Typ_CVELL2C More...
 
struct  CurvEll2
 ellipse, Typ_CVELL2 More...
 
struct  CurvElli
 ellipse, Typ_CVELL More...
 
struct  Curv
 do not use; replaced by ObjGX More...
 
struct  CurvPoly
 Curve: polygon, Typ_CVPOL. More...
 
struct  CurvBSpl2
 Curve: B-spline Typ_CVBSP2. More...
 
struct  CurvBSpl
 Curve: B-spline Typ_CVBSP. More...
 
struct  CurvRBSpl
 Rational B-Spline-curve; Typ_CVRBSP. More...
 
struct  CurvBez2
 2D-Bezier curve Typ_CVBEZ2 More...
 
struct  CurvBez
 Bezier curve Typ_CVBEZ. More...
 
struct  CurvRBez
 Rational Bezier curve Typ_CVRBEZ. More...
 
struct  CurvClot
 Clothoid curve Typ_CVCLOT. More...
 
struct  CurvPrcv
 polygonal_representation_of_curve CurvPrcv More...
 
struct  CurvCCV
 Trimmed curve CurvCCV Typ_CVTRM. More...
 
struct  Plane
 3D-plane, Typ_PLN More...
 
struct  SurHat
 Hatch Typ_SURHAT. More...
 
struct  SurRev
 RevolvedSurf Typ_SURRV. More...
 
struct  SurSwp
 SweepSurf Typ_SURSWP. More...
 
struct  SurStd
 StandardSurf (planar, conic, toroid) Typ_SUR. More...
 
struct  SurStripe
 surface from group of stripes; stripe from 2 polygons. More...
 
struct  SurBSpl
 Area: B-Spline-Surf Typ_SURBSP. More...
 
struct  SurRBSpl
 Area: Rat.B-Spline-Surf Typ_SURRBSP. More...
 
struct  ColRGB
 color, Typ_Color More...
 
struct  GText
 grafic text; Typ_GTXT More...
 
struct  AText
 text or image or tag or label; Typ_ATXT, Typ_Tag More...
 
struct  TexBas
 basic texture description; Typ_TEXB More...
 
struct  TexRef
 texture reference; Typ_TEXR More...
 
struct  Ditto
 internal submodel (block); Typ_Ditto More...
 
struct  ModelBas
 basic model description; Typ_SubModel More...
 
struct  ModelRef
 model reference; Typ_Model More...
 
struct  ModelNode
 Typ_ModelNode. More...
 
struct  Sphere
 sphere; Typ_SPH More...
 
struct  Conus
 cone; Typ_CON More...
 
struct  Torus
 torus; Typ_TOR More...
 
struct  Dimen
 dimension; Typ_Dimen More...
 
struct  Dim3
 3D-dimension; Typ_Dim3 More...
 
struct  SymRef2
 2D-symbol; Typ_SymRef2 Typ_SymB Typ_SymV More...
 
struct  SymRef
 3D-symbol; Typ_SymRef More...
 
struct  Att_ln
 grafic attribute; Typ_G_Att More...
 
struct  Ind_Att_ln
 grafic attribute for lines, curves; Typ_Ltyp More...
 
struct  ObjAtt
 GraficAttribute. More...
 
struct  DL_Att
 DisplayListRecord. More...
 
struct  TraRot
 Typ_TraRot: More...
 
struct  Activity
 Typ_Activ ("I") More...
 
struct  GridBoxH
 Typ_BoxH. More...
 

Macros

#define RAD_360   6.2831853071795862319
 360 Grad More...
 
#define RAD_270   4.7123889803846896739
 270 Grad More...
 
#define RAD_225   3.92699081698724151736
 225 Grad More...
 
#define RAD_180   3.14159265358979323846
 180 Grad More...
 
#define RAD_135   2.3561944901923448368
 135 Grad More...
 
#define RAD_120   2.0943951023931953735
 120 Grad More...
 
#define RAD_90   1.5707963267948965579
 90 Grad More...
 
#define RAD_60   1.0471975511965976313
 60 Grad More...
 
#define RAD_45   0.7853981633974482789
 45 Grad More...
 
#define RAD_30   0.5235987755982988156
 30 Grad More...
 
#define RAD_10   0.174532925199432954
 10 Grad More...
 
#define RAD_1   0.0174532925199432954
 1 Grad More...
 
#define RAD_01   0.0017453292519943295
 0.1 Grad More...
 
#define RAD_1_360   0.15915494309189534561
 1 / 6.28 More...
 
#define SR_3   1.7320508075688772
 SQRT(3) More...
 
#define SR_2   1.4142135623730951
 SQRT(2) More...
 
#define SR_PI   1.7724538509055159
 SQRT(PI) = SQRT(RAD_180) More...
 
#define CCW   1
 counterclockwise More...
 
#define CW   -1
 clockwise More...
 
#define NOT   !
 
#define YES   0
 FALSE. More...
 
#define NO   1
 TRUE. More...
 
#define ON   0
 FALSE. More...
 
#define OFF   1
 TRUE. More...
 
#define LIMITED   0
 
#define UNLIMITED   1
 
#define UT_BEZDEG_MAX   50
 maximal degree of Bezier curve More...
 
#define ATT_BIT_ABS   1
 das Absolut-Bit; Achtung: 0=ON=absolut, 1=relativ. More...
 
#define ATT_BIT_LIM   2
 Limited; 0=On; 2=unbegrenzte Linie/Vollkreis. More...
 
#define OBJ_SIZ_MAX   160
 OBJ_SIZ_MAX max. obj-size (for get, copy ..) More...
 
#define IABS(i)   (((i)<0)?-(i):(i))
 abs(int); always positive More...
 
#define ISIGN(i)   ((i>=0)?(1):(-1))
 sign of int; +1 or -1 More...
 
#define ICHG01(i)   (((i)>0)?(0):(1))
 change 0 -> 1, 1 -> 0; i1 = ICHG01 (i1); More...
 
#define ICHG0x1(ii)   ((ii * -1) - 1)
 
#define IMIN(x, y)   (((x)<(y))?(x):(y))
 
#define IMAX(x, y)   (((x)>(y))?(x):(y))
 
#define ILIM01(ii)   (((ii) > 0)?1:0)
 ILIM01 returns 0 (ii <= 0) or 1 (ii >= 1) More...
 
#define ILIMm10(ii)   (((ii) < 0)?-1:0)
 ILIM0x1 returns 0 (ii >= 0) or -1 (ii <= -1) More...
 
#define ILIM0X(x, hi)   (((x)>(hi))?(hi):(((x)<0)?0:(x)))
 ILIM0X returns x = between 0 and hi. More...
 
#define ILIM2(x, lo, hi)   (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))
 ILIM2 returns x = between lo and hi. More...
 
#define ILIMCK1(x, lim)   (((x)>(lim))?(1):(((x)<(0))?(1):(0)))
 
#define ILIMCK2(x, lo, hi)   (((x)>(hi))?(1):(((x)<(lo))?(1):(0)))
 
#define I_XOR_2I(i1, i2)   i1 ^ i2
 
#define UTN_LIMCK__(x, v1, v2)
 
#define ICHAR(x)   ((x) & 15)
 
#define UTI_iNr_chrNr(i1)   (((i1) >> 2) + 1)
 UTI_iNr_chrNr give nr of ints for n characters (not including \0) More...
 
#define FDABS(df)   ((df>=0.f)?(df):(-df))
 FDABS absolute value of float. More...
 
#define DMIN(x, y)   (((x)<(y))?(x):(y))
 
#define DMAX(x, y)   (((x)>(y))?(x):(y))
 
#define DLIM01(dd)   ((dd >= 0.)?0:1)
 DLIM01 0 if (d1 >= 0.); 1 if (d1 < 0.) More...
 
#define DLIM2(x, lo, hi)   (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))
 DLIM2 returns x = between lo and hi. More...
 
#define DSIGN(d)   ((d>=0.)?(1):(-1))
 sign of double; +1 or -1 More...
 
#define DSIGTOL(d, t)   ((d>t)?(1):((d<-(t))?(-1):(0)))
 d>t=1; d<-t=-1; else 0 More...
 
#define ACOS(dCos)   ((dCos>=1.)?(0.):((dCos<=-1.)?(RAD_180):acos(dCos)))
 
#define UT_RADIANS(angDeg)   ((angDeg)*(RAD_1))
 UT_RADIANS radians from degrees. More...
 
#define UT_DEGREES(angRad)   ((angRad)/(RAD_1))
 UT_DEGREES degrees from radians. More...
 
#define UT3D_vc_crossprod2vc   UT3D_vc_perp2vc
 
#define UT2D_acos_innerprod2vc   UT2D_acos_2vc
 
#define UTP_comp_0(db)   (fabs(db) < UT_TOL_min1)
 UTP_comp_0 compare double (double == 0.0 + - UT_TOL_min1) More...
 
#define UTP_comp2db(d1, d2, tol)   (fabs(d2-d1) < (tol))
 UTP_comp2db compare 2 doubles (with tolerance) More...
 
#define UTP_px_paramp0p1px(p0, p1, par)   ((p1) - (p0)) * (par) + (p0);
 UTP_px_paramp0p1px Zahl aus p0, p1 und Parameterwert. More...
 
#define UTP_db_comp_0(d1)   ((fabs(d1) < UT_TOL_min1) ? 0.0 : d1)
 UTP_db_comp_0 if fabs(d1) < UT_TOL_min1) d1 = 0.;. More...
 
#define BIT_SET(i, b)   (i)|=(b)
 
#define BIT_CLR(i, b)   (i)&=~(b)
 
#define BIT_GET(i, b)   ((i)&(b))
 
#define UT2D_lenq_vc(vc)   ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy)
 UT2D_lenq_vc quadr.length of 2D-vector. More...
 
#define UT2D_len_vc(vc)   (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy))
 UT2D_len_vc length of 2D-vector. More...
 
#define UT2D_lenS_2pt(p1, p2)   (fabs((p2)->x - (p1)->x) + fabs((p2)->y - (p1)->y))
 UT2D_lenS_2pt dx+dy-distance point-point. More...
 
#define UT2D_lenS_vc(vc1)   (fabs((vc1)->dx) + fabs((vc1)->dy))
 UT2D_lenS_vc dx+dy-distance 2D-vector. More...
 
#define UT2D_lenq_2pt(lq, p1, p2)
 UT2D_lenq_2pt quadr. distance pt - pt. More...
 
#define UT2D_comp2pt(p1, p2, tol)
 UT2D_comp2pt compare 2 points. More...
 
#define UT2D_swap2pt(p1, p2)
 UT2D_swap2pt swap 2 2D-points. More...
 
#define UT2D_pt_2db(pt2, dx, dy)
 UT2D_pt_2db 2D-Point < 2 doubles (x, y) More...
 
#define UT2D_pt_pt3(pt3)   (*(Point2*)pt3)
 UT2D_pt_pt3 2D-Point = 3D-Point. More...
 
#define UT2D_pt_pt(pt2, pt3)   (memcpy((pt2), (pt3), sizeof(Point2)))
 UT2D_pt_pt 2D-Point = 3D-Point. More...
 
#define UT2D_pt_pt3bp(p2o, p3i, bpi)
 UT2D_pt_pt3bp 2D-Point = 3D-Point on Backplane. More...
 
#define UT2D_pt_addpt(po, p1)
 UT2D_pt_addpt Add two points: po += p1. More...
 
#define UT2D_pt_sub_pt(po, p1, p2)
 UT2D_pt_sub_pt subtract point p2 from p1. More...
 
#define UT2D_pt_opp2pt(po, p1, p2)
 UT2D_pt_opp2pt opposite point (p1 = center) More...
 
#define UT2D_pt_mid2pt(po, p1, p2)
 UT2D_pt_mid2pt midpoint between 2 points. More...
 
#define UT2D_pt_traptvc(po, pi, vc)
 UT2D_pt_traptvc 2D Point = Point + Vector. More...
 
#define UT3D_pt_multvc(po, pi, vi, d)
 UT2D_pt_multvc po = pi + (vi * d) MULT. More...
 
#define UT2D_slen_vc_vcNo   UT2D_skp_2vc
 
#define UT2D_acos_2vc   UT2D_skp_2vc
 UT2D_skp_2vc cos of opening angle of 2 vecs (dot=scalarprod) DOT. More...
 
#define UT2D_skp_2vc(v1, v2)   ((v1)->dx * (v2)->dx + (v1)->dy * (v2)->dy)
 
#define UT2D_sar_2vc(v1, v2)   ((v1)->dx * (v2)->dy - (v1)->dy * (v2)->dx)
 
#define UT2D_acos_vc2pt   UT2D_skp_vc2pt
 UT3D_acos_vc2pt cos of opening angle of vec-(pt-pt) (dot=scalarprod) DOT. More...
 
#define UT2D_skp_vc2pt(v1, p1, p2)
 
#define UT2D_vc_pt(vc, pt)   (memcpy((vc), (pt), sizeof(Point2)))
 
#define UT2D_vc_vc3(vc2, vc3)   (memcpy((vc2), (vc3), sizeof(Vector2)))
 UT2D_vc_vc3 2D-Vector from 3D-Vector. More...
 
#define UT2D_vc_2db(vc, dx, dy)
 UT2D_vc_2db 2D-Vector < 2 doubles (x, y) More...
 
#define UT2D_vc_invert(vo, vi)
 UT2D_vc_invert 2D-Vector invert (change direction) More...
 
#define UT2D_vc_add2vc(v3, v1, v2)
 UT2D_vc_add2vc v3 = v1 + v2 ADD. More...
 
#define UT2D_vc_sub2vc(v3, v1, v2)
 UT2D_vc_sub2vc v3 = v1 - v2 SUB. More...
 
#define UT2D_vc_div_d(vo, vi, d)
 UT2D_vc_div_d divide vector. More...
 
#define UT2D_vc_multvc(vo, vi, d)
 UT2D_vc_multvc vo = vi * d MULT. More...
 
#define UT2D_vc_perpvc(vo, vi)
 UT2D_vc_perpvc vector = perpendic. to vector ( + 90 degrees) More...
 
#define UT2D_vc_perp2pt(vo, p1, p2)
 UT2D_vc_perp2pt vector = perpendic. to Line ( + 90 degrees) More...
 
#define UT2D_vc_angr(vc, angr)
 UT2D_vc_angr 2DVector = angle (radians) More...
 
#define UT2D_vc_vc3bp(v2o, v3i, bpi)
 UT2D_vc_vc3bp 2D-Vector = 3D-Vector on Backplane. More...
 
#define UT2D_vc_2pt(vc, p1, p2)
 UT2D_vc_2pt 2D-Vector = 2D-Point -> 2D-Point. More...
 
#define UT2D_vc_ln(vc, ln)
 UT2D_vc_ln 2D-Vector from 2D-Line. More...
 
#define UT2D_ln_ptpt(ln1, pt1, pt2)
 
#define UT2D_ln_ptvc(ln, pt, vc)
 UT2D_ln_ptvc 2D-Line from 2D-point and 2D-vector. More...
 
#define UT2D_ln_ln3(ln2, ln3)
 UT2D_ln_ln3 2D-Line = 3D-Line. More...
 
#define UT2D_len_cia(radius, ango)   (fabs((radius)*(ango)))
 UT2D_len_cia length arc (from rad & angle) More...
 
#define UT2D_ln_inv(ln)
 UT2D_ln_inv Invert 2D-Line. More...
 
#define UT3D_lenq_vc(vc)   ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz)
 UT3D_lenq_vc quadr.length of 3D-vector. More...
 
#define UT3D_len_vc(vc)   (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz))
 UT3D_len_vc length of 3D-vector. More...
 
#define UT3D_skp_2vc(v1, v2)   ((v1)->dx*(v2)->dx + (v1)->dy*(v2)->dy + (v1)->dz*(v2)->dz)
 UT3D_skp_2vc scalarprod of 2 vecs (dotprod,Skalarprod) More...
 
#define UT3D_skp_2ptvc(p1, p2, v1)
 
#define UT3D_acos_2vc   UT3D_skp_2vc
 UT3D_acos_vc2pt cos of opening angle of vec-(pt-pt) (dot=scalarprod) DOT. More...
 
#define UT3D_acos_vc2pt   UT3D_skp_2ptvc
 
#define UT3D_pt_NEW   {UT_VAL_MAX, 0., 0.}
 UT3D_pt_NEW create empty point (UT3D_pt_isFree) More...
 
#define UT3D_pt_setFree(obj)   (obj)->x = UT_VAL_MAX
 UT3D_pt_setFree set point not valid (not initialized) More...
 
#define UT3D_pt_isFree(obj)   ((obj)->x == UT_VAL_MAX)
 
#define UT3D_pt_pt(pt3, pt2, zVal)
 UT3D_pt_ptz 3D-Point = 2D-Point + Z-Val. More...
 
#define UT3D_pt_multpt(po, pi, d)
 UT3D_pt_multpt po = pi * d. More...
 
#define UT3D_pt_LinComb2Pts(po, a1, p1, a2, p2)
 UT3D_pt_LinComb2Pts Linear combination of two points: More...
 
#define UT3D_pt_addpt(po, p1)
 UT3D_pt_addpt Add point: po += p1. More...
 
#define UT3D_pt_add_pt2(po, p1)
 UT3D_pt_add_pt2 Add 2D-point: po += p1. More...
 
#define UT3D_pt_add_vc__(pt, vc)
 UT3D_pt_add_vc__ add vector: pt += vc. More...
 
#define UT3D_pt_add_vc_rev(pt, vc)
 UT3D_pt_add_vc_rev add vector: pt -= vc. More...
 
#define UT3D_pt_add_vc_par(pt, vc, lpar)
 UT3D_pt_add_vc_par add (vector * lpar) po += (vc * lpar) More...
 
#define UT3D_pt_add_3vc_3par(pt, v1, v2, v3, lp1, lp2, lp3)
 see also UT3D_pt_traptmultvc More...
 
#define UT3D_pt_add2pt(po, p1, p2)
 see also UT3D_pt_trapt3vc3len More...
 
#define UT3D_pt_sub_pt3(pto, pti)
 UT3D_pt_sub_pt3 subtract point po = p1 - p2. More...
 
#define UT3D_pt_sub_pt2(po, p1, p2)
 UT3D_pt_sub_pt2 subtract 2D-point po = p1 - p2. More...
 
#define UT3D_swap2pt(p1, p2)
 UT3D_swap2pt swap 2 3D-points. More...
 
#define UT3D_pt_vc(pt, vc)   (memcpy((pt), (vc), sizeof(Point)))
 UT3D_pt_vc Point = Vector. More...
 
#define UT3D_pt_tra_pt_dx(po, pi, dx)   *po = *pi; (po)->x += dx
 UT3D_pt_tra_pt_dx Point = Point + dx. More...
 
#define UT3D_pt_tra_pt_dy(po, pi, dy)   *po = *pi; (po)->y += dy
 UT3D_pt_tra_pt_dy Point = Point + dy. More...
 
#define UT3D_pt_traptvc(po, pi, vc)
 UT3D_pt_traptvc Point = Point + Vector. More...
 
#define UT3D_pt_traptivc(po, pi, vc)
 UT3D_pt_traptivc Point = Point - Vector. More...
 
#define UT3D_pt_traptmultvc(po, pi, vc, fac)
 UT3D_pt_traptmultvc point = point + (vector * factor) (INLINE) More...
 
#define UT3D_pt_evparptcv(pto, par, ptl, vcl)
 UT3D_pt_evparptcv evaluate param.point on line from point+vector. More...
 
#define u3d_LinComb2Pts(po, a1, p1, a2, p2)
 u3d_LinComb2Pts Linear combination of two points: More...
 
#define UT3D_vc_isFree(obj)   (obj)->dx == UT_VAL_MAX
 UT3D_vc_isFree check if vector is valid. More...
 
#define UT3D_vc_setFree(obj)   (obj)->dx = UT_VAL_MAX
 UT3D_vc_setFree set vector not valid (not initialized) More...
 
#define UT3D_vc_vc2(v3o, v2i)
 UT3D_vc_vc2 3D-vector = 2D-vector. More...
 
#define UT3D_vc_3db(vc, x, y, z)
 UT3D_vc_3db Vector < 3 doubles (x, y, z) More...
 
#define UT3D_vc_pt(vc, pt)   (memcpy((vc), (pt), sizeof(Point)))
 UT3D_vc_pt Vector = Point. More...
 
#define UT3D_vc_pt3db(vc, p1, px, py, pz)
 
#define UT3D_vc_2pt(vc, p1, p2)
 UT3D_vc_2pt Vector = Point -> Point. More...
 
#define UT3D_vc_perpTria(vn, tri)   UT3D_vc_perp3pt ((vn),(tri)->pa[0],(tri)->pa[1],(tri)->pa[2])
 UT3D_vc_perpTria vector = perpendic. to Triangle (crossprod) More...
 
#define UT3D_vc_invert(vio, vii)
 UT3D_vc_invert invert Vector. More...
 
#define UT3D_vc_addvc(vo, vi)
 UT3D_vc_addvc vo += vi. More...
 
#define UT3D_vc_add2vc(v3, v1, v2)
 UT3D_vc_add2vc v3 = v1 + v2 ADD. More...
 
#define UT3D_vc_addvc2pt(v3, v1, p1, p2)
 UT3D_vc_addvc2pt v3 = v1 + (p2-p1) Vector + (Vector from 2 points) More...
 
#define UT3D_vc_add3vc(vo, v1, v2, v3)
 UT3D_vc_add3vc vo = v1 + v2 + v3. More...
 
#define UT3D_vc_sub2vc(v3, v1, v2)
 UT3D_vc_sub2vc v3 = v1 - v2 SUB. More...
 
#define UT3D_vc_div_d(vo, vi, d)
 
#define UT3D_vc_multvc(vo, vi, d)
 UT3D_vc_multvc vo = vi * d MULT. More...
 
#define UT3D_vc_merge2vc(vo, v1, v2)
 UT3D_vc_merge2vc merge 2 vectors vo = (v1 + v2) / 2. More...
 
#define UT3D_comp2pt(p1, p2, tol)
 
#define UT3D_ln_inv(ln)   {Point _pt = (ln)->p1; (ln)->p1 = (ln)->p2; (ln)->p2 = _pt;}
 UT3D_ln_inv Invert 3D-Line. More...
 
#define UT3D_ln_ptpt(ln1, pt1, pt2)
 UT3D_ln_ptpt Line = Point, Point. More...
 
#define UT3D_ln_ptvc(ln, pt, vc)
 UT3D_ln_ptvc Line = Point, Vector. More...
 
#define UT3D_ln_ln2(ln3, ln2)
 UT3D_ln_ln2 3D-Line from 2D-Line (Z=0) More...
 

Typedefs

typedef double Mat_3x2 [2][3]
 Typ_M3x2. More...
 
typedef double Mat_3x3 [3][3]
 Typ_M3x3. More...
 
typedef double Mat_4x3 [3][4]
 Typ_M4x3 size 96. More...
 
typedef double Mat_4x4 [4][4]
 Typ_M4x4. More...
 

Functions

int UTP_comp_0 (double)
 
int UTP_compdb0 (double, double)
 
int UTP_comp2db (double, double, double)
 
int UTP_comp2x2db (double d11, double d12, double d21, double d22, double tol)
 
int UTP_db_ck_in2db (double v, double v1, double v2)
 
int UTP_db_ck_in2dbTol (double v, double v1, double v2, double tol)
 
int UTP_db_cknear_2db (double *db, double *d1, double *d2)
 
int UTP_db_cknear_ndb (double db1, int dbNr, double *dbTab)
 
double UTP_min_d3 (double *d1, double *d2, double *d3)
 
double UTP_max_d3 (double *d1, double *d2, double *d3)
 
double UTP_db_rnd1sig (double)
 
double UTP_db_rnd2sig (double)
 
int UT1D_ndb_npt_bp (double *da, Point *pa, int pNr, int bp)
 
double UT_DEGREES (double)
 
double UT_RADIANS (double)
 
int UT2D_sidPerp_3pt (Point2 *p1, Point2 *p2, Point2 *p3)
 
int UT2D_angr_set (double *angr)
 
int UT2D_2angr_set (double *ang1, double *ang2, int irot)
 
double UT2D_angr_2angr (double ang1, double ang2, int irot)
 
double UT2D_angr_set_2angr (double as, double aa, int sr)
 
int UT2D_ptNr_ci (double rdc, double ao, double tol)
 
int UT2D_solvtriri_a (double *a, double b, double c)
 
int UT2D_solvtriri_bc (double *, double *, double, double)
 
int UT2D_solvtri_abc (double *, double *, double, double, double)
 
int UT2D_ckBoxinBox1 (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p4)
 
int UT2D_ckBoxinBox2 (Point2 *, Point2 *, Point2 *, Point2 *, double)
 
double UT2D_slen_vc_vc__ (Vector2 *vac, Vector2 *vab)
 
double UT2D_slen_vc_vcNo (Vector2 *vac, Vector2 *vnab)
 
double UT2D_slen_pt_pt_vc__ (Point2 *pc, Point2 *pa, Vector2 *vab)
 
double UT2D_skp_2vc (Vector2 *, Vector2 *)
 
double UT2D_skp_vc2pt (Vector2 *, Point2 *, Point2 *)
 
double UT2D_acos_2vc (Vector2 *, Vector2 *)
 
double UT2D_sar_2vc (Vector2 *, Vector2 *)
 
double UT2D_acos_vc2pt (Vector2 *, Point2 *, Point2 *)
 
double UT2D_crossprod_2vc (Vector2 *, Vector2 *)
 
double UT2D_angd_angr (double)
 
double UT2D_angd_invert (double *andi)
 
double UT2D_angr_angd (double)
 
double UT2D_angr_triri_ab (double, double)
 
double UT2D_angr_ptpt (Point2 *, Point2 *)
 
double UT2D_angr_vc (Vector2 *)
 
double UT2D_angr_2ln (Line2 *, Line2 *)
 
double UT3D_angr_vc2pt (Point *pz, Vector *vz, Point *p1, Point *p2)
 
double UT3D_angr_vcpl_z (Plane *pl1, Vector *vc1)
 
double UT3D_angr_vcpl_tilt (Plane *pl1, Vector *vc1)
 
double UT3D_angr_vc2vc (Vector *vc1, Vector *vcx, Vector *vcy)
 
double UT3D_angr_2pl (Plane *pl1, Plane *pl2)
 
double UT2D_angr_2vc (Vector2 *, Vector2 *)
 
double UT2D_angr_3ptdr (Point2 *, Point2 *, Point2 *, int)
 
double UT3D_angr_4pt (Point *p11, Point *p12, Point *p21, Point *p22)
 
double UT2D_angr_ci (Point2 *pa, Point2 *pe, Point2 *pc, double rad_in)
 
double UT3D_angr_ci_p1_pt (Circ *ci1, Point *pti)
 
double UT2D_angr_perpangr (double *)
 
double UT2D_len_vc (Vector2 *)
 
double UT2D_lenq_vc (Vector2 *)
 
void UT2D_lenq_2pt (double *lq, Point2 *p1, Point2 *p2)
 
double UT2D_len_2pt (Point2 *, Point2 *)
 
double UT2D_lenB_2pt (Point2 *p1, Point2 *p2)
 
double UT2D_lenS_2pt (Point2 *p1, Point2 *p2)
 
double UT2D_lenS_vc (Vector2 *vc1)
 
int UT2D_minLenB_4pt (double *dp, Point2 *, Point2 *, Point2 *, Point2 *)
 
int UT3D_minLen_3pt (double *, Point *, Point *, Point *)
 
int UT3D_minLen_4pt (double *, Point *, Point *, Point *, Point *)
 
int UT3D_minLen_npt (Point *p0, Point *pa, int pNr)
 
double UT2D_len_ptln (Point2 *pt, Point2 *pa, Point2 *pe)
 
int UT2D_3len_ptln (double *, double *, double *, Point2 *, Point2 *, Point2 *)
 
int UT2D_slenq_ptptvc (double *qlen, Point2 *pa, Point2 *pb, Point2 *pc)
 
double UT2D_slen_nor3pt (Point2 *p1, Point2 *p2, Point2 *p3)
 
int UT2D_slen_nor2vc (double *slen, Vector2 *v1, Vector2 *v2)
 
int UT2D_slen_nor_vc_vcNo (double *slen, Vector2 *v1, Vector2 *v2)
 
double UT2D_slen_nor_2pt_vc__ (Point2 *pt, Point2 *pl, Vector2 *vl)
 
double UT2D_slen_nor_2pt_vcNo (Vector2 *v1, Point2 *p1, Point2 *p2)
 
int UT2D_2slen_vc_vc__ (double *dx, double *dy, Vector2 *vp, Vector2 *vl)
 
int UT2D_2slen_2pt_vc__ (double *dx, double *dy, Point2 *px, Point2 *pl, Vector2 *vl)
 
int UT2D_sid_2vc (Vector2 *v1, Vector2 *v2, double tol)
 
int UT2D_sidPerp_2vc (Vector *v1, Vector *v2)
 
int UT2D_sid_3pt (Point2 *pt, Point2 *p1, Point2 *p2)
 
int UT2D_sid_ptvc (Point2 *, Point2 *, Vector2 *)
 
int UT2D_sidPerp_ptvc (Point2 *pt, Point2 *pl, Vector2 *vl)
 
int UT3D_sid_2vc (Vector *v1, Vector *v2)
 
int UT3D_sid_3pt (Point *p1, Point *p2, Point *p3)
 
int UT3D_sid_ptpl (Point *pt, Plane *pl)
 
int UT3D_sid_ptptvc (Point *ptx, Point *pto, Vector *vz)
 
int UT2D_parLn_pt2pt (double *d1, Point2 *p1, Point2 *p2, Point2 *px)
 
double UT2D_ar_3pt (Point2 *p1, Point2 *p2, Point2 *p3)
 
int UT2D_comp2pt (Point2 *, Point2 *, double)
 
int UT2D_comp4pt (Point2 *, Point2 *, Point2 *, Point2 *, double)
 
int UT2D_pt_ck_int4pt (Point2 *, Point2 *, Point2 *, Point2 *)
 
int UT2D_pt_ck_onLine (Point2 *po, Point2 *p1, Point2 *p2, Point2 *p3, double tol)
 
int UT2D_pt_ck_inLine (Point2 *p1, Point2 *p2, Point2 *p3, double tol)
 
int UT2D_pt_ck_inplg (Point2 *pTab, int pNr, Point2 *ptx)
 
int UT2D_pt_ck_linear (int np, Point2 *ptab, double tol)
 
int UT2D_pt_ck_inBox (Point2 *p1, Point2 *p2, Point2 *p)
 
int UT2D_pt_ck_inBoxTol (Point2 *p1, Point2 *p2, Point2 *p, double tol)
 
int UT2D_pt_ck_inAc (Point2 *pt, Circ2 *ci)
 
int UT2D_pt_ck_inTriangle (Point2 *p1, Point2 *p2, Point2 *p3, Point2 *p)
 
int UT2D_pt_ck_inCv3 (Point *ptx, int pNr, Point *pTab)
 
int UT2D_pt_cknear_npt (Point2 *p0, Point2 *ptTab, int ptNr)
 
void UT2D_swap2pt (Point2 *p1, Point2 *p2)
 
Point2 UT2D_pt_pt3 (Point *)
 
void UT2D_pt_2db (Point2 *, double, double)
 
int UT3D_pt_pt2bp (Point *p3, Point2 *p2, int bp)
 
void UT2D_pt_addpt (Point2 *, Point2 *)
 
void UT2D_pt_sub_pt3 (Point2 *, Point *)
 
void UT2D_pt_opp2pt (Point2 *, Point2 *, Point2 *)
 
void UT2D_pt_mid2pt (Point2 *, Point2 *, Point2 *)
 
void UT2D_pt_traptvc (Point2 *, Point2 *, Vector2 *)
 
void UT2D_pt_tra2ptlen (Point2 *, Point2 *, Point2 *, double)
 
void UT2D_pt_traPtPtPar (Point2 *po, Point2 *p1, Point2 *p2, double d1)
 
void UT2D_pt_tra3ptlen (Point2 *, Point2 *, Point2 *, Point2 *, double)
 
void UT2D_pt_tra2pt2len (Point2 *, Point2 *, Point2 *, double, double)
 
void UT2D_pt_tra2pt3len (Point2 *, Point2 *, Point2 *, double, double, double)
 
void UT2D_pt_traptvclen (Point2 *, Point2 *, Vector2 *, double)
 
void UT2D_pt_traptangrlen (Point2 *, Point2 *, double, double)
 
void UT2D_pt_tranor2ptlen (Point2 *, Point2 *, Point2 *, double)
 
void UT2D_pt_tranorptvclen (Point2 *, Point2 *, Vector2 *, double)
 
void UT2D_pt_traptvc2len (Point2 *, Point2 *, Vector2 *, double, double)
 
void UT2D_pt_tracirlen (Point2 *, Point2 *, Point2 *, double, double)
 
void UT2D_pt_rotptangr (Point2 *, Point2 *, Point2 *, double)
 
int UT2D_pt_projptptvc (Point2 *, Point2 *, Point2 *, Vector2 *)
 
int UT2D_pt_projpt2pt (Point2 *pp, double *len, Point2 *pt, Point2 *p1, Point2 *p2)
 
int UT2D_pt_projptln (Point2 *, Point2 *, Line2 *)
 
void UT2D_2pt_projptci (Point2 *, Point2 *, Point2 *, Point2 *, double)
 
int UT2D_pt_projptci (Point2 *pp, Point2 *pt, Circ2 *ci1)
 
int UT3D_ptDi_intptvcptvc (Point *ip, double *dist, Point *ptl, Vector *vcl, Point *ptp, Vector *vcp)
 
int UT3D_ptDi_intptvcpln (Point *ip, double *dist, Plane *pl, Point *pt, Vector *vln)
 
int UT2D_pt_int4pt (Point2 *, double *, double *, double *, Point2 *, Point2 *, Point2 *, Point2 *)
 
int UT2D_pt_int2ln (Point2 *, Line2 *, Line2 *)
 
int UT2D_pt_intptvcy (Point2 *pto, Point2 *ptl, Vector2 *vcl, double yVal)
 
int UT2D_pt_intlny (Point2 *pto, Point2 *lp1, Point2 *lp2, double yVal)
 
int UT2D_pt_int2pt2vc (Point2 *ip, Point2 *pt1, Vector2 *vc1, Point2 *pt2, Vector2 *vc2)
 
int UT2D_pt_int2vc2pt (Point2 *, Point2 *, Vector2 *, Point2 *, Vector2 *)
 
int UT2D_2pt_intciptvc (Point2 *, Point2 *, Point2 *, double, Point2 *, Vector2 *)
 
int UT2D_2pt_intlnci (Point2 *ip1, Point2 *ip2, Line2 *ln, int lnMode, Circ2 *ci, int ciMode)
 
int UT2D_2pt_intcici (Point2 *, Point2 *, Point2 *, double, Point2 *, double)
 
int UT2D_2pt_int2ci (Point2 *ip1, Point2 *ip2, Circ2 *ci1, int ci1Mode, Circ2 *ci2, int ci2Mode)
 
void UT2D_pt_traptm2 (Point2 *, Mat_3x2, Point2 *)
 
Point2 UT2D_pt_obj2 (ObjG2 *obj1)
 
void UT2D_ln_ptpt (Line2 *, Point2 *, Point2 *)
 
void UT2D_ln_ptvc (Line2 *, Point2 *, Vector2 *)
 
void UT2D_ln_ln3 (Line2 *ln2, Line *ln3)
 
void UT2D_ln_inv (Line2 *ln1)
 
void UT2D_ln_4db (Line2 *ln2, double xs, double ys, double xe, double ye)
 
Line2 UT2D_ln_obj2 (ObjG2 *)
 
int UT2D_lncoe_ln (double *k, double *d, Line2 *ln)
 
int UT2D_ln_pts_dmax (Line2 *ln, int np, Point2 *ptab, double tol)
 
int UT2D_comp2vc (Vector2 *, Vector2 *, double)
 
int UT2D_comp2vc_p (Vector2 *, Vector2 *, double)
 
int UT2D_ckvc_in2vc (Vector2 *v1, Vector2 *v2, Vector2 *v3)
 
void UT2D_vc_vc3 (Vector2 *, Vector *)
 
int UT2D_2parvc_3vc (double *, double *, Vector2 *, Vector2 *, Vector2 *)
 
void UT2D_vc_2db (Vector2 *, double, double)
 
void UT2D_vc_angr (Vector2 *, double)
 
void UT2D_vc_angrlen (Vector2 *, double, double)
 
void UT2D_vc_2pt (Vector2 *, Point2 *, Point2 *)
 
void UT2D_vc_2pt3 (Vector2 *vc, Point *p1, Point *p2)
 
int UT2D_vc_2pt3_bp (Vector2 *vo, Point *p1, Point *p2, int bp)
 
void UT2D_vc_2ptlen (Vector2 *, Point2 *, Point2 *, double)
 
void UT2D_vc_ln (Vector2 *, Line2 *)
 
void UT2D_vc_invert (Vector2 *, Vector2 *)
 
int UT3D_vc_Zup (Vector *v2, Vector *v1)
 
void UT2D_vc_perpvc (Vector2 *, Vector2 *)
 
void UT2D_vc_perp2pt (Vector2 *, Point2 *, Point2 *)
 
void UT2D_vc_normalize (Vector2 *, Vector2 *)
 
void UT2D_vc_setLength (Vector2 *, Vector2 *, double)
 
void UT2D_vc_mid2vc (Vector2 *, Vector2 *, Vector2 *)
 
void UT2D_vc_merge2vc (Vector2 *vm, Vector2 *v1, Vector2 *v2)
 
void UT2D_vc_rotangr (Vector2 *, Vector2 *, double)
 
void UT2D_vc_travcm2 (Vector2 *vo, Mat_3x2 mata, Vector2 *vi)
 
double UT2D_angr_ciSec (double hc, double radc)
 
double UT2D_len_ciSec (double hSec, double rCi)
 
double UT2D_len_cia (double rad, double ango)
 
double UT2D_len_cir (double *angOpe, Point2 *pa, Point2 *pe, Point2 *pc, double rad_in)
 
int UT2D_compPtOnAc (double, double, double, int)
 
Circ2 UT2D_ci_obj2 (ObjG2 *)
 
int UT2D_ci_ptrd (Circ2 *ci, Point2 *ptc, double rdc)
 
int UT2D_ci_ci3 (Circ2 *ci2, Circ *ci3)
 
int UT2D_ci_2vc2ptrd (Point2 *, Point2 *, Vector2 *, Point2 *, Vector2 *, double)
 
int UT2D_ci_ciptvcrd (Point2 *, Point2 *, double, int, Point2 *, Vector2 *, double)
 
int UT2D_ci_ptvcpt (Point2 *, double *, Point2 *, Vector2 *, Point2 *)
 
int UT2D_obj_obj3 (ObjGX *oo, ObjGX *oi, Memspc *memSeg)
 
ObjG2 UT2D_obj_ci2 (Circ2 *)
 
int UT2D_void_obj2 (void *memObj, unsigned long *oSiz, ObjG2 *og2)
 
void UT2D_cv_ci360 (Point2 *cv, int ptNr, double rd, Point2 *ptCen)
 
int UT2D_cv_ln (Point2 *cv, int ptAnz, Point2 *p1, Point2 *p2)
 
int UT2D_npt_ci (Point2 *pa, int pNr, Circ2 *ci1)
 
int UT2D_cv_ci (Point2[], int *, Point2 *, Point2 *, Point2 *, int)
 
int UT2D_cv3_linear (int *pNr, Point *pTab, double tol)
 
int UT2D_srar_polc (double *aro, int ptNr, Point2 *pa)
 
void UT2D_m2_load (Mat_3x2, Vector2 *, Point2 *)
 
void UT2D_m2_loadtravcm2 (Mat_3x2 ma, Vector2 *vx, Vector2 *vy, Vector2 *vt)
 
int UT2D_m2_invtravcm2 (Mat_3x2 im1, Mat_3x2 m1)
 
void UT2D_m2_init_rot (Mat_3x2 ma, double angle, Point2 *cen)
 
int UT3D_stru_dump (int typ, void *data, char *txt,...)
 
double UT3D_len_vc (Vector *)
 
double UT3D_lenq_vc (Vector *)
 
int UT3D_bplen_vc (double *lnv, Vector *vc1)
 
double UT3D_lenB_vc (Vector *vc1)
 
double UT3D_lenB_2pt (Point *p1, Point *p2)
 
double UT3D_len_2pt (Point *, Point *)
 
double UT3D_lenq_PtPt (Point *p1, Point *p2)
 
int UT3D_lenq_PtLn (double *lenq, Point *p, Point *p1, Point *p2)
 
double UT3D_len_ln (Line *)
 
double UT3D_len_ci (Circ *ci1)
 
double UT3D_slen_3pt (Point *pt, Point *p1, Point *p2)
 
double UT3D_slen_projvcvc (Vector *vc1, Vector *vc2)
 
double UT3D_slenq_projvcvc (Vector *vc1, Vector *vc2)
 
double UT3D_slenq_2ptvc (Point *p1, Point *p2, Vector *vc)
 
double UT3D_nlen_projvcvc (Vector *vc1, Vector *vc2)
 
double UT3D_slen_2ptvc (Point *p1, Point *p2, Vector *vc)
 
double UT3D_slen_ptpl (Point *pt, Plane *pl)
 
double UT3D_nlen_2ptvc (Point *p1, Point *pv, Vector *vc)
 
double UT3D_nlen_3pt (Point *p1, Point *p2, Point *p3)
 
int UT3D_parpt_3pt (double *pl, Point *ptx, Point *pl1, Point *pl2)
 
int UT3D_parpt_ptvc (double *pl, Point *ptx, Point *pt1, Vector *vc1)
 
double UT3D_parpt_lnbp (Point *pti, Line *ln1, int bp)
 
double UT3D_par1_ci_angr (Circ *ci1, double angr)
 
double UT3D_par1_ci_pt (Circ *ci1, Point *pt1)
 
void UT3D_pt_setFree (Point *)
 
int UT3D_pt_isFree (Point *)
 
int UT3D_pt_ck_npt (Point *p0, Point *pTab, int pNr, double tol)
 
int UT3D_ipt_cknear_npt (Point *p0, Point *ptTab, int ptNr)
 
int UT3D_ipt_ckfar_npt (Point *p0, Point *ptTab, int ptNr)
 
int UT3D_ipt_cknearn_npt (Point *p0, Point *ptTab, int ptNr, int distNr)
 
int UT3D_ipt2_nptvc (Point *pt1, Point *pt2, int mode, Point *pta, int iNr, Vector *vc)
 
int UT3D_pt_ck_onel (Point *pt, CurvElli *el)
 
int UT3D_pt_ck_ptvc (Point *pt, Point *pl, Vector *vl, double tol)
 
int UT3D_pt_ck_2pt (Point *pt, Point *pl1, Point *pl2, double tol)
 
int UT3D_pt_ck_onLine (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_inLine (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_mid_2pt (Point *p1, Point *p2, Point *p3, double *tol)
 
int UT3D_pt_ck_on_pta (Point *pTab, int ptNr, Point *pt1, double tol)
 
int UT3D_pt_ck_in2pt (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_inCirc (Circ *ci1, Point *pt1, double tol)
 
int UT3D_pt_ck_inSph (Point *pt, Point *ps, double rs)
 
void UT3D_swap2pt (Point *p1, Point *p2)
 
int UT3D_comp4pt (Point *p1a, Point *p1e, Point *p2a, Point *p2e, double tol)
 
int UT3D_compptpl (Point *, Plane *)
 
Point UT3D_pt_pt2 (Point2 *)
 
Point UT3D_pt_pt2z (Point2 *pt20, double zVal)
 
void UT3D_pt_3db (Point *, double, double, double)
 
void UT3D_pt_vc (Point *, Vector *)
 
void UT3D_pt_txt (Point *, char *)
 
void UT3D_pt_mid2pt (Point *, Point *, Point *)
 
int UT3D_pt_mid_pta (Point *pto, Point *pTab, int ptNr)
 
void UT3D_pt_midci (Point *, Circ *)
 
void UT3D_pt_opp2pt (Point *, Point *, Point *)
 
int UT3D_pt_oppptptvc (Point *po, Point *pi, Point *pl, Vector *vl)
 
int UT3D_2pt_oppptvclen (Point *, Point *, Point *, Vector *, double)
 
void UT3D_pt_addpt (Point *, Point *)
 
void UT3D_pt_add_vc__ (Point *, Vector *)
 
void UT3D_pt_add_vc_par (Point *, Vector *, double)
 
void UT3D_pt_add_3vc_3par (Point *, Vector *, Vector *, Vector *, double, double, double)
 
void UT3D_pt_add_pt2 (Point *, Point2 *)
 
void UT3D_pt_add2pt (Point *, Point *, Point *)
 
void UT3D_pt_sub_pt2 (Point *, Point *, Point2 *)
 
void UT3D_pt_sub_pt3 (Point *, Point2 *)
 
void UT3D_pt_tra_pt_dx (Point *, Point *, double)
 
void UT3D_pt_tra_pt_dy (Point *, Point *, double)
 
void UT3D_pt_traptvclen (Point *po, Point *pi, Vector *vc, double dist)
 
void UT3D_pt_tra_pt_vc_par (Point *po, Point *pi, Vector *vc, double dist)
 
void UT3D_pt_trapt2vc (Point *po, Point *pi, Vector *vc1, Vector *vc2)
 
void UT3D_pt_trapt2vc2len (Point *, Point *, Vector *, double, Vector *, double)
 
void UT3D_pt_tra_pt_2vc_2par (Point *, Point *, Vector *, double, Vector *, double)
 
void UT3D_pt_trapt3vc3len (Point *po, Point *pi, Vector *vx, double dx, Vector *vy, double dy, Vector *vz, double dz)
 
void UT3D_pt_traptptlen (Point *po, Point *pi, Point *pDir, double lenv)
 
void UT3D_pt_trapt2pt (Point *po, Point *pi, Point *p1, Point *p2)
 
int UT3D_pt_tracirlen (Point *pto, Point *pti, Circ *cii, double clen)
 
int UT3D_pt_rotptptangr (Point *pto, Point *ptc, Point *pti, double *ar)
 
void UT3D_pt_rotptptvcangr (Point *pto, Point *pti, Point *ptc, Vector *vz, double angr)
 
int UT3D_pt_rotptm3 (Point *p2, Point *p1, Mat_4x3 ma)
 
int UT3D_pt_rotciangr (Point *pto, double angr, Circ *ci1)
 
int UT3D_pt_projpt2pt (Point *pp, double *len, Point *pt, Point *p1, Point *p2)
 
int UT3D_pt_projptln (Point *, double *, double *, Point *, Line *)
 
int UT3D_pt_projptci (Point *ptn, Point *ptf, Point *pt1, Circ *ci1)
 
int UT3D_pt_projptptvc (Point *pp, double *len, double *par, Point *pt, Point *pl, Vector *vl)
 
int UT3D_pt_projptel (int *numpe, Point *pe, CurvElli *ell, Point *pt)
 
int UT3D_pt_projptbspl (int *nxp, Point *ptab, double *ttab, CurvBSpl *bspl, Point *pt)
 
int UT3D_pt_projptptnvc (Point *po, Point *pi, Point *plo, Vector *plz)
 
void UT3D_pt_projptpl (Point *, Plane *, Point *)
 
int UT3D_pt_int2pt2vc (Point *ip1, Point *ip2, double *dist, Point *ptu, Vector *vcu, Point *ptv, Vector *vcv)
 
int UT3D_pt_intptvcplx (Point *px, Point *pl, Vector *vl, double plx)
 
int UT3D_pt_intptvcply (Point *px, Point *pl, Vector *vl, double ply)
 
int UT3D_pt_intptvcplz (Point *px, Point *pl, Vector *vl, double plz)
 
int UT3D_pt_intptvcln (Point *ip1, Point *ip2, double *dist, Point *pt1, Vector *vc1, Line *ln2)
 
int UT3D_pt_intptvcxpln (Point *pti, Point *ptl, Point *ptpl, Vector *vcpl)
 
int UT3D_pt_intptvcypln (Point *pti, Point *ptl, Point *ptpl, Vector *vcpl)
 
int UT3D_pt_intptvczpln (Point *pti, Point *ptl, Point *ptpl, Vector *vcpl)
 
int UT3D_pt_intptvcsph (Point *pa, Point *pl, Vector *vl, Point *ps, double rs)
 
int UT3D_pt_int2ln (Point *, Point *, double *, Line *, Line *)
 
int UT3D_pt_intperp2ln (Point *po, Point *p1, Vector *v1, Point *p2, Vector *v2)
 
int UT3D_pt_intlnci__ (int *np, Point xp[], Line *ln, Circ *ci1)
 
int UT3D_pt_intlnci_p (int *np, Point xp[], Line *ln, Circ *ci1)
 
int UT3D_pt_intlnsph (Line *ln1, Point *ps, double rs)
 
int UT3D_pt_intcici (Point pa[], Circ *ci1, int ci1Lim, Circ *ci2, int ci2Lim)
 
int UT3D_pt_intplnln (Point *ip, double *dist, Plane *pl, Line *ln)
 
int UT3D_pt_intlnpl (Point *, Plane *, Line *)
 
int UT3D_pt_intlnpl1 (Point *, double *, Point *, Point *, double, double)
 
int UT3D_pt_intptvcpln (Point *pti, Point *ptl, Vector *vcl, Point *ptpl, Vector *vcpl)
 
int UT3D_pt_intplnci (Point pa[], Plane *pl1, Circ *ci1, int ciLim)
 
int UT3D_pt_intcidpln (int *np, Point xp[], Point *pc, Point *p1, Vector *vz, double dx)
 
int UT3D_pt_intptvcpl_ (Point *, Plane *, Point *, Vector *)
 
int UT3D_pt_intlnel__ (int *np, Point xp[], Line *ln, CurvElli *el)
 
int UT3D_pt_intlnel_p (int *np, Point xp[], Line *ln, CurvElli *el)
 
int UT3D_pt_ipl_2ptpt2 (Point *pi3, Point *p1, Point *p2, Point2 *pi2)
 
int UT3D_pt_mirptpl (Point *pto, Point *pti, Plane *pln)
 
int UT3D_pt_mirptln (Point *pto, Point *pti, Line *ln)
 
int UT3D_pt_tangptci (Point *po1, Point *po2, Point *pt1, Circ *ci1)
 
int UT3D_pt_elfoc (Point *fp1, Point *fp2, CurvElli *el)
 
int UT3D_pt_evparln (Point *pto, double lpar, Line *ln1)
 
int UT3D_pt_evparci (Point *pto, double lpar, Circ *ci1)
 
int UT3D_pt_m3 (Point *pto, Mat_4x3 ma)
 
void UT2D_pt_traptm3 (Point2 *p2, Mat_4x3 mata, Point2 *p1)
 
void UT3D_pt_traptm3 (Point *, Mat_4x3, Point *)
 
void UT3D_pt_traptm4 (Point *p2, Mat_4x4 ma, Point *p1)
 
int UT2D_ptvc_ck_int2pt (int mode, Point2 *p1s, Vector2 *v1, Point2 *p2s, Point2 *p2e)
 
int UT3D_ptvc_int2pl (Point *pt, Vector *vc, Plane *pl1, Plane *pl2)
 
int UT3D_ptvc_int2pln (Point *pti, Vector *vci, Point *pl1pt, Vector *pl1vz, Point *pl2pt, Vector *pl2vz)
 
int UT3D_ptvc_ox (Point *pta, Vector *vca, ObjGX *oxi)
 
double UT3D_angr_3pt (Point *p1, Point *pc, Point *p2)
 
double UT3D_angr_2vc__ (Vector *, Vector *)
 
double UT3D_angr_3vc__ (Vector *vz, Vector *v1, Vector *v2)
 
double UT3D_angr_3vcn_CCW (Vector *vz, Vector *v1, Vector *v2)
 
double UT3D_angr_ci_par1 (Circ *ci1, double par1)
 
double UT3D_angr_ci__ (Circ *ci1)
 
int UT3D_2angr_vc (double *az, double *ay, Vector *vc1)
 
int UT3D_atan_vcpl (double *kvc, Vector *vci, Plane *pli)
 
int UT3D_compvc0 (Vector *v1, double tol)
 
int UT3D_comp2vc_d (Vector *, Vector *, double)
 
int UT3D_comp2vc_p (Vector *, Vector *, double)
 
void UT3D_vc_pt (Vector *, Point *)
 
int UT3D_vc_ck_parpl (Vector *vci, Plane *pli, double tol)
 
int UT3D_vc_ckperp_2vc1 (Vector *vc1, Vector *vc2, double tol)
 
int UT3D_vc_ck_std (Vector *vc1)
 
int UT3D_parvc_2vcbp (double *dl, int mainPln, Vector *v1, Vector *v2)
 
int UT3D_2parvc_3vcbp (double *, double *, int, Vector *, Vector *, Vector *)
 
void UT3D_vc_txt (Vector *vc, char *txt)
 
void UT3D_vc_2ptlen (Vector *, Point *, Point *, double)
 
void UT3D_vc_angr (Vector *vc, double angr)
 
void UT3D_vc_2angr (Vector *, double, double)
 
void UT3D_vc_2vc (Vector *, Vector *, Vector *)
 
void UT3D_vc_ln (Vector *, Line *)
 
int UT3D_vc_bp (Vector *vn, int bp)
 
void UT3D_vc_invert (Vector *, Vector *)
 
void UT3D_vc_perp1vc (Vector *vp, Vector *vi)
 
void UT3D_vc_perp2vc (Vector *, Vector *, Vector *)
 
int UT3D_vc_perpvc2pt (Vector *vp, Vector *vx, Point *pc, Point *py)
 
int UT3D_vc_perp3pt (Vector *vp, Point *ptc, Point *ptx, Point *pty)
 
int UT3D_vc_perp4pt (Vector *vp, Point *p1, Point *p2, Point *p3, Point *p4)
 
void UT3D_vc_perpTria (Vector *vn, Triangle *tri)
 
void UT3D_vc_perpvcplXY (Vector *, Vector *)
 
int UT3D_vc_perppta (Vector *vcn, int pNr, Point *pa)
 
void UT3D_vc_normalize (Vector *, Vector *)
 
void UT3D_vc_setLength (Vector *, Vector *, double)
 
int UT3D_vc_setLenLen (Vector *vco, Vector *vci, double newLen, double actLen)
 
int UT3D_vc_tng_ci_pt (Vector *vt, Point *p1, Circ *ci)
 
int UT3D_vc_rotangr (Vector *vco, Vector *vci, double *ar)
 
void UT3D_vc_rot3angr (Vector *, Vector *, double, double, double)
 
int UT3D_vc_rotvcvcangr (Vector *vo, Vector *va, Vector *vi, double angr)
 
int UT3D_vc_projvcvc (Vector *v3, Vector *v1, Vector *v2)
 
int UT3D_vc_projvc2vc (Vector *vo, Vector *vi, Vector *v1, Vector *v2)
 
int UT3D_vc_projvcnvc (Vector *vo, Vector *vi, Vector *vz)
 
void UT3D_vc_projvcpl (Vector *, Plane *, Vector *)
 
int UT3D_vc_mirvcpl (Vector *vco, Vector *vci, Plane *pln)
 
int UT3D_vc_mirvcln (Vector *vco, Vector *vci, Line *ln)
 
void UT3D_vc_travcm3 (Vector *b, Mat_4x3 ma, Vector *a)
 
void UT3D_vc_travcm4 (Vector *b, Mat_4x4 ma, Vector *a)
 
int UT3D_comp2ln (Line *pa1, Line *pa2, double tol)
 
int UT3D_ln_ck_on_ln (Point *, Point *, Point *, Point *, Point *, Point *, double tol)
 
int UT3D_ln_ck_parpl (double *dist, Line *ln, Plane *pl, double tol)
 
void UT3D_ln_6db (Line *, double, double, double, double, double, double)
 
void UT3D_ln_2pt (Line *ln1, Point *pta, Point *pte)
 
void UT3D_ln_2pt2 (Line *ln1, Point2 *pta, Point2 *pte)
 
int UT3D_ln_int2pl (Line *ln, Plane *pl1, Plane *pl2)
 
int UT3D_ln_tng_ci_ci (Line *ln1, Circ *ci1, Circ *ci2, int sNr)
 
int UT3D_ln_parl2ln (Point *, Point *, Point *, Point *, Point *, Point *)
 
int UT3D_ln_pts_dmax (Line *ln, int np, Point *ptab, double tol)
 
int UT3D_ln_setLen (Line *lno, Point *pc, double lnlg, Line *lni)
 
void UT3D_ln_inv (Line *ln1)
 
void UT3D_ln_ln2 (Line *, Line2 *)
 
int UT3D_rdc_3pt (double *rdc, Point *pp1, Point *pp2, Point *pp3)
 
int UT3D_ck_ci180 (Circ *ci1)
 
int UT3D_ck_ci360 (Circ *ci1)
 
int UT3D_ci_cip1 (Circ *ci1, Point *p1)
 
int UT3D_ci_ptvcr (Circ *ci1, Point *pc, Vector *vz, double rc)
 
int UT3D_ci_pt2vcr (Circ *ci1, Point *pc, Vector *vz, Vector *vx, double rc)
 
int UT3D_ci_cip2 (Circ *ci1, Point *p2)
 
int UT3D_ci_cip3 (Circ *ci1, Point *p1, Point *p2)
 
int UT3D_ci_ciangr (Circ *ci, double ao2)
 
void UT3D_ci_setangr (Circ *ci1)
 
int UT3D_ci_ptptvcangr (Circ *ci, Point *pc, Point *p1, Vector *vz, double ao)
 
int UT3D_ci_ptptvcrd (Circ *ci, Point *p1, Point *p2, double rd, Vector *vz, int sr, int iMod)
 
int UT3D_ci_cipt180 (Circ *ci1, Point *p1)
 
int UT3D_ci_cipt360 (Circ *ci1, Point *p1)
 
int UT3D_ci_pcvzpt180 (Circ *ci1, Point *pc, Vector *vz, Point *p1, int dreh)
 
int UT3D_ptNr_ci (Circ *ci1, double tol)
 
int UT3D_ci_inv1 (Circ *ci1)
 
int UT3D_ci_inv2 (Circ *ci1)
 
int UT3D_ci_inv3 (Circ *ci1)
 
Circ UT3D_ci_ci2 (Circ2 *)
 
Circ UT3D_ci_obj2 (ObjG2 *)
 
Circ UT3D_ci_obj (ObjG *ci_in)
 
int UT3D_ci_ptvcrd (Circ *ci, Point *ps, Vector *vs, double rd, Vector *vz, double a1)
 
int UT3D_ci_2ptvcrd (Circ *cia, Point *pp1, Point *pp2, Vector *vz, double rdc)
 
int UT3D_ci_3pt (Circ *cpo, Point *pp1, Point *pp2, Point *pp3)
 
int UT3D_ci_ptptrd (Circ ca[], Point *pt1, Point *pt2, double radi)
 
int UT3D_ci_lnptrd (Circ ca[], Line *ln1, Point *pt1, Vector *vz, double rdc)
 
int UT3D_ci_ciptrd (Circ ca[], Circ *ci1, Point *pt1, double rdc)
 
int UT3D_ci_2lnrd (Circ ca[], Line *ln1, Line *ln2, double rdc, int)
 
int UT3D_ci_cicird (Circ ca[], Circ *ci1, Circ *ci2, double rdc, int)
 
int UT3D_ci_lncird (Circ ca[], Line *ln1, Circ *ci1, double rdc, int)
 
int UT3D_ci_intplsph (Circ *cio, Plane *pli, Sphere *spi)
 
int UT3D_ci_ptrd2vc2angr (Circ *ci, Point *pc, double rd, Vector *vz, Vector *vx, double a1, double a2)
 
int UT3D_ci_ptvcpt2angr (Circ *ci, Point *pc, Point *p1, Vector *vz, double a1, double a2)
 
int UT3D_ck_el360 (CurvElli *el1)
 
int UT3D_el_elpt180 (CurvElli *el1, Point *p1)
 
double UT3D_angr_elpt (Point *pti, Point *ptc, Vector *va, Vector *vb)
 
int UT2D_pt_elangd (Point2 *pto, double lx, double ly, double angr)
 
int UT3D_pt_elangd (Point *pto, Point *ptc, Vector *va, Vector *vb, double angr)
 
int UT3D_el_pt2vc2a (CurvElli *el, Point *ptc, Vector *vcx, Vector *vcy, double a1, double a2, int idir)
 
int UT3D_el_projcipl (CurvElli *el, Plane *pl, Circ *ci)
 
int UT3D_el_projelpl (CurvElli *elo, Plane *pl, CurvElli *eli)
 
int UT3D_el_elcoe (CurvElli *, polcoeff_d5 *, Point2 *pa, Point2 *pe, double zt)
 
int UT3D_elcoe_el (polcoeff_d5 *, CurvElli *)
 
int UT3D_pta_ck_planar (int pNr, Point *pTab, Point *pPln, Vector *vc)
 
int UT3D_rMin_pta (double *rMin, int pNr, Point *pTab)
 
int UT3D_sr_polc (int ptNr, Point *pa, Vector *vcn, int plMain)
 
int UT3D_pta_dbo (Point **pTab, int *pNr, int typ, long ind, double tol)
 
void UT3D_cv_ln (Point *cv, int *ptAnz, Point *p1, Point *p2)
 
int UT3D_npt_ci (Point *pa, int pNr, Circ *ci1)
 
void UT3D_cv_ci (Point cv[], int *ptanz, Circ *ci1, int ptmax, double tol)
 
int UT3D_cv_delia (int *pNr, Point *pTab, char *ptStat)
 
int UT3D_cv3_linear (int *pNr, Point *pTab, double tol)
 
ObjG UT3D_obj_ln (Line *)
 
ObjG UT3D_obj_ci (Circ *)
 
int UT3D_bp_2pt (Point *pt1, Point *pt2)
 
int UT3D_bp_vc_ (Vector *)
 
int UT3D_bp_vcz (Vector *)
 
void UT3D_pl_XYZ (Plane *pl1)
 
int UT3D_pl_bpdb (Plane *plo, int bp, double dbc)
 
int UT3D_pl_3pt (Plane *, Point *, Point *, Point *)
 
int UT3D_pl_ptvc (Plane *, Point *, Vector *)
 
int UT3D_pl_ptvzpl (Plane *pl, Point *pt, Vector *vcz, Plane *basPln)
 
int UT3D_pl_ptvxpl (Plane *pl, Point *pt, Vector *vcx, Plane *basPln)
 
int UT3D_pl_pto_vcz_vcx (Plane *pl1, Point *po, Vector *vz, Vector *vx)
 
void UT3D_pl_pto_vcx_vcz (Plane *pl1, Point *po, Vector *vx, Vector *vz)
 
void UT3D_pl_pto_vcx_vcy (Plane *pl1, Point *po, Vector *vx, Vector *vy)
 
void UT3D_pl_pto_vcz_ptx (Plane *pl1, Point *po, Vector *vz, Point *ptx)
 
int UT3D_pl_ln (Plane *pln, Line *lna)
 
void UT3D_pl_2ln (Plane *pl1, Line *ln1, Line *ln2)
 
int UT3D_pl_ci (Plane *pl1, Circ *ci1)
 
int UT3D_pl_nobj (Plane *pl1, int oNr, ObjGX *oTab)
 
void UT3D_pl_invert (Plane *pl)
 
int UT3D_pl_rotpt (Plane *plo, Plane *pli, Point *ptx)
 
void UT3D_pl_ptpl (Plane *pl, Point *pt1)
 
int UT3D_pl_plcoe (Plane *pl, polcoeff_d3 *co)
 
int UT3D_plcoe_pl (polcoeff_d3 *co, Plane *pl)
 
void UT3D_pl_p (Plane *pl)
 
double UT3D_plg_lvTab (double *lvTab, Point *pta, int ptNr)
 
int UT3D_pta_plg (int *ptNr, Point *pta, CurvPoly *plg)
 
int UT2D_box_ini0 (Point2 *pt1, Point2 *pt2)
 
int UT2D_box_extend (Point2 *pb1, Point2 *pb2, Point2 *pt1)
 
int UT2D_rect_pts (Point2 *pmin, Point2 *pmax, int nump, Point2 *ptab)
 
int UT3D_cv_boxxy (Point *pb1, double x1, double x2, double y1, double y2)
 
int UT3D_box_extend (Point *pb1, Point *pb2, Point *pt1)
 
int UT3D_box_2pt (Point *pb1, Point *pb2, Point *pt1, Point *pt2)
 
int UT3D_box_2pttol (Point *pb1, Point *pb2, Point *pt1, Point *pt2, double tol)
 
int UT3D_box_pts (Point *pmin, Point *pmax, int nump, Point *ptab)
 
int UT3D_box_tria (Point *pb1, Point *pb2, Triangle *tr, double tol)
 
int UT3D_box_addTol (Point *pb1, Point *pb2, double tol)
 
int UT3D_ck_ptInBox (Point *p1, Point *p2, Point *px)
 
int UT3D_ckBoxinBox1 (Point *p1, Point *p2, Point *p3, Point *p4)
 
int UT3D_box_ck_intLn (Line *ln, Point *pmin, Point *pmax, double tol)
 
int UT3D_box_ck_intpl (Plane *pln, Point *p1, Point *p2, double tol)
 
int UT3D_rbox_loadxy (Point *pb1, double x1, double x2, double y1, double y2)
 
int UT3D_ptvc_intbox (Point *pl, Vector *vl, Point *bp1, Point *bp2)
 
int UT3D_ln_intbox (Line *ln1, Point *bp1, Point *bp2)
 
int UT3D_m3_inirot_angr (Mat_4x3 ma, Point *pa, Vector *va, double angr)
 
void UT3D_m3_loadpl (Mat_4x3, Plane *)
 
void UT3D_m3_load (Mat_4x3, Vector *, Vector *, Vector *)
 
void UT3D_m3_load_povxvy (Mat_4x3 ma, Point *ori, Vector *vx, Vector *vy)
 
void UT3D_m3_load_povxvz (Mat_4x3 ma, Point *ori, Vector *vx, Vector *vz)
 
void UT3D_m3_load_o (Mat_4x3, Point *)
 
int UT3D_m3_invm3 (Mat_4x3, Mat_4x3)
 
void UT3D_m3_multm3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2)
 
int UT3D_m3_tram3m3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2)
 
void UT3D_m4_init (Mat_4x4 ma)
 
void UT3D_m4_init_ori (Mat_4x4 ma, double px, double py, double pz)
 
void UT3D_m4_init_rot (Mat_4x4 ma, double angle, Vector *axis)
 
void UT3D_m4_loadpl (Mat_4x4 m1, Plane *pl1)
 
void UT3D_m4_load_o (Mat_4x4 ma, Point *ori)
 
void UT3D_m4_addrot (Mat_4x4 mo, Mat_4x4 ma, Mat_4x4 mb)
 
void UT3D_m4_addtra (Mat_4x4 ma, double px, double py, double pz)
 
double UT3D_sbs_ck_planar (SurBSpl *su1)
 
double UT3D_sru_ck_planar (ObjGX *ru1)
 
double UTP_db_comp_0 (double)
 
void UT2D_vc_pt (Vector2 *, Point2 *)
 UT2D_vc_pt 2D-Vector from 0,0 -> point. More...
 
void UT2D_vc_div_d (Vector2 *, Vector2 *, double)
 
void UT3D_vc_pt3db (Vector *, Point *, double, double, double)
 UT3D_vc_pt3db Vector from point p1 to point from 3 doubles. More...
 
void UT3D_vc_div_d (Vector *, Vector *, double)
 UT3D_vc_div_d divide vector. More...
 
int UT3D_comp2pt (Point *, Point *, double)
 UT3D_comp2pt compare 2 points with tolerance. More...
 
void ODB_set_odb (ObjDB *odb, int oTyp, long oDbi)
 

Variables

double UT_TOL_pt
 identical Points-tolerence More...
 
double UT_TOL_cv
 max deviation from curve (distance analyticalCurve -> Curvepoint) More...
 
double UT_TOL_ln
 max deviation of a point from a line More...
 
double UT_DISP_cv
 max deviation from curve (distance analyticalCurve -> displayPolygon) More...
 
double UT_DISP_ln
 length of construction-lines More...
 
double UT_TOL_min0
 
double UT_TOL_min1
 
double UT_TOL_min2
 
double UT_TOL_PAR
 tolerance for parallelism More...
 
double UT_TOL_Ang1
 tolerance for Angle 0.01 degree More...
 
double UT_TOL_Ang2
 tolerance for Angle 0.1 degree More...
 
const double UT_VAL_MIN
 
const double UT_VAL_MAX
 
const double UT_DB_LEER
 
const double UT_DB_NULL
 
const int UT_INT_MAX
 
const char UT_CHR_NULL
 
const Point2 UT2D_PT_NUL
 
const Point UT3D_PT_NUL
 
const Vector2 UT2D_VECTOR_NUL
 
const Vector2 UT2D_VECTOR_X
 
const Vector2 UT2D_VECTOR_Y
 
const Vector UT3D_VECTOR_NUL
 
const Vector UT3D_VECTOR_X
 
const Vector UT3D_VECTOR_Y
 
const Vector UT3D_VECTOR_Z
 
const Vector UT3D_VECTOR_IX
 
const Vector UT3D_VECTOR_IY
 
const Vector UT3D_VECTOR_IZ
 
const Mat_3x3 UT3D_MAT_3x3
 
const Mat_4x3 UT3D_MAT_4x3
 
const Mat_4x4 UT3D_MAT_4x4
 

Macro Definition Documentation

#define RAD_360   6.2831853071795862319

360 Grad

#define RAD_270   4.7123889803846896739

270 Grad

#define RAD_225   3.92699081698724151736

225 Grad

#define RAD_180   3.14159265358979323846

180 Grad

#define RAD_135   2.3561944901923448368

135 Grad

#define RAD_120   2.0943951023931953735

120 Grad

#define RAD_90   1.5707963267948965579

90 Grad

#define RAD_60   1.0471975511965976313

60 Grad

#define RAD_45   0.7853981633974482789

45 Grad

#define RAD_30   0.5235987755982988156

30 Grad

#define RAD_10   0.174532925199432954

10 Grad

#define RAD_1   0.0174532925199432954

1 Grad

#define RAD_01   0.0017453292519943295

0.1 Grad

#define RAD_1_360   0.15915494309189534561

1 / 6.28

#define SR_3   1.7320508075688772

SQRT(3)

#define SR_2   1.4142135623730951

SQRT(2)

#define SR_PI   1.7724538509055159

SQRT(PI) = SQRT(RAD_180)

#define CCW   1

counterclockwise

#define CW   -1

clockwise

#define NOT   !
#define YES   0

FALSE.

#define NO   1

TRUE.

#define ON   0

FALSE.

#define OFF   1

TRUE.

#define LIMITED   0
#define UNLIMITED   1
#define UT_BEZDEG_MAX   50

maximal degree of Bezier curve

#define ATT_BIT_ABS   1

das Absolut-Bit; Achtung: 0=ON=absolut, 1=relativ.

#define ATT_BIT_LIM   2

Limited; 0=On; 2=unbegrenzte Linie/Vollkreis.

#define OBJ_SIZ_MAX   160

OBJ_SIZ_MAX max. obj-size (for get, copy ..)

#define IABS (   i)    (((i)<0)?-(i):(i))

abs(int); always positive

#define ISIGN (   i)    ((i>=0)?(1):(-1))

sign of int; +1 or -1

#define ICHG01 (   i)    (((i)>0)?(0):(1))

change 0 -> 1, 1 -> 0; i1 = ICHG01 (i1);

#define ICHG0x1 (   ii)    ((ii * -1) - 1)
#define IMIN (   x,
 
)    (((x)<(y))?(x):(y))

IMIN: return the smaller of 2 values IMIN (val2,val2) return val1 if val1<val2 else return val2

#define IMAX (   x,
 
)    (((x)>(y))?(x):(y))

IMAX: return the bigger of 2 values IMAX (val1,val2) return val1 if val1>val2 else return val2

#define ILIM01 (   ii)    (((ii) > 0)?1:0)

ILIM01 returns 0 (ii <= 0) or 1 (ii >= 1)

#define ILIMm10 (   ii)    (((ii) < 0)?-1:0)

ILIM0x1 returns 0 (ii >= 0) or -1 (ii <= -1)

#define ILIM0X (   x,
  hi 
)    (((x)>(hi))?(hi):(((x)<0)?0:(x)))

ILIM0X returns x = between 0 and hi.

#define ILIM2 (   x,
  lo,
  hi 
)    (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))

ILIM2 returns x = between lo and hi.

ii = ILIM2 (i1, 10, 20);
returns 10 if i1<10; else returns 20 if i1>20; else returns i1.
#define ILIMCK1 (   x,
  lim 
)    (((x)>(lim))?(1):(((x)<(0))?(1):(0)))
ii = ILIM2 (i1, 10, 20);
returns 10 if i1<10; else returns 20 if i1>20; else returns i1.

ILIMCK1 check if x is between 0 and lim

returns 0 if ix is between 0 and lim; else 1.
ii = ILIMCK1 (x, 10);
#define ILIMCK2 (   x,
  lo,
  hi 
)    (((x)>(hi))?(1):(((x)<(lo))?(1):(0)))

ILIMCK2 check if x is between hi and lo

returns 0 if ix is between iHi and iLo; else 1.
lo hi must be ascending. For int and double.
ii = ILIMCK2 (x, 10, 20);
#define I_XOR_2I (   i1,
  i2 
)    i1 ^ i2

I_XOR_2I XOR exclusive or;

0,0 -> 0; printf(" %d\n",I_XOR_2I(0,0));
0,1 -> 1;
1,0 -> 1;
1,1 -> 0;
#define UTN_LIMCK__ (   x,
  v1,
  v2 
)
Value:
(((v1)<(v2))\
?(((x)>(v2))?(1):(((x)<(v1))?(1):(0)))\
:(((x)>(v1))?(1):(((x)<(v2))?(1):(0))))

UTN_LIMCK__ check if x is between v1 and v2

returns 0 if x is between v1 and v2; else 1 (not between v1 and v2).
lo hi can be ascending or descending. For int and double.
d1 = UTN_LIMCK__ (x, 1., 2.);
#define ICHAR (   x)    ((x) & 15)

char –> int; eg get 1 from '1' same as (int = charDig - 48) or (int = charDig - '0')

#define UTI_iNr_chrNr (   i1)    (((i1) >> 2) + 1)

UTI_iNr_chrNr give nr of ints for n characters (not including \0)

makes 2 from 4 (4 chars + \0 needs 2 ints to store in int-words)
#define FDABS (   df)    ((df>=0.f)?(df):(-df))

FDABS absolute value of float.

#define DMIN (   x,
 
)    (((x)<(y))?(x):(y))
#define DMAX (   x,
 
)    (((x)>(y))?(x):(y))
#define DLIM01 (   dd)    ((dd >= 0.)?0:1)

DLIM01 0 if (d1 >= 0.); 1 if (d1 < 0.)

#define DLIM2 (   x,
  lo,
  hi 
)    (((x)>(hi))?(hi):(((x)<(lo))?(lo):(x)))

DLIM2 returns x = between lo and hi.

i1 = DLIM01 (d1);
returns 0 if (d1 >= 0.); else returns 1 if (d1 < 0.)
#define DSIGN (   d)    ((d>=0.)?(1):(-1))

sign of double; +1 or -1

di = DLIM2 (d1, 0., 10.);
returns 0 if d1<0; else returns 10 if d1>10; else returns d1.
#define DSIGTOL (   d,
 
)    ((d>t)?(1):((d<-(t))?(-1):(0)))

d>t=1; d<-t=-1; else 0

#define ACOS (   dCos)    ((dCos>=1.)?(0.):((dCos<=-1.)?(RAD_180):acos(dCos)))
#define UT_RADIANS (   angDeg)    ((angDeg)*(RAD_1))

UT_RADIANS radians from degrees.

#define UT_DEGREES (   angRad)    ((angRad)/(RAD_1))

UT_DEGREES degrees from radians.

#define UT3D_vc_crossprod2vc   UT3D_vc_perp2vc
#define UT2D_acos_innerprod2vc   UT2D_acos_2vc
#define UTP_comp_0 (   db)    (fabs(db) < UT_TOL_min1)

UTP_comp_0 compare double (double == 0.0 + - UT_TOL_min1)

Retcode 0: db <> 0.0
1: db = 0.0
UTP_comp_0 (1.); // returns 0 (false, not equal to 0.0)
UTP_comp_0 (0.); // returns 1 (true, is equal 0)
see also UTP_db_comp_0
#define UTP_comp2db (   d1,
  d2,
  tol 
)    (fabs(d2-d1) < (tol))

UTP_comp2db compare 2 doubles (with tolerance)

Retcode 0 = Differenz der Werte > tol - different
Retcode 1 = Differenz der Werte < tol - ident
#define UTP_px_paramp0p1px (   p0,
  p1,
  par 
)    ((p1) - (p0)) * (par) + (p0);

UTP_px_paramp0p1px Zahl aus p0, p1 und Parameterwert.

Example: p0=5, p1=10, par=0.5; retVal=7.5.
#define UTP_db_comp_0 (   d1)    ((fabs(d1) < UT_TOL_min1) ? 0.0 : d1)

UTP_db_comp_0 if fabs(d1) < UT_TOL_min1) d1 = 0.;.

#define BIT_SET (   i,
 
)    (i)|=(b)

BIT_SET set bits; BITSET(data,value) data: byte|short|int|long data,value: value of bit to set (1|2|4..)

#define BIT_CLR (   i,
 
)    (i)&=~(b)

BIT_CLR clear bits; BITCLR(data,value) data: byte|short|int|long data,value: value of bit to test (1|2|4..) Example: BITCLR(i1,3); // clear bit-0 and bit-1 of i1

#define BIT_GET (   i,
 
)    ((i)&(b))

BIT_GET filter bits; BITGET(data,value) data: byte|short|int|long to test data,value: value of bit to test (1|2|4..) RetCod: 0 (not set) or value (set)

#define UT2D_lenq_vc (   vc)    ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy)

UT2D_lenq_vc quadr.length of 2D-vector.

#define UT2D_len_vc (   vc)    (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy))

UT2D_len_vc length of 2D-vector.

#define UT2D_lenS_2pt (   p1,
  p2 
)    (fabs((p2)->x - (p1)->x) + fabs((p2)->y - (p1)->y))

UT2D_lenS_2pt dx+dy-distance point-point.

#define UT2D_lenS_vc (   vc1)    (fabs((vc1)->dx) + fabs((vc1)->dy))

UT2D_lenS_vc dx+dy-distance 2D-vector.

#define UT2D_lenq_2pt (   lq,
  p1,
  p2 
)
Value:
{\
double _dx = (p2)->x - (p1)->x;\
double _dy = (p2)->y - (p1)->y;\
*(lq) = _dx * _dx + _dy * _dy;}

UT2D_lenq_2pt quadr. distance pt - pt.

#define UT2D_comp2pt (   p1,
  p2,
  tol 
)
Value:
((fabs((p2)->x - (p1)->x) < tol) &&\
(fabs((p2)->y - (p1)->y) < tol))

UT2D_comp2pt compare 2 points.

RC = 0: Punkte nicht gleich; Abstand > tol.
RC = 1: Punkte sind gleich; Abstand < tol.
#define UT2D_swap2pt (   p1,
  p2 
)
Value:
{\
Point2 p3 = *(p1); *(p1) = *(p2); *(p2) = p3;}

UT2D_swap2pt swap 2 2D-points.

see also MEM_swap_
#define UT2D_pt_2db (   pt2,
  dx,
  dy 
)
Value:
{\
(pt2)->x = dx; (pt2)->y = dy;}

UT2D_pt_2db 2D-Point < 2 doubles (x, y)

#define UT2D_pt_pt3 (   pt3)    (*(Point2*)pt3)

UT2D_pt_pt3 2D-Point = 3D-Point.

#define UT2D_pt_pt (   pt2,
  pt3 
)    (memcpy((pt2), (pt3), sizeof(Point2)))

UT2D_pt_pt 2D-Point = 3D-Point.

#define UT2D_pt_pt3bp (   p2o,
  p3i,
  bpi 
)
Value:
{\
if (bpi == BCKPLN_XY) {(p2o)->x = (p3i)->x; (p2o)->y = (p3i)->y;} \
else if(bpi == BCKPLN_XZ) {(p2o)->x = (p3i)->x; (p2o)->y = (p3i)->z;} \
else if(bpi == BCKPLN_YZ) {(p2o)->x = (p3i)->y; (p2o)->y = (p3i)->z;}}
#define BCKPLN_XY
Z-Vec BCKVEC_Z.
Definition: AP_types.h:366
#define BCKPLN_XZ
Y-Vec BCKVEC_Y.
Definition: AP_types.h:367
#define BCKPLN_YZ
X-Vec BCKVEC_X.
Definition: AP_types.h:368

UT2D_pt_pt3bp 2D-Point = 3D-Point on Backplane.

#define UT2D_pt_addpt (   po,
  p1 
)
Value:
{\
(po)->x = (po)->x + (p1)->x;\
(po)->y = (po)->y + (p1)->y;}

UT2D_pt_addpt Add two points: po += p1.

#define UT2D_pt_sub_pt (   po,
  p1,
  p2 
)
Value:
{\
(po)->x = (p1)->x - (p2)->x;\
(po)->y = (p1)->y - (p2)->y;}

UT2D_pt_sub_pt subtract point p2 from p1.

#define UT2D_pt_opp2pt (   po,
  p1,
  p2 
)
Value:
{\
(po)->x = (p1)->x - ((p2)->x - (p1)->x);\
(po)->y = (p1)->y - ((p2)->y - (p1)->y);}

UT2D_pt_opp2pt opposite point (p1 = center)

#define UT2D_pt_mid2pt (   po,
  p1,
  p2 
)
Value:
{\
(po)->x = ((p1)->x + (p2)->x) / 2.0;\
(po)->y = ((p1)->y + (p2)->y) / 2.0;}

UT2D_pt_mid2pt midpoint between 2 points.

#define UT2D_pt_traptvc (   po,
  pi,
  vc 
)
Value:
{\
(po)->x = (pi)->x + (vc)->dx;\
(po)->y = (pi)->y + (vc)->dy;}

UT2D_pt_traptvc 2D Point = Point + Vector.

#define UT3D_pt_multvc (   po,
  pi,
  vi,
 
)
Value:
{\
(po)->x = (vi)->dx * (d) + (pi)->x;\
(po)->y = (vi)->dy * (d) + (pi)->y;\
(po)->z = (vi)->dy * (d) + (pi)->z;}

UT2D_pt_multvc po = pi + (vi * d) MULT.

#define UT2D_slen_vc_vcNo   UT2D_skp_2vc
UT2D_slen_vc_vcNo signed length of vector on norm.vector
vnab must be normalized; else returns (slen * length_of_vAB)
C
. | A-C = vector vac
. | A-B = vector vnab (normalized)
. |
. |
A-----_--+---------B
|--slen--|
Input:
(Vector2)vAC;
(Vector2)vAB; if not normalized: returns (slen * length_of_vab)
Returns:
(double)slen; negative if C is left of A-B
#define UT2D_acos_2vc   UT2D_skp_2vc

UT2D_skp_2vc cos of opening angle of 2 vecs (dot=scalarprod) DOT.

#define UT2D_skp_2vc (   v1,
  v2 
)    ((v1)->dx * (v2)->dx + (v1)->dy * (v2)->dy)
#define UT2D_sar_2vc (   v1,
  v2 
)    ((v1)->dx * (v2)->dy - (v1)->dy * (v2)->dx)

UT2D_sar_2vc signed area of 2 vectors (scalarprod) sign gives side UT2D_crossprod_2vc crossprod of 2 2D-Vectors

#define UT2D_acos_vc2pt   UT2D_skp_vc2pt

UT3D_acos_vc2pt cos of opening angle of vec-(pt-pt) (dot=scalarprod) DOT.

#define UT2D_skp_vc2pt (   v1,
  p1,
  p2 
)
Value:
((v1)->dx * ((p2)->x - (p1)->x) +\
(v1)->dy * ((p2)->y - (p1)->y))
#define UT2D_vc_pt (   vc,
  pt 
)    (memcpy((vc), (pt), sizeof(Point2)))
#define UT2D_vc_vc3 (   vc2,
  vc3 
)    (memcpy((vc2), (vc3), sizeof(Vector2)))

UT2D_vc_vc3 2D-Vector from 3D-Vector.

#define UT2D_vc_2db (   vc,
  dx,
  dy 
)
Value:
{\
(vc)->dx = (dx);\
(vc)->dy = (dy);}

UT2D_vc_2db 2D-Vector < 2 doubles (x, y)

#define UT2D_vc_invert (   vo,
  vi 
)
Value:
{\
(vo)->dx = -(vi)->dx;\
(vo)->dy = -(vi)->dy;}

UT2D_vc_invert 2D-Vector invert (change direction)

#define UT2D_vc_add2vc (   v3,
  v1,
  v2 
)
Value:
{\
(v3)->dx = (v1)->dx + (v2)->dx;\
(v3)->dy = (v1)->dy + (v2)->dy;}

UT2D_vc_add2vc v3 = v1 + v2 ADD.

#define UT2D_vc_sub2vc (   v3,
  v1,
  v2 
)
Value:
{\
(v3)->dx = (v1)->dx - (v2)->dx;\
(v3)->dy = (v1)->dy - (v2)->dy;}

UT2D_vc_sub2vc v3 = v1 - v2 SUB.

#define UT2D_vc_div_d (   vo,
  vi,
 
)
Value:
{\
(vo)->dx = (vi)->dx / (d);\
(vo)->dy = (vi)->dy / (d);}

UT2D_vc_div_d divide vector.

#define UT2D_vc_multvc (   vo,
  vi,
 
)
Value:
{\
(vo)->dx = (vi)->dx * (d);\
(vo)->dy = (vi)->dy * (d);}

UT2D_vc_multvc vo = vi * d MULT.

#define UT2D_vc_perpvc (   vo,
  vi 
)
Value:
{\
double _dx = (vi)->dx; (vo)->dx = -(vi)->dy; (vo)->dy = _dx;}

UT2D_vc_perpvc vector = perpendic. to vector ( + 90 degrees)

#define UT2D_vc_perp2pt (   vo,
  p1,
  p2 
)
Value:
{\
(vo)->dx = (p1)->y - (p2)->y;\
(vo)->dy = (p2)->x - (p1)->x;}

UT2D_vc_perp2pt vector = perpendic. to Line ( + 90 degrees)

#define UT2D_vc_angr (   vc,
  angr 
)
Value:
{\
(vc)->dx = cos(angr);\
(vc)->dy = sin(angr);}

UT2D_vc_angr 2DVector = angle (radians)

#define UT2D_vc_vc3bp (   v2o,
  v3i,
  bpi 
)
Value:
{\
if (bpi == BCKPLN_XY) {(v2o)->dx = (v3i)->dx; (v2o)->dy = (v3i)->dy;} \
else if(bpi == BCKPLN_XZ) {(v2o)->dx = (v3i)->dx; (v2o)->dy = (v3i)->dz;} \
else if(bpi == BCKPLN_YZ) {(v2o)->dx = (v3i)->dy; (v2o)->dy = (v3i)->dz;}}
#define BCKPLN_XY
Z-Vec BCKVEC_Z.
Definition: AP_types.h:366
#define BCKPLN_XZ
Y-Vec BCKVEC_Y.
Definition: AP_types.h:367
#define BCKPLN_YZ
X-Vec BCKVEC_X.
Definition: AP_types.h:368

UT2D_vc_vc3bp 2D-Vector = 3D-Vector on Backplane.

#define UT2D_vc_2pt (   vc,
  p1,
  p2 
)
Value:
{\
(vc)->dx = (p2)->x - (p1)->x;\
(vc)->dy = (p2)->y - (p1)->y;;}

UT2D_vc_2pt 2D-Vector = 2D-Point -> 2D-Point.

#define UT2D_vc_ln (   vc,
  ln 
)
Value:
{\
(vc)->dx = (ln)->p2.x - (ln)->p1.x;\
(vc)->dy = (ln)->p2.y - (ln)->p1.y;}

UT2D_vc_ln 2D-Vector from 2D-Line.

#define UT2D_ln_ptpt (   ln1,
  pt1,
  pt2 
)
Value:
{\
(ln1)->p1 = *(pt1);\
(ln1)->p2 = *(pt2);}
static Point pt1
Definition: DemoPlugin_Dialog.c:85
static Line ln1
Definition: DemoPlugin_Dialog.c:86
#define UT2D_ln_ptvc (   ln,
  pt,
  vc 
)
Value:
{\
(ln)->p1 = *(pt);\
(ln)->p2.x = (pt)->x + (vc)->dx;\
(ln)->p2.y = (pt)->y + (vc)->dy;}

UT2D_ln_ptvc 2D-Line from 2D-point and 2D-vector.

#define UT2D_ln_ln3 (   ln2,
  ln3 
)
Value:
{\
(ln2)->p1.x = (ln3)->p1.x;\
(ln2)->p1.y = (ln3)->p1.y;\
(ln2)->p2.x = (ln3)->p2.x;\
(ln2)->p2.y = (ln3)->p2.y;}

UT2D_ln_ln3 2D-Line = 3D-Line.

#define UT2D_len_cia (   radius,
  ango 
)    (fabs((radius)*(ango)))

UT2D_len_cia length arc (from rad & angle)

#define UT2D_ln_inv (   ln)
Value:
{\
Point2 _pt = (ln)->p1; (ln)->p1 = (ln)->p2; (ln)->p2 = _pt;}

UT2D_ln_inv Invert 2D-Line.

#define UT3D_lenq_vc (   vc)    ((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz)

UT3D_lenq_vc quadr.length of 3D-vector.

#define UT3D_len_vc (   vc)    (sqrt((vc)->dx*(vc)->dx + (vc)->dy*(vc)->dy + (vc)->dz*(vc)->dz))

UT3D_len_vc length of 3D-vector.

#define UT3D_skp_2vc (   v1,
  v2 
)    ((v1)->dx*(v2)->dx + (v1)->dy*(v2)->dy + (v1)->dz*(v2)->dz)

UT3D_skp_2vc scalarprod of 2 vecs (dotprod,Skalarprod)

UT3D_acos_2vc cos of opening angle of 2 vecs; see double UT3D_acos_2vc
get opening-angle: oa = ACOS(UT3D_acos_2vc (&v1, &v2));
test if 2 vectors normal: if(fabs(UT3D_skp_2vc(&v1,&v2)) < UT_TOL_min1) yes
if (length of v1 = 1): signed length of v2 along v1 (see UT3D_slen_projvcvc)
/|
V2/ |
/ |
/ |
x--------+------> V1
<---rc--->
#define UT3D_skp_2ptvc (   p1,
  p2,
  v1 
)
Value:
((v1)->dx * ((p2)->x - (p1)->x) +\
(v1)->dy * ((p2)->y - (p1)->y) +\
(v1)->dz * ((p2)->z - (p1)->z))
#define UT3D_acos_2vc   UT3D_skp_2vc

UT3D_acos_vc2pt cos of opening angle of vec-(pt-pt) (dot=scalarprod) DOT.

#define UT3D_acos_vc2pt   UT3D_skp_2ptvc
#define UT3D_pt_NEW   {UT_VAL_MAX, 0., 0.}

UT3D_pt_NEW create empty point (UT3D_pt_isFree)

#define UT3D_pt_setFree (   obj)    (obj)->x = UT_VAL_MAX

UT3D_pt_setFree set point not valid (not initialized)

#define UT3D_pt_isFree (   obj)    ((obj)->x == UT_VAL_MAX)
0 = point is valid )(pt->x != FLT_32_MAX)
1 = point is free (NEW, not set).
#define UT3D_pt_pt (   pt3,
  pt2,
  zVal 
)
Value:
{\
memcpy((pt3), (pt2), sizeof(Point)); (pt3)->z = (zVal);}
3D-point, Typ_PT
Definition: ut_geo.h:195

UT3D_pt_ptz 3D-Point = 2D-Point + Z-Val.

#define UT3D_pt_multpt (   po,
  pi,
 
)
Value:
{\
(po)->x = (pi)->x * (d);\
(po)->y = (pi)->y * (d);\
(po)->z = (pi)->z * (d);}

UT3D_pt_multpt po = pi * d.

#define UT3D_pt_LinComb2Pts (   po,
  a1,
  p1,
  a2,
  p2 
)
Value:
{\
(po)->x = a1 * (p1)->x + a2 * (p2)->x;\
(po)->y = a1 * (p1)->y + a2 * (p2)->y;\
(po)->z = a1 * (p1)->z + a2 * (p2)->z;}

UT3D_pt_LinComb2Pts Linear combination of two points:

po = a1 * p1 + a2 * p2
#define UT3D_pt_addpt (   po,
  p1 
)
Value:
{\
(po)->x += (p1)->x;\
(po)->y += (p1)->y;\
(po)->z += (p1)->z;}

UT3D_pt_addpt Add point: po += p1.

#define UT3D_pt_add_pt2 (   po,
  p1 
)
Value:
{\
(po)->x += (p1)->x;\
(po)->y += (p1)->y;}

UT3D_pt_add_pt2 Add 2D-point: po += p1.

#define UT3D_pt_add_vc__ (   pt,
  vc 
)
Value:
{\
(pt)->x += (vc)->dx;\
(pt)->y += (vc)->dy;\
(pt)->z += (vc)->dz;}

UT3D_pt_add_vc__ add vector: pt += vc.

#define UT3D_pt_add_vc_rev (   pt,
  vc 
)
Value:
{\
(pt)->x -= (vc)->dx;\
(pt)->y -= (vc)->dy;\
(pt)->z -= (vc)->dz;}

UT3D_pt_add_vc_rev add vector: pt -= vc.

#define UT3D_pt_add_vc_par (   pt,
  vc,
  lpar 
)
Value:
{\
(pt)->x += (vc)->dx * lpar;\
(pt)->y += (vc)->dy * lpar;\
(pt)->z += (vc)->dz * lpar;}

UT3D_pt_add_vc_par add (vector * lpar) po += (vc * lpar)

#define UT3D_pt_add_3vc_3par (   pt,
  v1,
  v2,
  v3,
  lp1,
  lp2,
  lp3 
)
Value:
{\
(pt)->x += (v1)->dx * lp1 + (v2)->dx * lp2 + (v3)->dx * lp3;\
(pt)->y += (v1)->dy * lp1 + (v2)->dy * lp2 + (v3)->dy * lp3;\
(pt)->z += (v1)->dz * lp1 + (v2)->dz * lp2 + (v3)->dz * lp3;}

see also UT3D_pt_traptmultvc

UT3D_pt_add_3vc_3par add (vector * lpar) po += (vc * lpar)

  • eg transport point (lp1/lp2/lp3) into refsys v1/v2/v3
#define UT3D_pt_add2pt (   po,
  p1,
  p2 
)
Value:
{\
(po)->x = (p1)->x + (p2)->x;\
(po)->y = (p1)->y + (p2)->y;\
(po)->z = (p1)->z + (p2)->z;}

see also UT3D_pt_trapt3vc3len

UT3D_pt_add2pt Add two points: po = p1 + p2

#define UT3D_pt_sub_pt3 (   pto,
  pti 
)
Value:
{\
(pto)->x -= (pti)->x;\
(pto)->y -= (pti)->y;\
(pto)->z -= (pti)->z;}

UT3D_pt_sub_pt3 subtract point po = p1 - p2.

#define UT3D_pt_sub_pt2 (   po,
  p1,
  p2 
)
Value:
{\
(po)->x = (p1)->x - (p2)->x;\
(po)->y = (p1)->y - (p2)->y;}

UT3D_pt_sub_pt2 subtract 2D-point po = p1 - p2.

#define UT3D_swap2pt (   p1,
  p2 
)
Value:
{\
Point p3 = *(p1); *(p1) = *(p2); *(p2) = p3;}

UT3D_swap2pt swap 2 3D-points.

see also MEM_swap_
#define UT3D_pt_vc (   pt,
  vc 
)    (memcpy((pt), (vc), sizeof(Point)))

UT3D_pt_vc Point = Vector.

#define UT3D_pt_tra_pt_dx (   po,
  pi,
  dx 
)    *po = *pi; (po)->x += dx

UT3D_pt_tra_pt_dx Point = Point + dx.

#define UT3D_pt_tra_pt_dy (   po,
  pi,
  dy 
)    *po = *pi; (po)->y += dy

UT3D_pt_tra_pt_dy Point = Point + dy.

#define UT3D_pt_traptvc (   po,
  pi,
  vc 
)
Value:
{\
(po)->x = (pi)->x + (vc)->dx;\
(po)->y = (pi)->y + (vc)->dy;\
(po)->z = (pi)->z + (vc)->dz;}

UT3D_pt_traptvc Point = Point + Vector.

#define UT3D_pt_traptivc (   po,
  pi,
  vc 
)
Value:
{\
(po)->x = (pi)->x - (vc)->dx;\
(po)->y = (pi)->y - (vc)->dy;\
(po)->z = (pi)->z - (vc)->dz;}

UT3D_pt_traptivc Point = Point - Vector.

#define UT3D_pt_traptmultvc (   po,
  pi,
  vc,
  fac 
)
Value:
{\
(po)->x = (pi)->x + (vc)->dx * fac; \
(po)->y = (pi)->y + (vc)->dy * fac;\
(po)->z = (pi)->z + (vc)->dz * fac;}

UT3D_pt_traptmultvc point = point + (vector * factor) (INLINE)

#define UT3D_pt_evparptcv (   pto,
  par,
  ptl,
  vcl 
)
Value:
{\
(pto)->x = (ptl)->x + (vcl)->dx * (par);\
(pto)->y = (ptl)->y + (vcl)->dy * (par);\
(pto)->z = (ptl)->z + (vcl)->dz * (par);}

UT3D_pt_evparptcv evaluate param.point on line from point+vector.

#define u3d_LinComb2Pts (   po,
  a1,
  p1,
  a2,
  p2 
)
Value:
{\
(po)->x = a1 * (p1)->x + a2 * (p2)->x;\
(po)->y = a1 * (p1)->y + a2 * (p2)->y;\
(po)->z = a1 * (p1)->z + a2 * (p2)->z;}

u3d_LinComb2Pts Linear combination of two points:

po = a1 * p1 + a2 * p2
#define UT3D_vc_isFree (   obj)    (obj)->dx == UT_VAL_MAX

UT3D_vc_isFree check if vector is valid.

returns 0 if vector is valid (not free)
returns 1 if vector is free (after calling UT3D_vc_setFree)
#define UT3D_vc_setFree (   obj)    (obj)->dx = UT_VAL_MAX

UT3D_vc_setFree set vector not valid (not initialized)

#define UT3D_vc_vc2 (   v3o,
  v2i 
)
Value:
{\
(v3o)->dx = (v2i)->dx;\
(v3o)->dy = (v2i)->dy;\
(v3o)->dz = UT_DB_NULL;}
const double UT_DB_NULL
Definition: ut_const.h:39

UT3D_vc_vc2 3D-vector = 2D-vector.

#define UT3D_vc_3db (   vc,
  x,
  y,
 
)
Value:
{\
(vc)->dx = (x);\
(vc)->dy = (y);\
(vc)->dz = (z);}

UT3D_vc_3db Vector < 3 doubles (x, y, z)

#define UT3D_vc_pt (   vc,
  pt 
)    (memcpy((vc), (pt), sizeof(Point)))

UT3D_vc_pt Vector = Point.

#define UT3D_vc_pt3db (   vc,
  p1,
  px,
  py,
  pz 
)
Value:
{\
(vc)->dx = (px) - (p1)->x;\
(vc)->dy = (py) - (p1)->y;\
(vc)->dz = (pz) - (p1)->z;}
#define UT3D_vc_2pt (   vc,
  p1,
  p2 
)
Value:
{\
(vc)->dx = (p2)->x - (p1)->x;\
(vc)->dy = (p2)->y - (p1)->y;\
(vc)->dz = (p2)->z - (p1)->z;}

UT3D_vc_2pt Vector = Point -> Point.

#define UT3D_vc_perpTria (   vn,
  tri 
)    UT3D_vc_perp3pt ((vn),(tri)->pa[0],(tri)->pa[1],(tri)->pa[2])

UT3D_vc_perpTria vector = perpendic. to Triangle (crossprod)

#define UT3D_vc_invert (   vio,
  vii 
)
Value:
{\
(vio)->dx = -(vii)->dx;\
(vio)->dy = -(vii)->dy;\
(vio)->dz = -(vii)->dz;}

UT3D_vc_invert invert Vector.

#define UT3D_vc_addvc (   vo,
  vi 
)
Value:
{\
(vo)->dx += (vi)->dx;\
(vo)->dy += (vi)->dy;\
(vo)->dz += (vi)->dz;}

UT3D_vc_addvc vo += vi.

#define UT3D_vc_add2vc (   v3,
  v1,
  v2 
)
Value:
{\
(v3)->dx = (v1)->dx + (v2)->dx;\
(v3)->dy = (v1)->dy + (v2)->dy;\
(v3)->dz = (v1)->dz + (v2)->dz;}

UT3D_vc_add2vc v3 = v1 + v2 ADD.

#define UT3D_vc_addvc2pt (   v3,
  v1,
  p1,
  p2 
)
Value:
{\
(v3)->dx = (v1)->dx + (p2)->x - (p1)->x;\
(v3)->dy = (v1)->dy + (p2)->y - (p1)->y;\
(v3)->dz = (v1)->dz + (p2)->z - (p1)->z;}

UT3D_vc_addvc2pt v3 = v1 + (p2-p1) Vector + (Vector from 2 points)

#define UT3D_vc_add3vc (   vo,
  v1,
  v2,
  v3 
)
Value:
{\
(vo)->dx = (v1)->dx + (v2)->dx + (v3)->dx;\
(vo)->dy = (v1)->dy + (v2)->dy + (v3)->dy;\
(vo)->dz = (v1)->dz + (v2)->dz + (v3)->dz;}

UT3D_vc_add3vc vo = v1 + v2 + v3.

#define UT3D_vc_sub2vc (   v3,
  v1,
  v2 
)
Value:
{\
(v3)->dx = (v1)->dx - (v2)->dx;\
(v3)->dy = (v1)->dy - (v2)->dy;\
(v3)->dz = (v1)->dz - (v2)->dz;}

UT3D_vc_sub2vc v3 = v1 - v2 SUB.

#define UT3D_vc_div_d (   vo,
  vi,
 
)
Value:
{\
(vo)->dx = (vi)->dx / (d);\
(vo)->dy = (vi)->dy / (d);\
(vo)->dz = (vi)->dz / (d);}
#define UT3D_vc_multvc (   vo,
  vi,
 
)
Value:
{\
(vo)->dx = (vi)->dx * (d);\
(vo)->dy = (vi)->dy * (d);\
(vo)->dz = (vi)->dz * (d);}

UT3D_vc_multvc vo = vi * d MULT.

#define UT3D_vc_merge2vc (   vo,
  v1,
  v2 
)
Value:
{\
(vo)->dx = ((v1)->dx + (v2)->dx) / 2.;\
(vo)->dy = ((v1)->dy + (v2)->dy) / 2.;\
(vo)->dz = ((v1)->dz + (v2)->dz) / 2.;}

UT3D_vc_merge2vc merge 2 vectors vo = (v1 + v2) / 2.

#define UT3D_comp2pt (   p1,
  p2,
  tol 
)
Value:
((fabs((p2)->x - (p1)->x) < tol) &&\
(fabs((p2)->y - (p1)->y) < tol) &&\
(fabs((p2)->z - (p1)->z) < tol))
#define UT3D_ln_inv (   ln)    {Point _pt = (ln)->p1; (ln)->p1 = (ln)->p2; (ln)->p2 = _pt;}

UT3D_ln_inv Invert 3D-Line.

#define UT3D_ln_ptpt (   ln1,
  pt1,
  pt2 
)
Value:
{(ln1)->p1 = *(pt1);\
(ln1)->p2 = *(pt2);}
static Point pt1
Definition: DemoPlugin_Dialog.c:85
static Line ln1
Definition: DemoPlugin_Dialog.c:86

UT3D_ln_ptpt Line = Point, Point.

#define UT3D_ln_ptvc (   ln,
  pt,
  vc 
)
Value:
{(ln)->p1 = *(pt);\
(ln)->p2.x = (pt)->x + (vc)->dx;\
(ln)->p2.y = (pt)->y + (vc)->dy;\
(ln)->p2.z = (pt)->z + (vc)->dz;}

UT3D_ln_ptvc Line = Point, Vector.

#define UT3D_ln_ln2 (   ln3,
  ln2 
)
Value:
{(ln3)->p1.x = (ln2)->p1.x;\
(ln3)->p1.y = (ln2)->p1.y;\
(ln3)->p1.z = UT_DB_NULL;\
(ln3)->p2.x = (ln2)->p2.x;\
(ln3)->p2.y = (ln2)->p2.y;\
(ln3)->p2.z = UT_DB_NULL;}
const double UT_DB_NULL
Definition: ut_const.h:39

UT3D_ln_ln2 3D-Line from 2D-Line (Z=0)

Typedef Documentation

typedef double Mat_3x2[2][3]

Typ_M3x2.

typedef double Mat_3x3[3][3]

Typ_M3x3.

typedef double Mat_4x3[3][4]

Typ_M4x3 size 96.

typedef double Mat_4x4[4][4]

Typ_M4x4.

Function Documentation

int UTP_comp_0 ( double  )
int UTP_compdb0 ( double  ,
double   
)
UTP_compdb0 compare double mit 0.0 mit Tol.
Retcode 0: db <> 0.0 (gr. oder kl. tol)
1: db = 0.0 (innerhalb tol)
int UTP_comp2db ( double  ,
double  ,
double   
)
int UTP_comp2x2db ( double  d11,
double  d12,
double  d21,
double  d22,
double  tol 
)
UTP_comp2x2db compare 2 * 2 doubles (with tolerance)
2 * 2 Zahlen vergleichen; gleich=0; verkehrt=1; else=-1.
RetCod:
0 d11 == d21; d12 == d22; beide Paare gleich.
1 d11 == d22; d12 == d21; beide Paare gleich, aber verkehrt.
-1 d11 == d21; d21 != d22;
-2 d11 == d22; d12 != d21
ACHTUNG: d12 == d22 wird nicht getestet !
-3 beide Paare ungleich.
int UTP_db_ck_in2db ( double  v,
double  v1,
double  v2 
)
test if value of v is between v1 / v2
RC = 0: YES, v is between v1 / v2
RC = 1: NO, v is outside near v1; v2 > v1.
RC = 2: NO, v is outside near v2; v2 > v1.
RC = -1: NO, v is outside near v1; v2 < v1.
RC = -2: NO, v is outside near v2; v2 < v1.
int UTP_db_ck_in2dbTol ( double  v,
double  v1,
double  v2,
double  tol 
)
test if value of v is between v1 / v2
RC = 0: YES, v is between v1 / v2
RC = 1: NO, v is outside v1 / v2
int UTP_db_cknear_2db ( double *  db,
double *  d1,
double *  d2 
)
UTP_db_cknear_2db find nearest double out of 2 doubles
RetCod 0 = db-d1 ist smaller than db-d2
RetCod 1 = db-d2 ist smaller than db-d1
int UTP_db_cknear_ndb ( double  db1,
int  dbNr,
double *  dbTab 
)

UTP_db_cknear_ndb find nearest double out of dbTab

double UTP_min_d3 ( double *  d1,
double *  d2,
double *  d3 
)

UTP_min_d3 find minimum double of 3; returns double.

double UTP_max_d3 ( double *  d1,
double *  d2,
double *  d3 
)

UTP_max_d3 find maximum double of 3; returns double.

double UTP_db_rnd1sig ( double  )
auf 1 sig. Stelle bringen:
(0.00579, 1) -> 0.006
(0.19500, 1) -> 0.2 (gerundet !!)
(1.00500, 1) -> 1.
(167.500, 1) -> 200.
double UTP_db_rnd2sig ( double  )
auf 2 sig. Stellen runden
(0.00579, 1) -> 0.0058
(0.19500, 1) -> 0.19 (gerundet !!)
(1.00500, 1) -> 1.
(167.500, 1) -> 170.
int UT1D_ndb_npt_bp ( double *  da,
Point pa,
int  pNr,
int  bp 
)

UT1D_ndb_npt_bp copy the backplane-part of a pointTable

double UT_DEGREES ( double  )
double UT_RADIANS ( double  )
int UT2D_sidPerp_3pt ( Point2 p1,
Point2 p2,
Point2 p3 
)
UT2D_sidPerp_3pt check if p3 is in, before or behind perp-line tru p2
Ist p3 vor oder hinter der Linie, die durch p2 geht u.normal auf p1-p2 steht
RC -1 p3 liegt vor Ebene p1-p2 (vis-a-vis)
RC 0 p3 liegt genau in der Ebene
RC 1 liegt hinter Ebene p1-p2 (in der Naehe von p2)
p3 |
x |
. |
. -1 0 +1
. |
x--------------x
p1 p2
see also UT3D_acos_2vc
int UT2D_angr_set ( double *  angr)

UT2D_angr_set change to val >= 0 <= RAD_360

int UT2D_2angr_set ( double *  ang1,
double *  ang2,
int  irot 
)
UT2D_2angr_set change consecutive values from -RAD_360 to RAD_360
if irot == 0 (CCW) ang2 > ang1
if irot == 1 (CW) ang2 < ang1
double UT2D_angr_2angr ( double  ang1,
double  ang2,
int  irot 
)
UT2D_angr_2angr angle between 2 angles (opening-angle)
irot = 0 CCW
irot = 1 CW
double UT2D_angr_set_2angr ( double  as,
double  aa,
int  sr 
)
UT2D_angr_set_2angr set aa following as. Do not modify as.
as startAngle; not modified.
aa following angle; must be > as for CCW; must be < as for CW.
sr 0=CCW; 1=CW
Output:
retVal if(sr==1) then retVal > as;
else retVal < as;
as and retVal may have identical position.
Examples:
as=0.; aa=1; sr=1; retVal=-5
int UT2D_ptNr_ci ( double  rdc,
double  ao,
double  tol 
)
UT2D_ptNr_ci get nr of points for polygon from circ
Input:
rdc radius; must be pos.
ao opening angle in rad; must be pos.
tol deviation
Output:
retCod nr of points for polygon
int UT2D_solvtriri_a ( double *  a,
double  b,
double  c 
)
UT2D_solvtriri_a right-angled tri: a from sides b and c
C Der rechte Winkel liegt im Punkt C.
/ . \
/ \
b a
/ \
A -------c-------- B c = hypotenuse
a*a + b*b = c*c
a = sqrt (c*c - b*b)
Input: the length of the sides b, c.
c length of baseline, from point A to point B;
b length of side left, from point A to point C;
Output:
a length of side right, from point B to point C;
Retcodes:
0 OK
int UT2D_solvtriri_bc ( double *  ,
double *  ,
double  ,
double   
)
UT2D_solvtriri_ac right-angled tri: q and hc from sides b and c.
C Right angle is in point C
/ | \
/ | \
b hc a
/ | \
A -------c-------- B
q p
Input: the length of the sides a, b, c.
c is the baseline, from point A to point B;
b length of side left, from point A to point C;
Output:
q the length of b projected to c; (with direction - can be negativ !)
hc the length of the normal standing on c
hc parts c into q (lying under b) and p (lying under a)
Retcodes:
0 OK
-1 Error (b>c)
int UT2D_solvtri_abc ( double *  ,
double *  ,
double  ,
double  ,
double   
)
UT2D_solvtri_abc scalene tri: q and hc from sides a, b and c.
C Allgemeines Dreieck. Kein rechter Winkel.
/ | \
/ | \
b hc a
/ | \
A -------c-------- B
q p
Input: the length of the sides a, b, c.
c is the baseline, from point A to point B;
b length of side left, from point A to point C;
a length of side right, from point B to point C;
Output:
q the length of b projected to c; (with direction - can be negativ !)
hc the length of the normal standing on c
hc parts c into q (lying under b) and p (lying under a)
Retcodes:
0 - Ok.
-1 - error; c = 0.;
-2 - error; b > a + c;
-3 - error; a > b + c;
int UT2D_ckBoxinBox1 ( Point2 p1,
Point2 p2,
Point2 p3,
Point2 p4 
)
check if 2 boxes overlap
p1-p2 sind Box1, p3-p4 Box2.
ACHTUNG: p1 muss links unter p2 liegen; p3 links unter p4.
RC -1: NO, boxes do not overlap
RC 1: yes boxes overlap.
int UT2D_ckBoxinBox2 ( Point2 ,
Point2 ,
Point2 ,
Point2 ,
double   
)
check if Box2 is complete in Box1
p1-p2 sind Box1, p3-p4 Box2.
ACHTUNG: p1 muss links unter p2 liegen; p3 links unter p4.
RC -1: NO, boxes overlap
RC 1: yes, Box2 is complete inside Box1
double UT2D_slen_vc_vc__ ( Vector2 vac,
Vector2 vab 
)
UT2D_slen_vc_vc__ signed length of vector on vector
both vector need not to be normalized.
If vab = normalized use UT2D_slen_vc_vcNo.
C
. | A-C = vector vac
. | A-B = vector vab
. |
. |
A-----_--+---------B
|--slen--|
Returns:
slen; negative if C is left of A-B
double UT2D_slen_vc_vcNo ( Vector2 vac,
Vector2 vnab 
)
double UT2D_slen_pt_pt_vc__ ( Point2 pc,
Point2 pa,
Vector2 vab 
)
UT2D_slen_pt_pt_vc__ signed length of point onto vector
both vector need not to be normalized.
pc
. |
. |
. |
. |
pa--------+-----vab-->
|--slen--|
Returns:
slen; negative if C is left of A-B
double UT2D_skp_2vc ( Vector2 ,
Vector2  
)
double UT2D_skp_vc2pt ( Vector2 ,
Point2 ,
Point2  
)
double UT2D_acos_2vc ( Vector2 ,
Vector2  
)
double UT2D_sar_2vc ( Vector2 ,
Vector2  
)
double UT2D_acos_vc2pt ( Vector2 ,
Point2 ,
Point2  
)
double UT2D_crossprod_2vc ( Vector2 ,
Vector2  
)
double UT2D_angd_angr ( double  )

UT2D_angd_angr angle (degrees) = angle (radians)

double UT2D_angd_invert ( double *  andi)

UT2D_angd_invert ang(deg.) invert (change direction)

double UT2D_angr_angd ( double  )

UT2D_angr_angd angle (radians) = angle (degrees)

double UT2D_angr_triri_ab ( double  ,
double   
)
UT2D_angr_triri_ab right-angled tri: angle alfa from sides a and b.
c = hypotenuse (baseline),
b = side left,
a = side right,
the sides b - a include the right-angle.
Returns the angle alfa (in rad; which is included by the sides b and c).
double UT2D_angr_ptpt ( Point2 ,
Point2  
)

UT2D_angr_ptpt angle (radians) = pt > pt

double UT2D_angr_vc ( Vector2 )
UT2D_angr_vc angle (radians) = vector (0-360)
returns 0 - RAD_360 (PI * 2)
Example: (1,1) returns RAD_45 (0.785)
double UT2D_angr_2ln ( Line2 ,
Line2  
)

UT2D_angr_2ln angle (rad.) between 2 Lines

double UT3D_angr_vc2pt ( Point pz,
Vector vz,
Point p1,
Point p2 
)
UT3D_angr_vc2pt angle between 2 points in plane (plane from pt-vc)
get angle between lines pz-p1 and pz-p2, on a plane normal to vz.
angle is CCW, 0 - PI*2
double UT3D_angr_vcpl_z ( Plane pl1,
Vector vc1 
)
UT3D_angr_vcpl_z compute angle of vec in Refsys (to X-axis)
Compute the angle between vc1 and the X-vector of plane pl1
around the Z-axis of pl1.
Input:
pl1 Plane / Refsys
vc1 Vector
Output:
angr angle in radians; min 0 max 2Pi (0-360 deg).
double UT3D_angr_vcpl_tilt ( Plane pl1,
Vector vc1 
)
UT3D_angr_vcpl_tilt compute angle of vec in Refsys (to XY-plane)
Compute the angle between vc1 and the XY-plane of plane pl1
around a vector normal to vc1 in the XY-plane of pl1
Input:
pl1 Plane / Refsys
vc1 Vector
Output:
angr angle in radians; min 0 max 2Pi (0-360 deg).
double UT3D_angr_vc2vc ( Vector vc1,
Vector vcx,
Vector vcy 
)
UT3D_angr_vc2vc compute angle of vec in Refsys (to X-axis)
Compute the angle between vector vc1 in a refSys = plane
from its X- and Y-vector around the Z-axis of this plane.
vcx,vcy must be normalized !
the angle between vc1 - vcx is computed.
Input:
vcx, vcy defining the plane
vc1 compute the angle between vcx-vc1 in the plane.
Output:
angr angle in radians; min 0 max 2Pi (0-360 deg).
double UT3D_angr_2pl ( Plane pl1,
Plane pl2 
)

Oeffnungswinkel zwischen 2 Planes

double UT2D_angr_2vc ( Vector2 ,
Vector2  
)
UT2D_angr_2vc angle (rad.) between 2 Vectors
Die Vektoren muessen CCW liegen; vc1 entspricht der X-Achse; vc2 CCW davon.
double UT2D_angr_3ptdr ( Point2 ,
Point2 ,
Point2 ,
int   
)

DO NOT USE; use UT2D_angr_ci

double UT3D_angr_4pt ( Point p11,
Point p12,
Point p21,
Point p22 
)

UT3D_angr_4pt angle between 2 lines

double UT2D_angr_ci ( Point2 pa,
Point2 pe,
Point2 pc,
double  rad_in 
)
UT2D_angr_ci openingAngle of circle (pa,pe,pc,rad/dreh)
Der Winkel ist bei CW-Kreisen immer negativ (-360 - 0 - 360).
Achtung: rad gibt auch die Drehrichtung !
CCW = rad > 0 ;
CW = rad < 0 ;
double UT3D_angr_ci_p1_pt ( Circ ci1,
Point pti 
)
UT3D_angr_ci_p1_pt opening angle of point on Circ
Returns the angle from ci1->p1 to pti.
angle 0 means that pti == ci1->p1;
angle 3.14 means that pti is opposite ci1->p1.
ATTENTION: DO NOT USE FOR 360-DEG-CIRCs: returns angle = 0.;
ACHTUNG: ES KANN KEIN VOLLKREIS ANALYSIERT WERDEN - ERGIBT Winkel 0 !!
double UT2D_angr_perpangr ( double *  )

UT2D_angr_perpangr angle + 90 degree (perp. to angle)

double UT2D_len_vc ( Vector2 )
double UT2D_lenq_vc ( Vector2 )
void UT2D_lenq_2pt ( double *  lq,
Point2 p1,
Point2 p2 
)
double UT2D_len_2pt ( Point2 ,
Point2  
)

UT2D_len_2pt distance pt - pt

double UT2D_lenB_2pt ( Point2 p1,
Point2 p2 
)

UT2D_lenB_2pt longest dx/dy-distance point-point (fast!)

double UT2D_lenS_2pt ( Point2 p1,
Point2 p2 
)
double UT2D_lenS_vc ( Vector2 vc1)
int UT2D_minLenB_4pt ( double *  dp,
Point2 ,
Point2 ,
Point2 ,
Point2  
)
UT2D_minLenB_4pt min lenght between 2 lines
dp ist Streckensumme entlang der Hauptachsen - nicht genau Laenge !
rc = 1 p1e - p2a hat geringsten Abstand
rc = 2 p1a - p2a hat geringsten Abstand
rc = 3 p1e - p2e hat geringsten Abstand
rc = 4 p1a - p2e hat geringsten Abstand
dx,dy addieren; den geringsten Wert auswaehlen.
int UT3D_minLen_3pt ( double *  ,
Point ,
Point ,
Point  
)
dp ist Streckensumme entlang der Hauptachsen - nicht genau Laenge !
rc = 1 p0 - p1 hat geringeren Abstand
rc = 2 p0 - p2 hat geringeren Abstand
dx,dy,dz addieren; den geringsten Wert auswaehlen.
int UT3D_minLen_4pt ( double *  ,
Point ,
Point ,
Point ,
Point  
)
dp ist Streckensumme entlang der Hauptachsen - nicht genau Laenge !
rc = 1 p1e - p2a hat geringsten Abstand
rc = 2 p1a - p2a hat geringsten Abstand
rc = 3 p1e - p2e hat geringsten Abstand
rc = 4 p1a - p2e hat geringsten Abstand
dx,dy,dz addieren; den geringsten Wert auswaehlen.
int UT3D_minLen_npt ( Point p0,
Point pa,
int  pNr 
)
double UT2D_len_ptln ( Point2 pt,
Point2 pa,
Point2 pe 
)
UT2D_len_ptln get (signed) minDist from pt to Line pa-pe
int UT2D_3len_ptln ( double *  ,
double *  ,
double *  ,
Point2 ,
Point2 ,
Point2  
)
ck minimalAbst von pt auf Line pa,pe
feststellen, ob der Normalpunkt auf oder ausserhalb Line ist
(Normalpunkt = Projektion von pt auf Line pa-pe)
Auf Line: den Abstand pt-NormalPt liefern (mit Vorzeichen)
nicht auf Line: den Abstand zum naeheren Endpunkt liefern
d1: Normalabstand od MindestAbstand
dx: LaengsAbstand (der Abstand des NormalPunktes von pa)
dy: der Normalabstand von pt zur Line pa-pe;
Vorzeichen positiv: pt links von pa; negativ: rechts von pa.
RetCod:
-1 = vor pa; dy ist nicht gueltig !
0 zwischen pa-pe; dx,dy sind gueltig
1 ausserhalb pe; dy ist nicht gueltig !
int UT2D_slenq_ptptvc ( double *  qlen,
Point2 pa,
Point2 pb,
Point2 pc 
)
UT2D_slenq_ptptvc signed quadr.Distance pt-pt in Richtung vec
pa - pb gives a line, pc is projected onto this line, giving e.
Returns the quadr. length pa - e.
pc
|
|
qlen |
pa--------+-----pb
e
RetCod erweitern;
-1 pc is left of pa (pc - pa - pb)
0 pc is between pa -pb (pa - pc - pb)
1 pc is right of pb (pa - pb - pc)
double UT2D_slen_nor3pt ( Point2 p1,
Point2 p2,
Point2 p3 
)
UT2D_slen_nor3pt signed length of normal point - line
gibt den Abstand den p2 auf die Linie p1 - p3 hat mit Vorzeichen.
p2
|
slen|
|
p1------+--------p3
int UT2D_slen_nor2vc ( double *  slen,
Vector2 v1,
Vector2 v2 
)
UT2D_slen_nor2vc signed length of normal of 2 vectors
both vectors need not to be normalized.
If v1 = normalized use UT2D_slen_nor_vc_vcNo.
x
/|
/ |
V2/ |
/ |
/ |slen
/ |
x------+-------x
V1
RetCode: 0 OK
-1 length v1 = 0
int UT2D_slen_nor_vc_vcNo ( double *  slen,
Vector2 v1,
Vector2 v2 
)
UT2D_slen_nor_vc_vcNo signed length of normal of 2 vectors (1 normalized)
v1 must be normalized (else slen *= length_of_V1)
x
/|
/ |
V2/ |
/ |
/ |slen
/ |
x------+-------x
V1
RetCode: 0 OK
-1 length v1 = 0
double UT2D_slen_nor_2pt_vc__ ( Point2 pt,
Point2 pl,
Vector2 vl 
)
UT2D_slen_norvc2pt signed length of normal point onto vector
vl must not be normalized.
if vl = normalized: use UT2D_slen_nor_2pt_vcNo
. pt
. .
. .
. .
vp . sk = normal-distance of pt onto vector pl-vl
. .
. .
. .
X-----------------.------->
pl vl
double UT2D_slen_nor_2pt_vcNo ( Vector2 v1,
Point2 p1,
Point2 p2 
)
UT2D_slen_nor_2pt_vcNo signed length of normal of point onto norm.vector
For true length v1 must be normalized !
. p2
. .
. .
. .
v2 . sk = normal-distance of p2 onto vector p1-v1
. .
. .
. .
X-----------------.------->
p1 v1
int UT2D_2slen_vc_vc__ ( double *  dx,
double *  dy,
Vector2 vp,
Vector2 vl 
)
UT2D_2slen_vc_vc__ relative coords (dx,dy) of vector on vector
vl need not to be normalized.
x
/|
/ |
vp/ |
/ |
/ |dy
/ |
x------+---vl---->
| dx |
RetCode: 0 OK
-1 length vl = 0
int UT2D_2slen_2pt_vc__ ( double *  dx,
double *  dy,
Point2 px,
Point2 pl,
Vector2 vl 
)
UT2D_2slen_2pt_vc__ relative coords (dx,dy) of point along/normal to line
vl need not to be normalized.
px
/|
/ |
vp/ |
/ |
/ |dy
/ |
pl------+---vl---->
| dx |
RetCode: 0 OK
-1 length vl = 0
int UT2D_sid_2vc ( Vector2 v1,
Vector2 v2,
double  tol 
)
UT3D_cklr_2vc check vc for left (CCW, above) or right (CW, below)
Vektoren muessen nicht normiert sein !
RC 1 v2 is CCW from v1 (pos. angle)
RC 0 v1-v2 are parallel
RC -1 v2 is CW from v1 (neg. angle)
X
v1/ 1
/
----------X---v2-----------> 0
-1
int UT2D_sidPerp_2vc ( Vector v1,
Vector v2 
)
UT2D_sidPerp_2vc check vecs for inFront, perp.(normal), or behind
Ist v2 vor oder hinter einem Normalvektor auf v1 durch den Startpunkt von v1.
sind Vektoren eher parallel oder anpiparallel ..
Vektoren muessen nicht normiert sein !
RC -1 vecs point into opposit direction (angle > 90 deg.)
RC 0 vecs are perpendicular (angle = 90 deg)
RC 1 vecs point into same direction (angle < 90 deg)
int UT2D_sid_3pt ( Point2 pt,
Point2 p1,
Point2 p2 
)
UT2D_sid_3pt compare if pt is on, above or below line (p1-p2)
X
vp . pt 1
.
p1------------vl--------p2->
X
pt -1
RetCode:
0 pt is on vector vl
1 pt is above vector vl (left side)
-1 pt is below vector vl (right side)
side before,behind: UT2D_sidPerp_3pt
int UT2D_sid_ptvc ( Point2 ,
Point2 ,
Vector2  
)
UT2D_sid_ptvc compare if pt is on, above or below line (pl+vl)
was UT2D_dir_ptvc
X
pt 1
pl
----------X---vl-----------> 0
X
pt -1
retcode:
0 pt is on vector vl
1 pt is above vector vl (left side)
-1 pt is below vector vl (right side)
int UT2D_sidPerp_ptvc ( Point2 pt,
Point2 pl,
Vector2 vl 
)
UT2D_sidPerp_ptvc compare if pt is right/on/left of a normal to pl+vc
pt | pt
-1 | 1
|
|--------->vl
----------X----------------
pl
|
retcode:
0 pt is on a normal to line pl-vl
1 pt is before pl (to the right side of a normal to line pl-vl)
-1 pt is behind pl (to the left side of a normal to line pl-vl)
int UT3D_sid_2vc ( Vector v1,
Vector v2 
)
UT3D_sid_2vc check vc's for perp, same or opposit direction
test if vectors are parallel or antipiparallel or normal ..
RC -1 vc's point into opposit direction
RC 0 vc's are perpendicular
RC 1 vc's point into same direction
see also UT3D_acos_2vc
int UT3D_sid_3pt ( Point p1,
Point p2,
Point p3 
)
UT3D_sid_3pt check if pt is in, before or behind perpendic.Plane
Ist p3 vor oder hinter der Ebene, die durch p1 geht u.normal auf p1-p2 steht
RC -1 p3 liegt vor Ebene p1-p2 (vis-a-vis)
RC 0 p3 liegt genau in der Ebene
RC 1 liegt hinter Ebene p1-p2 (in der Naehe von p2)
see also UT3D_acos_2vc
int UT3D_sid_ptpl ( Point pt,
Plane pl 
)
UT3D_sid_ptpl compare if pt is in, above or below plane
retcode:
0 pt is in plane pl
1 pt is above plane pl (same side as the z-vector)
-1 pt is below plane pl
int UT3D_sid_ptptvc ( Point ptx,
Point pto,
Vector vz 
)
UT3D_sid_ptptvc compare if pt is in, above or below plane
........ ptx
. .
. .
. .
. .
pto-------+------> vz
below---|---above
in
Plane is defind by origin pto and z-vector vz
retcode:
0 pt is in plane pl
1 pt is above plane pl (same side as the z-vector)
-1 pt is below plane pl
int UT2D_parLn_pt2pt ( double *  d1,
Point2 p1,
Point2 p2,
Point2 px 
)
double UT2D_ar_3pt ( Point2 p1,
Point2 p2,
Point2 p3 
)
UT2D_ar_3pt get (signed) area of triangle
int UT2D_comp2pt ( Point2 ,
Point2 ,
double   
)
int UT2D_comp4pt ( Point2 ,
Point2 ,
Point2 ,
Point2 ,
double   
)
UT2D_comp4pt compare 4 2D-points
Ob 2 der 4 Punkte zusammenpassen
(zum Test ob 2 Lines einen gemeinsamen Punkt haben).
Retcode 0 = Abstand aller Punkte > tol
1 = Abstand (p1e - p2a) < tol
2 = Abstand (p1a - p2a) < tol (Obj 1 verkehrt)
3 = Abstand (p1e - p2e) < tol (Obj 2 verkehrt)
4 = Abstand (p1a - p2e) < tol (Obj 1 und 2 verkehrt)
int UT2D_pt_ck_int4pt ( Point2 ,
Point2 ,
Point2 ,
Point2  
)
test ob die Linien p1-p2 und p3-p4 sich schneiden/beruehren/parallel sind
rc=-1: kein Schnittpunkt
rc=0: die Linien beruehren sich
rc=1: die Linien sind (teilweise) parallel
rc=2: die Linien schneiden sich
int UT2D_pt_ck_onLine ( Point2 po,
Point2 p1,
Point2 p2,
Point2 p3,
double  tol 
)
liegt p3 auf der Linie p1-p2 ? (Tests mit UT_TOL_pt)
Output:
po nearest point on line; (NULL; not computed)
retCod
-1 NO; Point outside Line p1-p2
0 Yes; p3=p1; po=p1.
1 Yes; po between p1-p2
2 Yes; p3=p2; po=p2.
int UT2D_pt_ck_inLine ( Point2 p1,
Point2 p2,
Point2 p3,
double  tol 
)
UT2D_pt_ck_inLine check 2D-point on line segment
Check if a 3. 2D-point lies inside the line segment defined by two 2D-points.
It is assumed that the 2D-point is ON the line defined by the two 2D-points.
IN:
Point2 p1 ... 2D-point 1 defining the line segment
Point2 p2 ... 2D-point 2 defining the line segment
Point2 p3 ... 2D-point to check
double tol ... tolerance for 2D-point to ly inside line segment (>0)
OUT:
Returncodes:
0 = the 2D-point lies outside the segment
1 = the 2D-point lies inside the segment
int UT2D_pt_ck_inplg ( Point2 pTab,
int  pNr,
Point2 ptx 
)
UT2D_pt_ck_inplg Test if Point ptx is inside polygon pTab
Input:
pTab polygonPoints; closing edge is from pTab[pNr-1] to pTab[0]
Output:
RetCod 0 No, point ptx is outside pTab;
else Yes, point is inside.
int UT2D_pt_ck_linear ( int  np,
Point2 ptab,
double  tol 
)
UT2D_pt_ck_linear check straight position of 2D-points
Check if the position of 2D-points is straight.
IN:
int np ... number of 2D-points
Point2 *ptab ... 2D-points
double tol ... tolerance for straightness (>0)
OUT:
Returncodes:
0 = position of points is not straight
1 = position of points is straight
int UT2D_pt_ck_inBox ( Point2 p1,
Point2 p2,
Point2 p 
)
UT2D_pt_ck_inBox check if point p is inside box p1-p2
RC = 0: YES, p is inside box p1 / p2
RC = 1: NO, p is outside box p1 / p2
int UT2D_pt_ck_inBoxTol ( Point2 p1,
Point2 p2,
Point2 p,
double  tol 
)
UT2D_pt_ck_inBoxTol check if point p is inside box p1-p2
RC = 0: YES, p is inside box p1 / p2
RC = 1: NO, p is outside box p1 / p2
int UT2D_pt_ck_inAc ( Point2 pt,
Circ2 ci 
)
UT2D_pt_ck_inAc check if pt is in Arc(Segment)
Vektor Cen-Pt muss Arc schneiden; else not in Arc.
Es wird der Radius nicht kontrolliert; auch nicht die gegenUeberseite.
RetCod: 0 = yes, pt is in Arcsegment;
-1,-2,1,2 = no.
int UT2D_pt_ck_inTriangle ( Point2 p1,
Point2 p2,
Point2 p3,
Point2 p 
)
int UT2D_pt_ck_inCv3 ( Point ptx,
int  pNr,
Point pTab 
)
UT2D_pt_ck_inCv3 check if point is inside polygon
geschlossene Kontur erforderlich; pTab[pNr-1] muss gleich wie pTab[0] sein
irc 1 Punkt liegt innerhalb der Kontur
irc 0 Punkt liegt auf der Kontur
irc -1 Punkt liegt ausserhalb der Kontur
Schnittpunkte aller Kantenlinien mit Horzontale Linie durch ptx
rechts von ptx zaehlen; ungerade == innen.
int UT2D_pt_cknear_npt ( Point2 p0,
Point2 ptTab,
int  ptNr 
)
UT2D_pt_cknear_npt return index of nearest Point from n points
use: pt1 = ptTab[UT2D_ipt_cknear_npt (&ptStart, ptTab, ptNr)];
void UT2D_swap2pt ( Point2 p1,
Point2 p2 
)
Point2 UT2D_pt_pt3 ( Point )
void UT2D_pt_2db ( Point2 ,
double  ,
double   
)
int UT3D_pt_pt2bp ( Point p3,
Point2 p2,
int  bp 
)

make 3D-point from 2D-point & backplane

void UT2D_pt_addpt ( Point2 ,
Point2  
)
void UT2D_pt_sub_pt3 ( Point2 ,
Point  
)
void UT2D_pt_opp2pt ( Point2 ,
Point2 ,
Point2  
)
void UT2D_pt_mid2pt ( Point2 ,
Point2 ,
Point2  
)
void UT2D_pt_traptvc ( Point2 ,
Point2 ,
Vector2  
)
void UT2D_pt_tra2ptlen ( Point2 ,
Point2 ,
Point2 ,
double   
)

UT2D_pt_tra2ptlen transl. point p1 into dir p1 -> p2 dist. lenv

void UT2D_pt_traPtPtPar ( Point2 po,
Point2 p1,
Point2 p2,
double  d1 
)
UT2D_pt_traPtPtPar transl. pt with parameter along p1-p2
void UT2D_pt_tra3ptlen ( Point2 ,
Point2 ,
Point2 ,
Point2 ,
double   
)

UT2D_pt_tra3ptlen transl. point p1 into dir p2 -> p3 dist. lenv

void UT2D_pt_tra2pt2len ( Point2 ,
Point2 ,
Point2 ,
double  ,
double   
)

UT2D_pt_tra2pt2len transl. point into dir p1 -> p2 dist. dx and normal dy

void UT2D_pt_tra2pt3len ( Point2 ,
Point2 ,
Point2 ,
double  ,
double  ,
double   
)

UT2D_pt_tra2pt3len move p1; Baseline p1-p2; Dir dx/dy; length lenv.

void UT2D_pt_traptvclen ( Point2 ,
Point2 ,
Vector2 ,
double   
)

UT2D_pt_traptvclen move pi along vc length lenv

void UT2D_pt_traptangrlen ( Point2 ,
Point2 ,
double  ,
double   
)

UT2D_pt_traptangrlen move point; direction from angle, distance=lenv

void UT2D_pt_tranor2ptlen ( Point2 ,
Point2 ,
Point2 ,
double   
)
UT2D_pt_tranor2ptlen transl. point normal to p1 - p2 dist. lenv
Center is p1; p1-p2 gives the baseline
void UT2D_pt_tranorptvclen ( Point2 ,
Point2 ,
Vector2 ,
double   
)
UT2D_pt_tranorptvclen transl. point normal to vec dist. lenv
Center is p1; p1-v1 gives the baseline
void UT2D_pt_traptvc2len ( Point2 ,
Point2 ,
Vector2 ,
double  ,
double   
)
UT2D_pt_traptvc2len transl. point into dir vc; dist. dx and normal dy
Move point into direction vc with distance dx and normal to vc -
with distance dy.
void UT2D_pt_tracirlen ( Point2 ,
Point2 ,
Point2 ,
double  ,
double   
)
UT2D_pt_tracirlen transl. point circular length
rad = Radius; Pos.Val = CCW; neg.Val =CW.
clen = arcLenght
void UT2D_pt_rotptangr ( Point2 ,
Point2 ,
Point2 ,
double   
)
UT2D_pt_rotptangr rotate a point around centerpoint
p2 darf ident mit p1 sein.
int UT2D_pt_projptptvc ( Point2 ,
Point2 ,
Point2 ,
Vector2  
)
UT2D_pt_projptptvc point = project point to line (pt+vc)
Project a point onto a line given by point and vector.
pl - vl gives a line, pt is projected onto this line.
IN:
Point2 *pt ... point to project on line pl-vl
Point2 *pl ... point on line
Vector2 *vl ... vector of line
OUT:
Point2 *pp ... normal projection of pt onto line
Returncodes:
0 = OK
1 = point is on line
int UT2D_pt_projpt2pt ( Point2 pp,
double *  len,
Point2 pt,
Point2 p1,
Point2 p2 
)
UT2D_pt_projpt2pt pp = project point pt to lineSegment p1-p2
p1-p2 is a line, pt is projected onto this line.
len ist the len pt-pp (if not NULL)
-1 1 0 2 -2 retcod
| pt |
|
len|
|
p1------+--------p2
pp
Input:
len NULL or address
Output:
pp pr projected to p1-p2
len distance pt-pp if not NULL on input
retcod 0=OK, pp is on line, between p1-p2
1 OK; pp = p1
2 OK; pp = p2
-1 outside; pt is before line
-2 outside; pt if after line
-3 Input-Error; p1==p2
int UT2D_pt_projptln ( Point2 ,
Point2 ,
Line2  
)

UT2D_pt_projptln point = project point to line

void UT2D_2pt_projptci ( Point2 ,
Point2 ,
Point2 ,
Point2 ,
double   
)
UT2D_2pt_projptci project point to circle
ip1 ist the nearer solution,
ip2 is farer away from cen
int UT2D_pt_projptci ( Point2 pp,
Point2 pt,
Circ2 ci1 
)
UT2D_pt_projptci project point to Arc (segment of circle)
2 solutions: der nearest point is selected.
RetCod: 0 = yes, pp is in Arcsegment;
-1 = no; none of the 2 projectionpoints is on the ArcSegment.
int UT3D_ptDi_intptvcptvc ( Point ip,
double *  dist,
Point ptl,
Vector vcl,
Point ptp,
Vector vcp 
)
intersect line-plane (pt-vc pt-vc)
ip = project pt1 along vcl onto plane ptp-vcp
Output:
dist = der Faktor fuer den Abstand vom pt zum ip in Richtung vln.
vln * dist ab pt ergibt ip.
Returncodes:
0 = vc parallel to plane
1 = OK;
int UT3D_ptDi_intptvcpln ( Point ip,
double *  dist,
Plane pl,
Point pt,
Vector vln 
)
UT3D_ptDi_intptvcpln intersect line-plane (pt-vc pt-vc)
provide also parameter of intersection-point on line.
Von pl wird nur p und vz benutzt.
Output:
dist = der Faktor fuer den Abstand vom pt zum ip in Richtung vln.
vln * dist ab pt ergibt ip.
Returncodes:
0 = vc parallel to plane
1 = OK;
int UT2D_pt_int4pt ( Point2 ,
double *  ,
double *  ,
double *  ,
Point2 ,
Point2 ,
Point2 ,
Point2  
)
intersection of 2 limited lines, tolerance.
Info, ob Schnittpunkt ident mit p1 oder p2 (p3,p4 werden nicht getestet)
Info, ob p1-p2 und p3-p4 uebereinanderliegen (ueberlappen)
Output:
dp1 parameter along p1-p2
dp2 parameter along p3-p4
RC = -1 NO intersection.
RC = 0 Yes; intersect; ps=p1; dp1=0;
RC = 1 Yes; intersect; ps between p1-p2;
dp1 ist der Abstandswert (0-1) des Schnittpunktes entlang p1-p2
RC = 2 Yes; intersect; ps=p2; dp1=1;
RC = 3 Lines parallel - Endpoints touch (not overlap). ps, dp1 unused.
RC = 4 Lines parallel and overlap; ps, dp1 unused.
int UT2D_pt_int2ln ( Point2 ,
Line2 ,
Line2  
)
UT2D_pt_int2ln point = intersection of 2 lines
Returncodes:
0 = Lines parallel or zero-length
1 = OK.
int UT2D_pt_intptvcy ( Point2 pto,
Point2 ptl,
Vector2 vcl,
double  yVal 
)
UT2D_pt_intptvcy intersection line (pt-vc) - horizontal line
Schnittpunkt eines Linesegmentes ln1 mit einer unendlich langen,
horiz. Geraden mit Y=yVal errechnen.
Retcod= 0: Schnittpunkt in pto
Retcod= 1: Linie vertical; beliebig viele Schnittpunkte
int UT2D_pt_intlny ( Point2 pto,
Point2 lp1,
Point2 lp2,
double  yVal 
)
UT2D_pt_intlny intersection linesegment - horizontal line
Schnittpunkt eines Linesegmentes ln1 mit einer unendlich langen,
horizontalen Geraden mit Y=yVal errechnen.
Retcod= 0: Schnittpunkt in pto
Retcod=-1: kein Schnittpunkt
Retcod= 1: Linie horizontal; beliebig viele Schnittpunkte
int UT2D_pt_int2pt2vc ( Point2 ip,
Point2 pt1,
Vector2 vc1,
Point2 pt2,
Vector2 vc2 
)
UT2D_pt_int2pt2vc point = intersection of 2 vectors + 2 Points
intersection of 2 unlimited lines
Returncodes:
0 = Lines parallel or zero-length
1 = OK; ip = intersectionPoint;
int UT2D_pt_int2vc2pt ( Point2 ,
Point2 ,
Vector2 ,
Point2 ,
Vector2  
)
UT2D_pt_int2vc2pt point = intersection of 2 vectors + 2 Points
Es wird auch getestet, ob der Schnittpunkt ip sich auf oder ausserhalb des
vc1 / vc2 befindet.
Returncodes:
0 = Lines parallel or zero-length
1 = OK; Schnittpunkt befindet sich auf vc1 und auf vc2.
2 = OK; Schnittpunkt befindet sich nicht auf vc1 (vc2 wird nicht getestet)
3 = OK; Schnittpunkt befindet sich auf vc1, nicht auf vc2.
int UT2D_2pt_intciptvc ( Point2 ,
Point2 ,
Point2 ,
double  ,
Point2 ,
Vector2  
)
UT2D_2pt_intciptvc intersect Circle - Line (pt+vc)
ip1 immer jener Punkt,
Return code:
0 ... normal intersection (2 Ergebnispunkte)
1 ... circle touches line
-1 .. no intersection
int UT2D_2pt_intlnci ( Point2 ip1,
Point2 ip2,
Line2 ln,
int  lnMode,
Circ2 ci,
int  ciMode 
)
UT2D_2pt_intlnci intersect Line x Circ; both limited or unlimited
lnMode 0=limited Line, 1=unlimited Line.
ciMode 0=limited Circ, 1=unlimited Circ.
Retcod 1/2 number of intersectionpoints
-1 no intersectionpoint
int UT2D_2pt_intcici ( Point2 ,
Point2 ,
Point2 ,
double  ,
Point2 ,
double   
)
UT2D_2pt_intcici intersect 2 Circles
Return code:
0 ... normal intersection
1 ... circles touch each other
-1 .. circles do not intersect
int UT2D_2pt_int2ci ( Point2 ip1,
Point2 ip2,
Circ2 ci1,
int  ci1Mode,
Circ2 ci2,
int  ci2Mode 
)
UT2D_2pt_int2ci intersect Circ x Circ; both limited or unlimited
ciXMode 0=limited Circ, 1=unlimited Circ.
Retcod 1/2 number of intersectionpoints
-1 no intersectionpoint
void UT2D_pt_traptm2 ( Point2 ,
Mat_3x2  ,
Point2  
)
UT2D_pt_traptm2 einen 2D-Punkt mit 3x2-Matrix transformieren.
- transform point von Refsys ma nach absolut (mit normaler Matrix)
- transform point von absolut Refsys ima (mit inverser Matrix)
Ausgabe: ein Punkt im 2D-System mata, gedreht um Center/Vektor in mata.
Point2 UT2D_pt_obj2 ( ObjG2 obj1)
UT2D_pt_obj2 2D-Obj > 2D-Point
DO NOT USE
void UT2D_ln_ptpt ( Line2 ,
Point2 ,
Point2  
)
void UT2D_ln_ptvc ( Line2 ,
Point2 ,
Vector2  
)
void UT2D_ln_ln3 ( Line2 ln2,
Line ln3 
)
void UT2D_ln_inv ( Line2 ln1)
void UT2D_ln_4db ( Line2 ln2,
double  xs,
double  ys,
double  xe,
double  ye 
)

UT2D_ln_4db 2D-Line from 4 doubles

Line2 UT2D_ln_obj2 ( ObjG2 )
UT2D_ln_obj2 2D-Obj > 2D-Line
DO NOT USE
int UT2D_lncoe_ln ( double *  k,
double *  d,
Line2 ln 
)
UT2D_lncoe_ln coefficients of 2D Line
Coefficients of 2D-Line equation y = k*x + d, if the line is
NOT parallel to the y-axis.
IN:
Line2 *ln ... 2D-line
OUT:
double *k ... coefficient k
double *d ... coefficient d
Returncodes:
0 = OK
1 = line parallel y-axis
int UT2D_ln_pts_dmax ( Line2 ln,
int  np,
Point2 ptab,
double  tol 
)
UT2D_ln_pts_dmax line <-- points with max. distance of pointTab.
Computation of a 2D-line from a set of 2D-points.
The line points will be such that their distance is maximal!
Die am weitesten auseinanderliegenden Punkte suchen, Linie davon machen.
IN:
int np ... number of 2D-points
Point2 *ptab ... 2D-points
double tol ... tolerance: minimal desired distance between
2D-line points
OUT:
Line2 *ln ... 2D-line with maximal point distance
Returncodes:
1: line exists
0: no line exists
int UT2D_comp2vc ( Vector2 ,
Vector2 ,
double   
)
UT2D_comp2vc compare 2 vectors for parallel and antiparallel
Vectors must not be normalized.
tol applies to length 1
Returns 1 if parallel=yes, else 0.
if(UT2D_comp2vc(&vc1, &vc2, UT_TOL_pt)) printf(" parallel=yes");
int UT2D_comp2vc_p ( Vector2 ,
Vector2 ,
double   
)
UT2D_comp2vc_p compare 2 vectors for parallel
Compare directions; lenght is normalized (tol applies to length 1)
Returns 1 wenn parallel, else 0.
int UT2D_ckvc_in2vc ( Vector2 v1,
Vector2 v2,
Vector2 v3 
)
UT2D_ckvc_in2vc check if v2 is between v1 and v3
the opening-angle of v1-v3 is less than 180 deg.
RetCod:
0 = yes; v2 is between v1 and v3
1 = no; v2 = above (left of) v1 and v3
-1 = no; v2 = below (right of) v1 and v3
void UT2D_vc_vc3 ( Vector2 ,
Vector  
)
int UT2D_2parvc_3vc ( double *  ,
double *  ,
Vector2 ,
Vector2 ,
Vector2  
)
UT2D_2parvc_3vc project end of vec1 along vec2 on vec3
Zu gegebenen Vektoren v1, v2, v3 finden wir Zahlen x und y so,
dass x * v1 + y * v3 = v2.
dx/dy sind zwischen 0 bis 1; wenn dx=0.5 liegt der Endpunkt von V2
genau in der Mitte des Parallelogramss V1-V3.
y
\
\ V1,V2,V3 have same startpoint s.
dy \-----------x
\ / \
\ / \
V3 \ V2 \
\ / \
\ / \
s----------------------------x
dx V1
void UT2D_vc_2db ( Vector2 ,
double  ,
double   
)
void UT2D_vc_angr ( Vector2 ,
double   
)
void UT2D_vc_angrlen ( Vector2 ,
double  ,
double   
)

UT2D_vc_angrlen 2DVector = angle (radians) + Length

void UT2D_vc_2pt ( Vector2 ,
Point2 ,
Point2  
)
void UT2D_vc_2pt3 ( Vector2 vc,
Point p1,
Point p2 
)

UT2D_vc_2pt3 2D-Vector = 3D-Point -> 3D-Point

int UT2D_vc_2pt3_bp ( Vector2 vo,
Point p1,
Point p2,
int  bp 
)

2D-Vector = (3D-Point -> 3D-Point) on Backplane

void UT2D_vc_2ptlen ( Vector2 ,
Point2 ,
Point2 ,
double   
)

UT2D_vc_2ptlen 2D-Vector = 2D-Point -> 2D-Point, set Length

void UT2D_vc_ln ( Vector2 ,
Line2  
)
void UT2D_vc_invert ( Vector2 ,
Vector2  
)
int UT3D_vc_Zup ( Vector v2,
Vector v1 
)

invert Vector if its Z-coord is negative

void UT2D_vc_perpvc ( Vector2 ,
Vector2  
)
void UT2D_vc_perp2pt ( Vector2 ,
Point2 ,
Point2  
)
void UT2D_vc_normalize ( Vector2 ,
Vector2  
)

UT2D_vc_normalize change to length 1

void UT2D_vc_setLength ( Vector2 ,
Vector2 ,
double   
)
UT2D_vc_setLength change 2D-Vectorlength
vco and vci may be the same address
if length of vci is known:
UT2D_vc_multvc (&vco, &vci, newLengthOfVco / actLengthOfVci);
void UT2D_vc_mid2vc ( Vector2 ,
Vector2 ,
Vector2  
)
UT2D_vc_mid2vc vector = midVector between 2 vectors
void UT2D_vc_merge2vc ( Vector2 vm,
Vector2 v1,
Vector2 v2 
)

UT2D_vc_merge2vc merge 2 vectors vNew = (v1 + v2) / 2

void UT2D_vc_rotangr ( Vector2 ,
Vector2 ,
double   
)
UT2D_vc_rotangr rotate a 2D_vector
(vco and vci can be the same adress)
void UT2D_vc_travcm2 ( Vector2 vo,
Mat_3x2  mata,
Vector2 vi 
)
UT2D_vc_travcm2 2D-vector transformation (3x2-matrix)
UT2D_vc_travcm2 Author: Thomas Backmeister 9.4.2003
Transformation of a 2D-vector with a 3x2-matrix.
IN:
Mat_3x2 mata ... transformation matrix
Vector2 *vi ... 2D-vector
OUT:
Vector2 *vo ... transformed 2D-vector
double UT2D_angr_ciSec ( double  hc,
double  radc 
)
UT2D_angr_ciSec opening angle of Secant of Circ
for length of secant see UT2D_len_ciSec
double UT2D_len_ciSec ( double  hSec,
double  rCi 
)
UT2D_len_ciSec cmp length of secant from radius + height of secant.
Gegeben:
_ - + - _ x = hSec = Hoehe der sekante
^ |x ^ c = rCi = radius Kreis
/ | \
+---a-----+---a-----+ Gesucht:
| / a = lSec = halbe Laenge der Sekante
b| /
| /c b = c - x
| / a*a + b*b = c*c
+ a = sqrt (c*c - b*b)
CirCen
double UT2D_len_cia ( double  rad,
double  ango 
)
double UT2D_len_cir ( double *  angOpe,
Point2 pa,
Point2 pe,
Point2 pc,
double  rad_in 
)
UT2D_len_cir length circular arc (pa,pe,pc,rad/dreh)
Laenge immer positiv (angOpe nicht !)
Liefert auch den Oeffnungswinkel angOpe.
Achtung: rad gibt auch die Drehrichtung !
CCW = rad > 0 ;
CW = rad < 0 ;
int UT2D_compPtOnAc ( double  ,
double  ,
double  ,
int   
)
Testen, ob sich ein Punkt auf einem Arc befindet. Die Winkel
sind Input (ev. aus UT2D_angr_ptpt).
Out als RetCod: YES oder NO.
Circ2 UT2D_ci_obj2 ( ObjG2 )

UT2D_ci_obj2 2D-Circ = 2D-ObjG

int UT2D_ci_ptrd ( Circ2 ci,
Point2 ptc,
double  rdc 
)

UT2D_ci_ptrd 360-deg 2D-Circ from center, radius

int UT2D_ci_ci3 ( Circ2 ci2,
Circ ci3 
)

UT2D_ci_ci3 2D-Circ = 3D-Circ

int UT2D_ci_2vc2ptrd ( Point2 ,
Point2 ,
Vector2 ,
Point2 ,
Vector2 ,
double   
)
int UT2D_ci_ciptvcrd ( Point2 ,
Point2 ,
double  ,
int  ,
Point2 ,
Vector2 ,
double   
)
int UT2D_ci_ptvcpt ( Point2 ,
double *  ,
Point2 ,
Vector2 ,
Point2  
)
circ from point and point+tangentVector
Input:
ps = Startpunkt des Cir,
vcs = Startvektor
pe = ein Punkt am Kreis
Output:
pc = Mittelpunkt
radc = Radius; ACHTUNG: negativ bei CW
int UT2D_obj_obj3 ( ObjGX oo,
ObjGX oi,
Memspc memSeg 
)
UT2D_obj_obj3 change 3D-Obj > 2D-Obj (remove Z-val)
3D-Objekt in 2D-Objekte umwandeln (remove Z-Wert)
ObjG2 UT2D_obj_ci2 ( Circ2 )
UT2D_obj_ci2 change 2D-Circ > 2D-Obj
DO NOT USE
int UT2D_void_obj2 ( void *  memObj,
unsigned long *  oSiz,
ObjG2 og2 
)
change ObjG2-Objekt -> data-Obj
DO NOT USE
void UT2D_cv_ci360 ( Point2 cv,
int  ptNr,
double  rd,
Point2 ptCen 
)
Vollkreis --> Polygon.
insgesamt ptNr Punkt; erster und letzter sind gleich.
int UT2D_cv_ln ( Point2 cv,
int  ptAnz,
Point2 p1,
Point2 p2 
)
UT2D_cv_ln Linearstueck -> Polygon.
int UT2D_npt_ci ( Point2 pa,
int  pNr,
Circ2 ci1 
)
UT2D_npt_ci circular polygon
see also UT2D_cv_cin UT2D_pt_rotptangr
int UT2D_cv_ci ( Point2  [],
int *  ,
Point2 ,
Point2 ,
Point2 ,
int   
)
UT2D_cv_ci change circle > polygon
nur CCW. Max 64 Segments. Sehr schnell.
Erstes und letztes Segment haben unterschiedliche Groesse.
the circle is divided into 64/idiv segments.
int UT2D_cv3_linear ( int *  pNr,
Point pTab,
double  tol 
)
UT2D_cv3_linear delete unnecesary straight points
alle Punkte die innerhalb tol liegen aus pTab entfernen.
ACHTUNG: pTab sind 3D-Punkte; Z ignorieren !
int UT2D_srar_polc ( double *  aro,
int  ptNr,
Point2 pa 
)
UT2D_srar_polc nach Karl Sauer 2004-04-07
Umlaufsinn (sr=sense of rotation) und Flaeche (ar=area) eines
geschlossenen 2D-Polygons (polc) berechnen.
ptNr = Anzahl Punkte ohne den letzten == ersten Punkt !
pa = PunkteTabelle ohne den letzten == ersten Punkt !
RetCod = 1 = CCW
-1 = CW
void UT2D_m2_load ( Mat_3x2  ,
Vector2 ,
Point2  
)

UT2D_m2_load 2D-Refsys from baseDirection, basePoint.

void UT2D_m2_loadtravcm2 ( Mat_3x2  ma,
Vector2 vx,
Vector2 vy,
Vector2 vt 
)
UT2D_m2_loadtravcm2 load 2D-vector trafo (3x2 matrix)
Load a 2D-vector transformation with 3x2-matrix.
IN:
Vector2 *vx ... vector 1
Vector2 *vy ... vector 2
Vector2 *vt ... translation vector
OUT:
Mat_3x2 ma ... transformation matrix
int UT2D_m2_invtravcm2 ( Mat_3x2  im1,
Mat_3x2  m1 
)
UT2D_m2_invtravcm2 invert 2D-vector transformation
Inversion of a 2D-vector transformation.
IN:
Mat_3x2 m1 ... transformation matrix
OUT:
Mat_3x2 im1 ... inverse transformation matrix
Returncodes:
0 = OK
1 = no inverse trafo
void UT2D_m2_init_rot ( Mat_3x2  ma,
double  angle,
Point2 cen 
)

UT2D_m3_init_rot Initialize a 3x2 - matrix with rotation

int UT3D_stru_dump ( int  typ,
void *  data,
char *  txt,
  ... 
)
UT3D_stru_dump Testausgabe Geom.Element.
typ = TYP_FuncInit: ab nun Ausgabe -> Datei "txt" (Open File)
typ = TYP_FuncEnd: ab nun wiederAusgabe -> term. (Close File)
typ = TYP_FuncInit1: ab nun Ausgabe -> FILE "txt" (File must be open)
typ = TYP_FuncExit: ab nun wiederAusgabe -> term. (does not close File)
resolv ObjGX: see UTO_dump__
double UT3D_len_vc ( Vector )
double UT3D_lenq_vc ( Vector )
int UT3D_bplen_vc ( double *  lnv,
Vector vc1 
)
UT3D_len1_vc returns longest vectorpart and its backPlane
RC = 0 = BCKPLN_YZ = X-part-len
1 = BCKPLN_XZ = Y-part-len
2 = BCKPLN_XY = Z-part-len
double UT3D_lenB_vc ( Vector vc1)
UT3D_lenB_vc returns longest vectorpart
double UT3D_lenB_2pt ( Point p1,
Point p2 
)

UT3D_lenB_2pt longest dx/dy/dz-distance point-point (fast!)

double UT3D_len_2pt ( Point ,
Point  
)

UT3D_len_2pt distance point - point

double UT3D_lenq_PtPt ( Point p1,
Point p2 
)
UT3D_lenq_PtPt square-distance point - point
alias UT3D_lenq_2pt
nur Abstand ohne sqrt ausrechen (nur f Vergleichswert)
int UT3D_lenq_PtLn ( double *  lenq,
Point p,
Point p1,
Point p2 
)
UT3D_lenq_PtLn minimum (quadr) distance Point-Segment
give min. distance from Point p to Line p1-p2
double UT3D_len_ln ( Line )

UT3D_len_ln length of line

double UT3D_len_ci ( Circ ci1)
UT3D_len_ci length of circ
immer pos.
double UT3D_slen_3pt ( Point pt,
Point p1,
Point p2 
)
UT3D_slen_3pt signed distance point - point
p1-p2 gives the direction,
OUT: signed distance p1-p3
........ p3
. .
. .
. .
. .
p1--------+------>p2
<---rc--->
double UT3D_slen_projvcvc ( Vector vc1,
Vector vc2 
)
UT3D_slen_projvcvc signed length of vector projected on vector
length of vc1 does not influence result.
3D-Projektionslaenge eines Vektors auf einen anderen Vektor:
vc2 wird auf vc1 projiziert.
negativ if Oeffnungswinkel > 90 Grad
if (length of vc1 = 1): use UT3D_skp_2vc
/|
V2/ |
/ |
/ |
x--------+------> V1
<---rc--->
double UT3D_slenq_projvcvc ( Vector vc1,
Vector vc2 
)
Quadr.3D-Projektionslaenge eines Vektors auf einen anderen Vektor:
vc2 wird auf vc1 projiziert.
negativ if Oeffnungswinkel > 90 Grad !
ACHTUNG: sqrt von einem negativen Wert geht ned !!!!
/|
V2/ |
/ |
/ |
x--------+------> V1
<---rc--->
double UT3D_slenq_2ptvc ( Point p1,
Point p2,
Vector vc 
)
UT3D_slenq_2ptvc Quadr. Laenge pt-pt in Richtung vec (m. Vorzeichen !)
die wahre Laenge ist sqrt(fabs(lq))*DSIGN(lq)
p2
/|
/ |
/ |
/ |
p1--------+------> VC
<---rc--->
double UT3D_nlen_projvcvc ( Vector vc1,
Vector vc2 
)
3D-Normalabstand eines Vektors auf einen anderen Vektor:
vc2 wird auf vc1 projiziert.
_
/| |
V2/ | |
/ vc3 l3=rc
/ | |
/ | |
x--------+------------> V1
|---v1x--|
double UT3D_slen_2ptvc ( Point p1,
Point p2,
Vector vc 
)
UT3D_slen_2ptvc signed length of (p1-(p2 projected on (p1-vc))
Laenge pt-pt in Richtung vec (m. Vorzeichen !)
Wenn vc normiert ist (Laenge 1) dann genuegt Skalarprodunkt (UT3D_acos_2vc)
p1-vc definieren eine Plane; p1=Origin, vc=Normalvektor.
p2 auf die Plane p1-vc projizieren (ergibt ps); die Laenge p2-ps liefern.
........ p2
. .
. .
. .
. .
p1--------+------> vc
<---rc--->
double UT3D_slen_ptpl ( Point pt,
Plane pl 
)
UT3D_slen_ptpl signed distance point - plane
Value is positive point ON same side as plane normal vector
Value is negativ point on OPPOSITE side of plane normal vector
double UT3D_nlen_2ptvc ( Point p1,
Point pv,
Vector vc 
)
UT3D_nlen_2ptvc Laenge der Normalen auf Vektor
2003-11-07: p1-p2 vertauscht! RF.
p1 auf pv-vc projizieren (ergibt ps); die Laenge p1-ps liefern.
(p1 -ps ist normal auf vc)
X p1
|
rc |
|
pv------+--------> vc
double UT3D_nlen_3pt ( Point p1,
Point p2,
Point p3 
)
UT3D_nlen_3pt Laenge der Normalen von p2 auf Line p1-p3
p2 liegt in der Mitte; p1-p3 ist die Linie.
p2 wird auf die Linie projiziert; der Abstand ist der Rueckgabewert.
X p2
|
rc |
|
p1------+--------p3
int UT3D_parpt_3pt ( double *  pl,
Point ptx,
Point pl1,
Point pl2 
)
UT3D_parpt_3pt parameter of distance of point ptx on line pl1-pl2
pl ist zwischen 0 bis 1; wenn pl=0.5 liegt ptx
genau in der Mitte von pl1-pl2
ptx
X
/|
/ |
/ |
/ |
/ .|
X-----|------------X
pl1 pl=0.4 pl2
RetCodes:
0 OK
-1 v1-v2 aufeinander Normal; pl = 0.
int UT3D_parpt_ptvc ( double *  pl,
Point ptx,
Point pt1,
Vector vc1 
)
UT3D_parpt_ptvc parameter of distance of point ptx on line pt1-vc1
pl ist zwischen 0 bis 1; wenn pl=0.5 liegt ptx
genau in der Mitte von pl1-pl2
ptx
X
/|
/ |
/ |
/ |
/ .|
X-----|------------>X
pt1 pl=0.4 vc1
RetCodes:
0 OK
-1 v1-v2 aufeinander Normal; pl = 0.
double UT3D_parpt_lnbp ( Point pti,
Line ln1,
int  bp 
)
UT3D_parpt_lnbp parameter of point on line (via 2D,BackPlane)
bp = Berechnungsebene BackPlane ex UT3D_bp_vcz
double UT3D_par1_ci_angr ( Circ ci1,
double  angr 
)
UT3D_par1_ci_angr get parameter 0-1 for circ from opening-angle
angr opening-angle to vector (ci.pc - ci.p1)
RetCod: parameter 0-1;
0. = startpoint of circ, 1. = endpoint of circ.
double UT3D_par1_ci_pt ( Circ ci1,
Point pt1 
)
UT3D_par1_ci_pt get parameter (0-1) for point on circ
RetCod=0 gives the startpoint of the circ (ci1->p1);
1 gives the endpoint (ci1->p2)
par = total_length / length_p1_pti
length = radius * angle
void UT3D_pt_setFree ( Point )
int UT3D_pt_isFree ( Point )
int UT3D_pt_ck_npt ( Point p0,
Point pTab,
int  pNr,
double  tol 
)
UT3D_pt_ck_npt compare point / points
check if p0 ist identical with one of the points of pTab
Retcode:
irc = -1 all points have a distance > tol
irc >= 0 index of (first) identical point;
int UT3D_ipt_cknear_npt ( Point p0,
Point ptTab,
int  ptNr 
)

UT3D_ipt_cknear_npt return index of nearest Point from n points

int UT3D_ipt_ckfar_npt ( Point p0,
Point ptTab,
int  ptNr 
)

UT3D_ipt_ckfar_npt return index of farest Point from n points

int UT3D_ipt_cknearn_npt ( Point p0,
Point ptTab,
int  ptNr,
int  distNr 
)
UT3D_ipt_cknearn_npt return index of n-nearest Point from n points
distNr=0: return index of nearest point;
distNr=1: return index of 2.nearest point ...
int UT3D_ipt2_nptvc ( Point pt1,
Point pt2,
int  mode,
Point pta,
int  iNr,
Vector vc 
)
ind. of outermost points in direction vc of n pt's
mode 0 = start, >0 = resume
see UT3D_slen_2ptvc UT3D_slen_ptpl
int UT3D_pt_ck_onel ( Point pt,
CurvElli el 
)
UT3D_pt_ck_onel check if point lies on an (full) ellipse
Check if a point lies on an (full) ellipse.
It is assumed that the point lies in the plane of the ellipse.
IN:
Point *pt ... 3D-point
CurvElli *el ... 3D-ellipse
OUT:
Returncodes:
0 = point is not on the ellipse
1 = point is on the ellipse
-1 = internal error
int UT3D_pt_ck_ptvc ( Point pt,
Point pl,
Vector vl,
double  tol 
)
UT3D_pt_ck_ptvc check if point is on unlimited line (point-vector)
RC = -1 NO; Point pt is outside Line pl1-pl2
RC = 0 Yes; pt is nearer than tol to line pl1-pl2
int UT3D_pt_ck_2pt ( Point pt,
Point pl1,
Point pl2,
double  tol 
)
UT3D_pt_ck_2pt check if point is on unlimited line (2 points)
RC = -1 NO; Point pt is outside Line pl1-pl2
RC = 0 Yes; pt is nearer than tol to line pl1-pl2
int UT3D_pt_ck_onLine ( Point p1,
Point p2,
Point p3,
double  tol 
)
liegt p3 auf der Linie p1-p2 ? (Tests mit UT_TOL_pt)
RC = -1 NO; Point outside Line p1-p2
RC = 0 Yes; p3=p1; po=p1.
RC = 1 Yes; po between p1-p2
RC = 2 Yes; p3=p2; po=p2.
int UT3D_pt_ck_inLine ( Point p1,
Point p2,
Point p3,
double  tol 
)
UT3D_pt_ck_inLine check point on line segment
Check if a 3. point lies inside the line segment defined by two points.
It is assumed that the point is ON the line defined by the two points.
IN:
Point p1 ... point 1 defining the line segment
Point p2 ... point 2 defining the line segment
Point p3 ... point to check
double tol ... tolerance for point to ly inside line segment (>0)
OUT:
Returncodes:
0 = the point lies outside the segment
1 = the point lies inside the segment
int UT3D_pt_ck_mid_2pt ( Point p1,
Point p2,
Point p3,
double *  tol 
)
check if point is on perp.plane between 2 points
x p3
|
p1 x-------|--------x p2
RetCod
0 not OK; p3 has different distances from p1 and p2
1 OK; p3 has the same distance from p1 and p2
int UT3D_pt_ck_on_pta ( Point pTab,
int  ptNr,
Point pt1,
double  tol 
)
testen, ob pt1 AUF Polygon liegt
RetCod 0 pt1 is on polygon ptab
RetCod -1 pt1 is not on polygon ptab
int UT3D_pt_ck_in2pt ( Point p1,
Point p2,
Point p3,
double  tol 
)
check if point p3 is inside box of points p1-p2
Returncodes:
-1 = the point lies outside the box
0 = the point lies inside the segment
int UT3D_pt_ck_inCirc ( Circ ci1,
Point pt1,
double  tol 
)
check if point is on circSegment
ACHTUNG: Radius und ob in gleicher Plane wird nicht mehr getestet !
Es wird nur geprueft ob zwischen Start- und Endpunkt.
RC = -1 NO; Point outside CircSeg p1-p2
RC = 0 Yes; p3=p1; po=p1.
RC = 1 Yes; po between p1-p2
RC = 2 Yes; p3=p2; po=p2.
int UT3D_pt_ck_inSph ( Point pt,
Point ps,
double  rs 
)
UT3D_pt_ck_inSph check if point is inside sphere
irc:
1 = YES point lies inside
0 = --- point touches
-1 = NO point lies outside
void UT3D_swap2pt ( Point p1,
Point p2 
)
int UT3D_comp4pt ( Point p1a,
Point p1e,
Point p2a,
Point p2e,
double  tol 
)
UT3D_comp4pt compare 4 points
Ob 2 der 4 Punkte zusammenpassen (ob 2 Lines einen gemeinsamen Punkt haben).
Es wird nur der Abstand entlang der Hauptachsen getestet !
rc=0: keine Verbindung
rc=1: bei El. liegen richtig.
rc=2: Obj 1 verkehrt
rc=3: Obj 2 verkehrt
rc=4: Obj 1 und Obj 2 verkehrt
Retcode 0 = Abstand aller Punkte > tol
1 = Abstand (p1e - p2a) < tol (beide Obj. liegen korrekt)
2 = Abstand (p1a - p2a) < tol (Obj 1 verkehrt)
3 = Abstand (p1e - p2e) < tol (Obj 2 verkehrt)
4 = Abstand (p1a - p2e) < tol (Obj 1 und 2 verkehrt)
int UT3D_compptpl ( Point ,
Plane  
)
Point UT3D_pt_pt2 ( Point2 )

UT3D_pt_pt2 3D-Point = 2D-Point

Point UT3D_pt_pt2z ( Point2 pt20,
double  zVal 
)

UT3D_pt_pt2z 3D-Point = 2D-Point; Z-value = zVal

void UT3D_pt_3db ( Point ,
double  ,
double  ,
double   
)

UT3D_pt_3db Point < 3 doubles (x, y, z)

void UT3D_pt_vc ( Point ,
Vector  
)
void UT3D_pt_txt ( Point ,
char *   
)
UT3D_pt_txt Point from text
delimiters: blank, comma, comma and blank ..
eg: "100 23 45"
void UT3D_pt_mid2pt ( Point ,
Point ,
Point  
)
UT3D_pt_mid2pt midpoint between 2 points
po may be p1
int UT3D_pt_mid_pta ( Point pto,
Point pTab,
int  ptNr 
)
arithm. Mittelwert der Punktetabelle pTab
(alle Punktcoord addieren dann durch PunkteAnzahl divid.)
void UT3D_pt_midci ( Point ,
Circ  
)

UT3D_pt_midci midpoint of a circ

void UT3D_pt_opp2pt ( Point ,
Point ,
Point  
)
UT3D_pt_opp2pt opposite point (p1 = center)
p1 may be == po
p2 may be == po
int UT3D_pt_oppptptvc ( Point po,
Point pi,
Point pl,
Vector vl 
)

UT3D_pt_oppptptvc point opposite line (= 180 deg rot.)

int UT3D_2pt_oppptvclen ( Point ,
Point ,
Point ,
Vector ,
double   
)
UT3D_2pt_oppptvclen 2 opposite points (center, vector, dist)
pc is center, p1 is direction vc1 from pc, p2 in reverse direction.
void UT3D_pt_addpt ( Point ,
Point  
)
void UT3D_pt_add_vc__ ( Point ,
Vector  
)
void UT3D_pt_add_vc_par ( Point ,
Vector ,
double   
)
void UT3D_pt_add_3vc_3par ( Point ,
Vector ,
Vector ,
Vector ,
double  ,
double  ,
double   
)
void UT3D_pt_add_pt2 ( Point ,
Point2  
)
void UT3D_pt_add2pt ( Point ,
Point ,
Point  
)
void UT3D_pt_sub_pt2 ( Point ,
Point ,
Point2  
)
void UT3D_pt_sub_pt3 ( Point ,
Point2  
)
void UT3D_pt_tra_pt_dx ( Point ,
Point ,
double   
)
void UT3D_pt_tra_pt_dy ( Point ,
Point ,
double   
)
void UT3D_pt_traptvclen ( Point po,
Point pi,
Vector vc,
double  dist 
)
UT3D_pt_ptvclen transl. point into dir vc dist. lenv
Move point into direction vc with distance dx.
po and pi may be identical.
void UT3D_pt_tra_pt_vc_par ( Point po,
Point pi,
Vector vc,
double  dist 
)

====.==================================================================

UT3D_pt_tra_pt_vc_par transl. point into dir vc dist.lenv (vcLen=1)
Vector has Length 1.; Point = basePoint + (vec * len)
void UT3D_pt_trapt2vc ( Point po,
Point pi,
Vector vc1,
Vector vc2 
)
UT3D_pt_trapt2vc transl. point into 2 directions
po kann mit pi ident sein.
void UT3D_pt_trapt2vc2len ( Point ,
Point ,
Vector ,
double  ,
Vector ,
double   
)
UT3D_pt_trapt2vc2len transl. point into 2 directions (2 len's)
vc1, vc2 must not be normalized.
Move point into direction vc with distance dx.
po kann mit pi ident sein.
void UT3D_pt_tra_pt_2vc_2par ( Point ,
Point ,
Vector ,
double  ,
Vector ,
double   
)
UT3D_pt_tra_pt_2vc_2par transl. point into 2 directions
distance = vc. * l. (real dist if vc has length=1)
po, pi can have same address.
void UT3D_pt_trapt3vc3len ( Point po,
Point pi,
Vector vx,
double  dx,
Vector vy,
double  dy,
Vector vz,
double  dz 
)
UT3D_pt_trapt3vc3len transl. point into 3 directions (3 len's)
Move point into direction vx,vy,vz with distance dx, dy dz.
vx, vy, vz must not be normalized.
po kann mit pi ident sein.
void UT3D_pt_traptptlen ( Point po,
Point pi,
Point pDir,
double  lenv 
)
UT3D_pt_traptptlen transl. point into dir pDir dist. lenv
Move point into direction pi->pDir with distance lenv.
po kann mit pi ident sein.
void UT3D_pt_trapt2pt ( Point po,
Point pi,
Point p1,
Point p2 
)

UT3D_pt_trapt2pt transl. point distance p1 -> p2

int UT3D_pt_tracirlen ( Point pto,
Point pti,
Circ cii,
double  clen 
)
UT3D_pt_tracirlen transl. point circular length
CCW = rad > 0 ;
CW = rad < 0 ;
int UT3D_pt_rotptptangr ( Point pto,
Point ptc,
Point pti,
double *  ar 
)

UT3D_pt_rotptptangr rotate pti around ptc/Z-Axis

void UT3D_pt_rotptptvcangr ( Point pto,
Point pti,
Point ptc,
Vector vz,
double  angr 
)
Punkt pti um die Achse pta/vca um angr weiterdrehen
angr = -2Pi bis +2Pi.
ACHTUNG: vca muss normiert sein !!
int UT3D_pt_rotptm3 ( Point p2,
Point p1,
Mat_4x3  ma 
)

Rotate Point (prepare with UT3D_m3_inirot_angr)

int UT3D_pt_rotciangr ( Point pto,
double  angr,
Circ ci1 
)
UT3D_pt_rotciangr get point on circle from opening-angle
Rotate startpoint of circle around its axis
Input:
angr opening-angle to vector (ci1.pc - ci1.p1)
If angr=0.0 - the resulting point = ci1.p1;
If angr=pc.ango - the resulting point = ci1.p2;
int UT3D_pt_projpt2pt ( Point pp,
double *  len,
Point pt,
Point p1,
Point p2 
)
UT3D_pt_projpt2pt point = project point pt to line p1+p2
retcod 0=OK, 1=pt is on line, 2=Inputerror (vl too short)
int UT3D_pt_projptln ( Point ,
double *  ,
double *  ,
Point ,
Line  
)
UT3D_pt_projptln point = project point to line
Output:
ndist normal distance pt - ln or NULL
par1 parameter for pp on ln or NULL
retcod 0 OK, but point outside limited line
1 pt is on line
2 pp == ln.p1
3 pp == ln.p2
-1 Inputerror (line too short)
int UT3D_pt_projptci ( Point ptn,
Point ptf,
Point pt1,
Circ ci1 
)
UT3D_pt_projptci point = project point to unlim. circ
Output:
ptn point near on (unlim) circ
ptf point far on (unlim) circ; can be NULL
Retcod: 0=OK
-1=Inputerror (pt1 == CircCenter)
int UT3D_pt_projptptvc ( Point pp,
double *  len,
double *  par,
Point pt,
Point pl,
Vector vl 
)
UT3D_pt_projptptvc point = project point pt onto line pl+vl
Output:
pp point pt projected onto line pl+vl
len length pp - pt
par parameter of pp on vl; NULL for none.
retcod 0=OK,
-1=Inputerror (vl too short)
pl - vl gives a line, pt is projected onto this line.
X pt
|
len|
|
x-----x------->vl
pl pp
E001 vl too short
int UT3D_pt_projptel ( int *  numpe,
Point pe,
CurvElli ell,
Point pt 
)
UT3D_pt_projptel proj PT -> CRV-Ellipse
Project a point onto an ellipse.
All possible cases are considered!
IN:
CurvElli *ell ... a 3D - ellipse
Point *pt ... a 3D - point
OUT:
int *numpe ... number of points (0-4 points out)
Point *pe ... points on the ellipse all having the same minimal
distance to the input point
Returncodes:
0 = OK
1 = input error
TODO: gives only one solution !
int UT3D_pt_projptbspl ( int *  nxp,
Point ptab,
double *  ttab,
CurvBSpl bspl,
Point pt 
)
int UT3D_pt_projptptnvc ( Point po,
Point pi,
Point plo,
Vector plz 
)

UT3D_pt_projptptnvc project point pt to plane from Origin, Z-vec

void UT3D_pt_projptpl ( Point ,
Plane ,
Point  
)

UT3D_pt_projptpl point = project point to plane

see UPRJ_app_pt

int UT3D_pt_int2pt2vc ( Point ip1,
Point ip2,
double *  dist,
Point ptu,
Vector vcu,
Point ptv,
Vector vcv 
)
UT3D_pt_int2pt2vc intersect 2 rays
ip1 liegt auf ray1 (ptu/vcu)
ip2 liegt auf ray2 (ptv/vcv)
Returncodes:
0 = Lines parallel or zero-length
1 = OK; dist gives the minimum distance.
2 = OK; lines are crossing, ip1 = ip2, dist = 0.
int UT3D_pt_intptvcplx ( Point px,
Point pl,
Vector vl,
double  plx 
)
UT3D_pt_intptvcplx intersect point/vector with Y-Z-plane
irc 0 OK px = Schnittpunkt
irc -1 kein Schnittpunkt (vl parallel pln)
int UT3D_pt_intptvcply ( Point px,
Point pl,
Vector vl,
double  ply 
)
UT3D_pt_intptvcply intersect point/vector with X-Z-plane
irc 0 OK px = Schnittpunkt
irc -1 kein Schnittpunkt (vl parallel pln)
int UT3D_pt_intptvcplz ( Point px,
Point pl,
Vector vl,
double  plz 
)
UT3D_pt_intptvcplz intersect point/vector with X-Y-plane
irc 0 OK px = Schnittpunkt
irc -1 kein Schnittpunkt (vl parallel pln)
int UT3D_pt_intptvcln ( Point ip1,
Point ip2,
double *  dist,
Point pt1,
Vector vc1,
Line ln2 
)
UT3D_pt_intptvcln intersect ray - lineSegment
ip1 liegt auf ray (pt1/vc1)
ip2 liegt auf Line ln2
Returncodes:
0 = Lines parallel or zero-length
1 = OK; dist gives the minimum distance.
2 = OK; lines are crossing, dist=0, ip1=ip2, but outside lineSegment.
3 = OK; lines are crossing, dist=0, ip1=ip2 and inside lineSegment.
int UT3D_pt_intptvcxpln ( Point pti,
Point ptl,
Point ptpl,
Vector vcpl 
)
UT3D_pt_intptvcxpln intersect line(x-parallel) X plane (pt-vc)
Input:
ptl Point on line (direction of line = 1,0,0)
ptpl Point in plane
vcpl perpendicular Vector to plane (muss nicht normiert sein);
Returncodes:
0 = OK
1 = no intersection (parallel)
See also UT3D_ln_int2pl UT3D_ptvc_int2pl UT3D_pt_intptvcpl
int UT3D_pt_intptvcypln ( Point pti,
Point ptl,
Point ptpl,
Vector vcpl 
)
UT3D_pt_intptvcypln intersect line(y-parallel) X plane (pt-vc)
Input:
ptl Point on line (direction of line = 0,1,0)
ptpl Point in plane
vcpl perpendicular Vector to plane (muss nicht normiert sein);
Returncodes:
0 = OK
1 = no intersection (parallel)
See also UT3D_ln_int2pl UT3D_ptvc_int2pl UT3D_pt_intptvcpl
int UT3D_pt_intptvczpln ( Point pti,
Point ptl,
Point ptpl,
Vector vcpl 
)
UT3D_pt_intptvczpln intersect line(z-parallel) X plane (pt-vc)
Input:
ptl Point on line (direction of line = 0,0,1)
ptpl Point in plane
vcpl perpendicular Vector to plane (muss nicht normiert sein);
Returncodes:
0 = OK
1 = no intersection (parallel)
See also UT3D_ln_int2pl UT3D_ptvc_int2pl UT3D_pt_intptvcpl
int UT3D_pt_intptvcsph ( Point pa,
Point pl,
Vector vl,
Point ps,
double  rs 
)
UT3D_pt_intlnsph intersect unlimited line / sphere
irc -1 Error (vl too short)
irc 0 pl-vl outside sphere
irc 1 touches - OK - 1 point out
irc 2 OK, 2 points out. Richtung entspricht vl.
int UT3D_pt_int2ln ( Point ,
Point ,
double *  ,
Line ,
Line  
)
UT3D_pt_int2ln intersect 2 unlimitedLines; get 2 points & dist.
IN:
Line *ln1 line 1
Line *ln2 line 2
Point *ip1 NULL: do not compute ip1
double *dist NULL = do not compute dist
OUT:
Point *ip1 point on line 1;
Point *ip2 point on line 2
double *dist minimal distance between ip1 and ip2
Returncodes:
-1 = Lines parallel or zero-length
0 = OK; dist gives the minimum distance.
1 = OK; distance (ip1-ip2) is less than UT_TOL_pt
intersect limited lines: UT3D_pt_int2pt2pt_lim
int UT3D_pt_intperp2ln ( Point po,
Point p1,
Vector v1,
Point p2,
Vector v2 
)
UT3D_pt_intperp2ln inters ln2 with perp.plane to ln1
Plane geht durch p1 normal auf v1; Schnittpunkt liegt auf p2/v2.
po-p1 hat rechten Winkel zu p1-v1.
see UT3D_pt_intptvcpl; pl.po=p1; pl.vz=v1; pt=p2, vln=v2.
Returncodes:
0 = vc parallel to plane; Error
1 = OK;
-1 = p1 und p2 ident; po = p1.
int UT3D_pt_intlnci__ ( int *  np,
Point  xp[],
Line ln,
Circ ci1 
)
UT3D_pt_intlnci__ intersect line - circle (both unlimited)
Intersection of line and circle.
The line need NOT lie in the plane of the circle.
IN:
Line *ln ... 3D-line
Circ *ci ... 3D-circle
OUT:
int *np ... number of intersection points (0,1,2)
Point xp[] ... array of intersection points
Returncodes:
0 = OK
1 = no intersection
int UT3D_pt_intlnci_p ( int *  np,
Point  xp[],
Line ln,
Circ ci1 
)
UT3D_pt_intlnci_p intersection LN-CIR (both unlimited; 0/1/2 points)
Intersection of 3D-line with 3D-circle.
The line must lie in the plane of the circle. !!
IN:
Line *ln ... 3D-line
Circ *ci1 ... 3D-circle
OUT:
int *np ... number of intersection points (0,1,2)
Point xp[] ... array of intersection points
Returncode:
0 = OK
1 = no intersection; xp[0]=pc projected -> ln
int UT3D_pt_intlnsph ( Line ln1,
Point ps,
double  rs 
)
UT3D_pt_intlnsph intersect limited line / sphere
irc -1 Line ganz ausserhalb
int UT3D_pt_intcici ( Point  pa[],
Circ ci1,
int  ci1Lim,
Circ ci2,
int  ci2Lim 
)
UT3D_pt_intcici intersect CIR CIR (gives 0/1/2 points)
IN:
Line *ln 3D-line
Circ *ci1 3D-circle
ci1Lim1 0=limited Circ, 1=unlimited Circ
Circ *ci2 3D-circle
ci1Lim2 0=limited Circ, 1=unlimited Circ
OUT:
Point pa[] array of intersection points; size 2
Returncode:
-2 concentric (same center, radius, z.vec)
-1 no intersection
1 1 intersectionpoint (pa[0])
2 2 intersectionpoints (pa[0] and pa[1])
int UT3D_pt_intplnln ( Point ip,
double *  dist,
Plane pl,
Line ln 
)
UT3D_pt_intplnln intersect LineSegment X Plane
Von pl wird nur p und vz benutzt.
Returncodes:
-1 = LineSegment outside Plane
0 = vc parallel to plane
1 = OK; intersecting ...
2 = ip = ln.p1
3 = ip = ln.p2
intersect unlimited Line X Plane: UT3D_pt_intptvcpln
int UT3D_pt_intlnpl ( Point ,
Plane ,
Line  
)
UT3D_pt_intlnpl point = intersection of line - plane
ln = unlimited line
Returncodes:
0 = line parallel to plane
1 = OK;
int UT3D_pt_intlnpl1 ( Point ,
double *  ,
Point ,
Point ,
double  ,
double   
)
intersect line - plane
OUT
pi Intersectionpoint
dl Faktor Abstand p1 - pi - p2; 0.5 ist genau in der Mitte.
IN
p1, p2 die Linie, die geschnitten wird
dn1 dn2 der Normalabstand der Punkte p1 p2 von der Schnittebene.
(get dn1 from UT3D_slen_ptpl)
pi liegt auf der Geraden p1;p2.
Die Plane wird ebenfalls als (hor-) Linie betrachtet.
pi ist intersection dieser beiden Lines.
dn. sind die NormalAbstaende von p1,p2 auf die Plane (=hor.Linie).
int UT3D_pt_intptvcpln ( Point pti,
Point ptl,
Vector vcl,
Point ptpl,
Vector vcpl 
)
UT3D_pt_intptvcpln intersect line-plane (pt-vc pt-vc)
Line durch Point + Vektor
Plane durch Nullpunkt + Normalvektor.
pl2vz muss nicht normiert sein;
See also UT3D_ln_int2pl UT3D_ptvc_int2pl UT3D_pt_intptvcpl
Returncodes:
0 = OK
1 = no intersection (parallel)
int UT3D_pt_intplnci ( Point  pa[],
Plane pl1,
Circ ci1,
int  ciLim 
)
UT3D_pt_intplnci intersect PLN 360-deg-Circ
IN:
Plane *pl1 Plane
Circ *ci 3D-circle
ciLim 0=limited Circ, 1=unlimited Circ
OUT:
Point pa[] array of intersection points; size 2
Returncode:
-2 = no intersection (parallel planes)
-1 = no intersection (plane passes circle) pa[0]=cp.pc proj -> pl
1 = 1 intersectionpoint (circ touch plane)
2 = 2 intersectionpoints
was UT3D_pt_intplci
int UT3D_pt_intcidpln ( int *  np,
Point  xp[],
Point pc,
Point p1,
Vector vz,
double  dx 
)
UT3D_pt_intcidpln intersect circ / perpend.offsetPlane
unlimited circle only !
Ein Kreis (pc=Mittelpunkt, p1=Punkt am Kreis, vz=Achse)
dx ist der Abstand der Plane vom pc.
Eine Plane normal zur Kreisflaeche im Abstand von dx schneidet den Kreis.
Z-Vektor der Plane ist pc-p1; der vz ist der X-vec der Plane.
Origin der Plane ist ppo (Vom pc in Richtg p1 Abstand dx)
Output: die beiden Schnittpunkte mit der Plane.
np Anzahl Schnittpunkte (0/1/2)
int UT3D_pt_intptvcpl_ ( Point ,
Plane ,
Point ,
Vector  
)
UT3D_pt_intptvcpl_ point = intersection of pt / vc - plane
Von pl wird nur p und vz benutzt.
Returncodes:
0 = vc parallel to plane
1 = OK;
int UT3D_pt_intlnel__ ( int *  np,
Point  xp[],
Line ln,
CurvElli el 
)
UT3D_pt_intlnel__ intersect (unlim.) line and ellipse
Intersection of line and ellipse.
The line need NOT lie in the plane of the ellipse.
IN:
Line *ln ... 3D-line
CurvElli *el ... 3D-ellipse
OUT:
int *np ... number of intersection points (0,1,2)
Point xp[] ... array of intersection points
Returncodes:
0 = OK
1 = no intersection
-1 = ellipse degenerated
int UT3D_pt_intlnel_p ( int *  np,
Point  xp[],
Line ln,
CurvElli el 
)
UT3D_pt_intlnel_p intersection LN-ELL (gives 0/1/2 points)
both unlimited !
!! The line must lie in the plane of the ellipse. !!
Intersection of 3D-line with 3D-ellipse.
!! The line must lie in the plane of the ellipse. !!
IN:
Line *ln ... 3D-line
CurvElli *el ... 3D-ellipse
OUT:
int *np ... number of intersection points (0,1,2)
Point xp[] ... array of intersection points
Returncodes:
0 = OK
1 = no intersection
-1 = ellipse degenerated
int UT3D_pt_ipl_2ptpt2 ( Point pi3,
Point p1,
Point p2,
Point2 pi2 
)
UT3D_pt_ipl_2ptpt2 interpolate PointPosition for 2D-point
Input: 2 3D-points and 1 2D-point (between the 3D-pt's; z-coord missing).
Output: 3D-Point with interpolated Z-coord.
see also UTP_param_p0p1px UTP_px_paramp0p1px
int UT3D_pt_mirptpl ( Point pto,
Point pti,
Plane pln 
)
mirror point about plane
int UT3D_pt_mirptln ( Point pto,
Point pti,
Line ln 
)
mirror point about line
int UT3D_pt_tangptci ( Point po1,
Point po2,
Point pt1,
Circ ci1 
)
UT3D_pt_tangptci tangent from point to circ
RetCod: Nr of solutions; -1,1,2.
int UT3D_pt_elfoc ( Point fp1,
Point fp2,
CurvElli el 
)
UT3D_pt_elfoc focal points of ellipse
Computation of the focal points of an ellipse.
IN:
CurvElli *el ... 3D-ellipse
OUT:
Point *fp1 focal point 1 (in direction of main axis); NULL = none
Point *fp2 focal point 2 NULL = none
Returncodes:
0 = OK
-1 = input error
int UT3D_pt_evparln ( Point pto,
double  lpar,
Line ln1 
)
UT3D_pt_evparln evaluate param.point on line
einen Punkt auf Line ln1 errechnen;
lpar = Abstandswert 0 - 1.
lpar=0: pto = ln1.p1;
lpar=1: pto = ln1.p2;
int UT3D_pt_evparci ( Point pto,
double  lpar,
Circ ci1 
)
UT3D_pt_evparci evaluate param.point on circ
einen Punkt auf Circ ci1 errechnen;
lpar = Abstandswert 0 - 1.
lpar=0: pto = ci1.p1;
lpar=1: pto = ci1.p2;
int UT3D_pt_m3 ( Point pto,
Mat_4x3  ma 
)

UT3D_pt_m3 copy origin out of 4x3-matrix

void UT2D_pt_traptm3 ( Point2 p2,
Mat_4x3  mata,
Point2 p1 
)
UT2D_pt_traptm3 apply transformation to point (from 4x3-matrix)
p2 und p1 duerfen ident sein
void UT3D_pt_traptm3 ( Point ,
Mat_4x3  ,
Point  
)
UT3D_pt_traptm3 apply transformation to point (from 4x3-matrix)
p2 und p1 duerfen ident sein
VX VY VZ Nullpunkt
[0][0]=vx.dx [0][1]=vy.dx [0][2]=vz.dx [0][3]=o.x
[1][0]=vx.dy [1][1]=vy.dy [1][2]=vz.dy [1][3]=o.y
[2][0]=vx.dz [2][1]=vy.dz [2][2]=vz.dz [2][3]=o.z
Mat via Adresse:
printf(" vz=%f,%f,%f\n",(*mata)[0][2],(*mata)[1][2],(*mata)[2][2]);
void UT3D_pt_traptm4 ( Point p2,
Mat_4x4  ma,
Point p1 
)
UT3D_pt_traptm4 apply transformation to point (from 4x4-matrix)
p1 in p2 out.
int UT2D_ptvc_ck_int2pt ( int  mode,
Point2 p1s,
Vector2 v1,
Point2 p2s,
Point2 p2e 
)
UT2D_ptvc_ck_int2pt check if Line|Ray Pt-Vec intersects Line Pt-Pt
Line = both sides limited; Ray = one side unlimited.
Input:
mode = 0 p1s-v1: both sides unlimited; p2s-p2e: both sides limited.
mode = 1 p1s-v1: one side unlimited; p2s-p2e: both sides limited.
Returncodes:
-1 = no intersection between unlimited Line p1s-v1 and segment p2s-p2e.
0 = OK; lines intersect.
1 = p1s-v1 goes tru p2s
2 = p1s-v1 goes tru p2e
3 = p1s-v1 and p2s-p2e are parallel; no intersection-checks yet !
4 = p1s lies exact on p2s-p2e. (ONLY if mode=1)
5 = p1s and p2s are equal (ONLY if mode=1)
6 = p1s and p2e are equal (ONLY if mode=1)
int UT3D_ptvc_int2pl ( Point pt,
Vector vc,
Plane pl1,
Plane pl2 
)
UT3D_ptvc_int2pl point/vector = intersection of 2 planes
Retcodes:
1 - OK
0 - no intersection; planes parallel
Intersectionpoint is nearest point to both origins.
int UT3D_ptvc_int2pln ( Point pti,
Vector vci,
Point pl1pt,
Vector pl1vz,
Point pl2pt,
Vector pl2vz 
)
UT3D_ptvc_int2pln point/vector = intersection of 2 planes
Planes durch Nullpunkt und Normalvektoren.
pl2vz muss nicht normiert sein;
vci (out) ist normiert.
See also UT3D_ln_int2pl UT3D_ptvc_int2pl UT3D_pt_intptvcpl
Returncodes:
0 = OK
1 = no intersection (parallel planes)
int UT3D_ptvc_ox ( Point pta,
Vector vca,
ObjGX oxi 
)
UT3D_ptvc_ox get axis (PT+VC) from PT|LN|CI|PLN
double UT3D_angr_3pt ( Point p1,
Point pc,
Point p2 
)

UT3D_angr_3pt angle between 3 points

double UT3D_angr_2vc__ ( Vector ,
Vector  
)
UT3D_angr_2vc__d angle between two vec's (always 0 <= PI)
v1, v2 must not be normalized.
see UT3D_angr_2vc_n
double UT3D_angr_3vc__ ( Vector vz,
Vector v1,
Vector v2 
)
UT3D_angr_3vc__ angle between 2 vectors; vz gives direction (pos|neg)
RetCod: angle between v1 and v2;
range from pi to -pi
double UT3D_angr_3vcn_CCW ( Vector vz,
Vector v1,
Vector v2 
)
UT3D_angr_3vcn_CCW angle between 2 vectors CCW around vz; all normalized
Rotation CCW around vz
RetCod: angle CCW between v1 and v2;
Input:
v1, v2 compute angle between these vectors
vz up-vector (necessary if angle > PI)
Output:
retCod angle 0 < 2*PI
double UT3D_angr_ci_par1 ( Circ ci1,
double  par1 
)
UT3D_angr_ci_par1 get opening-angle from parameter 0-1
Input:
par1 0. = startpoint of circ, 1. = endpoint of circ
RetCod:
angle opening-angle to vector (ci.pc - ci.p1)
double UT3D_angr_ci__ ( Circ ci1)
UT3D_angr_ci__ opening angle of Circ (ci.p1 - ci.p2)
ACHTUNG: nicht fuer Vollkreise !
int UT3D_2angr_vc ( double *  az,
double *  ay,
Vector vc1 
)
UT3D_2angr_vc 2 opening angels of vec (Y-ang = kipp, Z-ang = dreh)
vc1 entspricht der X-Achse; dise wird so gedreht, dass dann vc1
Die Winkel sind so gesetzt, dass die X-Achse einer DL-Liste dann in
Richtung vc1 zeigt. (soll Z-Achse benutzt werden: ay -= 90. degree.)
int UT3D_atan_vcpl ( double *  kvc,
Vector vci,
Plane pli 
)
den Anstieg (tan) der Geraden vci bezueglich Ebene pli
vci muss nicht normiert sein
irc: 0 OK
irc: -1 vci ist normal auf die Plane pli
int UT3D_compvc0 ( Vector v1,
double  tol 
)
UT3D_compvc0 compare vectors for 0,0,0.
Retcode 0: v1 <> 0.0 (gr. oder kl. tol)
1: v1 = 0.0 (innerhalb tol)
if(UT3D_compvc0 (&vz, UT_TOL_min0) == 1) printf("vec is 0,0,0 !\n");
int UT3D_comp2vc_d ( Vector ,
Vector ,
double   
)
UT3D_comp2vc compare 2 vectors for parallel and antiparallel
tolerances: see func. UT3D_vc_ck_parpl
RC=1: die Vektoren sind gleich.
RC=0: die Vektoren sind unterschiedlich.
int UT3D_comp2vc_p ( Vector ,
Vector ,
double   
)
UT3D_comp2vc_p compare 2 vectors for parallel
tolerances: see func. UT3D_vc_ck_parpl
RC=1: die Vektoren sind gleich.
RC=0: die Vektoren sind unterschiedlich.
if(UT3D_comp2vc_p(&ciO.vz, &UT3D_VECTOR_IZ, UT_TOL_min1) != 0) gleich
void UT3D_vc_pt ( Vector ,
Point  
)
int UT3D_vc_ck_parpl ( Vector vci,
Plane pli,
double  tol 
)
UT3D_vc_ck_parpl check if vec is parallel to plane
tol ca 0.1 (zB UT_TOL_cv
tol 0.02 ist 1.15 Grad (bei Vec-Laenge 1 !)
tol 0.01 ist 0.60 Grad (bei Vec-Laenge 1 !)
tol 0.004 ist 0.23 Grad (bei Vec-Laenge 1 !)
RetCode:
0 = vec is NOT parallel to plane
1 = vec is parallel to plane
int UT3D_vc_ckperp_2vc1 ( Vector vc1,
Vector vc2,
double  tol 
)
UT3D_vc_ckperp_2vc1 check if 2 normalized-vectors are normal (perp.)
For not-normalized vectors use UT3D_vc_ck_perpvc.
tol entspricht etwa der Abweichung; 1 / 0.1 = Steigung 10 : 1;
0.1 ~ 5.7 deg, 0.01 ~ 0.5 deg ..
RetCode:
0 = vc1 is NOT normal to vc2
1 = vc1 is normal to vc2
int UT3D_vc_ck_std ( Vector vc1)
UT3D_vc_ck_std check for standardVector (DX DY DZ DIX DIY DIZ)
RetCod:
0 not parallel to x, y, or z-vector
1 DX
2 DY
3 DZ
-1 DIX
-2 DIY
-3 DIZ
index: i = v; if(i < 0) i = 3 - i; // gives 1-6
DBindex: dbi = -i;
int UT3D_parvc_2vcbp ( double *  dl,
int  mainPln,
Vector v1,
Vector v2 
)
UT3D_parvc_2vcbp parameter of distance of vec1 projected on vec2
mainPln: Berechnungsebene BackPlane ex UT3D_bp_vcz.
dl ist zwischen 0 bis 1; wenn dl=0.5 liegt der Endpunkt von V2
genau in der Mitte des Vektors V2.
V1,V2 have same startpoint s.
x
/|
/ |
V1 |
/ |
/ |
s---------V2-------x
dl
int UT3D_2parvc_3vcbp ( double *  ,
double *  ,
int  ,
Vector ,
Vector ,
Vector  
)
UT2D_2parvc_3vc project end of vec1 along vec2 on vec3
mainPln: Berechnungsebene BackPlane ex UT3D_bp_vcz.
Zu gegebenen Vektoren v1, v2, v3 finden wir Zahlen x und y so,
dass dx * v1 + dy * v3 = v2.
dx/dy sind zwischen 0 bis 1; wenn dx=0.5 liegt der Endpunkt von V2
genau in der Mitte des Parallelogramss V1-V3.
y
\ V1,V2,V3 have same startpoint s.
dy \-----------x
\ / \
\ / \
V3 \ V2 \
\ / \
\ / \
s----------------------------x
dx V1
void UT3D_vc_txt ( Vector vc,
char *  txt 
)

UT3D_vc_txt Vector from text

void UT3D_vc_2ptlen ( Vector ,
Point ,
Point ,
double   
)

UT3D_vc_2ptlen Vector = Point -> Point, set Length

void UT3D_vc_angr ( Vector vc,
double  angr 
)

UT3D_vc_angr Vector = Angle_X_axis

void UT3D_vc_2angr ( Vector ,