VARKON Version 1.16 1998-03-24
cur_approx - Geometric procedure
Creates a curve
Description
This procedure approximates a curve with another curve type.
The procedure can for instance be used to approximate a surface curve (a curve with UV_SEG segments) to a cubic curve (a curve with CUB_SEG segments).
Syntax
cur_approx(id, curve, ctype, method, cdata1, cdata2:attributes);
REF id; REF curve; STRING ctype*7; INT method; FLOAT cdata1; FLOAT cdata2;
Principal parameters
id - Local identity curve - Identity of curve ctype - Curve segment type "CUB_SEG" or "CUBIC" = Approximate with non rational cubic segments "RAT_SEG" or "RATIONAL" = Approximate with rational cubic segments "CIR_SEG" = Approximate with circular arcs and lines method - Approximation method 1 = The number of segments is input (no tolerances used) 2 = Reduce and/or add segments respecting the given tolerances (Implemented for ctype= CIR_SEG) 3 = Add only segments respecting the given tolerances cdata1 - Data 1 for the computation Requested number of segments for method= 1 Coordinate tolerance for method= 2 and method=3
Optional parameters
cdata2 - Computational tolerance as follows: Tangent (angle) tolerence for method 2 and 3 Criterion for a straight line (max curvature) for method 2 and ctype="CIR_SEG"
Attributes
PEN - Pen or colour number LEVEL - Level number BLANK - Visible(0) or invisible(1) WIDTH - Linewidth CFONT - Solid (0), dashed (1) or centerline (2) CDASHL - Dash length
Example
cur_approx(#10, #5, "CUBIC", 1, 4);
Creates a new curve (#10) which approximates a previously created curve #5. The output curve will have cubic segments and the number of segments will be four times the number of segments for the old curve.
No tolerances are used in the calculations.
VARKON Homepage | Index |