gCAD3D 2.40
u3d.c File Reference

general 3d-geometric functions More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_math.h"
#include "../ut/ut_TX.h"
#include "../ut/u3d.h"

Functions

int UT3D_ch_lnbox (Line *ln, Point *pmin, Point *pmax, double tol)
 
int UT3D_GravCentPts (Point *gc, int np, Point *ptab)
 
int UT3D_ChkPlanPts (int piT[3], int np, Point *ptab)
 
int UT3D_VcPts2Crvs (Vector *vc, void *cv, int cvt, void *ocv, int np, int sn)
 
int UT3D_CompPts (int np, Point *pTab, double tol)
 

Variables

double UT_TOL_0Cos
 tolerance for zero cosine More...
 

Detailed Description

general 3d-geometric functions

=====================================================
List_functions_start:
UT3D_ChkPlanPts Check planarity <-- points
UT3D_ch_lnbox check line-X with axis-parallel box
UT3D_CompPts Compare <-- points
UT3D_GravCentPts Gravitation center <-- points
UT3D_VcPts2Crvs Vector <-- corresponding points on two curves
List_functions_end:
=====================================================

Function Documentation

int UT3D_ch_lnbox ( Line ln,
Point pmin,
Point pmax,
double  tol 
)
* UT3D_ch_lnbox check line-X with axis-parallel box
*
* Check if a line intersects an axis-parallel box.
*
* IN:
* Line *ln ... line
* Point *pmin ... endpoint 1 of box diagonal
* Point *pmax ... endpoint 2 of box diagonal
* double tol ... tolerance for line intersecting box (>0)
* OUT:
* Returncodes:
* 0 = the line does not intersect the box
* 1 = the line intersects the box
*
int UT3D_GravCentPts ( Point gc,
int  np,
Point ptab 
)
* UT3D_GravCentPts Gravitation center <-- points
*
* Center of gravitation of a set of points.
*
* IN:
* int np ... number of points
* Point *ptab ... points
* OUT:
* Point *gc ... gravitation center
* Returncode:
* 0 = OK
*
int UT3D_ChkPlanPts ( int  piT[3],
int  np,
Point ptab 
)
* UT3D_ChkPlanPts Check planarity <-- points
*
* Check if the given points lie on a plane.
*
* IN:
* int np ... number of points
* Point *ptab ... points
* OUT:
* int piT[3] ... point indices rel. ptab defining plane
* (if returncode < 2)
* Returncodes:
* 0 = points are not planar
* 1 = points are planar
* 2 = points are collinear
* 3 = points are identic
*
int UT3D_VcPts2Crvs ( Vector vc,
void *  cv,
int  cvt,
void *  ocv,
int  np,
int  sn 
)
* UT3D_VcPts2Crvs Vector <-- corresponding points on two curves
*
* The two given curves have same type, orientation and parameterization and
* should have no intersections.
* The sample number determines a curve parameter from which corresponding
* curve points are computed.
* Their difference is the resulting vector.
*
* From the sample-number the curve-parameter t follows by
* t = a + sn * (b-a)/np, where [a,b] is the support of the curves.
*
* IN:
* void *cv ... curve
* int cvt ... type of curve
* void *ocv ... offset curve (corr. to cv)
* int np ... number of point-positions on cv/ocv (without endpoint)
* int sn ... sample-number of points to evaluate (0 <= sn <= np)
* OUT:
* Vector *vc ... vector
* Returncodes:
* 0 = OK
* -1 = internal error
*
int UT3D_CompPts ( int  np,
Point pTab,
double  tol 
)
* UT3D_CompPts Compare <-- points
*
* Compare the given points.
*
* IN:
* int np ... number of points
* Point *pTab ... array of points
* OUT:
* Returncodes:
* 1/0 <=> points are all equal Y/N
*

Variable Documentation

double UT_TOL_0Cos

tolerance for zero cosine