Module fmeobjects :: Class FMEArea
[hide private]
[frames] | no frames]

Class FMEArea

 object --+    
          |    
FMEGeometry --+
              |
             FMEArea
Known Subclasses:

init()

FMEArea is an abstract class. It cannot be created directly.

Instance Methods [hide private]
 
__init__()
x.__init__(...) initializes x; see help(type(x)) for signature
bool
isBoundaryLinear()
Returns True if the outer boundary (and inner boundaries in the case of FMEDonut) of this area contains FMELines only.
bool
isConvex()
Determines if area is convex.
tuple
isInPlane(tolerance, normalVector, valD, recalculateD)
Works similarly to isPlanar(), but checks planarity with respect to given normal or given plane (if plane equation D is specified - see below).
bool
isOriented(rightOrLeft)
This returns True if the geometry has the specified orientation.
bool
isPlanar(tolerance)
Returns True if this is planar within the given tolerance, and False otherwise.
None
offset(offsetPoint)
Offsets the area by the coords specified by 'offsetPoint'.
None
orient(rightOrLeft)
This sets the geometry to the specified orientation.
None
removeDuplicates(checkZ)
Removes any adjacent duplicate points.
None
reverse()
This reverses the order of the area's points.
None
rotate2D(center, angle)
Rotate the area counterclockwise around the 'center' point by the specified 'angle' (in degrees).
None
scale(xScale, yScale, zScale)
Scale the feature by the given amounts.

Inherited from FMEGeometry: __getObject__, __new__, boundingBox, boundingCube, bounds, clearMeasures, copyAttributesFromFeature, copyNameFromGeometry, copyTraitsFromGeometry, copyTraitsToFeature, deleteName, force2D, force3D, getArea, getMeasureNames, getName, getTrait, getTraitNames, getTraitNullMissingAndType, getTraitType, hasMeasures, hasName, is3D, isCollection, measureExists, removeMeasure, removeTraits, renameMeasure, setName, setTrait, setTraitNullWithType

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__()
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

isBoundaryLinear()

 

Returns True if the outer boundary (and inner boundaries in the case of FMEDonut) of this area contains FMELines only.

Returns: bool
Whether the area's boundaries contain only lines.

isConvex()

 

Determines if area is convex. The polygon making up the area is convex if all internal angles are less than 180 degrees and it's not self-intersecting. Imperfectly planar 3D polygons are tolerated.

Returns: bool
Whether the area is convex.

isInPlane(tolerance, normalVector, valD, recalculateD)

 

Works similarly to isPlanar(), but checks planarity with respect to given normal or given plane (if plane equation D is specified - see below). If given normal is the zero vector, the normal used to check the planarity is computed using Newell's method as in isPlanar(). valD is a reference to a value of D in the plane equation AX + BY + CZ = D. It can be used to make sure that multiple pieces lie in the same plane. If 'recalculateD' is set to False, the passed in value of D will be used in the calculation. If 'recalcualteD' is set to True, the passed in value is ignored and is instead automatically calculated (and returned in the second position of the returned tuple). A useful calling pattern for ensuring co-planarity is to get valD computed on the first call to the function setting recalculateD to True, and then use this value for future calls with recalculateD to False.

Parameters:
  • tolerance (float) - The tolerance to check against.
  • normalVector (tuple of 3 floats) - The normal used to check the planarity.
  • valD (float) - The value D from 'AX + BY + CZ = D'.
  • recalculateD (bool) - Whether to recalculate 'D' or not.
Returns: tuple
A tuple containing a boolean, tuple, and float representing: 1) Whether or not the area is in plane; 2) The normal vector returned; and 3) The value 'D'.

Note: If recalculateD is False, the tuple returned will only contain the boolean and vector tuple (i.e. 'valD' is not returned).

isOriented(rightOrLeft)

 

This returns True if the geometry has the specified orientation.

Parameters:
  • rightOrLeft (int) - The orientation to check the FMEArea for.
Returns: bool
Whether the area has the specified orientation.

isPlanar(tolerance)

 

Returns True if this is planar within the given tolerance, and False otherwise.

The planarity condition is computed by the following algorithm. The normal vector <A, B, C> is determined by the vertices of this area using Newell's method. For the first point (x', y', z') of this area, we compute D' = Ax' + By' + Cz'. Then, this area is planar if and only if every subsequent point (x, y, z) of this area gives a D = Ax + By + Cz, that is within the tolerance amount of D'. That is, | D - D' | <= tolerance.

If the specified tolerance is negative, then this method always returns True.

Parameters:
  • tolerance (float) - The tolerance to check against.
Returns: bool
Whether the area is planar within the tolerance supplied.

offset(offsetPoint)

 

Offsets the area by the coords specified by 'offsetPoint'.

Parameters:
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

orient(rightOrLeft)

 

This sets the geometry to the specified orientation.

Parameters:
  • rightOrLeft (int) - The orientation to set on the FMEArea.
Returns: None

removeDuplicates(checkZ)

 

Removes any adjacent duplicate points. If 'checkZ' is True, x, y, and z coordinates are checked, otherwise only x and y are.

Parameters:
  • checkZ (bool) - Whether to check the z coordinate.
Returns: None

rotate2D(center, angle)

 

Rotate the area counterclockwise around the 'center' point by the specified 'angle' (in degrees).

Parameters:
  • center (FMEPoint) - The center point of the area.
  • angle (float) - The angle by which the area is rotated.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

scale(xScale, yScale, zScale)

 

Scale the feature by the given amounts.

Parameters:
  • xScale (float) - The value to scale x by.
  • yScale (float) - The value to scale y by.
  • zScale (float) - The value to scale z by.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.