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

Class FMESurface


init()

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

Instance Methods [hide private]
 
__decIterRef__(args)
 
__incIterRef__(args)
 
__init__()
x.__init__(...) initializes x; see help(type(x)) for signature
 
__iter__(x)
iter(x)
boolean
deleteSide(front)
This method deletes the side specified by 'front' and indicates whether or not it existed before being deleted.
int
getAppearanceReference(front)
This method returns the appearance reference within the Library associated with this surface.
FMEMultiCurve or None
getAsWireFrame()
Returns the wireframe of the surface as a FMEMultiCurve.
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).
boolean
isOriented()
A face with a donut area will not be oriented if the normal of any inner boundary has the same direction as the normal of the outer boundary.
bool
isPlanar(tolerance)
Returns True if this is planar within the given tolerance, and False otherwise.
None
offset(offsetPoint)
Offsets the surface by the coords specified by 'offsetPoint'.
None
orient()
Flips the front and the back of parts of the surface as required to create a surface that is oriented.
None
reorient()
Flips the surface such that the front and back of the surface are switched.
None
reverse()
This reverses the order of the surface's points.
None
rotate2D(center, angle)
Rotates this surface about the z-axis by the specified angle, in degrees.The rotation is performed relative to the center specified.
None
scale(xScale, yScale, zScale)
Scale the feature by the given amounts.
 
setAppearanceReference(appearanceRef, front)
This method associates an appearance within the Library with this surface.
boolean
sideExists(front)
This method checks whether the side specified by 'front' exists.

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__

deleteSide(front)

 

This method deletes the side specified by 'front' and indicates whether or not it existed before being deleted.

Parameters:
  • front (boolean) - If true then the front side will be deleted, otherwise the back side will be deleted.
Returns: boolean
Returns true if the side existed before being deleted and returns false if it didn't exist.

getAppearanceReference(front)

 

This method returns the appearance reference within the Library associated with this surface. The front parameter controls whether this query should return the front or the back appearance reference. Both can be fetched independently. If this surface is a regular surface with no geometry instance, a FMEException will be thrown.

Parameters:
  • front (bool) - Boolean indicting whether the appearance reference should be retrieved for the front or back of the surface.
Returns: int
The unique appearance reference for this appearance.
Raises:
  • FMEException - An exception is raised if an error occurred or this surface is a regular surface with no geometry instance.

getAsWireFrame()

 

Returns the wireframe of the surface as a FMEMultiCurve. None is returned if a wireframe cannot be generated.

Returns: FMEMultiCurve or None
The wireframe of the surface as a FMEMultiCurve

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 surface 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()

 

A face with a donut area will not be oriented if the normal of any inner boundary has the same direction as the normal of the outer boundary. Meshes and composite surfaces will return False if they have two parts that share an edge and those two parts are not consistently oriented with respect to each other. If the surface is improperly noded, the behaviour of this function is undefined.

Returns: boolean
Returns True if the surface is oriented, False otherwise.

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 surface using Newell's method. For the first point (x', y', z') of this surface, we compute D' = Ax' + By' + Cz'. Then, this surface is planar if and only if every subsequent point (x, y, z) of this surface 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 surface is planar within the tolerance supplied.

offset(offsetPoint)

 

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

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

orient()

 

Flips the front and the back of parts of the surface as required to create a surface that is oriented. Refer to isOriented() for the specification of what it means to be an oriented surface. If the surface is improperly noded or non-orientable, the behaviour of this function is undefined. All measures are changed as needed, including the vertex normal measures. Note: The vertex normals are not flipped (scaled by -1).

Returns: None

reorient()

 

Flips the surface such that the front and back of the surface are switched. All measures are changed as needed, including the vertex normal measures. Note: The vertex normals are not flipped (scaled by -1). Refer to reverse() if the vertex normals need to be flipped. Note: FMETriangleStrips have a method called isFlipped() that is to be used in conjunction with the geometry to determine which side is the front. When isFlipped() returns true, the front is actually the opposite side of what the coordinates of the first triangle in the strip indicate.

Returns: None

rotate2D(center, angle)

 

Rotates this surface about the z-axis by the specified angle, in degrees.The rotation is performed relative to the center specified. A positive angle corresponds to a counter-clockwise rotation, when looking down onto the XY-plane.

Parameters:
  • center (FMEPoint) - The center point of the surface.
  • angle (float) - The angle by which the surface 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.

setAppearanceReference(appearanceRef, front)

 

This method associates an appearance within the Library with this surface. This is done by passing in the unique appearance reference for this appearance. Subsequent calls to this method on the same side, will override the previous appearance used with the new appearance passed in. An appearance reference of '0' represents the default appearance. Interpretation of the default appearance is left to the consumer of this geometry. When set at this FMESurface level, the appearance represents the default appearance to apply when the contained surfaces use the default appearance instead of a specific appearance. Contained surfaces may be found within nested surfaces, geometry instances that reference geometries containing surfaces, or as surfaces or multi-surfaces. The second parameter controls whether this action should take place on the front of the contained surfaces or the back. Both can be set independently. The appearanceRef should be a valid reference to a definition stored in the FMELibrary. If the reference was not found in the library, it will still attach the reference to the instance, but will throw a FMEException. This is an unhealthy situation as it represents a 'dangling reference'.

Parameters:
  • appearanceRef (int) - The unique appearance reference for this appearance.
  • front (bool) - Boolean indicting whether the appearance reference should be set for the front or back of the surface.
Raises:
  • FMEException - An exception is raised if an error occurred or the reference was not found in the library and a dangling reference was attached.

sideExists(front)

 

This method checks whether the side specified by 'front' exists.

Parameters:
  • front (boolean) - If 'front' is true then the front side will be checked otherwise the back side will be checked.
Returns: boolean
Returns true if the side exists and false otherwise. .