gCAD3D 2.40
ut_geo3d.c File Reference

3D geometric point vector line circle More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_ox_base.h"
#include "../ut/ut_math.h"
#include "../ut/ut_bspl.h"
#include "../ut/ut_rbspl.h"
#include "../ut/ut_plg.h"
#include "../ut/ut_elli.h"
#include "../ut/func_types.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_memTab.h"
#include "../xa/xa_msg.h"

Macros

#define CONVEX   1
 
#define CONCAV   -1
 

Functions

double UT3D_angr_vc2pt (Point *pz, Vector *vz, Point *p1, Point *p2)
 
double UT3D_angr_vc2vc (Vector *vc1, Vector *vcx, Vector *vcy)
 
double UT3D_angr_vcpl_tilt (Plane *pl1, Vector *vc1)
 
double UT3D_angr_vcpl_z (Plane *pl1, Vector *vc1)
 
double UT3D_angr_2pl (Plane *pl1, Plane *pl2)
 
int UT3D_angrR_vc (double *ar, Vector *vc1)
 
int UT3D_angrT_vc (double *at, Vector *vc1)
 
int UT3D_2angr_2vc (double *angX, double *angZ, Vector *vcX, Vector *vcY)
 
int UT3D_2angr_vc (double *az, double *ay, Vector *vc1)
 
int UT3D_3angr_2vc (double *az1, double *ay, double *az2, Vector *vx, Vector *vz)
 
int UT3D_atan_vcpl (double *kvc, Vector *vci, Plane *pli)
 
int UT3D_pt_intptvcln (Point *ip1, Point *ip2, double *dist, Point *pt1, Vector *vc1, Line *ln2)
 
int UT3D_pt_int2pt2vcn_lim (Point *px, double *ux_ab, double *ux_cd, Point *pta, Vector *vab, Point *ptc, Vector *vcd, double tol)
 
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_intptvczpln (Point *pti, Point *ptl, Point *ptpl, Vector *vcpl)
 
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_int2pt2pt_lim (Point *px, double *ux_ab, double *ux_cd, Point *pta, Point *ptb, Point *ptc, Point *ptd, double tol)
 
int UT3D_2par_int2pt2vc (double *par1, double *par2, Point *pa, Vector *vab, Point *pc, Vector *vcd)
 
int UT3D_pt1_int2pt2pt (Point *ip, Point *pa, Point *pb, Point *pc, Point *pd)
 
int UT3D_pt_int2pt2vc (Point *ip1, Point *ip2, double *dist, Point *ptu, Vector *vcu, Point *ptv, Vector *vcv)
 
int UT3D_ci_cicird (Circ ca[], Circ *ci1, Circ *ci2, double rad1, int sNr)
 
int UT3D_ci_ptptrd (Circ ca[], Point *pt1, Point *pt2, double rad1)
 
int UT3D_ci_lnptrd (Circ *cia, Line *ln1, Point *pt1, Vector *vc, double rdc)
 
int UT3D_ci_ciptrd (Circ ca[], Circ *ci1, Point *pt1, double rad1)
 
int UT3D_ci_lncird (Circ ca[], Line *ln1, Circ *ci1, double rad1, int sNr)
 
int UT3D_ci_2lnrd (Circ ca[], Line *ln1, Line *ln2, double rad1, int sNr)
 
int UT3D_ci_intplsph (Circ *cio, Plane *pli, Sphere *spi)
 
int UT3D_ci_tracivc (Circ *cio, Circ *cii, Vector *vc1)
 
void UT3D_obj_vctra (ObjG *o2, ObjG *o1, Vector *vc1)
 
int UT3D_obj_obj2 (ObjGX *oo, ObjGX *oi, Memspc *memSeg)
 
ObjG UT3D_obj_ln (Line *ln1)
 
ObjG UT3D_obj_ci (Circ *ci1)
 
int UT3D_cv3_linear (int *pNr, Point *pTab, double tol)
 
int UT3D_cv_delia (int *pNr, Point *pTab, char *ptStat)
 
int UT3D_sr_rev_obj (int sr1, int sr2)
 
int UT3D_sr_ci (Circ *ac1)
 
int UT3D_sr_el (CurvElli *el1)
 
int UT3D_sr_npt_bp (int pNr, Point *pa, int bp)
 
int UT3D_sr_polc (int ptNr, Point *pa, Vector *vcn, int mode)
 
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_cksq_4pt (Point *pp1, Point *pp2, Point *pp3, Point *pp4)
 
int UT3D_bplen_2pt (double *lnv, Point *p1, Point *p2)
 
double UT3D_lenB_vc (Vector *vc1)
 
int UT3D_bplen_vc (double *lnv, Vector *vc1)
 
double UT3D_len_ci (Circ *ci1)
 
double UT3D_len_ln (Line *ln)
 
double UT3D_slen_ptpl (Point *pt, Plane *pl)
 
double UT3D_lenB_2pt (Point *p1, Point *p2)
 
double UT3D_len_2pt (Point *p1, Point *p2)
 
double UT3D_lenq_PtPt (Point *p1, Point *p2)
 
int UT3D_lenq_PtLn (double *lenq, Point *p, Point *p1, Point *p2)
 
int UT3D_minLen_3pt (double *dp, Point *p0, Point *p1, Point *p2)
 
int UT3D_minLen_npt (Point *p0, Point *pa, int pNr)
 
int UT3D_minLen_4pt (double *dp, Point *p1a, Point *p1e, Point *p2a, Point *p2e)
 
double UT3D_slen_3pt (Point *p1, Point *p2, Point *p3)
 
double UT3D_nlen_2ptvc (Point *p1, Point *pv, Vector *vc)
 
int UT3D_nlenq_3pt (double *qlen, Point *pa, Point *pb, Point *pc)
 
int UT3D_nlenq_2ptvc (double *qlen, Point *pc, Point *pa, Vector *vab)
 
int UT3D_nlenq_2vc (double *qlen, Vector *vac, Vector *vab)
 
double UT3D_nlen_3pt (Point *p1, Point *p2, Point *p3)
 
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)
 
int UT3D_slenq_ptptvc (double *qlen, Point *pa, Point *pb, Point *pc)
 
double UT3D_slen_2ptvc (Point *p1, Point *p2, Vector *vc)
 
int UT3D_comp4pt (Point *p1a, Point *p1e, Point *p2a, Point *p2e, double tol)
 
int UT3D_compn4pt (Point *p1, Point *p2, Point *p3, Point *p4)
 
int UT3D_sid_ptptvc (Point *ptx, Point *pto, Vector *vz)
 
int UT3D_sid_ptpl (Point *pt, Plane *pl)
 
int UT3D_sid_pt_pt2vc (Point *pt0, Vector *vx, Vector *vy, Point *pt1)
 
int UT3D_sid_3pt (Point *p1, Point *p2, Point *p3)
 
int UT3D_sid_2vc (Vector *v1, Vector *v2)
 
int UT3D_pt_ck_linear (int np, Point *ptab, double tol)
 
int UT3D_pt_ck_npt (Point *p0, Point *pTab, int pNr, double tol)
 
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_inLine (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_onLine (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_onLnSeg (Point *p1, Point *p2, Point *p3, double tol)
 
int UT3D_pt_ck_inSph (Point *pt, Point *ps, double rs)
 
Point UT3D_pt_pt2 (Point2 *pt20)
 
Point UT3D_pt_pt2z (Point2 *pt20, double zVal)
 
void UT3D_pt_3db (Point *pt, double x, double y, double z)
 
void UT3D_pt_mid2pt (Point *po, Point *p1, Point *p2)
 
int UT3D_pt_mid_pta (Point *pto, Point *pTab, int ptNr)
 
void UT3D_pt_midci (Point *po, Circ *ci1)
 
int UT3D_pt_std_ci (Point *po, int imod, Circ *ci1)
 
int UT3D_ptvcpar_std_dbo (Point *pto, Vector *vco, double *par, int pType, int dbtyp, long dbi)
 
int UT3D_ptvcpar1_std_obj (Point *pto, Vector *vco, double *par, int pType, int cvTyp, void *cvDat)
 
int UT3D_2pt_oppptvclen (Point *p1, Point *p2, Point *pc, Vector *vc1, double dist)
 
int UT3D_ipt_ckfar_npt (Point *p0, Point *ptTab, int ptNr)
 
int UT3D_ipt_cknear_3pt (Point *p0, Point *p1, Point *p2)
 
int UT3D_ipt_cknear_npt (Point *p0, Point *ptTab, int ptNr)
 
int UT3D_ipt_cknearn_npt (Point *p0, Point *ptTab, int ptNr, int distNr)
 
int UT3D_ipt2_npt (int *ip1, int *ip2, Point *pta, int pNr)
 
int UT3D_ipt2_nptvc (Point *pt1, Point *pt2, int mode, Point *pta, int iNr, Vector *vc)
 
int UT3D_pt_ck_perp_2pt (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)
 
void UT3D_pt_opp2pt (Point *po, Point *p1, Point *p2)
 
int UT3D_pt_oppptptvc (Point *po, Point *pi, Point *pl, Vector *vl)
 
void UT3D_pt_tra_pt_vc_par (Point *po, Point *pi, Vector *vc, double dist)
 
void UT3D_pt_traptvclen (Point *po, Point *pi, Vector *vc, double lenv)
 
void UT3D_pt_trapt2vc (Point *po, Point *pi, Vector *vc1, Vector *vc2)
 
void UT3D_pt_tra_pt_2vc_2par (Point *po, Point *pi, Vector *vc1, double l1, Vector *vc2, double l2)
 
void UT3D_pt_trapt2vc2len (Point *po, Point *pi, Vector *vc1, double len1, Vector *vc2, double len2)
 
void UT3D_pt_trapt3vc3len (Point *po, Point *pi, Vector *vx, double dx, Vector *vy, double dy, Vector *vz, double dz)
 
void UT3D_pt_trapt2pt (Point *po, Point *pi, Point *p1, Point *p2)
 
void UT3D_pt_traptptlen (Point *po, Point *pi, Point *pDir, double lenv)
 
int UT3D_pt_tracirlen (Point *pto, Point *pti, Circ *cii, double clen)
 
int UT3D_pt_rotciangr (Point *pto, double angr, Circ *ci1)
 
int UT3D_pt_rotptm3 (Point *p2, Point *p1, Mat_4x3 ma)
 
int UT3D_pt_rotptptangr (Point *pto, Point *ptc, Point *pti, double *ar)
 
void UT3D_pt_rotptptvcangr (Point *pto, Point *pti, Point *pta, Vector *vca, double angr)
 
int UT3D_pt_projptln (Point *pp, double *ndist, double *par1, Point *pt, Line *ln)
 
int UT3D_pt_projptci (Point *ptn, Point *ptf, Point *pt1, Circ *ci1)
 
int UT3D_pt_projpt2pt (Point *pp, double *len, Point *pt, Point *p1, Point *p2)
 
int UT3D_pt_projptptvc (Point *pp, double *len, double *par, Point *pt, Point *pl, Vector *vl)
 
int UT3D_pt_projptptnvc (Point *po, Point *pi, Point *plo, Vector *plz)
 
void UT3D_pt_projptpl (Point *pp, Plane *pl, Point *pt)
 
int UT3D_pt_intplnln (Point *ip, double *dist, Plane *pl, Line *ln)
 
int UT3D_pt_intlnpl (Point *ip, Plane *pl, Line *ln)
 
int UT3D_pt_intptvcpl_ (Point *ip, Plane *pl, Point *pt, Vector *vln)
 
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 UT3D_pt_intlnpl1 (Point *pi, double *dl, Point *p1, Point *p2, double dn1, double dn2)
 
int UT3D_pt_intptvcpln (Point *pti, Point *ptl, Vector *vcl, Point *ptpl, Vector *vcpl)
 
int UT3D_pt_intperp2ln (Point *po, Point *p1, Vector *v1, Point *p2, Vector *v2)
 
int UT3D_pt_ipl_2ptpt2 (Point *pi3, Point *p1, Point *p2, Point2 *pi2)
 
int UT3D_pt_mirptln (Point *pto, Point *pti, Line *ln1)
 
int UT3D_pt_mirptpl (Point *pto, Point *pti, Plane *pln)
 
int UT3D_isConvx_ptTab (int pNr, Point *pa)
 
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)
 
int UT3D_pt_tangptci (Point *po1, Point *po2, Point *pt1, Circ *ci1)
 
int UT3D_pt_tng_ci_vc (Point *pto, Circ *ci1, Vector *vc1, int imod)
 
int UT3D_pt_evpar2pt (Point *po, double lpar, Point *p1, Point *p2)
 
int UT3D_pt_evparln (Point *pto, double lpar, Line *ln1)
 
int UT3D_pt_evparci (Point *pto, double lpar, Circ *ci1)
 
int UT3D_pt_seg_par_nln (Point *p1, int is, double ps, ObjGX *cv1)
 
int UT3D_pt_evparcrv (Point *pto, double lpar, int typ, void *data)
 
int UT3D_pt_m3 (Point *pto, Mat_4x3 ma)
 
void UT3D_pt_traptm3 (Point *p2, Mat_4x3 mata, Point *p1)
 
void UT3D_pt_traptm4 (Point *p2, Mat_4x4 ma, Point *p1)
 
int UT3D_compvcNull (Vector *v1)
 
int UT3D_compvc0 (Vector *v1, double tol)
 
int UT3D_comp2vc_p (Vector *v1, Vector *v2, double tol)
 
int UT3D_comp2vc_d (Vector *v1, Vector *v2, double tol)
 
int UT3D_vc_ck_parl_vc (Vector *v1, Vector *v2, double tol)
 
int UT3D_vc_ck_aparl_vc (Vector *v1, Vector *v2, double tol)
 
int UT3D_vc_ck_parpl (Vector *vci, Plane *pli, double tol)
 
int UT3D_vc_ck_perpvc (Vector *vc1, Vector *vc2, double tol)
 
int UT3D_vc_ckperp_2vc1 (Vector *vc1, Vector *vc2, double tol)
 
int UT3D_vc_ck_std (Vector *vc1)
 
int UT3D_pt_pt2bp (Point *p3, Point2 *p2, int bp)
 
void UT3D_pt_txt (Point *pt, char *txt)
 
void UT3D_vc_txt (Vector *vc, char *txt)
 
int UT3D_vc_bp (Vector *vn, int bp)
 
int UT3D_2vc_pta (Vector *vc1, Vector *vc2, int pNr, Point *pta)
 
void UT3D_vc_ln (Vector *vc, Line *ln)
 
void UT3D_vc_2ptlen (Vector *vc, Point *p1, Point *p2, double vlen)
 
void UT3D_vc_angr (Vector *vc, double angr)
 
void UT3D_vc_2angr (Vector *vc, double angX, double angZ)
 
void UT3D_vc_2vc (Vector *vco, Vector *vc1, Vector *vc2)
 
int UT3D_ptvc_eval_ci_angr (Point *pto, Vector *vct, Circ *ci1, double angr)
 
int UT3D_vc_tng_crv_pt (Vector *vco, Point *pti, int typ, void *data)
 
int UT3D_vc_tng_ci_pt (Vector *vct, Point *p1, Circ *ci)
 
int UT3D_vc_Zup (Vector *v2, Vector *v1)
 
void UT3D_vc_perp1vc (Vector *vp, Vector *vi)
 
void UT3D_vc_perp2vc (Vector *vp, Vector *v1, Vector *v2)
 
int UT3D_vc_perpvc2pt (Vector *vp, Vector *vx, Point *pc, Point *py)
 
int UT3D_vc_perp_npt (Vector *vn, Point *pa, int pNr)
 
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_perpvcplXY (Vector *vx, Vector *vc1)
 
int UT3D_vc_perpcv (Vector *vcz, int pNr, Point *pTab)
 
int UT3D_vc_perp_npt_bp_ix (Vector *vcn, Point *pa, int *ia, int bp)
 
int UT3D_vc_perppta (Vector *vcn, int pNr, Point *pta)
 
void UT3D_vc_normalize (Vector *vn, Vector *vc)
 
void UT3D_vc_setLength (Vector *vco, Vector *vci, double new_len)
 
int UT3D_vc_setLenLen (Vector *vco, Vector *vci, double newLen, double actLen)
 
int UT3D_vc_rotangr (Vector *vco, Vector *vci, double *ar)
 
void UT3D_vc_rot3angr (Vector *vco, Vector *vci, double alpha, double beta, double gamma)
 
int UT3D_vc_rotvcvcangr (Vector *vo, Vector *va, Vector *vi, double angr)
 
void UT3D_vc_rotvcangr (Vector *vco, double a1, Vector *Vi, Vector *Va)
 
int UT3D_vc_perpvcvc (Vector *v3, Vector *v1, Vector *v2)
 
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 *vco, Plane *pl, Vector *vci)
 
int UT3D_vc_mirvcpl (Vector *vco, Vector *vci, Plane *pln)
 
int UT3D_vc_mirvcln (Vector *vco, Vector *vci, Line *ln1)
 
void UT3D_vc_travcm3 (Vector *b, Mat_4x3 mata, 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 *lo1, Point *lo2, Point *l11, Point *l12, Point *l21, Point *l22, double tol)
 
int UT3D_ln_ck_degen (Line *ln)
 
int UT3D_ln_ck_parpl (double *dist, Line *ln, Plane *pl, double tol)
 
int UT3D_ln_unlim (Line *lno, int lTyp)
 
void UT3D_ln_6db (Line *ln, double x1, double y1, double z1, double x2, double y2, double z2)
 
void UT3D_ln_2pt2 (Line *ln1, Point2 *pta, Point2 *pte)
 
int UT3D_ptNr_ci (Circ *ci1, double tol)
 
int UT3D_ck_ci180 (Circ *ci1)
 
int UT3D_ck_ci360 (Circ *ci1)
 
int UT3D_cksid_civc (Circ *ci1, Vector *vc1)
 
int UT3D_ci_cipt180 (Circ *ci1, Point *p1)
 
int UT3D_ci_cipt360 (Circ *ci1, Point *p1)
 
int UT3D_ci_cip1 (Circ *ci1, Point *p1)
 
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_rdc_3pt (double *rdc, Point *pp1, Point *pp2, Point *pp3)
 
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_ci_ptvcrd (Circ *ci, Point *ps, Vector *vs, double rd, Vector *vz, double a1)
 
int UT3D_ci_3pt (Circ *cpo, Point *pp1, Point *pp2, Point *pp3)
 
int UT3D_ci_2ptvcrd (Circ *cia, Point *pp1, Point *pp2, Vector *vz, double rdc)
 
int UT3D_ci_ptptvcrd (Circ *ci, Point *p1, Point *p2, double rd, Vector *vz, int sr, int iMod)
 
int UT3D_ci_pcvzpt180 (Circ *ci1, Point *pc, Vector *vz, Point *p1, int dreh)
 
int UT3D_ci_inv1 (Circ *ci1)
 
int UT3D_ci_inv2 (Circ *ci1)
 
int UT3D_ci_inv3 (Circ *ci1)
 
int UT3D_ci_ptvcr (Circ *ci1, Point *pc, Vector *vcz, double rdc)
 
int UT3D_ci_pt2vcr (Circ *ci1, Point *pc, Vector *vz, Vector *vx, double rc)
 
Circ UT3D_ci_ci2 (Circ2 *ci20)
 
Circ UT3D_ci_obj2 (ObjG2 *ci20)
 
Circ UT3D_ci_obj (ObjG *ci_in)
 
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)
 
void UT3D_cv_ci (Point cv[], int *ptanz, Circ *ci1, int ptmax, double tol)
 
int UT3D_npt_ci (Point *pa, int pNr, Circ *ci1)
 
int UT3D_pta_rot__ (Point *p2Tab, Point *p1Tab, int ptNr, Point *pc, Vector *vz, double ar)
 
int UT3D_cv_inv (int ptNr, Point *pta)
 
int UT3D_cv_realg (int ptNr, Point *pta, int ista)
 
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)
 
int UT3D_ptvc_tng_crv_par (Point *pto, Vector *vct, int oTyp, void *obj, int pTyp, double par)
 
double UT3D_angr_3pt (Point *p1, Point *pc, Point *p2)
 
double UT3D_angr_2vc__ (Vector *v1, Vector *v2)
 
double UT3D_angr_2vc_n (Vector *v1, Vector *v2)
 
double UT3D_angr_3vc__ (Vector *vz, Vector *v1, Vector *v2)
 
double UT3D_angr_3vcn_CCW (Vector *vz, Vector *v1, Vector *v2)
 
double UT3D_angr_4pt (Point *p11, Point *p12, Point *p21, Point *p22)
 
double UT3D_angr_ci_p1_pt (Circ *ci1, Point *pti)
 
double UT3D_angr_ci_par1 (Circ *ci1, double par1)
 
double UT3D_angr_ci__ (Circ *ci1)
 
int UT3D_pl_pta (Plane *pl, int ptNr, Point *pta)
 
int UT3D_pl_bpdb (Plane *plo, int bp, double dbc)
 
int UT3D_pl_3pt (Plane *pl, Point *p1, Point *p2, Point *p3)
 
int UT3D_pl_ln (Plane *pln, Line *lna)
 
void UT3D_pl_2ln (Plane *pl1, Line *ln1, Line *ln2)
 
int UT3D_pl_ell (Plane *pl1, CurvElli *el1)
 
int UT3D_pl_obj (Plane *pl1, int typ, void *obj)
 
int UT3D_pl_ci (Plane *pl1, Circ *ci1)
 
int UT3D_pl_nobj (Plane *pl1, int oNr, ObjGX *oTab)
 
void UT3D_pl_XYZ (Plane *pl1)
 
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)
 
int UT3D_pl_ptvc (Plane *pl, Point *pt, Vector *vc)
 
void UT3D_pl_pto_vcz_ptx (Plane *pl1, Point *po, Vector *vz, Point *ptx)
 
void UT3D_pl_invert (Plane *pl)
 
int UT3D_pl_rotZangr (Plane *pln1, double *ar)
 
int UT3D_pl_rotYangr (Plane *pln1, double *ar)
 
int UT3D_pl_rotpt (Plane *plo, Plane *pli, Point *ptx)
 
void UT3D_pl_ptpl (Plane *pl, Point *pt1)
 
void UT3D_pl_p (Plane *pl)
 
int UT3D_pl_mirln (Plane *plno, Plane *plni, Line *ln1)
 
int UT3D_pl_mirpl (Plane *plno, Plane *plni, Plane *plnm)
 
int UT3D_pl_tra_m3 (Plane *pl2, Plane *pl1, Mat_4x3 ma)
 
int UT3D_m3_get (void *out, int mode, Mat_4x3 ma)
 
int UT3D_m3_set (Mat_4x3 ma, int mode, void *da)
 
int UT3D_m3_copy (Mat_4x3 mo, Mat_4x3 mi)
 
int UT3D_m3_iniZrot_angr (Mat_4x3 ma, Point *ptOri, double ar)
 
int UT3D_m3_inirot_angr (Mat_4x3 ma, Point *pa, Vector *va, double angr)
 
int UT3D_m3_inirot_2vc (Mat_4x3 ma1, Point *pto, Vector *vc1, Vector *vc2)
 
void UT3D_m3_load (Mat_4x3 ma, Vector *vx, Vector *vy, Vector *vz)
 
void UT3D_m3_load_o (Mat_4x3 ma, Point *ori)
 
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_loadpl (Mat_4x3 m1, Plane *pl1)
 
int UT3D_m3_invm3 (Mat_4x3 im1, Mat_4x3 m1)
 
int UT3D_m3_traVc (Mat_4x3 *ma, Vector *trVc)
 
int UT3D_m3_tram3m3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2)
 
int UT3D_m3_scl (Mat_4x3 *ma, double *sx, double *sy, double *sz)
 
void UT3D_m3_multm3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2)
 
int UT3D_m3_tra_m3 (Mat_4x3 m3, Mat_4x3 m1, Mat_4x3 m2)
 
int UT3D_m3_rot_m3 (Mat_4x3 m2, Mat_4x3 m1, Vector *vc1, double *a1)
 
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)
 
int UT3D_m4_copy (Mat_4x4 mo, Mat_4x4 mi)
 
int UT3D_m4v_m3 (Mat_4x4 mo, Mat_4x3 mi)
 
int UT3D_m3_m4v (Mat_4x3 mo, Mat_4x4 mi)
 
int UT3D_pt_intlnsph (Line *ln1, Point *ps, double rs)
 
int UT3D_ptCen_2Ln (Point *ptCen, Point *pa, Point *pb, Point *pc, Point *pd)
 
int UT3D_pt_intlnci_l (Point pa[], Line *ln, int lnLim, Circ *ci, int ciLim)
 
int UT3D_pt_intlnci_lp (Point pa[], Line *ln1, int lnLim, Circ *ci1, int ciLim)
 
int UT3D_pt_intlnci_p (int *np, Point xp[], Line *ln, Circ *ci1)
 
int UT3D_pt_intlnci__ (int *np, Point xp[], Line *ln, Circ *ci)
 
int UT3D_ln_tra_vc (Line *lno, Line *lni, Vector *vco)
 
int UT3D_ln_tng_ci_pt (Line *lno, Circ *ci1, Point *pt1, int imod)
 
int UT3D_ln_tng_ci_vc (Line *lno, Circ *ci1, Vector *vc1, int imod)
 
int UT3D_ln_tng_ci_ci (Line *ln1, Circ *ci1, Circ *ci2, int sNr)
 
int UT3D_ln_projlnci (Line *lno, Line *lni, Circ *cii)
 
int UT3D_ln_parl2ln (Point *po1, Point *po2, Point *p11, Point *p12, Point *p21, Point *p22)
 
int UT3D_ln_int2pl (Line *ln, Plane *pl1, Plane *pl2)
 
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)
 
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_intptvcsph (Point *pa, Point *pl, Vector *vl, Point *ps, double rs)
 
int UT3D_plcoe_pl (polcoeff_d3 *co, Plane *pl)
 
int UT3D_pl_plcoe (Plane *pl, polcoeff_d3 *co)
 
int UT3D_bp_2pt (Point *pt1, Point *pt2)
 
int UT3D_bp_vc_ (Vector *vc1)
 
int UT3D_bp_vcz (Vector *vcn)
 
int UT3D_bp_pta (int pNr, Point *pa)
 
int UT3D_par_ck_inObj__ (double ux, Point *px, Point *ps, Point *pe, double us, double ue)
 
int UT3D_par_ck_inObj_del (int *np, Point *pa, double *va, Point *ps, Point *pe, double us, double ue)
 
int UT3D_parvc_2vc (double *pl, Vector *v1, Vector *v2)
 
int UT3D_parvc_2vcbp (double *dl, int mainPln, Vector *v1, Vector *v2)
 
int UT3D_2par_vc_vcx_vcy (double *dx, double *dy, Vector *vc1, Vector *vcx, Vector *vcy)
 
int UT3D_2parvc_3vcbp (double *dx, double *dy, int mainPln, Vector *v1, Vector *v2, Vector *v3)
 
double UT3D_par1_ci_pt (Circ *ci1, Point *pt1)
 
int UT3D_pt_ln_lim_del (int *nrp, Point *pa, double *va1, Point *pl1, Point *pl2)
 
int UT3D_pt_ci_lim_del (int *nrp, Point *pa, double *va1, Circ *ci1)
 
int UT3D_par_pt_2pt (double *par1, Point *px, Point *pl1, Point *pl2)
 
double UT3D_par1_ci_angr (Circ *ci1, double angr)
 
int UT3D_ck_npt_inLine (Point *pa, int paSiz, Line *ln1)
 
int UT3D_ck_npt_inCirc (Point *pa, int paSiz, Circ *ci1)
 
int UT3D_pt_int2ln (Point *ip1, Point *ip2, double *dist, Line *ln1, Line *ln2)
 
int UT3D_pt_intlnln (Point *ip1, Point *ip2, double *dist, Line *ln1, int ln1Mode, Line *ln2, int ln2Mode)
 
int UT3D_pt_intcici (Point pa[], Circ *ci1, int ci1Lim, Circ *ci2, int ci2Lim)
 

Detailed Description

3D geometric point vector line circle

=====================================================
List_functions_start:
UPAT_ipatch_disp_opts display indexed-Opengl-patch
List_functions_end:
=====================================================
UTRI_triaNr_patch get nr of triangles of indexed-Opengl-patch
=====================================================
List_functions_start:
UT3D_stru_dump dump geom. element (2D or 3D) (../ut/ut_dump.c)
-------------- sense_of_rotation -------------------------------------
UT3D_sr_polc sense_of_rotation of a closed polygon
UT3D_sr_npt_bp get senseOfRotation for n points on backplane bp
UT3D_sr_el get sense_of_rotation of a ellipse
UT3D_sr_ci get sense_of_rotation of a circ
UT3D_sr_rev_obj get rotSense from rotSense and reverse-flag
-------------- side -------------------------------------
UT3D_sid_2vc check vc's for perp, same or opposit direction
UT3D_sid_3pt check if pt is in, before or behind perpendic.Plane
UT3D_sid_pt_pt2vc check if point is above or below plane from pt0,vx,vy
UT3D_sid_ptpl check if pt is in, above or below plane
UT3D_sid_ptptvc compare if pt is in, above or below plane
-------------- angles -------------------------------------
UT3D_acos_2vc cos of opening angle of 2 vecs (dot=scalarprod) INLINE
UT3D_acos_vc2pt cos of opening angle of vc-ptpt (dot=scalarprod) INLINE
UT3D_angr_2vc__ angle between two vec's (always 0 <= PI)
UT3D_angr_2vc_n angle between two normalized vec's (0 <= PI)
UT3D_angr_3pt angle between 3 points
UT3D_angr_3vc__ angle between 2 vectors; vz gives direction (pos|neg)
UT3D_angr_3vcn_CCW angle between 2 vectors CCW around vz; all normalized
UT3D_angr_4pt angle between 2 lines
UT3D_angr_ci_par1 get opening-angle from parameter 0-1
UT3D_angr_ci__ opening angle of Circ
UT3D_angr_ci_p1_pt opening angle of point on Circ
UT3D_angr_vc2pt angle between 2 points in plane (plane from pt-vc)
UT3D_angr_vc2vc compute angle of vec in Refsys (to X-axis)
UT3D_angr_vcpl_z compute ang. of vec in Refsys (to X-axis, around Z-axis)
UT3D_angr_vcpl_tilt compute angle of vec in Refsys (to XY-plane)
UT3D_angr_2pl opening angle of 2 planes
UT3D_angrR_vc get rotation-angle for vector
UT3D_angrT_vc get tilt-angle for vector
UT3D_2angr_2vc get transf.angles for a refSys from its X-and Y-axis
UT3D_2angr_vc 2 opening angels of vec (Y-ang = kipp, Z-ang = dreh)
UT3D_3angr_2vc 3 opening angels (3D-position) from X and Z-vec
UT3D_atan_vcpl Anstieg (tan) der Geraden vci bezueglich Ebene pli
UT_RADIANS radians from degrees
UT_DEGREES degrees from radians
-------------- length, parameter -------------------------------------
UT3D_len_vc Vectorlength INLINE
UT3D_lenq_vc Quadr.Vectorlength INLINE
UT3D_bplen_vc returns longest vectorpart and its backPlane
UT3D_lenB_vc returns longest vectorpart
UT3D_lenB_2pt longest dx/dy/dz-distance point-point (fast!)
UT3D_len_2pt distance point - point
UT3D_lenq_PtPt square-distance point - point
UT3D_lenq_PtLn minimum (quadr) distance Point-Segment
UT3D_minLen_3pt query min dist of 3 points
UT3D_minLen_4pt query min dist of 4 points
UT3D_minLen_npt query min dist of n points
UT3D_len_ln length of line
UT3D_len_ci length of circ
UT3D_slen_3pt signed distance point - point
UT3D_slen_2ptvc signed Laenge pt-pt in Richtung vec (m. Vorzeichen !)
UT3D_slen_projvcvc Proj.laenge eines Vektors auf einen anderen Vektor
UT3D_slenq_2ptvc Quadr. Laenge pt-pt in Richtung vec (m. Vorzeichen !)
UT3D_slenq_ptptvc signed quadr.Distance pt-pt in Richtung vec
UT3D_slenq_projvcvc Quadr.laenge eines Vektors auf einen anderen Vektor
UT3D_slen_ptpl signed distance point - plane
UT3D_nlen_2ptvc Laenge der Normalen auf Vektor
UT3D_nlen_projvcvc Normalabstand eines Vektors auf einen anderen Vektor
UT3D_nlenq_3pt give quadr.Distance from point to line
UT3D_nlenq_2ptvc give quadr.Distance from point to line
UT3D_nlenq_2vc give quadr.Distance from point to line
UT3D_nlen_3pt Laenge der Normalen von p2 auf Line p1-p3
UT3D_par_ck_inObj__ check if parameter is inside range us-ue & check points
UT3D_par_ck_inObj_del delete all points & parameters not on obj
UT3D_parvc_2vc parameter of distance of vec projected on vec
UT3D_parvc_2vcbp parameter of distance of vec projected on vec
UT3D_2par_vc_vcx_vcy get parameter of vector projected onto vx,vy
UT3D_2parvc_3vcbp project end of vec1 along vec2 on vec3
UT3D_par_pt_2pt get parameter of point on line
UT3D_parpt_3pt parameter of distance of point ptx on line pl1-pl2
UT3D_parpt_ptvc parameter of distance of point ptx on line pt1-vc1
UT3D_parpt_lnbp parameter of point on line (via 2D,BackPlane)
UT3D_par1_ci_angr get parameter 0-1 for circ from opening-angle
UT3D_par1_ci_pt get parameter 0-1 for point on circ
-------------- points --------------------------------------
UT3D_swap2pt swap 2 2D-points INLINE
UT3D_comp2pt compare 2 points INLINE
UT3D_ck2D_equ_2pt 2D-compare of 2 3D-points with tolerance INLINE
UT3D_comp4pt compare 4 points
UT3D_pt_ck_npt compare point / points
UT3D_pt_ck_ptvc check if point is on unlimited line (point-vector)
UT3D_pt_ck_2pt check if point is on unlimited line (2 points)
UT3D_pt_ck_inLine check point on line segment
UT3D_pt_ck_onLine check point on line segment
UT3D_pt_ck_onLnSeg check point on line segment (for polygons)
UT3D_ck_npt_inLine check if points are on lineSegment
UT3D_pt_ck_perp_2pt check if 3 points are normal (perpendic.)
UT3D_pt_ck_mid_2pt check if point is on perp.plane between 2 points
UT3D_pt_ck_on_pta check if point lies ON polygon
UT3D_pt_ck_in2pt check if point p3 is inside box of points p1-p2
UT3D_pt_ck_inCirc check if point is on circ segment
UT3D_ck_npt_inCirc check if points are on circSegment
UT3D_pt_ck_inSph check if point is inside sphere
UT3D_pt_ck_linear check if points are linear
UT3D_ipt_cknear_3pt return index of nearest Point from 3 points
UT3D_ipt_cknear_npt return index of nearest Point from n points
UT3D_ipt_ckfar_npt return index of farest Point from n points
UT3D_ipt_cknearn_npt return index of n-nearest Point from n points
UT3D_ipt2_nptvc ind. of outermost points in direction vc of n pt's
.. point inside polygon: see UT2D_pt_ck_inCv3
UT3D_pt_isFree check if pt is empty (free - UT3D_pt_init) INLINE
UT3D_ipt2_npt find the indices of the most extreme points
UT3D_isConvx_ptTab check if is contour convex or concave
UT3D_pt_ln_lim_del remove points outside limited line
UT3D_pt_ci_lim_del remove points outside limited circle
UT3D_pt_NEW create empty point (UT3D_pt_isFree) INLINE
UT3D_pt_ptz 3D-Point = 2D-Point + Z-Val INLINE
UT3D_pt_pt2 3D-Point = 2D-Point
UT3D_pt_pt2z 3D-Point = 2D-Point auf bestimmter Z-Hoehe
UT3D_pt_3db Point = 3 doubles (x, y, z)
UT3D_pt_txt Point from text
UT3D_pt_pt2bp 3D-point from 2D-point & backplane
UT3D_pt_addpt Add two points: po += p1 INLINE
UT3D_pt_add_pt2 add 2D-point po += p1 INLINE
UT3D_pt_add2pt Add two points: po = p1 + p2
UT3D_pt_add_vc__ add vector: pt += vc INLINE
UT3D_pt_add_vc_rev add vector revers pt -= vc INLINE
UT3D_pt_add_vc_par add (vector * lpar) po += (vc * lpar) INLINE
UT3D_pt_sub_pt2 subtract 2D-point INLINE
UT3D_pt_multpt multiply; po = pi * d
UT3D_pt_LinComb2Pts Linear combination of 2 points: po = a1 * p1 + a2 * p2
UT3D_pt_mid2pt midpoint between 2 points
UT3D_pt_mid_pta arithm. Mittelwert der Punktetabelle pTab
UT3D_pt_midci midpoint of a circ
UT3D_pt_std_ci 90/180/270-deg-point of circ
UT3D_ptvcpar_std_dbo get typical points & tangent-vector for DB-obj
UT3D_ptvcpar1_std_obj get typical points & tangent-vector for obj
UT3D_pt_opp2pt opposite point (p1 = center)
UT3D_pt_oppptptvc point opposite line (= 180 deg rot.)
UT3D_2pt_oppptvclen 2 opposite points (center, vector, dist)
UT3D_pt_tra_pt_dx Point = Point + dx (INLINE)
UT3D_pt_tra_pt_dy Point = Point + dy (INLINE)
UT3D_pt_traptvc Point = Point + Vector (INLINE)
UT3D_pt_traptivc Point = Point - Vector (INLINE)
UT3D_pt_traptmultvc point = point + (vector * factor) (INLINE)
UT3D_pt_traptvclen transl. point into dir vc dist. lenv
UT3D_pt_tra_pt_vc_par transl. point into dir vc dist. lenv (vcLen=1)
UT3D_pt_trapt2vc transl. point into 2 directions
UT3D_pt_tra_pt_2vc_2par transl. point into 2 directions
UT3D_pt_trapt2vc2len transl. point into 2 directions (2 len's)
UT3D_pt_trapt3vc3len transl. point into 3 directions (3 len's)
UT3D_pt_traptptlen transl. point into dir pDir dist. lenv
UT3D_pt_trapt2pt transl. point distance p1 -> p2
UT3D_pt_tracirlen transl. point circular length
UT3D_pt_rotptptangr rotate pti around ptc/Z-Axis
UT3D_pt_rotptptvcangr rotate pt around Line (pt/vc), angle
UT3D_pt_rotciangr rotate pt around Circ, angle
UT3D_pt_rotptm3 rotate pt (prepare with UT3D_m3_inirot_angr)
UT3D_pt_projpt2pt point = project point pt to line pt+pt
UT3D_pt_projptptvc point = project point pt to line pl+vl
UT3D_pt_projptln point = project point to line
UT3D_pt_projptci point = project point to circ
UT3D_pt_projptptnvc project point pt to plane from Origin, Z-vec
UT3D_pt_projptpl point = project point to plane
UT3D_pt_int2pt2pt_lim intersect 2 limited lines
UT3D_pt_int2pt2vcn_lim intersect 2 limited NORMAL lines
UT3D_pt_intptvcplx intersect point/vector with Y-Z-plane
UT3D_pt_intptvcply intersect point/vector with X-Z-plane
UT3D_pt_intptvcplz intersect point/vector with X-Y-plane
UT3D_pt_intptvcxpln intersect line(x-parallel) with plane (pt-vc)
UT3D_pt_intptvcypln intersect line(y-parallel) with plane (pt-vc)
UT3D_pt_intptvczpln intersect line(z-parallel) with plane (pt-vc)
UT3D_2par_int2pt2vc intersect 2 unlimitedLines; gives 2 parameters
UT3D_pt1_int2pt2pt intersect 2 unlimitedLines; point on pa-pb out
UT3D_pt_int2pt2vc intersect 2 rays
UT3D_pt_intptvcln intersect ray - lineSegment
UT3D_pt_int2ln intersect 2 unlimitedLines; get 2 points & dist
UT3D_pt_intlnln intersect 2 Lines both limited or unlimited
UT3D_pt_intptvcsph intersect unlimited line / sphere
UT3D_pt_intperp2ln inters ln2 with perp.plane to ln1
UT3D_ptCen_2Ln give common centerPoint of 2 Lines (from 2 CircSegs)
UT3D_pt_intlnci_l intersect line - circle (limited|unlimited)
UT3D_pt_intlnci__ intersect line - circle (both unlimited)
UT3D_pt_intlnci_lp intersection LN-CIR (limited|unlimited, same plane)
UT3D_pt_intlnci_p intersect LN-CIR (in same plane; both unlimited)
UT3D_pt_intlnsph intersect limited line / sphere
UT3D_pt_intcici intersect CIR CIR (gives 0/1/2 points)
UT3D_pt_intlnpl point = intersection of line - plane
UT3D_pt_intplnln intersect LineSegment X Plane
UT3D_pt_intlnpl1 intersect line - plane / besonders schnell
UT3D_ptDi_intptvcptvc intersect line-plane (pt-vc pt-vc)
UT3D_ptDi_intptvcpln intersect line-plane (pt-vc plane)
UT3D_pt_intptvcpln intersect line-plane (pt-vc pt-vc)
UT3D_pt_intplci intersect PLN CIR (gives 0/1/2 points)
UT3D_pt_intcidpln intersect circ / perpend.offsetPlane
UT3D_pt_intptvcpl_ point = intersection of pt / vc - plane
UT3D_pt_ipl_2ptpt2 interpolate PointPosition for 2D-point
UT3D_pt_mirptpl mirror point about plane
UT3D_pt_mirptln mirror point about line
UT3D_pt_tangptci tangent from point to circ
UT3D_pt_tng_ci_vc tangent with fixed vector to circ
UT3D_ptvc_eval_ci_angr get point/tangent to circ from opening-angle
UT3D_pt_evpar2pt evaluate param.point on line
UT3D_pt_evparptcv evaluate param.point on line from point+vector
UT3D_pt_evparln evaluate param.point on line
UT3D_pt_evparci evaluate param.point on circ
UT3D_pt_evparcrv evaluate param.point on curve
UT3D_pt_m3 copy origin out of 4x3-matrix
UT3D_pt_traptm3 apply transformation to point (from 4x3-matrix)
UT3D_pt_traptm4 apply transformation to point (from 4x4-matrix)
UT3D_pt_seg_par_nln point <-- segNr & parameter on lines[] (Typ_CVLNA)
-------------- Axis/Ray | tangent -----------------------------
UT3D_ptvc_int2pl point/vector = intersection of 2 planes
UT3D_ptvc_int2pln point/vector = intersection of 2 planes (pln=pt,z-vec)
UT3D_ptvc_ox get axis (PT+VC) from PT|LN|CI|PLN
UT3D_ptvc_tng_crv_par get point/tangentVector on obj from parameter
UT3D_ptvc_eval_ci_angr get point/tangent to circ from opening-angle
-------------- vectors -------------------------------------
UT3D_compvcNull compare vector for (exact) 0,0,0
UT3D_compvc0 compare vector for 0,0,0 with tol
UT3D_comp2vc_d compare 2 vectors for parallel and antiparallel
UT3D_comp2vc_p compare 2 vectors for parallel
UT3D_vc_ck_parl_vc check for parallel (normalized only)
UT3D_vc_ck_aparl_vc check for antiparallel (normalized only)
UT3D_vc_ck_parpl check if vec is parallel to plane
UT3D_vc_ck_perpvc check if 2 vectors are normal (perpendic.)
UT3D_vc_ckperp_2vc1 check if 2 normalized-vectors are normal (perp.)
UT3D_vc_ck_std check for defaultVector (DX DY DZ DIX DIY DIZ)
see also UT3D_sid_2vc check vc's for perp, same or opposit direction
UT3D_vc_merge2vc merge 2 vectors vNew = (v1 + v2) / 2 (INLINE)
UT3D_vc_3db Vector = 3 doubles (x, y, z) (INLINE)
UT3D_vc_pt Vector = 0,0,0 -> Point (INLINE)
UT3D_vc_pt3db Vector = Point -> point from 3 doubles (INLINE)
UT3D_vc_vc2 3D-vector = 2D-vector (INLINE)
UT3D_vc_2pt Vector = Point -> Point (INLINE)
UT3D_vc_2ptlen Vector = Point -> Point, set Length
UT3D_vc_angr Vector = Angle_X_axis
UT3D_vc_2angr Vector = Angle_X_axis, Angle_Z_axis
UT3D_vc_2vc intermediate Vector
UT3D_vc_ln Vector = LineStartPoint -> LineEndPoint
UT3D_vc_txt Vector from text
UT3D_vc_m3 = UT3D_m3_get
UT3D_vc_bp returns normalVector from BackPlaneNr (0-2)
UT3D_2vc_pta get 2 vecs of max extent of a polgon (for perp.Vec)
UT3D_vc_invert Vector invert (change direction) INLINE
UT3D_vc_Zup invert Vector if its Z-coord is negative
UT3D_vc_add2vc v3 = v1 + v2 (INLINE!)
UT3D_vc_addvc2pt add Vector + Vector from 2 points (INLINE)
UT3D_vc_add3vc vo = v1 + v2 + v3 (INLINE)
UT3D_vc_sub2vc v3 = v1 - v2 (INLINE)
UT3D_vc_div_d divide vector (INLINE)
UT3D_vc_multvc vo = vi * fakt Vec-multiplication (INLINE)
UT3D_vc_perp1vc normal vector to 3D-vector (in X-Y-plane)
UT3D_vc_perpvcvc get normal-vector from vector onto other vector
UT3D_vc_perp2vc vector = perpendic. to 2 vectors (crossprod)
UT3D_vc_perpvc2pt vector = perpendic. to vec & 2 points (crossprod)
UT3D_vc_perp3pt vector = perpendic. to 3 points (crossprod)
UT3D_vc_perp4pt vector = perpendic. to 2 lines (crossprod)
UT3D_vc_perp_npt vector = perpendic. to n points
UT3D_vc_perpvcplXY Normalvektor auf vc1, der in der X-Y-Plane liegt
UT3D_vc_perpcv Normalvektor auf planares Polygon / alt-langsam
UT3D_vc_perppta get normalvector for polygon
UT3D_vc_perp_npt_bp_ix normalvector for polygon from backPlane & extreme-points
UT3D_vc_normalize change to length 1
UT3D_vc_setLength change vectorlength
UT3D_vc_setLenLen change vectorlength; actLen known
UT3D_ptvc_eval_ci_angr get point/tangent to circ from opening-angle
UT3D_vc_tng_crv_pt vector tangent to curve
UT3D_vc_tng_ci_pt tangent-vector to circ (0. - 1.) from point on circ
UT3D_vc_rotangr rotate a vector around Z-axis
UT3D_vc_rot3angr rotate a vector around 3 angles
UT3D_vc_rotvcvcangr rotate vec vi around vec va
UT3D_vc_rotvcangr rotate a vector around axis
UT3D_vc_projvcvc vector v3 = project vector v1 to vector v2
UT3D_vc_projvc2vc vector = project vector to plane from 2 vec's
UT3D_vc_projvcnvc project vec onto plane from Z-vec
UT3D_vc_projvcpl vector = project vector onto plane
UT3D_vc_mirvcpl mirror vector about plane
UT3D_vc_mirvcln mirror vector about line
UT3D_vc_travcm3 apply transformation to vector (from 4x3-matrix)
UT3D_vc_travcm4 apply transformation to vector (from 4x4-matrix)
-------------- lines (see also _ptvc_) --------------------
UT3D_comp2ln compare 2 lines if identical
UT3D_ln_ck_on_ln check if 2 lines collinear
UT3D_ln_ck_parpl check if line is parallel to plane
UT3D_ln_ck_degen check if line is degenerated (length < UT_TOL_cv)
UT3D_ln_inv invert (change p1, p2) INLINE
UT3D_ln_unlim set length for construction-line
UT3D_ln_6db line from 2 * 3 doubles
UT3D_ln_ln2 3D-Line from 2D-Line (Z=0)
UT3D_ln_2pt2 3D-Line from 2D-points (Z=0)
UT3D_ln_ptvc Line = PT + VC INLINE
UT3D_ln_ptpt Line = Point, Point INLINE
UT3D_ln_tra_vc translate line
UT3D_ln_tng_ci_pt tangent to circ tru point
UT3D_ln_tng_ci_vc tangent with fixed vector to circ
UT3D_ln_tng_ci_ci Tangente an CIR - CIR
UT3D_ln_projlnci line = project endpoints of line --> circPlane
UT3D_ln_parl2ln ln <== gemeinsame Strecke of 2 lines
UT3D_ln_int2pl LN = Intersection PLN / PLN
UT3D_ln_pts_dmax line <-- points with max. distance of pointTab
UT3D_ln_setLen change LineLength; center around pc
-------------- circs --------------------------------------
UT3D_rdc_3pt Radius eines Kreises aus 3 Punkten errechnen
UT3D_ck_ci180 check if circ is 180-degree-circ
UT3D_ck_ci360 check if circ is 360-degree-circ
UT3D_cksid_civc ck if KreisStart/Endpunkt ist in Richtg VC od opposit
UT3D_ptNr_ci nr of points for polygon from circle (see UT2D_ptNr_ci)
UT3D_ci_inv1 invert (change p1, p2, dir (optisch gleich))
UT3D_ci_inv2 invert (dir - KomplementaerKreis)
UT3D_ci_inv3 invert (optisch gleich, Z-Axis invers)
UT3D_ci_cip1 change startpoint of circ
UT3D_ci_cip2 change endpoint of circ
UT3D_ci_ciangr change endpoint of circ from angle
UT3D_ci_setangr fix angle from p1-p2
UT3D_ci_cip3 change start- and endpoint of circ
UT3D_ci_cipt180 change circ -> 180 deg-circ; keep dir
UT3D_ci_cipt360 change circ -> 360 deg-circ; keep dir
UT3D_ci_ptvcr Circ from center, axis, radius
UT3D_ci_pt2vcr Circ from center, axis, x-vec and radius
UT3D_ci_ptptvcangr Circ from center, startpoint, axis, opening angle
UT3D_ci_2ptvcrd Circ from 2 Points-on-Circ & Radius
UT3D_ci_ptptvcrd Circ from startpoint endpoint radius Z-vector
UT3D_ci_ptvcpt2angr circ from center, point, axis, startAngle, endAngle
UT3D_ci_ptrd2vc2angr circ from cen, Rd, Z-Axis, X-Axis, startAng, endAng
UT3D_ci_ptvcrd Circ from startpoint, startvector, radius ..
UT3D_ci_3pt Circ from 3 points
UT3D_ci_pcvzpt180 180 deg-circ (CCW) from center, axis, startpoint
UT3D_ci_ci2 3D-Circ = 2D-Circ
UT3D_ci_obj2 3D-Circ = 2D-ObjG
UT3D_ci_obj 3D-Circ = 3D-ObjG
UT3D_civz_ci den vz eines Circ (aus p1-pc-p2) errechnen
UT3D_ci_2lnrd Circ = corner for 2 Lines
UT3D_ci_ptptrd Circ = tangent to PT + PT, radius
UT3D_ci_lnptrd Circ = tangent to LN + PT, radius
UT3D_ci_lncird Circ = tangent to LN + CIR, radius
UT3D_ci_ciptrd Circ = tangent to CI + PT, radius
UT3D_ci_cicird Circ = tangent to CIR + CIR, radius
UT3D_ci_intplsph Circ = intersect Plane Sphere
UT3D_ci_tracivc move circle
-------------- polygon -----------------------------------------
UT3D_pta_ck_planar test if all points are in plane from pt-normalVec
UT3D_rMin_pta den kleinsten Radius errechnen eines Polygon suchen
UT3D_cksq_4pt check 4 points if its a square
UT3D_pta_dbo get polygon from DB-object(typ,ind)
UT3D_cv_obj2 Polygon < 2D-Obj
UT3D_cv_ln Linearstueck -> Polygon / Anzahl
UT3D_cv_ci Polygon < 3D-Kreis
UT3D_npt_ci circular polygon
UT3D_pta_rot__ rotate curve CCW um axis ..
UT3D_cv_inv Punktetabelle umdrehen
UT3D_cv_realg Punktetabelle umschichten (realign)
UT3D_cv_delia delete points out of pTab
see also: ../ut/ut_npt.c
-------------- GrafObj - (see also UTO_) ---------------
UT3D_obj_obj2 change 2D-Obj > 3D-Obj (add Z=0; vz=0,0,1)
UT3D_obj_pt DO NOT USE change Point > 3D-Obj
UT3D_obj_ln DO NOT USE change Line > 3D-Obj
UT3D_obj_ci2 DO NOT USE change 2D-Circ > 3D-Obj
UT3D_obj_ci DO NOT USE change Circ > 3D-Obj
UT3D_obj_vctra DO NOT USE translate Obj
-------------- backPlane ---------------------------------------
UT3D_bp_2pt returns main-BackPlaneNr (0-2) from 2 points
UT3D_bp_vc_ returns main-BackPlaneNr (0-2) from vec
UT3D_bp_vcz returns main-BackPlaneNr (0-2) from normalvec
UT3D_bp_pta backplane from n points
-------------- plane ---------------------------------------
UT3D_pl_XYZ Defaultplane auf absolut 0,0,0
UT3D_pl_bpdb Plane from equation (x or y or z = value)
UT3D_pl_3pt plane from 3 point's
UT3D_pl_pta plane from n-points
UT3D_pl_ptvzpl plane from z-axis and origin and base-plane
UT3D_pl_ptvxpl plane from x-axis and origin and base-plane
UT3D_pl_pto_vcz_vcx plane from Origin, Z-vec, X-Vec. Z-vec is fixed.
UT3D_pl_pto_vcx_vcz plane from Origin, X-vec, Z-Vec. X-vec is fixed.
UT3D_pl_pto_vcx_vcy plane from origin, X-vec, Y-Vec. X-vec is fixed.
UT3D_pl_ptvc plane from origin, Z-vector
UT3D_pl_pto_vcz_ptx plane from origin, Z-vec, point on X-axis
UT3D_pl_obj get basic-plane for obj
UT3D_pl_ln make Plane from line (Origin=line-center; Z-vec=line)
UT3D_pl_2ln plane from 2 lines
UT3D_pl_ci make Plane from circ
UT3D_pl_ell make Plane from ellipse
UT3D_pl_nobj plane fron ObjGX-table
UT3D_pl_invert Plane invert (change direction of Z-vec)
UT3D_pl_rotpt rot. Refsys around Z; point gives new X-direction
UT3D_pl_rotZangr rot. Refsys around Z
UT3D_pl_rotYangr rot. Refsys around Z (tilt-angle)
UT3D_pl_ptpl change origin of plane
UT3D_pl_plcoe plane <-- plane equation
UT3D_plcoe_pl plane equation <-- plane
UT3D_pl_p plane - update p after a change of po or vz
UT3D_pl_mirln mirror plane about line
UT3D_pl_mirpl mirror plane about plane
UT3D_pl_tra_m3 apply transformation to refSys
-------------- transformation ------------------------------
UT3D_m3_inirot_angr define rotation (axis, origin angle)
UT3D_m3_iniZrot_angr define rotation around z-axis; (center, angle)
UT3D_m3_inirot_2vc define rotation-transformation between 2 vectors
UT3D_m3_load neues Achsensystem mit vx,vy,vz definieren
UT3D_m3_load_povxvy neues Achsensystem mit Origin,vx,vy definieren
UT3D_m3_load_povxvz neues Achsensystem mit Origin,vx,vz definieren
UT3D_m3_load_o Nullpunkt into 4x3 Transform.Matrix
UT3D_m3_loadpl load Plane(=Achsensystem) into 4x3 Transform.Matrix
UT3D_m3_invm3 4x3-Matrix invertieren
UT3D_m3_get get part of matrix; 0=VX, 1=VY, 2=VZ, 3=PO
UT3D_m3_set set part of matrix; 0=VX, 1=VY, 2=VZ, 3=PO
UT3D_m3_vc = UT3D_m3_set
UT3D_m3_traVc translate mat (move progin)
UT3D_m3_tram3m3 apply transformation to Mat_4x3
UT3D_m3_scl scale mat
UT3D_m3_multm3 4x3-Matrix mit 4x3 Matrix multiplizieren
UT3D_m3_rot_m3 rotate matrix
UT3D_m3_m4v copy a vertical-Mat_4x4 --> Mat_4x3
UT3D_m4_init Initialize a 4x4 - matrix
UT3D_m4_init_ori Initialize a 4x4 - matrix with translation
UT3D_m4_init_rot Initialize a 4x4 - matrix with rotation
UT3D_m4_load_o set origin
UT3D_m4_loadpl load Plane(=Achsensystem) into 4x4 Transform.Matrix
UT3D_m4_addrot Concatenate 2 4x4 - matrixes.
UT3D_m4_addtra add a translation into 4x4-matrix
UT3D_m4v_m3 copy a Mat_4x3 --> vertical-Mat_4x4
List_functions_end:
=====================================================

Macro Definition Documentation

#define CONVEX   1
#define CONCAV   -1

Function Documentation

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_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_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_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_2pl ( Plane pl1,
Plane pl2 
)

Oeffnungswinkel zwischen 2 Planes

int UT3D_angrR_vc ( double *  ar,
Vector vc1 
)
int UT3D_angrT_vc ( double *  at,
Vector vc1 
)
int UT3D_2angr_2vc ( double *  angX,
double *  angZ,
Vector vcX,
Vector vcY 
)
* UT3D_2angr_2vc get transf.angles for a refSys from its X-and Y-axis
* angX = tilt.Angle (rotate around X-axis), angZ = rotate around Z-axis
* using: rotate first GL_angX then GL_angZ (see GLBT_view_set)
* see also UQT_vcar_qt
*
int UT3D_2angr_vc ( double *  az,
double *  ay,
Vector vc1 
)
* UT3D_2angr_vc 2 opening angels of vec (Y-ang = kipp, Z-ang = dreh)
* ay only -90-deg to +90-deg ! For full range use UT3D_2angr_2vc
* 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_3angr_2vc ( double *  az1,
double *  ay,
double *  az2,
Vector vx,
Vector vz 
)
* UT3D_3angr_2vc 3 opening angels (3D-position) from X and Z-vec.
*
* Drehaufrufe:
* 1) um Z-Achse Winkel az1 drehen
* 2) um (neue) Y-Achse Winkel ay drehen (neue Y-Achse liegt noch in der
* absoluten XY-Ebene.
* 3) um neue Z-Achse Winkel az2 drehen
*
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_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_int2pt2vcn_lim ( Point px,
double *  ux_ab,
double *  ux_cd,
Point pta,
Vector vab,
Point ptc,
Vector vcd,
double  tol 
)
* UT3D_pt_int2pt2vcn_lim intersect 2 limited NORMAL lines
* get intersectionpoint and parameters
*
* IN:
* pta, vab line 1
* ptc, vcd line 2
* OUT:
* Point *px intersectionpoint
* double *ux_ab parameter of px on line a-b (none if NULL)
* double *ux_cd parameter of px on line c-d (none if NULL)
* Returncodes:
* -1 = no intersection inside the segments
* 0 = OK;
*
* a-b = ln1 c-d = ln2
*
* d
* |
* |
* |
* |
* |
* a-----x-------------------b
* | ln1
* |
* c
*
*
*
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_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_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_int2pt2pt_lim ( Point px,
double *  ux_ab,
double *  ux_cd,
Point pta,
Point ptb,
Point ptc,
Point ptd,
double  tol 
)
* UT3D_pt_int2pt2pt_lim intersect 2 limited lines
* get intersectionpoint and parameters
*
* IN:
* pta, ptb line 1
* ptc, ptd line 2
* OUT:
* Point *px intersectionpoint
* double *ux_ab parameter of px on line a-b (none if NULL)
* double *ux_cd parameter of px on line c-d (none if NULL)
* Returncodes:
* -1 = no intersection inside the segments
* 0 = OK; dist gives the minimum distance.
* 1 = Line a-b parallel and covering c-d (px set to midpoint)
*
* d
* /.
* / .
* ln2/ .
* / .
* / .
* / .
* a-----e--x------f-------------b
* | / ln1
* |/
* c
*
*
*
int UT3D_2par_int2pt2vc ( double *  par1,
double *  par2,
Point pa,
Vector vab,
Point pc,
Vector vcd 
)
* UT3D_2par_int2pt2vc intersect 2 unlimitedLines; gives 2 parameters
* Input:
* pa-vab Line1 (pa-pb)
* pc-vcb Line2 (pc-pd)
* Output:
* par1 = Parameter of IntersectPt auf pa-pb
* par2 = Parameter of IntersectPt auf pc-pd
* irc = -1 = parallel
* irc = 0 = OK;
*
* d
* /.
* / .
* / .
* / .
* c .
* .. .
* . . .
* . . .
* a-----+---e----f-----------------------b
* ip
*
int UT3D_pt1_int2pt2pt ( Point ip,
Point pa,
Point pb,
Point pc,
Point pd 
)
* UT3D_pt1_int2pt2pt intersect 2 unlimitedLines; point on pa-pb out.
* Input:
* pa-pb Line1
* pc-pd Line2
* Output:
* ip = intersectionpoint on pa-pb
* irc = -1 = parallel
* irc = 0 = OK;
*
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_ci_cicird ( Circ  ca[],
Circ ci1,
Circ ci2,
double  rad1,
int  sNr 
)
* UT3D_ci_lncird Circ = tangent to CIR + CIR, radius.
*
* sNr solutionNr, 0-7 (0=first, 1=second, 7=last)
* RC = 1,2 = rn circles
* -1 = Error - no solution
*
int UT3D_ci_ptptrd ( Circ  ca[],
Point pt1,
Point pt2,
double  rad1 
)
* UT3D_ci_ptptrd Circ = tangent to PT + PT, radius.
* DO NOT USE; use UT3D_ci_2ptvcrd
*
int UT3D_ci_lnptrd ( Circ cia,
Line ln1,
Point pt1,
Vector vc,
double  rdc 
)
* UT3D_ci_lnptrd Circ = tangent to LN + PT, radius.
*
* Input:
* pt1
* ln1
* vz axis of Circ; only used if pt1 is on line ln1
* rdc radius
* RetCod:
* 0-2 Nr of resulting Circles
*
int UT3D_ci_ciptrd ( Circ  ca[],
Circ ci1,
Point pt1,
double  rad1 
)
* UT3D_ci_ciptrd Circ = tangent to CI + PT, radius.
*
* RetCod:
* -1 Error
* 0-2 Nr of resulting Circles
*
int UT3D_ci_lncird ( Circ  ca[],
Line ln1,
Circ ci1,
double  rad1,
int  sNr 
)
* UT3D_ci_lncird Circ = tangent to LN + CIR, radius.
*
* Input:
* sNr solutionNr, -1 == all Solutions, else requested solution
*
* RC = 1,2,3,4,5,6,7,8 = Max. Anzahl Kreise.
*
int UT3D_ci_2lnrd ( Circ  ca[],
Line ln1,
Line ln2,
double  rad1,
int  sNr 
)
* UT3D_ci_2lnrd Circ = corner for 2 Lines
*
* Input:
* sNr solutionNr, -1 = all Solutions, else requested solution
* 0|1|2|3|4
* RC = -1: Lines parallel
* -2 lines do not intersect
* 4: OK, max nr of Circs, one circ back.
*
int UT3D_ci_intplsph ( Circ cio,
Plane pli,
Sphere spi 
)
* Circ = intersect Plane Sphere
*
* irc 0 OK
* irc -1 Plane touches Sphere
* irc -2 Plane outside Sphere
*
int UT3D_ci_tracivc ( Circ cio,
Circ cii,
Vector vc1 
)
void UT3D_obj_vctra ( ObjG o2,
ObjG o1,
Vector vc1 
)

UT3D_obj_vctra translate Obj

int UT3D_obj_obj2 ( ObjGX oo,
ObjGX oi,
Memspc memSeg 
)
* UT3D_obj_obj2 change 2D-Obj > 3D-Obj (add Z=0; vz=0,0,1)
* 2D-Objekte in 3D-Objekte umwandeln (add Z=0)
*
ObjG UT3D_obj_ln ( Line ln1)

DO NOT USE

ObjG UT3D_obj_ci ( Circ ci1)

DO NOT USE

int UT3D_cv3_linear ( int *  pNr,
Point pTab,
double  tol 
)
* UT3D_cv3_linear delete unnecesary straight points
* alle Punkte die innerhalb tol liegen aus pTab entfernen.
*
int UT3D_cv_delia ( int *  pNr,
Point pTab,
char *  ptStat 
)
* UT3D_cv_delia delete points out of pTab
* alle Punkte die (ptStat = 1) haben aus Tabelle loeschen
* pNr richtigstellen
* ptStat = 0: Punkt wird gebraucht
* ptStat = 1: Punkt loeschen
*
int UT3D_sr_rev_obj ( int  sr1,
int  sr2 
)
* UT3D_sr_rev_obj get rotSense from rotSense and reverse-flag
* Input:
* sr1 direction; 0=fwd, 1=bwd
* sr2 direction; 0=fwd, 1=bwd
* Output:
* retCod combined sr
*
int UT3D_sr_ci ( Circ ac1)
int UT3D_sr_el ( CurvElli el1)
int UT3D_sr_npt_bp ( int  pNr,
Point pa,
int  bp 
)
* UT3D_sr_npt_bp get senseOfRotation for n points on backplane bp
* Compute sr=sense of rotation of a closed 3D-polygon.
*
* Input:
* pNr nr points (without last = first point)
* pa points.
* bp BackPlane (get it from UT3D_bp_vcz)
* Output:
* RetCod 0 = CCW
* 1 = CW
*
*
int UT3D_sr_polc ( int  ptNr,
Point pa,
Vector vcn,
int  mode 
)
* UT3D_sr_polc nach Karl Sauer 2004-04-07
* Compute sr=sense of rotation of a closed 3D-polygon.
*
* Input:
* ptNr nr points (without last = first point)
* pa points.
* vcn normalvector (get it from UT3D_vc_perppta)
* mode BackPlane (get it from UT3D_bp_vcz)
* Output:
* RetCod 1 = CCW
* -1 = CW
*
*
int UT3D_pta_ck_planar ( int  pNr,
Point pTab,
Point pPln,
Vector vc 
)
* UT3D_pta_ck_planar test if all points are in plane from pt-normalVec
* testen ob alle Punkte planar (Abst. von Plane pPln-vc < UT_TOL_pt).
* Input:
* pPln point on plane
* vc normalvector of plane
* RetCod = 0 OK, ist planar
* -1 no, 1-n points of pTab are not in plane pPln-vc
*
int UT3D_rMin_pta ( double *  rMin,
int  pNr,
Point pTab 
)
* vom gesamten Polgon den kleinsten Radius errechnen
* Nur Abschaetzung; es wird von jeweils 3 Punkten der Kreisradius errechnet.
* ev in eine neue source ../ut/ut_pta.c ?
*
int UT3D_cksq_4pt ( Point pp1,
Point pp2,
Point pp3,
Point pp4 
)
* UT3D_cksq_4pt check 4 points if its a square
* Achtung: die 4 Punkte muessen korrekt geordnet sein !
*
* 4 3
*
* 1 2
*
* die 4 vektoren muessen gleich / bzw invers sein
* RetCod 0 yes, its a square
* -1 no
*
int UT3D_bplen_2pt ( double *  lnv,
Point p1,
Point p2 
)
* UT3D_bplen_2pt 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
*
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_len_ci ( Circ ci1)
* UT3D_len_ci length of circ
* immer pos.
*
double UT3D_len_ln ( Line ln)

UT3D_len_ln length of line

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_lenB_2pt ( Point p1,
Point p2 
)

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

double UT3D_len_2pt ( Point p1,
Point p2 
)

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
*
* see also UT3D_nlenq_3pt
*
int UT3D_minLen_3pt ( double *  dp,
Point p0,
Point p1,
Point p2 
)
* 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_npt ( Point p0,
Point pa,
int  pNr 
)
int UT3D_minLen_4pt ( double *  dp,
Point p1a,
Point p1e,
Point p2a,
Point p2e 
)
* 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.
*
double UT3D_slen_3pt ( Point p1,
Point p2,
Point p3 
)
* UT3D_slen_3pt signed distance point - point
*
* p1-p2 gives the direction,
* OUT: signed distance p1-p3
*
* ........ p3
* . .
* . .
* . .
* . .
* p1--------+------>p2
* <---rc--->
*
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
*
*
int UT3D_nlenq_3pt ( double *  qlen,
Point pa,
Point pb,
Point pc 
)
* UT3D_nlenq_3pt give quadr.Distance from point to line
* pa - pb gives a line, pc is projected onto this line.
*
* c
* |
* len|
* |
* a------+--------b
* e
*
int UT3D_nlenq_2ptvc ( double *  qlen,
Point pc,
Point pa,
Vector vab 
)
* UT3D_nlenq_2ptvc give quadr.Distance from point to line
* pa - pb gives a line, pc is projected onto this line.
*
* pc
* |
* |nlenq
* |
* pa------+--vab---b
* e
*
int UT3D_nlenq_2vc ( double *  qlen,
Vector vac,
Vector vab 
)
* UT3D_nlenq_2ptvc give quadr.Distance from point to line
* pa - pb gives a line, pc is projected onto this line.
*
* c
* / |
* vac/ |nlenq
* / |
* a------+--vab---b
* e
*
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
*
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--|
*
int UT3D_slenq_ptptvc ( double *  qlen,
Point pa,
Point pb,
Point pc 
)
* UT3D_slenq_ptptvc signed quadr.Distance pt-pt in Richtung vec
* pa - pb gives a line, pc is projected onto this line.
*
* c
* |
* |
* len |
* a--------+------b
* e
*
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--->
*
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_compn4pt ( Point p1,
Point p2,
Point p3,
Point p4 
)
* UT3D_compn4pt compare 4 points - find nearest points
* rc wie UT3D_comp4pt
*
* rc=1: bei El. liegen richtig. (p2-p3 nearest)
* rc=2: Obj 1 verkehrt (p1-p3 nearest)
* rc=3: Obj 2 verkehrt (p2-p4 nearest)
* rc=4: Obj 1 und Obj 2 verkehrt (p1-p4 nearest)
*
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
* see also UT3D_slen_2ptvc
*
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_pt_pt2vc ( Point pt0,
Vector vx,
Vector vy,
Point pt1 
)
RC -1 point is below plane vx-vy
RC 0 point is in plane vx-vy
RC 1 point is above plane vx-vy
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_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_pt_ck_linear ( int  np,
Point ptab,
double  tol 
)
* UT3D_pt_ck_linear check straight position of points
* Check if points form a straight line
*
* IN:
* int np ... number of points
* Point *ptab ... points
* double tol ... tolerance for straightness (>0)
* (as smaller tol as straighter the points)
* irc:
* 0 = position of points is not straight
* 1 = position of points is straight
*
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_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_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_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_onLnSeg ( Point p1,
Point p2,
Point p3,
double  tol 
)
* liegt p3 auf der Linie p1-p2 ? (Tests mit UT_TOL_pt)
* Speziell fuer Polygone;
* 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_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
*
Point UT3D_pt_pt2 ( Point2 pt20)

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 pt,
double  x,
double  y,
double  z 
)

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

void UT3D_pt_mid2pt ( Point po,
Point p1,
Point p2 
)
* 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 po,
Circ ci1 
)

UT3D_pt_midci midpoint of a circ

int UT3D_pt_std_ci ( Point po,
int  imod,
Circ ci1 
)
* UT3D_pt_std_ci get 90/180/270-deg-point of circ
* imod -1: rc returns nr of points; 4 for 360-deg-circs, else 2.
* if (circ == 360-deg-circ):
* imod: 0=0, 1=90, 2=180, 3=270 Grad !
* else if (circ < 360-deg):
* imod: 0=p1, 1=p2
* For nr of points use UTO_ptnr_std_obj
*
int UT3D_ptvcpar_std_dbo ( Point pto,
Vector vco,
double *  par,
int  pType,
int  dbtyp,
long  dbi 
)
* UT3D_ptvcpar1_std_obj get typical points & tangent-vector for DB-obj
*
int UT3D_ptvcpar1_std_obj ( Point pto,
Vector vco,
double *  par,
int  pType,
int  cvTyp,
void *  cvDat 
)
* UT3D_ptvcpar1_std_obj get typical points & tangent-vector for obj
* (start, end, mid, ..)
* (parametric points, typical points, standardpoints, characteristic points)
*
* Input:
* pto NULL for no output
* vco NULL for no output
* par NULL for no output
* pType which points to compute (eg Ptyp_0 ../ut/AP_types.h)
* -1 or less: get controlpoint of polygon|spline (-1 is first)
* cvTyp type of cvDat; eg Typ_LN
* cvDat line/curve, eg struct Line
* cvPar parameter (for pType Ptyp_param)
* Output:
* pto point out
* vco vector out normalized ??
* par parameter out (0-1)
* retcod 0=ok, -1=Error
*
* nr of std-points: UTO_ptnr_std_obj
* boxpoints: see UT3D_box_obja
*
int UT3D_2pt_oppptvclen ( Point p1,
Point p2,
Point pc,
Vector vc1,
double  dist 
)
* UT3D_2pt_oppptvclen 2 opposite points (center, vector, dist)
* pc is center, p1 is direction vc1 from pc, p2 in reverse direction.
*
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_cknear_3pt ( Point p0,
Point p1,
Point p2 
)
* UT3D_ipt_cknear_3pt return index of nearest Point from 3 points
* RetCod 0: p0-p1 is nearest
* 1: p0-p2 is nearest
*
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_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_npt ( int *  ip1,
int *  ip2,
Point pta,
int  pNr 
)

find the indices of the most extreme points ..

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_perp_2pt ( Point p1,
Point p2,
Point p3,
double  tol 
)
* UT3D_pt_ck_perp_2pt check if 3 points are normal (perpendic.)
*
* p3
* X
* /
* / |
* /
* / |
* /
* X-----|------------>X
* p1 p2
* RetCodes:
* 0 = p1-p3 is NOT normal to p1-p2
* 1 = p1-p3 is normal to p1-p2
*
*
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.
*
void UT3D_pt_opp2pt ( Point po,
Point p1,
Point p2 
)
* 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.)

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_traptvclen ( Point po,
Point pi,
Vector vc,
double  lenv 
)
* 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_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_tra_pt_2vc_2par ( Point po,
Point pi,
Vector vc1,
double  l1,
Vector vc2,
double  l2 
)
* 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_trapt2vc2len ( Point po,
Point pi,
Vector vc1,
double  len1,
Vector vc2,
double  len2 
)
* 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_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_trapt2pt ( Point po,
Point pi,
Point p1,
Point p2 
)

UT3D_pt_trapt2pt transl. point distance p1 -> p2

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.
*
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_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_rotptm3 ( Point p2,
Point p1,
Mat_4x3  ma 
)

Rotate Point (prepare with UT3D_m3_inirot_angr)

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 pta,
Vector vca,
double  angr 
)
* Punkt pti um die Achse pta/vca um angr weiterdrehen
* angr = -2Pi bis +2Pi.
* ACHTUNG: vca muss normiert sein !!
*
int UT3D_pt_projptln ( Point pp,
double *  ndist,
double *  par1,
Point pt,
Line ln 
)
* 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_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_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_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 pp,
Plane pl,
Point pt 
)

UT3D_pt_projptpl point = project point to plane

see UPRJ_app_pt

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 ip,
Plane pl,
Line ln 
)
* UT3D_pt_intlnpl point = intersection of line - plane
* ln = unlimited line
*
* Returncodes:
* 0 = line parallel to plane
* 1 = OK;
*
int UT3D_pt_intptvcpl_ ( Point ip,
Plane pl,
Point pt,
Vector vln 
)
* 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_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 UT3D_pt_intlnpl1 ( Point pi,
double *  dl,
Point p1,
Point p2,
double  dn1,
double  dn2 
)
* 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_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_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_mirptln ( Point pto,
Point pti,
Line ln1 
)
* mirror point about line
*
int UT3D_pt_mirptpl ( Point pto,
Point pti,
Plane pln 
)
* mirror point about plane
*
int UT3D_isConvx_ptTab ( int  pNr,
Point pa 
)
* check if is contour convex or concave
* UT3D_isConvx_ptTab nach Karl Sauer 2005-08-12
* pa ist eine geschlossene Kontur; der erste und der letzte Punkt sind ident !
* irc 1 Konvex: zB ein Polyeder, kann via GL_DrawFan dargestellt werden
* irc -1 Konkav: tesselieren
*
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
*
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_tng_ci_vc ( Point pto,
Circ ci1,
Vector vc1,
int  imod 
)
* UT3D_pt_tng_ci_vc tangent with fixed vector to circ
* imod 0 = point at y-axis (vc1=x-axis; ci1.vz=z-axis)
* 1 = point at negative y-axis
*
int UT3D_pt_evpar2pt ( Point po,
double  lpar,
Point p1,
Point p2 
)
* UT3D_pt_evpar2pt 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_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_seg_par_nln ( Point p1,
int  is,
double  ps,
ObjGX cv1 
)

UT3D_pt_seg_par_nln point <– segNr & parameter on lines[] (Typ_CVLNA) TODO: change Typ_CVLNA -> Typ_LN;

int UT3D_pt_evparcrv ( Point pto,
double  lpar,
int  typ,
void *  data 
)
* get point on line/curve from parameter
* Aufruf nur mit der struct (statt einem ObjX):
* ObjGX ox1; UT3D_pt_evparcrv (pto, 0.5, ox1.form, &ox1.data);
* Input:
* typ,data curve
* lpar parameter on curve; 0-1
*
*
int UT3D_pt_m3 ( Point pto,
Mat_4x3  ma 
)

UT3D_pt_m3 copy origin out of 4x3-matrix

void UT3D_pt_traptm3 ( Point p2,
Mat_4x3  mata,
Point p1 
)
* 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 UT3D_compvcNull ( Vector v1)
* UT3D_compvcNull compare vector for (exact) 0,0,0.
*
* Retcode 0: v1 <> 0,0,0
* 1: v1 = 0,0,0
*
* if(UT3D_compvcNull (&vz) == 1) printf("vec is null !\n");
*
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_p ( Vector v1,
Vector v2,
double  tol 
)
* 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
*
int UT3D_comp2vc_d ( Vector v1,
Vector v2,
double  tol 
)
* 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_vc_ck_parl_vc ( Vector v1,
Vector v2,
double  tol 
)
* UT3D_vc_ck_parl_vc check for parallel (normalized only)
*
* useable also for circles and planes (vz is normalized)
* tol: RAD_1 RAD_01 ..
*
* Output:
* retCod 0 vectors are not antiparallel
* 1 vectors are parallel with different direction
* see also
* UT3D_vc_ck_aparl_vc (check for antiparallel)
* UT3D_comp2vc_p, UT3D_comp2vc_d - if not normalized
*
int UT3D_vc_ck_aparl_vc ( Vector v1,
Vector v2,
double  tol 
)
* UT3D_vc_ck_aparl_vc check for antiparallel (normalized only)
*
* tol: RAD_1 RAD_01 ..
*
* Output:
* retCod 0 vectors are not antiparallel
* 1 vectors are parallel with different direction
* see also UT3D_comp2vc__
*
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_ck_perpvc ( Vector vc1,
Vector vc2,
double  tol 
)
* UT3D_vc_ck_perpvc check if 2 vectors are normal (perpendic.)
* For normalized vectors use UT3D_vc_ckperp_2vc1.
* tol ca 0.1 (auch 1. genuegt!)
* RetCode:
* 0 = vc1 is NOT normal to vc2
* 1 = vc1 is normal to vc2
*
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_pt_pt2bp ( Point p3,
Point2 p2,
int  bp 
)

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

void UT3D_pt_txt ( Point pt,
char *  txt 
)
* UT3D_pt_txt Point from text
* delimiters: blank, comma, comma and blank ..
* eg: "100 23 45"
*
void UT3D_vc_txt ( Vector vc,
char *  txt 
)

UT3D_vc_txt Vector from text

int UT3D_vc_bp ( Vector vn,
int  bp 
)

UT3D_vc_bp returns normalVector from BackPlaneNr (0-2)

int UT3D_2vc_pta ( Vector vc1,
Vector vc2,
int  pNr,
Point pta 
)
* get 2 vecs of max extent of a polgon (for perp.Vec)
* 2 normal aufeinander-stehende Vektoren eines Polygon suchen
* (fuer Normalvektor auf Polygon)
*
void UT3D_vc_ln ( Vector vc,
Line ln 
)

UT3D_vc_ln Vector = LineStartPoint -> LineEndPoint

void UT3D_vc_2ptlen ( Vector vc,
Point p1,
Point p2,
double  vlen 
)

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 vc,
double  angX,
double  angZ 
)
* UT3D_vc_2angr Vector = Angle_X_axis, Angle_Z_axis.
*
* angX = Drehwinkel, angZ = Kippwinkel.
*
void UT3D_vc_2vc ( Vector vco,
Vector vc1,
Vector vc2 
)
* UT3D_vc_2vc intermediate Vector
*
* Vektoren muessen normiert sein !!!
* Vektoren duerfen nicht antiparallel sein !!
* AusgabeVektor nicht normiert !
*
int UT3D_ptvc_eval_ci_angr ( Point pto,
Vector vct,
Circ ci1,
double  angr 
)
* UT3D_ptvc_eval_ci_angr get point/tangent to circ from opening-angle
* Input:
* angr opening-angle to vector (ci1.pc - ci1.p1)
* Output:
* pto point on circ (if *pto != NULL)
* vco tangent to circ (if *vct != NULL)
*
* If angr=0.0 - the resulting point = ci1.p1; vector is normal to ci1.p1;
*
int UT3D_vc_tng_crv_pt ( Vector vco,
Point pti,
int  typ,
void *  data 
)
* UT3D_vc_tng_crv_pt vector tangent to curve
* Input:
* typ type of curve
* data curve-data
*
*
int UT3D_vc_tng_ci_pt ( Vector vct,
Point p1,
Circ ci 
)

UT3D_vc_tng_ci_pt tangent-vector to circ (0. - 1.) from point on circ

int UT3D_vc_Zup ( Vector v2,
Vector v1 
)

invert Vector if its Z-coord is negative

void UT3D_vc_perp1vc ( Vector vp,
Vector vi 
)

UT3D_vc_perp1vc normal vector to 3D-vector in X-Y-plane

Computation of a normal vector (not necessarily of length 1) to a 3D-vector. Liefert den Y-Vektor !!!

IN: Vector *vi ... 3D-vector OUT: Vector *vp ... vector normal to the input vector

void UT3D_vc_perp2vc ( Vector vp,
Vector v1,
Vector v2 
)
* UT3D_vc_perp2vc vector perpendic. to 2 vectors (angle < PI only)
* angle between v1-v2 MUST BE < PI (else vp points into negative)
* NO OUTPUT if v1-v2 is parallel or antiparallel
* always normal to short angle ( < PI); not respecting sense of rotation.
* Output:
* vp vector normal to v1 and v2;
*
* length-vp = 1 only if v1 and v2 are normalized AND have angle = 90 deg
* length-vp is the projection of v2 onto v1 ??
* CAN BE 0,0,0 - if v1,v2 are parallel !
* lenght-vp = (lenght-v1 * lenght-perpVec-v2-v1)
* = (lenght-v2 * lenght-perpVec-v1-v2)
*
*
* Get VZ from VX, VY: UT3D_vc_perp2vc (&vz, &vx, &vy);
* Get VY from VZ, VX: UT3D_vc_perp2vc (&vy, &vz, &vx);
* Get VX from VY, VZ: UT3D_vc_perp2vc (&vx, &vy, &vz);
*
* vp (z)
* | /v2 (y)
* | /
* | /
* | /
* x----------v1 (x) angle v1 v2 < PI
*
*
* /v1 (x)
* /
* /
* x----------v2 (y) angle v1 v2 > PI
* |
* |
* |
* vp (z)
*
*
int UT3D_vc_perpvc2pt ( Vector vp,
Vector vx,
Point pc,
Point py 
)
* UT3D_vc_perpvc2pt vector = perpendic. to vec & 2 points (crossprod)
*
* Liefert den Z-Vektor von X-Vektor, Y-AchsStartpunkt und Y-AchsEndpunkt
* Get VZ from VX, PY1, PY2: UT3D_vc_perp3pt (&vz, &vx, &pya, &pye);
* Get VY from VZ, PX1, PX2: UT3D_vc_perp3pt (&vy, &vz, &pxa, &pxe);
*
int UT3D_vc_perp_npt ( Vector vn,
Point pa,
int  pNr 
)
int UT3D_vc_perp3pt ( Vector vp,
Point ptc,
Point ptx,
Point pty 
)
* UT3D_vc_perp3pt vector = perpendic. to 3 points (crossprod)
*
* Liefert den Z-Vektor von Origin, X-AchsEndpunkt und Y-AchsEndpunkt
* Get VZ from PO, PX, PY: UT3D_vc_perp3pt (&vz, &po, &px, &py);
* Get VY from PO, PX, PZ: UT3D_vc_perp3pt (&vy, &po, &pz, &px);
*
int UT3D_vc_perp4pt ( Vector vp,
Point p1,
Point p2,
Point p3,
Point p4 
)
* UT3D_vc_perp4pt vector = perpendic. to 2 lines (crossprod)
*
* Get VY from VZ, PX1, PX2: UT3D_vc_perp3pt (&vy, &vz, &pxa, &pxe);
*
void UT3D_vc_perpvcplXY ( Vector vx,
Vector vc1 
)

UT3D_vc_perpvcplXY Normalvektor auf vc1, der in der X-Y-Plane liegt. returns vx from vz; vz,vy gives vx. vx gives vy.

int UT3D_vc_perpcv ( Vector vcz,
int  pNr,
Point pTab 
)
* UT3D_vc_perpcv Normalvektor auf planares Polygon
* ACHTUNG: liefert NICHT immer im gleichen Umlaufsinn ! Korrigieren !!!!
*
int UT3D_vc_perp_npt_bp_ix ( Vector vcn,
Point pa,
int *  ia,
int  bp 
)
* get normalvector plb->vz for polygon from backPlane and extreme-points
* Input:
* ia[6] index to extreme-points in pa; get it from UT3D_box_ix_npt
* bp backPlane (eg from UT3D_bp_2pt)
* Output
* vcn
*
int UT3D_vc_perppta ( Vector vcn,
int  pNr,
Point pta 
)
* UT3D_vc_perppta get normalvector for polygon for rot.sense CCW
* Normalvector vcn always for sense-of-rotation CCW !
* Input
* pNr nr of points in pta, including first = last point.
* pta[pNr] polygon; first and last point must be ident.
* Output
* vcn
* see also UT3D_ChkPlanPts
*
void UT3D_vc_normalize ( Vector vn,
Vector vc 
)
* UT3D_vc_normalize change to length 1
*
* vn = vc = OK.
*
void UT3D_vc_setLength ( Vector vco,
Vector vci,
double  new_len 
)
* UT3D_vc_setLength change vectorlength
*
* vco und vci duerfen ident sein
*
* use UT3D_vc_multvc with vectors of length=1
*
int UT3D_vc_setLenLen ( Vector vco,
Vector vci,
double  newLen,
double  actLen 
)

UT3D_vc_setLenLen change vectorlength; actLen known.

int UT3D_vc_rotangr ( Vector vco,
Vector vci,
double *  ar 
)
* UT3D_vc_rotangr rotate a vector around Z-axis
*
* vco and vci can be the same adress
*
void UT3D_vc_rot3angr ( Vector vco,
Vector vci,
double  alpha,
double  beta,
double  gamma 
)
* UT3D_vc_rot3angr rotate a vector
*
* (vco and vci can have the same adress)
*
int UT3D_vc_rotvcvcangr ( Vector vo,
Vector va,
Vector vi,
double  angr 
)
* UT3D_vc_rotvcvcangr rotate vec vi around vec va
* VA MUSS NORMIERT SEIN !!!
*
void UT3D_vc_rotvcangr ( Vector vco,
double  a1,
Vector Vi,
Vector Va 
)
* rotate vector Vi around axis Va angr=a1
* vco Vi may be ident
*
int UT3D_vc_perpvcvc ( Vector v3,
Vector v1,
Vector v2 
)
* UT3D_vc_perpvcvc get normal-vector from vector onto other vector
* output-vector v3 is normal onto v2
* RetCodes:
* 0 OK
* -1 v1-v2 aufeinander Normal; v3 == v1
*
* /|
* V1/ |
* / V3
* / |
* / \|/ V2
* x---vcl-->------------>
*
int UT3D_vc_projvcvc ( Vector v3,
Vector v1,
Vector v2 
)
* UT3D_vc_projvcvc vector v3 = project vector v1 to vector v2
* v3 will have same direction as v2 (parallel or antiparallel)
* the length of v3 is the length of v1 projected onto v2.
* Opening-angle v1-v2 > 180: v3 follows v1.
* RetCodes:
* 0 OK
* 1 v1-v2 are perpendicular; v3 = 0,0,0
* -1 v2=0,0,0; v3 = 0,0,0
*
* /|
* V1/ |
* / |
* / |
* / | V2
* x----V3-->------------>
*
* /|
* / |
* V1/ |
* / |
* / |
* <-------V2--------x----V3-->
*
*
int UT3D_vc_projvc2vc ( Vector vo,
Vector vi,
Vector v1,
Vector v2 
)

UT3D_vc_projvc2vc vector = project vector to plane from 2 vec's

int UT3D_vc_projvcnvc ( Vector vo,
Vector vi,
Vector vz 
)
* UT3D_vc_projvcnvc project vec onto plane from Z-vec
* vo = vi projected onto a plane defined by its normal-vector vz.
* vo is parallel to the plane from vz
* the length of vo is the length of vi projected onto the plane from vz.
* Opening-angle vi-vz > 180: vo follows vi.
* RetCodes:
* 0 OK
* 1 vi-vz are perpendicular; vo = vi
* -1 vz=0,0,0; vo = vi
*
* pln vo = vi - vz1
* ^-------/^
* | / |
* vo vi vo
* | / |
* | / |
* x--------+------------> vz (normal-vector of plane)
* |---vz1-->
*
*
void UT3D_vc_projvcpl ( Vector vco,
Plane pl,
Vector vci 
)
* UT3D_vc_projvcpl vector = project vector onto plane
* test for vci=normal to pl with:
* if(UT3D_compvc0 (vco, UT_TOL_min1)) - IS NORMAL !
*
int UT3D_vc_mirvcpl ( Vector vco,
Vector vci,
Plane pln 
)
* mirror vector about plane
*
int UT3D_vc_mirvcln ( Vector vco,
Vector vci,
Line ln1 
)
* mirror vector about line
*
void UT3D_vc_travcm3 ( Vector b,
Mat_4x3  mata,
Vector a 
)
* UT3D_vc_travcm3 apply transformation to vector (from 4x3-matrix)
* rotate Vector: prepare with UT3D_m3_inirot_angr
* b a may be ident
*
void UT3D_vc_travcm4 ( Vector b,
Mat_4x4  ma,
Vector a 
)
* UT3D_vc_travcm4 apply transformation to vector (from 4x4-matrix)
* wird das ein normalisierter vektor ?
* eigentlich eine vectorTransform ?
* dann sollte a ein vc sein !
*
int UT3D_comp2ln ( Line pa1,
Line pa2,
double  tol 
)
* UT3D_comp2ln compare 2 lines if identical
*
* RC = 1 = Lines are identical
* RC = 0 = one of the points has a distance > tol
*
int UT3D_ln_ck_on_ln ( Point lo1,
Point lo2,
Point l11,
Point l12,
Point l21,
Point l22,
double  tol 
)
* check if 2 lines collinear
* Input:
* l11, l12 Line 1
* l21, l22 Line 2
* Output:
* lo1, lo2 the collinear segment if RC==1
* RetCod:
* -1 no
* 0 yes, no coverage
* 1 coverage: coverline out
*
int UT3D_ln_ck_degen ( Line ln)
* UT3D_ln_ck_degen check if line is degenerated (length < UT_TOL_cv)
* retCode: 1 no, not degenerated
* -2 yes, degenerated; length is .lt. UT_TOL_cv but .gt. UT_TOL_pt
* -3 yes, degenerated; length is .lt. UT_TOL_pt
*
int UT3D_ln_ck_parpl ( double *  dist,
Line ln,
Plane pl,
double  tol 
)
* UT3D_ln_ck_parpl check if line is parallel to plane
*
* UT3D_ln_ck_parpl Author: Thomas Backmeister 4.7.2003
*
* Check, if a line is parallel to a plane.
*
* IN:
* Line *ln ... 3D-line
* Plane *pl ... plane
* double tol ... tolerance for parallelism
* OUT:
* double *dist ... signed distance line - plane if line || plane
* >0.0 <=> line ON side of plane normal vector
* <0.0 <=> line on OPPOSITE side of plane normal vector
* Returncodes:
* 0 = line is NOT parallel to plane
* 1 = line is parallel to plane
*
int UT3D_ln_unlim ( Line lno,
int  lTyp 
)
void UT3D_ln_6db ( Line ln,
double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2 
)

line from 2 * 3 doubles

void UT3D_ln_2pt2 ( Line ln1,
Point2 pta,
Point2 pte 
)

UT3D_ln_2pt2 3D-Line aus 2 2D-Punkten

int UT3D_ptNr_ci ( Circ ci1,
double  tol 
)

UT3D_ptNr_ci nr of points for polygon from circle

int UT3D_ck_ci180 ( Circ ci1)
* UT3D_ck_ci180 check if circ is 180-degree-circ
* RC = 0: YES, is 180-deg-circ
* RC = 1: NO
* if(UT3D_ck_ci180 == YES) ...
*
int UT3D_ck_ci360 ( Circ ci1)
* UT3D_ck_ci360 check if circ is 360-degree-circ
* RC = 1: NO
* RC = 0: YES, is 360DegCirc
* RC = -2: degenerated (rad < UT_TOL_cv)
* if(UT3D_ck_ci360 == YES) ...
*
int UT3D_cksid_civc ( Circ ci1,
Vector vc1 
)
* UT3D_cksid_civc ck if KreisStart/Endpunkt ist in Richtg VC od verk.
* Ein Vektor und ein Kreisbogen sind in der gleichen Ebene;
* Test, ob KreisStart/Endpunkt eher in Richtung des Vektors liegen
* oder eher verkehrt liegen.
* RetCod=0: Start/Endpunkt liegen in Richtung vc1
* RetCod=1: Start/Endpunkt liegen verkehrt zu vc1
*
int UT3D_ci_cipt180 ( Circ ci1,
Point p1 
)
* UT3D_ci_cipt180 change circ -> 180 deg-circ; keep dir
* make p2 opposit to p1
*
int UT3D_ci_cipt360 ( Circ ci1,
Point p1 
)

UT3D_ci_cipt360 change circ -> 360 deg-circ; keep dir

int UT3D_ci_cip1 ( Circ ci1,
Point p1 
)

UT3D_ci_cip1 change startpoint of circ

int UT3D_ci_cip2 ( Circ ci1,
Point p2 
)

UT3D_ci_cip2 change endpoint of circ

int UT3D_ci_cip3 ( Circ ci1,
Point p1,
Point p2 
)
* UT3D_ci_cip3 change start- and endpoint of circ
* ATTENTION: DO NOT USE FOR 360-DEG-CIRCs: returns angle = 0.;
* if (UT3D_comp2pt (&p1, &p2, UT_TOL_min0)) {
* UT3D_ci_cipt360 (cvo, &p1); // set 360-deg-circ
* } else {
* UT3D_ci_cip3 (cvo, &p1, &p2);
* }
*
int UT3D_ci_ciangr ( Circ ci,
double  ao2 
)

UT3D_ci_ciangr change endpoint of circ from angle

void UT3D_ci_setangr ( Circ ci1)

UT3D_ci_setangr fix angle from p1-p2

int UT3D_ci_ptptvcangr ( Circ ci,
Point pc,
Point p1,
Vector vz,
double  ao 
)
* UT3D_ci_ptptvcangr Circ from center, startpoint, axis, opening angle
* neg. Winkel: CCW !
*
int UT3D_rdc_3pt ( double *  rdc,
Point pp1,
Point pp2,
Point pp3 
)
* Den Radius eines Kreises errechnen, von dem 3 Punkte bekannt sind.
* p1-p3 sind 3 punkte am Kreis.
* rc = a * b / 2 * hc - is halt so ..
*
* pp2
* / | \
* / | \
* b hc a
* / | \
* pp3 -------c--------pp1
* q p
*
int UT3D_ci_ptrd2vc2angr ( Circ ci,
Point pc,
double  rd,
Vector vz,
Vector vx,
double  a1,
double  a2 
)
* circ from center, Radius, Z-Axis, X-Axis, startAngle, endAngle
* ACHTUNG: Z-Axis u X-Axis muessen normiert sein !!!!
* rd hat DrehRichtg.
* ACHTUNG: die Winkel werden hier umgedreht, die Kreisdrehachse
* ist genau verkehrt zum Plane-vz !
*
int UT3D_ci_ptvcpt2angr ( Circ ci,
Point pc,
Point p1,
Vector vz,
double  a1,
double  a2 
)

circ from center, point, axis, startAngle, endAngle

int UT3D_ci_ptvcrd ( Circ ci,
Point ps,
Vector vs,
double  rd,
Vector vz,
double  a1 
)
* UT3D_ci_ptvcrd Circ from startpoint, startvector, radius ..
* ACHTUNG: vs und vz muessen normiert sein !
* Input:
* ps Startpoint of circ
* vs tangent in ps
* rd Radius; positiv:circ=ccw; negativ: circ=cw.
* vz Axis
* a1 Angle in rad; 0=full circle.
*
int UT3D_ci_3pt ( Circ cpo,
Point pp1,
Point pp2,
Point pp3 
)
* UT3D_ci_3pt Circ from 3 points
* p1-p3 sind 3 punkte am Kreis.
* rc = a * b / 2 * hc - is halt so ..
* hx wird genau in Mitte von c angesetzt (Streckensymmetrale, Pt. pMc)
* hx = sqrt (r * r - (c * c / 4)) // gleichseitiges Dreieck p1,p2,Cen.
*
* pp2
* / | \
* / | \
* b hc a
* / | \
* pp3-------c--------pp1
* q |
* hx,vx
* |
* Cen
*
int UT3D_ci_2ptvcrd ( Circ cia,
Point pp1,
Point pp2,
Vector vz,
double  rdc 
)
* UT3D_ci_2ptvcrd Circ from 2 Points-on-Circ & Radius
* returns unlimited circle, starting at pp1.
*
* RetCod: nr of circles in cia
*
*
* d1 | vc1
* x-----------x-----------x
* pp1 pt1 pp2
* |
* |
* |vc2
* |
* x
* circ.pc
*
int UT3D_ci_ptptvcrd ( Circ ci,
Point p1,
Point p2,
double  rd,
Vector vz,
int  sr,
int  iMod 
)
* UT3D_ci_ptptvcrd Circ from startpoint endpoint radius Z-vector
* limited circle.
*
* rd Radius; r>0 = CCW, r<0 = sr inverted.
* sr sense of rotation; 1=CCW; -1=CW
* iMod 0 0-180 deg
* iMod 1 180-360 deg
*
* Retcod:
* -1 p1 - p2 ident
* -2 Radius too small (p1-p2) > (rd * 2)
*
int UT3D_ci_pcvzpt180 ( Circ ci1,
Point pc,
Vector vz,
Point p1,
int  dreh 
)

UT3D_ci_pcvzpt180 180 deg-circ (CCW) from center, axis, startpoint

int UT3D_ci_inv1 ( Circ ci1)
* UT3D_ci_inv1 invert (change p1, p2, dir)
* Kreis bleibt optisch ganz gleich !!
*
int UT3D_ci_inv2 ( Circ ci1)
* UT3D_ci_inv2 reverse Circ (open circle: complementary circ);
* closed circle: reverse direction.
*
int UT3D_ci_inv3 ( Circ ci1)

UT3D_ci_inv3 invert (optisch gleich, Z-Axis invers)

int UT3D_ci_ptvcr ( Circ ci1,
Point pc,
Vector vcz,
double  rdc 
)

UT3D_ci_ptvcr Circ from center, axis, radius

int UT3D_ci_pt2vcr ( Circ ci1,
Point pc,
Vector vz,
Vector vx,
double  rc 
)

UT3D_ci_pt2vcr Circ from center, axis, x-vec and radius

Circ UT3D_ci_ci2 ( Circ2 ci20)

UT3D_ci_ci2 3D-Circ = 2D-Circ; Z-vec=0,0,1

Circ UT3D_ci_obj2 ( ObjG2 ci20)

DO NOT USE

Circ UT3D_ci_obj ( ObjG ci_in)
int UT3D_pta_dbo ( Point **  pTab,
int *  pNr,
int  typ,
long  ind,
double  tol 
)
* UT3D_pta_dbo get polygon from DB-object(typ,ind)
* returns points in memspc201 ! (do not free)
*
void UT3D_cv_ln ( Point cv,
int *  ptAnz,
Point p1,
Point p2 
)
* Linearstueck -> Polygon.
*
* In/Out: *ptAnz wird nur in 2 geandert, wenn < 2.
*
void UT3D_cv_ci ( Point  cv[],
int *  ptanz,
Circ ci1,
int  ptmax,
double  tol 
)
* UT3D_cv_ci Polygon < 3D-Kreis
* IN:
* ptmax max. of outputpoints
* tol maximal deviation of secant;
* if(tol<0)then return fixed nr of points
* ptanz number of outputpoints (only if stol<0)
* OUT:
* Point cv[] ... array of polygonpoints;
* ptanz number of outputpoints
*
*
int UT3D_npt_ci ( Point pa,
int  pNr,
Circ ci1 
)
* UT3D_npt_ci circular polygon
*
* see also UT3D_cv_ci
*
int UT3D_pta_rot__ ( Point p2Tab,
Point p1Tab,
int  ptNr,
Point pc,
Vector vz,
double  ar 
)

rotate curve CCW um axis ..

int UT3D_cv_inv ( int  ptNr,
Point pta 
)

UT3D_cv_inv Punktetabelle umdrehen

int UT3D_cv_realg ( int  ptNr,
Point pta,
int  ista 
)
* UT3D_cv_realg Punktetabelle umschichten (realign)
* pta[0] soll pta[ista] sein und dann alle anschliessenden
* pta[ista] ist also der erste Punkt, dann folgen alle weiteren.
*
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
* retCod 0=OK-pta-vca; 1=vca-only; -1=error
*
int UT3D_ptvc_tng_crv_par ( Point pto,
Vector vct,
int  oTyp,
void *  obj,
int  pTyp,
double  par 
)
* UT3D_ptvc_tng_crv_par get point/tangentVector on obj from parameter
*
* Input:
* pto point; NULL for no output
* vct tangent-vector; NULL for no output
* oTyp,obj curve
* pTyp type of parameter;
* 0=normalized parameter (0-1)
* 1=native parameter; any value ..
* par parametervalue accord. pTyp
*
double UT3D_angr_3pt ( Point p1,
Point pc,
Point p2 
)

UT3D_angr_3pt angle between 3 points

double UT3D_angr_2vc__ ( Vector v1,
Vector v2 
)
* 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_2vc_n ( Vector v1,
Vector v2 
)
* UT3D_angr_2vc_n angle between two normalized vec's
* angle = always 0 <= PI; direction is CCW OR CW.
* for CCW-direction / angles (0 < 2PI) use UT3D_angr_3vcn
* 0.866, 0.500, 30 deg
* 0.707, 0.707, 45 deg
* 0.500, 0.866, 60 deg
*
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_4pt ( Point p11,
Point p12,
Point p21,
Point p22 
)

UT3D_angr_4pt angle between 2 lines

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 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_pl_pta ( Plane pl,
int  ptNr,
Point pta 
)
* UT3D_pl_pta plane from n-points
* ACHTUNG: Z-Vektor entspricht nicht dem Umlaufsinn !
* RetCod: -1 weniger als 3 Punkte
* see also UT3D_vc_perppta
*
int UT3D_pl_bpdb ( Plane plo,
int  bp,
double  dbc 
)
* UT3D_pl_bpdb Plane from equation;
*
* Input:
* bp = BCKVEC_Z = BCKPLN_XY: dbc = Z-Coord.Value
* bp = BCKVEC_Y = BCKPLN_XZ: dbc = Y-Coord.Value
* bp = BCKVEC_X = BCKPLN_YZ: dbc = X-Coord.Value
*
int UT3D_pl_3pt ( Plane pl,
Point p1,
Point p2,
Point p3 
)
* UT3D_pl_3pt plane from 3 point's
*
* Achtung: für Transformation manchmal ungeeignet, weil
* der X-Vektor immer parallel zur XY_Ebene eingerichtet wird
* (use UT3D_pl_pto_vcx_vcy).
*
int UT3D_pl_ln ( Plane pln,
Line lna 
)
* UT3D_pl_ln make Plane from line
* Origin is line-center; Z-vec is line.
*
void UT3D_pl_2ln ( Plane pl1,
Line ln1,
Line ln2 
)

plane from 2 lines;

int UT3D_pl_ell ( Plane pl1,
CurvElli el1 
)

UT3D_pl_ell make Plane from ellipse

int UT3D_pl_obj ( Plane pl1,
int  typ,
void *  obj 
)
int UT3D_pl_ci ( Plane pl1,
Circ ci1 
)

UT3D_pl_ci make Plane from circ

int UT3D_pl_nobj ( Plane pl1,
int  oNr,
ObjGX oTab 
)
* UT3D_pl_nobj plane fron ObjGX-table
* die Transformationsmatrix zu n Objekten suchen ..
* oTab enthaelt PT|LN|AC
* 1) Circ in den Inputdaten: vz auslesen, ptCen laden, Plane davon.
* 2) mind 2 Lines: vz=CrossProd. dazu; Origin = 1.Point, Plane davon.
* 3) von den InputObjekten eine Punktetabelle beladen; Plane davon.
*
void UT3D_pl_XYZ ( Plane pl1)

UT3D_pl_XYZ Defaultplane

int UT3D_pl_ptvzpl ( Plane pl,
Point pt,
Vector vcz,
Plane basPln 
)

UT3D_pl_ptvzpl plane from z-axis and origin and base-plane

int UT3D_pl_ptvxpl ( Plane pl,
Point pt,
Vector vcx,
Plane basPln 
)

UT3D_pl_ptvxpl plane from x-axis and origin and base-plane

int UT3D_pl_pto_vcz_vcx ( Plane pl1,
Point po,
Vector vz,
Vector vx 
)
* UT3D_pl_pto_vcz_vcx plane from Origin, Z-vec, X-Vec. Z-vec is fixed.
* vz must have length=1.
* Create vy from vx and vz; create new vx from vy, vz.
*
void UT3D_pl_pto_vcx_vcz ( Plane pl1,
Point po,
Vector vx,
Vector vz 
)

plane from Origin, X-vec, Z-Vec. X-vec is fixed.

void UT3D_pl_pto_vcx_vcy ( Plane pl1,
Point po,
Vector vx,
Vector vy 
)
* UT3D_pl_pto_vcx_vcy plane from origin, X-vec, Y-Vec. X-vec is fixed.
*
* Both vecs are in the Plane !
*
*
int UT3D_pl_ptvc ( Plane pl,
Point pt,
Vector vc 
)

UT3D_pl_ptvc plane from point + z-vector

void UT3D_pl_pto_vcz_ptx ( Plane pl1,
Point po,
Vector vz,
Point ptx 
)

UT3D_pl_pto_vcz_ptx Plane aus Nullpunkt, Z-Achse und Punkt auf X-Achse

void UT3D_pl_invert ( Plane pl)
* UT3D_pl_invert Plane invert (change direction of Z-vec)
* Invert Z-Achse, swap X-Y-Achse.
*
int UT3D_pl_rotZangr ( Plane pln1,
double *  ar 
)

UT3D_pl_rotZangr rot. Refsys around Z

int UT3D_pl_rotYangr ( Plane pln1,
double *  ar 
)

UT3D_pl_rotYangr rot. Refsys around Z (tilt-angle)

int UT3D_pl_rotpt ( Plane plo,
Plane pli,
Point ptx 
)
* UT3D_pl_rotpt rot. Refsys around Z; point gives new X-direction
* plo und pli duerfen gleich sein.
*
void UT3D_pl_ptpl ( Plane pl,
Point pt1 
)

UT3D_pl_ptpl change origin of plane

void UT3D_pl_p ( Plane pl)

UT3D_pl_p plane - update p after a change of po or vz

int UT3D_pl_mirln ( Plane plno,
Plane plni,
Line ln1 
)
int UT3D_pl_mirpl ( Plane plno,
Plane plni,
Plane plnm 
)
int UT3D_pl_tra_m3 ( Plane pl2,
Plane pl1,
Mat_4x3  ma 
)
* apply transformation to refSys
* Keep origin, rotate axes.
* get matrix eg with UT3D_m3_inirot_2vc
*
int UT3D_m3_get ( void *  out,
int  mode,
Mat_4x3  ma 
)

UT3D_m3_get get part of matrix; 0=VX, 1=VY, 2=VZ, 3=PO

int UT3D_m3_set ( Mat_4x3  ma,
int  mode,
void *  da 
)

UT3D_m3_set set part of matrix; 0=VX, 1=VY, 2=VZ, 3=PO

int UT3D_m3_copy ( Mat_4x3  mo,
Mat_4x3  mi 
)

UT3D_m3_copy memcpy

          // VX   VY   VZ   PO

Mat_4x3 mi= { {1.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0} };

UT3D_m3_copy (mo, mi); // mi=UT3D_MAT_4x3

int UT3D_m3_iniZrot_angr ( Mat_4x3  ma,
Point ptOri,
double  ar 
)

UT3D_m3_iniZrot_angr define rotation around z-axis; (center, angle) Drehung um die Z-Achse definieren ptOri ist ein Punkt, um den gedreht werden soll. Drehung um absolute Z-Achse oder obj schon in NullLage: ptOri=NULL.

int UT3D_m3_inirot_angr ( Mat_4x3  ma,
Point pa,
Vector va,
double  angr 
)

define rotation (axis, origin angle)

int UT3D_m3_inirot_2vc ( Mat_4x3  ma1,
Point pto,
Vector vc1,
Vector vc2 
)
* UT3D_m3_inirot_2vc define rotation-transformation between 2 vectors
* RetCod: 0 OK, transformation in ma1 defined;
* 1 vc1-vc2 are parallel (same direction); ma1 not defined.
* -1 vc1-vc2 are antiparallel; ma1 not defined.
*
void UT3D_m3_load ( Mat_4x3  ma,
Vector vx,
Vector vy,
Vector vz 
)
* UT3D_m3_load define refSys from 3 vectors (4x3 Matrix).
* Die Inp.Vec. muessen nicht normiert sein.
* use (translate points) with UT3D_pt_traptm3
*
void UT3D_m3_load_o ( Mat_4x3  ma,
Point ori 
)
* UT3D_m3_load_o Nullpunkt into 4x3 Transform.Matrix.
* Nach UT3D_m3_load.
*
void UT3D_m3_load_povxvy ( Mat_4x3  ma,
Point ori,
Vector vx,
Vector vy 
)

UT3D_m3_load_povxvy neues Achsensystem mit Origin,vx,vy definieren

void UT3D_m3_load_povxvz ( Mat_4x3  ma,
Point ori,
Vector vx,
Vector vz 
)
* UT3D_m3_load_povxvz neues Achsensystem mit Origin,vx,vz definieren
* Doku see UT3D_m3_load
*
void UT3D_m3_loadpl ( Mat_4x3  m1,
Plane pl1 
)

UT3D_m3_loadpl load Plane(=Achsensystem) into 4x3 Transform.Matrix

int UT3D_m3_invm3 ( Mat_4x3  im1,
Mat_4x3  m1 
)
* UT3D_m3_invm3 4x3-Matrix invertieren
* ACHTUNG: Adresse darf NICHT gleich sein !!
*
int UT3D_m3_traVc ( Mat_4x3 ma,
Vector trVc 
)

UT3D_m3_traVc translate mat (move origin)

int UT3D_m3_tram3m3 ( Mat_4x3  m3,
Mat_4x3  m1,
Mat_4x3  m2 
)
* UT3D_m3_tram3m3 apply transformation to Mat_4x3
*
* see also UTRA_app__
*
int UT3D_m3_scl ( Mat_4x3 ma,
double *  sx,
double *  sy,
double *  sz 
)

UT3D_m3_scl scale mat

void UT3D_m3_multm3 ( Mat_4x3  m3,
Mat_4x3  m1,
Mat_4x3  m2 
)
* UT3D_m3_multm3 4x3-Matrix mit 4x3 Matrix multiplizieren
* (nur den 3x3-Anteil)
*
int UT3D_m3_tra_m3 ( Mat_4x3  m3,
Mat_4x3  m1,
Mat_4x3  m2 
)
* m1 ist das aktive Refsys; es soll um m2 transformiert werden.
* Das resultierende Refsys ist m3.
* Die Punkte 0,0,0 1,0,0 und 0,0,1 mit m2 transformieren;
* die Ergebnispunkte dann mit m1 transformieren;
* daraus das Refsys m3 generieren.
*
int UT3D_m3_rot_m3 ( Mat_4x3  m2,
Mat_4x3  m1,
Vector vc1,
double *  a1 
)
void UT3D_m4_init ( Mat_4x4  ma)
* UT3D_m4_init Initialize a 4x4 - matrix
*
* Fuer horiz u vert matrix. !
*
* ( 1 0 0 0 )
* ( 0 1 0 0 )
* [a] = ( 0 0 1 0 )
* ( 0 0 0 1 )
*
*
void UT3D_m4_init_ori ( Mat_4x4  ma,
double  px,
double  py,
double  pz 
)
* UT3D_m4_init_ori Initialize a 4x4 - matrix with translation
*
* hor. Matrix !
*
* Mat_4x4-horizontal:
* Der erste Wert ist der Index ins double-Array.
*
* VX 0=[0][0]=vx.x 1=[0][1]=vx.y 2=[0][2]=vx.z 3=[0][3]=0
* VY 4=[1][0]=vy.x 5=[1][1]=vy.y 6=[1][2]=vy.z 7=[1][3]=0
* VZ 8=[2][0]=vz.x 9=[2][1]=vz.y 10=[2][2]=vz.z 11=[2][3]=0
* PO 12=[3][0]=o.x 13=[3][1]=o.y 14=[3][2]=o.z 15=[3][3]=1
*
void UT3D_m4_init_rot ( Mat_4x4  ma,
double  angle,
Vector axis 
)

UT3D_m4_init_rot Initialize a 4x4 - matrix with rotation

void UT3D_m4_loadpl ( Mat_4x4  m1,
Plane pl1 
)
* UT3D_m4_loadpl load Plane(=Achsensystem) into 4x4 Transform.Matrix
* kann fuer glMultMatrixd verwendet werden.
*
void UT3D_m4_load_o ( Mat_4x4  ma,
Point ori 
)
* UT3D_m3_load_o set origin into 4x4 Transform.Matrix.
*
void UT3D_m4_addrot ( Mat_4x4  mo,
Mat_4x4  ma,
Mat_4x4  mb 
)

UT3D_m4_addrot Concatenate 2 4x4 - matrixes.

void UT3D_m4_addtra ( Mat_4x4  ma,
double  px,
double  py,
double  pz 
)

UT3D_m4_addtra add a translation into 4x4-matrix

int UT3D_m4_copy ( Mat_4x4  mo,
Mat_4x4  mi 
)

UT3D_m4_copy memcpy

int UT3D_m4v_m3 ( Mat_4x4  mo,
Mat_4x3  mi 
)

UT3D_m4v_m3 copy a Mat_4x3 –> vertical-Mat_4x4

int UT3D_m3_m4v ( Mat_4x3  mo,
Mat_4x4  mi 
)

UT3D_m3_m4v copy a vertical-Mat_4x4 –> Mat_4x3

int UT3D_pt_intlnsph ( Line ln1,
Point ps,
double  rs 
)
* UT3D_pt_intlnsph intersect limited line / sphere
* irc -1 Line ganz ausserhalb
*
int UT3D_ptCen_2Ln ( Point ptCen,
Point pa,
Point pb,
Point pc,
Point pd 
)
* UT3D_ptCen_2Ln give common centerPoint of 2 Lines
* gemeinsamer Mittelpunkt: Intersect Normalen an den LineMittelpunkten
* irc = 0 = OK;
* irc = -1 = parallel; ip = midPoint.
*
int UT3D_pt_intlnci_l ( Point  pa[],
Line ln,
int  lnLim,
Circ ci,
int  ciLim 
)
* UT3D_pt_intlnci_l intersect line and circle (limited|unlimited)
*
* Intersection of line and circle.
* The line need NOT lie in the plane of the circle.
*
* IN:
* Line *ln 3D-line
* lnLim 0=limited Line, 1=unlimited Line
* Circ *ci 3D-circle
* ciLim 0=limited Circ, 1=unlimited Circ
* OUT:
* Point pa[] array of 0-2 intersection points
* Returncode:
* -1 no intersection
* 1 1 intersectionpoint (pa[0])
* 2 2 intersectionpoints (pa[0] and pa[1])
*
int UT3D_pt_intlnci_lp ( Point  pa[],
Line ln1,
int  lnLim,
Circ ci1,
int  ciLim 
)
* UT3D_pt_intlnci_p intersection LN-CIR (limited|unlimited)
* The line must lie in the plane of the circle. !!
*
* IN:
* Line *ln 3D-line
* lnLim 0=limited Line, 1=unlimited Line
* Circ *ci 3D-circle
* ciLim 0=limited Circ, 1=unlimited Circ
* OUT:
* Point pa[] array of intersection points; size 2
* Returncode:
* -1 no intersection
* 1 1 intersectionpoint (pa[0])
* 2 2 intersectionpoints (pa[0] and pa[1])
*
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_intlnci__ ( int *  np,
Point  xp[],
Line ln,
Circ ci 
)
* 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_ln_tra_vc ( Line lno,
Line lni,
Vector vco 
)
int UT3D_ln_tng_ci_pt ( Line lno,
Circ ci1,
Point pt1,
int  imod 
)
* UT3D_ln_tng_ci_pt tangent to circ tru point
* imod 0 = point at y-axis (vc1=x-axis; ci1.vz=z-axis)
* 1 = point at negative y-axis
* RetCod Nr of solutions; -1,1,2.
*
int UT3D_ln_tng_ci_vc ( Line lno,
Circ ci1,
Vector vc1,
int  imod 
)
* UT3D_ln_tng_ci_vc tangent with fixed vector to circ
* imod 0 = point at y-axis (vc1=x-axis; ci1.vz=z-axis)
* 1 = point at negative y-axis
*
int UT3D_ln_tng_ci_ci ( Line ln1,
Circ ci1,
Circ ci2,
int  sNr 
)
* UT3D_ln_tng_ci_ci Tangente (4 Lines) an CIR - CIR
* sNr solution-number 0-3
* Output:
* RC = nr of possible solutions; -1 (no solution), 1|2|3|4
*
* ------------1--------
* \ \ _/ /
* \ \__3 4/ /
* | _\ __/ |
* /__/ \___ \
* // \__ \
* -------2-------------
*
*
int UT3D_ln_projlnci ( Line lno,
Line lni,
Circ cii 
)

line = project endpoints of line –> circPlane

int UT3D_ln_parl2ln ( Point po1,
Point po2,
Point p11,
Point p12,
Point p21,
Point p22 
)
* UT3D_ln_parl2ln ln <== gemeinsame Strecke of 2 lines
* rc = -1: keine gemeinsame Strecke
* rc = 0: po1-po2 ist die gemeinsame Strecke
*
int UT3D_ln_int2pl ( Line ln,
Plane pl1,
Plane pl2 
)
* UT3D_ln_int2pl LN = Intersection PLN / PLN
*
*
* Intersection of 2 planes.
*
* The 1. point of the intersection line is the closest to the
* coordinate origin.
* The 2. point of the intersection line has distance 1 to the 1. point.
*
* IN:
* Plane *pl1 ... 1. plane
* Plane *pl2 ... 2. plane
* OUT:
* Line *ln ... intersection line of the 2 planes
* Returncodes:
* 0 = OK
* 1 = no intersection (parallel planes)
*
int UT3D_ln_pts_dmax ( Line ln,
int  np,
Point ptab,
double  tol 
)
* UT3D_ln_pts_dmax line <-- points with max. distance of pointTab.
*
*
* Computation of a line from a set of 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 points
* Point *ptab ... points
* double tol ... tolerance: minimal desired distance between
* line points
* OUT:
* Line *ln ... line with maximal point distance
* Returncodes:
* 1: line exists
* 0: no line exists
*
int UT3D_ln_setLen ( Line lno,
Point pc,
double  lnlg,
Line lni 
)

change LineLength; center around pc

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_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_plcoe_pl ( polcoeff_d3 co,
Plane pl 
)
* UT3D_plcoe_pl plane equation <-- plane
*
* Computation of the coefficients of the plane equation to a plane,
* i.e. a, b, c, d such that a*X + b*Y + c*Z = d;
*
* IN:
* Plane *pl ... plane
* OUT:
* polcoeff_d3 *co ... coefficients of plane equation
* Returncodes:
* 0 = OK
*
int UT3D_pl_plcoe ( Plane pl,
polcoeff_d3 co 
)
* UT3D_pl_plcoe plane <-- plane equation
*
*
* Computation of the plane from the coefficients of the plane equation.
*
* IN:
* polcoeff_d3 *co ... coefficients of plane equation
* OUT:
* Plane *pl ... plane
* Returncodes:
* 0 = OK
* -1 = input error
*
int UT3D_bp_2pt ( Point pt1,
Point pt2 
)
* UT3D_bp_2pt returns main-BackPlaneNr (0-2) from 2 points
* eg all points in XY-plane return 2 = BCKPLN_XY
*
int UT3D_bp_vc_ ( Vector vc1)
* UT3D_bp_vc_ returns main-BackPlaneNr (0-2) from vec
*
* eine Hilfsebene auswaehlen; Input ist ein Vektor;
* es wird jene Hauptebene mit dem hoechsten Wert gewaehlt.
* vc1 rc
* 1 0 0 1 = BCKPLN_XZ skip Y-Vec
* 0 1 0 2 = BCKPLN_XY skip Z-Vec
* 0 0 1 0 = BCKPLN_YZ skip X-Vec
*
int UT3D_bp_vcz ( Vector vcn)
* UT3D_bp_vcz returns main-BackPlaneNr (0-2) from normalvec
*
* eine Hilfsebene auswaehlen; Input ist der Normalvektor der Ebene;
* es wird jene Hauptebene mit dem geringsten Wert gewaehlt.
* In: Out:
* 1,0,0 X-Vektor: 0 = BCKPLN_YZ es wird Y-Z-Plane gewaehlt;
* 0,1,0 Y-Vektor: 1 = BCKPLN_XZ es wird X-Z-Plane gewaehlt;
* 0,0,1 Z-Vektor: 2 = BCKPLN_XY es wird X-Y-Plane gewaehlt;
*
int UT3D_bp_pta ( int  pNr,
Point pa 
)
* backplane from n points
*
int UT3D_par_ck_inObj__ ( double  ux,
Point px,
Point ps,
Point pe,
double  us,
double  ue 
)
* check if parameter is inside range us-ue & check limitpoints
* px point to check
* ps, pe limiting points
* us,ue parametric range of unlimited obj;
* RetCod: 0 NO, par1 is outside parameter-range us-ue
* 1 YES, par1 is inside parameter-range us-ue
*
int UT3D_par_ck_inObj_del ( int *  np,
Point pa,
double *  va,
Point ps,
Point pe,
double  us,
double  ue 
)
* delete all points & parameters not on obj (between limits us-ue)
* Input:
* np nr of parameters, points
* pa np points
* va np parameters
* ps,pe startpoint, endpoint of obj
* us,ue startparameter, endparameter of curve
* Output:
* np reduced nr of parameters, points
* pa delete all points outside range us-ue
* va delete all parameters outside range us-ue
*
* test if points coincide; then test if par1 inside 0-1
*
int UT3D_parvc_2vc ( double *  pl,
Vector v1,
Vector v2 
)
* UT3D_parvc_2vc parameter of distance of vec1 projected on vec2
*
* v1={0.5, 0.5, 0.}, v2={1., 0., 0.} gives pl = 0.5
* v1={-0.5, 0.5, 0.}, v2={1., 0., 0.} gives pl = -0.5
* v1={1.5, 0.5, 0.}, v2={1., 0., 0.} gives pl = 1.5
*
*
* V1,V2 have same startpoint s.
* x
* /|
* / |
* V1 |
* / |
* / .|
* s-----x---V2------->
* < 0 0 pl=0.4 1 > 1
*
* RetCodes:
* 0 OK
* -1 v1-v2 aufeinander Normal; pl = 0.
*
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_2par_vc_vcx_vcy ( double *  dx,
double *  dy,
Vector vc1,
Vector vcx,
Vector vcy 
)
* UT3D_2par_vc_vcx_vcy get parameters of vector projected onto vx,vy
* vcx and vcy must have length=1
*
* vcy
* ^
* |
* |---dx---|
* |
* | x ---
* | / |
* | vc1/ |
* | / dy
* | / |
* | / |
* x---------------------> vcx
*
*
int UT3D_2parvc_3vcbp ( double *  dx,
double *  dy,
int  mainPln,
Vector v1,
Vector v2,
Vector v3 
)
* 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
*
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
*
*
int UT3D_pt_ln_lim_del ( int *  nrp,
Point pa,
double *  va1,
Point pl1,
Point pl2 
)
* UT3D_pt_ln_lim_del remove points outside limited line
* Input:
* nrp nr of points on unlimited line
* pa points
* va1 size nrp, can be empty or NULL
* Output:
* nrp nr of points between pl1-pl2
* va1 parameter on points;
*
*
int UT3D_pt_ci_lim_del ( int *  nrp,
Point pa,
double *  va1,
Circ ci1 
)
* UT3D_pt_ci_lim_del remove points outside limited circle
* Input:
* nrp nr of points on unlimited circle ci1
* pa points
* va1 size nrp, can be empty or NULL
* Output:
* nrp nr of points inside trimmed circle ci1
* va1 parameter on points;
*
*
int UT3D_par_pt_2pt ( double *  par1,
Point px,
Point pl1,
Point pl2 
)

get parameter of point px on line pl1 - pl2

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.
*
*
int UT3D_ck_npt_inLine ( Point pa,
int  paSiz,
Line ln1 
)
* UT3D_ck_npt_inLine check if points are on lineSegment
* points outside lineSegment ci1 are removed from pa
*
* Returncode:
* nr of remaining points in pa (all points are on lineSegment ci1)
*
*
int UT3D_ck_npt_inCirc ( Point pa,
int  paSiz,
Circ ci1 
)
* UT3D_ck_npt_inCirc check if points are on circSegment
* points outside CircSegment ci1 are removed from pa
*
* Returncode:
* nr of remaining points in pa (all points are on CircSegment ci1)
*
*
int UT3D_pt_int2ln ( Point ip1,
Point ip2,
double *  dist,
Line ln1,
Line ln2 
)
* 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_intlnln ( Point ip1,
Point ip2,
double *  dist,
Line ln1,
int  ln1Mode,
Line ln2,
int  ln2Mode 
)
* UT3D_pt_int2ln intersect 2 Lines both limited or unlimited
* get 2 points & dist.
*
* IN:
* Line *ln1 line 1
* ln1Mode 0=limited Line, 1=unlimited Line.
* Line *ln2 line 2
* ln2Mode 0=limited Line, 1=unlimited Line.
* 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:
* -2 = no intersection inside the segments
* -1 = Lines parallel or zero-length
* 0 = OK; dist gives the minimum distance.
* 1 = OK; distance (ip1-ip2) is less than UT_TOL_pt
*
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])
*