gCAD3D 2.35
ut_plg.c File Reference

PolygonCurve. More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_plg.h"
#include "../ut/func_types.h"

Functions

int UPLG_2par_iseg (double *p1, double *p2, int is, CurvPoly *plg)
 
int UT3D_pt_plg_lim (Point *p1, Point *p2, double *v1, double *v2, CurvPoly *cv1)
 
int ULN3_segNr_par_prj_pt_nln (int *is, double *ps, Point *pti, int lNr, Line *lTab)
 
double UT3D_ck_pta_maxDev (int ptNr, Point *pTab)
 
int UT3D_ck_plg_par_trm (double *par, CurvPoly *plg)
 
int UT3D_ck_plg_trim (CurvPoly *cv1)
 
int UT3D_ck_plgpar1lim (CurvPoly *plg, double par1)
 
int UT3D_ck_plgparlim (CurvPoly *plg, double par)
 
int UT3D_2pt_segnln (Point *p1, Point *p2, int is, Line *lna)
 
int UT3D_2pt_plg_iseg (Point *p1, Point *p2, int is, CurvPoly *plg)
 
int UT3D_ck_plgclo (CurvPoly *plg)
 
int UT3D_plg_projplgpln (CurvPoly *plgo, CurvPoly *plgi, Plane *pln, Memspc *memSeg1)
 
int UT3D_pt_evalplg (Point *pto, CurvPoly *plg, double parPlg)
 
int UT3D_pt_intlnplg (int *nxp, Point *xptab, double *vtab, Line *ln, CurvPoly *plg, double tol)
 
int UT3D_pt_intciplg (int *nxp, Point *xptab, double *vtab, Circ *ci, CurvPoly *plg)
 
int UT3D_pt_intelplg (int *nxp, Point *xptab, double *va_el, double *va_plg, CurvElli *el, CurvPoly *plg)
 
int UT3D_pt_intbspplg (int *nxp, Point *xptab, double *vtab, Memspc *memSeg1, CurvBSpl *bspl, CurvPoly *plg)
 
int UT3D_pt_intplplg (int *pNr, Point *pa, Plane *pln, CurvPoly *plg)
 
int UT3D_pt_int2plg (int *nxp, Point *xptab, double *vtab1, double *vtab2, CurvPoly *plg1, CurvPoly *plg2)
 
int UT3D_par1_plg_pt (double *par1, Point *pt, CurvPoly *plg)
 
int UT3D_parplg_plgpt (double *parplg, Point *pt, CurvPoly *plg)
 
int UT3D_vc_evalplg (Vector *vco, CurvPoly *plg, double pVal)
 
int UT3D_pta_ccw_plg (int *ptNr, Point *pta, CurvPoly *plg)
 
int UT3D_pt_projptplg (int *nxp, Point *pto, double *ttab, CurvPoly *plg, Point *pt)
 
double UT3D_plg_lvTab (double *lTab, Point *pTab, int ptNr)
 
int UT3D_plg_pta (CurvPoly *plg1, Point *pta, int ptNr, Memspc *memSeg1)
 
int UT3D_plg_npar1_npar (double *da, CurvPoly *cv1)
 
double UT3D_par_par1plg (double pv, CurvPoly *cv1)
 
double UT3D_par1_parplg (double *kv, CurvPoly *cv1)
 
int UPLG_iseg_par (int *segNr, double up, CurvPoly *cv1)
 

Detailed Description

PolygonCurve.

pta = pointTable
plg = struct CurvPoly; pointTable + lengthTable + limitParameters v0,v1.
=====================================================
List_functions_start:
UT3D_ck_plgclo check if polygon is closed
UT3D_ck_plgparlim check if knotVal == start | endPt
UT3D_ck_plgpar1lim check if par == start | endPt
UT3D_ck_pta_maxDev get max.deviation of a pointTable
UT3D_ck_plg_trim check if polygon is limited
UT3D_ck_plg_par_trm test if point is on clipped parts
UT3D_pt_evalplg Punkt auf PolygonCurve aus Parameterwert
UT3D_pt_projptplg proj PT -> PolygonCurve
UT3D_pt_plg_lim get limits (startpoint, endpoint, parameters)
UT3D_pt_intlnplg intersect line and polygon
UT3D_pt_intciplg intersect circle and polygon
UT3D_pt_intelplg intersect ellipse and polygon
UT3D_pt_intbspplg intersect b-spline curve and polygon
UT3D_pt_intplplg intersect Plane polygon
UT3D_pt_int2plg intersect 2 polygons
UT3D_plg_pta PolygonCurve aus Punktetabelle
UT3D_plg_lvTab create new lengthTable lvTab
UT3D_plg_projplgpln Polygon = project Polygon -> Plane
UT3D_parplg_plgpt get knotvalue from point on polygon
UT3D_par_par1plg get knotvalue from parameter 0-1
UT3D_par1_plg_pt get parameter 0-1 for point on polygon
UT3D_par1_parplg get parameter 0-1 from knotvalue
UT3D_vc_evalplg Tangente an PolygonCurve aus Parameterwert
UT3D_pta_plg (ut_npt.c) Punktetabelle (relimited) aus PolygonCurve
UT3D_pta_ccw_plg Punktetabelle (relimited) aus PolygonCurve
UT3D_plg_npar1_npar get knotTable (length) with values from 0-1 for polygon
UT3D_2pt_plg_iseg get segment from polygon
UPLG_2par_iseg get parameters of single segment of polygon
UPLG_iseg_par get segmentNr from parameter
UPLG_pare_unl get unlimited endParameter of CurvPoly INLINE
ULN3_segNr_par_prj_pt_nln get segNr & parameter from prj point onto lnTab
UT3D_2pt_segnln get segment from lineTable
List_functions_end:
=====================================================
UT3D_2vc_pta UT3D_vc_perpptai

Function Documentation

int UPLG_2par_iseg ( double *  p1,
double *  p2,
int  is,
CurvPoly plg 
)
int UT3D_pt_plg_lim ( Point p1,
Point p2,
double *  v1,
double *  v2,
CurvPoly cv1 
)
UT3D_pt_plg_lim get limits (startpoint, endpoint, parameters)
Output:
p1 startpoint (none if p1 == NULL)
p2 endpoint (none if p2 == NULL)
v1 parameter (0-1) for startpoint (v1=NULL: none)
v2 parameter (0-1) for endpoint (v2=NULL: none)
see also UTO_2pt_lim_ox UTO_2pt_lim_dbo UTO_pt_ox
int ULN3_segNr_par_prj_pt_nln ( int *  is,
double *  ps,
Point pti,
int  lNr,
Line lTab 
)

ULN3_segNr_par_prj_pt_nln get segNr & parameter from prj point onto lnTab

double UT3D_ck_pta_maxDev ( int  ptNr,
Point pTab 
)
UT3D_ck_pta_maxDev get max.deviation of a pointTable
/p2\ |
/ \ | deviation = dist p2 to p1-p2-line
p1/ \p3 |
int UT3D_ck_plg_par_trm ( double *  par,
CurvPoly plg 
)
int UT3D_ck_plg_trim ( CurvPoly cv1)
int UT3D_ck_plgpar1lim ( CurvPoly plg,
double  par1 
)
int UT3D_ck_plgparlim ( CurvPoly plg,
double  par 
)
int UT3D_2pt_segnln ( Point p1,
Point p2,
int  is,
Line lna 
)

UT3D_2pt_segnln get segment from lineTable

int UT3D_2pt_plg_iseg ( Point p1,
Point p2,
int  is,
CurvPoly plg 
)
int UT3D_ck_plgclo ( CurvPoly plg)
UT3D_ck_plgclo check if polygon is closed
rc = 1: No, polygon not closed
rc = 0: YES, polygon is closed AND endpoint == end_of_curve
rc = -1: NO, polygon is closed BUT endpoint is trimmed
rc = -2: degenerated
int UT3D_plg_projplgpln ( CurvPoly plgo,
CurvPoly plgi,
Plane pln,
Memspc memSeg1 
)
int UT3D_pt_evalplg ( Point pto,
CurvPoly plg,
double  parPlg 
)
UT3D_pt_evalplg get point on polygon from parameter
parPlg parameter; distance from startpoint (not 0-1)
int UT3D_pt_intlnplg ( int *  nxp,
Point xptab,
double *  vtab,
Line ln,
CurvPoly plg,
double  tol 
)
UT3D_pt_intlnplg intersect line and polygon (both limited)
UT3D_pt_intlnplg Author: Thomas Backmeister 2.7.2003
IN:
int *nxp ... maximal number of output points
Line *ln ... 3D-line
CurvPoly *plg ... points of polygon
OUT:
int *nxp ... number of intersection points
Point *xptab ... intersection points
double *vtab ... parameter of intersectionpoint (can be NULL)
Returncodes:
0 = OK
-1 = out of mem (xptab too small)
int UT3D_pt_intciplg ( int *  nxp,
Point xptab,
double *  vtab,
Circ ci,
CurvPoly plg 
)
int UT3D_pt_intelplg ( int *  nxp,
Point xptab,
double *  va_el,
double *  va_plg,
CurvElli el,
CurvPoly plg 
)
int UT3D_pt_intbspplg ( int *  nxp,
Point xptab,
double *  vtab,
Memspc memSeg1,
CurvBSpl bspl,
CurvPoly plg 
)
int UT3D_pt_intplplg ( int *  pNr,
Point pa,
Plane pln,
CurvPoly plg 
)
int UT3D_pt_int2plg ( int *  nxp,
Point xptab,
double *  vtab1,
double *  vtab2,
CurvPoly plg1,
CurvPoly plg2 
)
int UT3D_par1_plg_pt ( double *  par1,
Point pt,
CurvPoly plg 
)
int UT3D_parplg_plgpt ( double *  parplg,
Point pt,
CurvPoly plg 
)

UT3D_parplg_plgpt get knotvalue from point on polygon

int UT3D_vc_evalplg ( Vector vco,
CurvPoly plg,
double  pVal 
)
int UT3D_pta_ccw_plg ( int *  ptNr,
Point pta,
CurvPoly plg 
)
int UT3D_pt_projptplg ( int *  nxp,
Point pto,
double *  ttab,
CurvPoly plg,
Point pt 
)
UT3D_pt_projptplg proj PT -> PolygonCurve
Input:
nxp size of outputarry pto and ttab
plg polygon
pt point; find nearest points to this point on polygon.
Output:
nxp nr of outputpoints in pto and values in ttab
pto nearest points on polygon; first=nearest.
ttab distance from start of curve for points in pto (v)
NULL = no parameters
Returncodes:
0 = OK
-1 = out of tempSpace
Nearest point to <pt> is in pto[0];
double UT3D_plg_lvTab ( double *  lTab,
Point pTab,
int  ptNr 
)
int UT3D_plg_pta ( CurvPoly plg1,
Point pta,
int  ptNr,
Memspc memSeg1 
)
int UT3D_plg_npar1_npar ( double *  da,
CurvPoly cv1 
)

get knotTable (length) with values from 0-1 for polygon

double UT3D_par_par1plg ( double  pv,
CurvPoly cv1 
)

UT3D_par_par1plg Parameterwert von 0-1 in einen Knotenwert aendern

double UT3D_par1_parplg ( double *  kv,
CurvPoly cv1 
)

UT3D_par1_parplg Knotenwert in einen Parameterwert von 0-1 aendern

int UPLG_iseg_par ( int *  segNr,
double  up,
CurvPoly cv1 
)