Difference between revisions of "Path2D:getPathPoints"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2018.12<br/>
'''<translate>Available since</translate>:''' Gideros 2018.12<br/>
+
'''Class:''' [[Path2D]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Path2D|Path2D]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Compute points location along the path. To do so, the path is converted into a series of straight segments and particular points are sampled along it. The resulting table outputs, for each point, its location (x,y) and its tangent orientation (angle) </translate>
+
Computes points location along the path. To do so, the path is converted into a series of straight segments and particular points are sampled along it. The resulting table outputs, for each point, its location (x,y), its tangent orientation (angle) and its offset from the start of the path (offset).
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(table) = Path2D:getPathPoints(interval,offset,maxpts,flatness,subdiv_limit)
 
(table) = Path2D:getPathPoints(interval,offset,maxpts,flatness,subdiv_limit)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''interval''': (number) <translate>distance between each considered point</translate> <br/>
+
=== Parameters ===
'''offset''': (number) <translate>distance to first point of interest. Defaults to 0.</translate> <translate>'''optional'''</translate> <br/>
+
'''interval''': (number) distance between each considered point '''optional'''<br/>
'''maxpts''': (number) <translate>maximum number of points to sample. Defaults to 1000.</translate>  <translate>'''optional'''</translate> <br/>
+
'''offset''': (number) distance to first point of interest. Defaults to 0 '''optional'''<br/>
'''flatness''': (number) <translate>maximum acceptable deviation for real curve. Defaults to 1.</translate>  <translate>'''optional'''</translate> <br/>
+
'''maxpts''': (number) maximum number of points to sample. Defaults to 1000 '''optional'''<br/>
'''subdiv_limit''': (number) <translate>maximum curve subdivision limit. Defaults to 10.</translate>  <translate>'''optional'''</translate> <br/>
+
'''flatness''': (number) maximum acceptable deviation for real curve. Defaults to 1 '''optional'''<br/>
 +
'''subdiv_limit''': (number) maximum curve subdivision limit. Defaults to 10 '''optional'''<br/>
  
=== <translate>Return values</translate> ===
+
=== Return values ===
'''<translate>Returns</translate>''' (table) <translate>information about selected points</translate><br/>
+
'''Returns''' (table) information about selected points<br/>
  
 
{{Path2D}}
 
{{Path2D}}

Latest revision as of 14:32, 13 July 2023

Available since: Gideros 2018.12
Class: Path2D

Description

Computes points location along the path. To do so, the path is converted into a series of straight segments and particular points are sampled along it. The resulting table outputs, for each point, its location (x,y), its tangent orientation (angle) and its offset from the start of the path (offset).

(table) = Path2D:getPathPoints(interval,offset,maxpts,flatness,subdiv_limit)

Parameters

interval: (number) distance between each considered point optional
offset: (number) distance to first point of interest. Defaults to 0 optional
maxpts: (number) maximum number of points to sample. Defaults to 1000 optional
flatness: (number) maximum acceptable deviation for real curve. Defaults to 1 optional
subdiv_limit: (number) maximum curve subdivision limit. Defaults to 10 optional

Return values

Returns (table) information about selected points