Packageaway3d.modifiers
Classpublic class PathAlignModifier

Public Properties
 PropertyDefined by
  arcLengthPrecision : Number
Determines the quality of the alignment.
PathAlignModifier
  fast : Boolean
Omits arc-length parameterization yielding less precise, but faster results.
PathAlignModifier
  offset : Number3D
Applies a vector offset to the mesh before it is modified
PathAlignModifier
  pathLength : Number
[read-only] Returns the last calculated length of the path.
PathAlignModifier
  restrain : Boolean
Forces the y alignment to face only 1 direction.
PathAlignModifier
Protected Properties
 PropertyDefined by
  ini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.
PathAlignModifier
Public Methods
 MethodDefined by
  
PathAlignModifier
(mesh:Mesh, path:Path, init:Object = null)
Creates a new PathAlignModifier object.
PathAlignModifier
  
applyCached(index:uint):void
Performs the alignment from precalculations.
PathAlignModifier
  
applyCachedAt(xOffset:Number = 0):void
See buildCacheAt();
PathAlignModifier
  
buildCache(divisions:Number):void
Traverses the entire path with a given offset, storing the vertex positions.
PathAlignModifier
  
buildCacheAt():void
Caches the warped vertex positions of the mesh at a given x offset.
PathAlignModifier
  
execute():void
Performs the alignment.
PathAlignModifier
  
Given a point in space, this method finds the offset in the curve that represents the closest point in the curve to the specified point in space.
PathAlignModifier
  
updatePath(path:Path, precision:Number = -1):Number
Updates the path of the alignment.
PathAlignModifier
Property detail
arcLengthPrecisionproperty
arcLengthPrecision:Number  [read-write]

Determines the quality of the alignment. The value is used to arc length parameterize the path. Without this technique the alignment would produce undesired scaling and squashing of the text. The closer to zero, the better the quality of the alignment is, the larger the value the faster the performance of the aligment is.

Implementation
    public function get arcLengthPrecision():Number
    public function set arcLengthPrecision(value:Number):void
fastproperty 
public var fast:Boolean

Omits arc-length parameterization yielding less precise, but faster results. Defaults to false.

iniproperty 
protected var ini:Init

Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.

offsetproperty 
public var offset:Number3D

Applies a vector offset to the mesh before it is modified

pathLengthproperty 
pathLength:Number  [read-only]

Returns the last calculated length of the path.

Implementation
    public function get pathLength():Number
restrainproperty 
public var restrain:Boolean

Forces the y alignment to face only 1 direction. Defaults to false.

Constructor detail
PathAlignModifier()constructor
public function PathAlignModifier(mesh:Mesh, path:Path, init:Object = null)Parameters
mesh:Mesh — A mesh containing the elements to be aligned.
 
path:Path — A Segment or a Face containing the path's vector data for the alignment.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
Init Parameters
 offset:Number3D
 restrain:Boolean (default = false)
 fast:Boolean (default = false)
Method detail
applyCached()method
public function applyCached(index:uint):void

Performs the alignment from precalculations. buildCache() must be called first. See buildCache().

Parameters
index:uint — uint Specifyes the index in the cached alignments to use, or which snapshot.
applyCachedAt()method 
public function applyCachedAt(xOffset:Number = 0):void

See buildCacheAt();

Parameters
xOffset:Number (default = 0) — The x offset to restore.
buildCache()method 
public function buildCache(divisions:Number):void

Traverses the entire path with a given offset, storing the vertex positions. Could yield pretty intensive calculation. The idea is to use this to precalculate alignments for later used with applyCached().

Parameters
divisions:Number — The number of snapshots to take. If the length of the path is 100px, a division of 50 would store alignment for an xOffset with 2px increment.
buildCacheAt()method 
public function buildCacheAt():void

Caches the warped vertex positions of the mesh at a given x offset. To recall positions cached in this way use applyCachedAt().

execute()method 
public function execute():void

Performs the alignment.

findClosestCurveOffsetToPoint()method 
public function findClosestCurveOffsetToPoint(point:Number3D):Object

Given a point in space, this method finds the offset in the curve that represents the closest point in the curve to the specified point in space.

Parameters
point:Number3D — Point The loose point in space.

Returns
Object — Number The offset in the curve that yields the closest point in the curve to the specified point.
updatePath()method 
public function updatePath(path:Path, precision:Number = -1):Number

Updates the path of the alignment.

Parameters
path:Path — Element A Segment or a Face containing the path's vector data for the alignment.
 
precision:Number (default = -1) — Number Sets the arcLengthPrecision value.

Returns
Number — Number The aproximated arc length of the path.
Wiki link
Click to go to the wiki page for 'away3d.modifiers.PathAlignModifier'

Code examples

Comments