Programmer Guide/Command Reference/EVAL/pginit: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====pginit - initialise polygon=====
Check or initialise a polygon stream.
;Usage:<code>pgInit(<var>X</var> {, <var>N</var>=0, {number}<var>E</var>=0} )</code>
:;<var>X</var>:A [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons.
:;<var>N</var>:The requested number of simple polygons:
::{|class="keinrahmen"
|<var>N</var><=0 ||undefined, polygons are counted during initialization
|-
|<var>N</var>>0 || exactly <var>N</var> simple polygons must be contained in <var>X</var>
|}
:;<var>E</var>:The maximum error for polygon simplification. If <var>E</var><=0 the simplification is skipped.
:;Result:A [[../#polygons|polygon-stream]] <var>P</var> containing all simple-polygons defined by <var>X</var>. The function failes if:
::*no simple polygons can be found or one of the detected polygons is invalid
::*<var>N</var>>0 and the number of polygons defined by <var>X</var> is not equal to <var>N</var>
;See also: [[../pgGet|pgGet]], [[../pgItest|pgItest]], [[../pgIline|pgIline]], [[../pgXgrid|pgXgrid]], [[../pgSplit|pgSplit]], [[../pgTrans|pgTrans]], [[../pgHull|pgHull]]


=====Usage:=====


<code>P := pgInit( {pg_cplist}<var>X</var>, {number}<var>N</var>=0, {number}<var>E</var>=0 )</code>
[[../#Functions|<function list>]]
 
=====Function:=====
 
Initialize polygons from a closed-point-list
 
=====Parameters:=====
 
;<var>X</var>
 
:A point-list defining one or more polygons.
 
;<var>N</var>
 
:The requested number of simple polygons:
 
:<var>N</var><=0 - unknown, computed during initialization
 
:<var>N</var>>0 - exactly <var>N</var> simple polygons must be contained in <var>X</var>
 
;<var>E</var>
 
:The maximum error for polygon simplification, if <var>E</var><=0 the simplification is skipped.
 
=====Result:=====
 
A polygon-stream <var>P</var> containing all simple-polygons defined by <var>X</var>.
 
If <var>N</var>>0, the number of polygons defined by <var>X</var> must be equal to <var>N</var>.
 
=====Examples:=====
 
See the example macro <code>polygon_stream</code> in the example script <code>polygon_examples.sts</code>.

Revision as of 13:44, 18 April 2011

Check or initialise a polygon stream.

Usage
pgInit(X {, N=0, {number}E=0} )
X
A closed point-list or a polygon-stream defining one or more polygons.
N
The requested number of simple polygons:
N<=0 undefined, polygons are counted during initialization
N>0 exactly N simple polygons must be contained in X
E
The maximum error for polygon simplification. If E<=0 the simplification is skipped.
Result
A polygon-stream P containing all simple-polygons defined by X. The function failes if:
  • no simple polygons can be found or one of the detected polygons is invalid
  • N>0 and the number of polygons defined by X is not equal to N
See also
pgGet, pgItest, pgIline, pgXgrid, pgSplit, pgTrans, pgHull


<function list>

Navigation menu

Personal tools