Class URBGEN.Builder
Defined in: UrbGen.js.
Constructor Attributes  Constructor Name and Description 

URBGEN.Builder(generator)
Represents a builder.

Field Attributes  Field Name and Description 

Ths end point for this builder's dividing line.


The generator that owns this builder.


The points this builder will use to build new polygons.


Ths origin point for this builder's dividing line.


The current polygon this builder is operating on.

Method Attributes  Method Name and Description 

addPointToPath(point, edgeStart, edgeEnd)
Adds the specified point to the edge with the specified start and end points.


Returns an array of new polygons created from this builder's current points.


pointByAngle(edgeStart, edgeEnd, angle)
Returns the point at which a line at the specified angle intersects with the
edge defined by the specified start and end points.


pointByRValue(edgeStart, edgeEnd, r)
Returns the point represented by the specified r value on the edge defined by
the specified start and end points.


setUp()
Sets this builder's origin and end points for the new dividing line.

Class Detail
URBGEN.Builder(generator)
Represents a builder.
 Parameters:
 {URBGEN.Generator} generator
  The generator that owns this builder.
Field Detail
{URBGEN.Point}
endPoint
Ths end point for this builder's dividing line.
{URBGEN.Generator}
generator
The generator that owns this builder.
{URBGEN.Point[]}
newPoints
The points this builder will use to build new polygons.
{URBGEN.Point}
origin
Ths origin point for this builder's dividing line.
{URBGEN.Poly}
poly
The current polygon this builder is operating on.
Method Detail
{URBGEN.Point}
addPointToPath(point, edgeStart, edgeEnd)
Adds the specified point to the edge with the specified start and end points.
If there is already a point on this edge within the current throughRoad
distance, returns that point. Otherwise, finds the new point's neighbors on
the edge, sets the neighbor relations to include the new point, and returns
that point.
 Parameters:
 {URBGEN.Point} point
  The point to be added to the edge.
 {URBGEN.Point} edgeStart
  The start point of the edge.
 {URBGEN.Point} edgeEnd
  The end point of the edge.
 Returns:
 {URBGEN.Point} A point within the throughRoad distance on the edge, or the originally specified point (with neighbor relations set).
{URBGEN.Poly[]}
buildPolys()
Returns an array of new polygons created from this builder's current points.
 Throws:
 {URBGEN.Exception.EdgeTooShortException}
 Returns:
 {URBGEN.Poly[]} The new polygons.
{URBGEN.Point}
pointByAngle(edgeStart, edgeEnd, angle)
Returns the point at which a line at the specified angle intersects with the
edge defined by the specified start and end points. If this point does not lie
on the legal part of the edge (defined as a region starting at the minimum
edge length from the start point and ending at the minium edge length before
the end point) then the closest point in the legal region is returned.
 Parameters:
 {URBGEN.Point} edgeStart
  The start point of the edge.
 {URBGEN.Point} edgeEnd
  The end point of the edge.
 {number} angle
  The angle in radians of the intersecting line.
 Throws:
 {URBGEN.Exception.EdgeTooShortException}
 Returns:
 {URBGEN.Point} The closest legal point at which the intersecting line meets the edge.
{URBGEN.Point}
pointByRValue(edgeStart, edgeEnd, r)
Returns the point represented by the specified r value on the edge defined by
the specified start and end points. If this point does not lie on the legal
part of the edge (defined as a region starting at the minimum edge length from
the start point and ending at the minium edge length before the end point) then
the closest point in the legal region is returned.
 Parameters:
 {URBGEN.Point} edgeStart
  The start point of the edge.
 {URBGEN.Point} edgeEnd
  The end point of the edge.
 {number} r
  The r value of the new point.
 Throws:
 {URBGEN.Exception.EdgeTooShortException}
 Returns:
 {URBGEN.Point} The closest legal point at which the intersecting line meets the edge.
setUp()
Sets this builder's origin and end points for the new dividing line.
 Throws:
 {URBGEN.Exception.EdgeTooShortException}