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

Class FMEMultiSurface


init(MultipleInvocations)

Create an instance of a Multi-Surface geometry object.

init()

Default FMEMultiSurface constructor.

Returns: FMEMultiSurface

init(multiSurface)

Create a copy of the passed in Multi-Surface geometry object.

Parameters

Returns: FMEMultiSurface

Instance Methods [hide private]
 
__decIterRef__(args)
 
__incIterRef__(args)
 
__init__(MultipleInvocations)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__iter__(x)
iter(x)
None
appendPart(surface)
This appends the surface to the multi surface.
None
appendParts(multiSurface)
This appends the multi surface passed in to the multi surface.
int
getAppearanceReference(front)
This method returns the appearance reference within the Library associated with this multisurface.
FMEMultiCurve or None
getAsWireFrame()
Returns the wireframe of the contained surfaces as a FMEMultiCurve.
FMESurface of a terminal type or None
getPartAt(index)
This method returns the surface at the given index.
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
isPlanar(tolerance)
Returns True if this is planar within the given tolerance, and False otherwise.
int
numParts()
This returns the number of surfaces that make up this multi surface.
None
offset(offsetPoint)
Offsets the geometry by the coords specified by offsetPoint.
None
removeAppearanceReference(front)
When set at this FMEMultiSurface level, the appearance represents the default appearance to apply when the contained surfaces use the default appearance instead of a specific appearance.
FMESurface of a terminal type or None
removeLastPart()
This removes and returns the last surface of the multi surface.
None
resolvePartDefaults()
Recursively resolves surface parts with default appearances by replacing these defaults with the inherited appearance references stored by the parent surface, if such a value exists.
None
rotate2D(center, angle)
Rotates the contained surfaces about the z-axis by the specified angle, in degrees.
None
scale(xscale, yscale, zscale)
Scales the contained surfaces by the scaling factors, relative to the origin.
None
setAppearanceReference(appearanceRef, front)
This method associates an appearance within the Library with this multisurface.

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__(MultipleInvocations)
(Constructor)

 

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

Overrides: object.__init__

appendPart(surface)

 

This appends the surface to the multi surface. If None is passed in, nothing will be appended. All surfaces in the multi surface will be forced to have the same dimension. If any 3D surfaces exist, all 2D surfaces will be converted to 3D with a default Z value of 0.0.

Parameters:
  • surface (FMESurface) - The surface to be appended.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

appendParts(multiSurface)

 

This appends the multi surface passed in to the multi surface. If None is passed in, nothing will be appended.

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

getAppearanceReference(front)

 

This method returns the appearance reference within the Library associated with this multisurface. The front parameter controls whether this query should return the front or the back appearance reference. Both can be fetched independently. If this multisurface is a regular multisurface 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 multisurface with no geometry instance.

getAsWireFrame()

 

Returns the wireframe of the contained surfaces as a FMEMultiCurve.

Returns: FMEMultiCurve or None
The wireframe of the contained surfaces or None if a multi curve count not be produced.
Raises:
  • FMEException - An exception is raised if there was a failure in creating the multi curve Python object.

getPartAt(index)

 

This method returns the surface at the given index. None is returned if the index is out of range.

Parameters:
  • index (int) - The index of the surface part to return.
Returns: FMESurface of a terminal type or None
The surface at the given index. Note: This method returns a terminal surface type of the FMESurface; i.e. one of the leaf classes in the FMESurface inheritance graph. For example, a FMELine is returned if the surface truly is a line.
Raises:
  • FMEException - An exception is raised if an error occurred.

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 multisurface 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).

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

numParts()

 

This returns the number of surfaces that make up this multi surface.

Returns: int
The number of surfaces in multi surface.

offset(offsetPoint)

 

Offsets the geometry by the coords specified by offsetPoint.

Parameters:
  • offsetPoint (FMEPoint) - The point to offset the coordinates of the geometry by.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

removeAppearanceReference(front)

 

When set at this FMEMultiSurface level, the appearance represents the default appearance to apply when the contained surfaces use the default appearance instead of a specific appearance. This call will remove the inherited appearance reference stored at this level, if any, on the side specified by the parameter front.

Parameters:
  • front (bool) - Boolean indicting whether the appearance reference should be retrieved for the front or back of the multisurface.
Returns: None

removeLastPart()

 

This removes and returns the last surface of the multi surface. If there are no surfaces in the multi surface, it will return None.

Returns: FMESurface of a terminal type or None
The last surface of the multi surface. Note: This method returns a terminal surface type of the FMESurface; i.e. one of the leaf classes in the FMESurface inheritance graph. For example, a FMELine is returned if the surface truly is a line.
Raises:
  • FMEException - An exception is raised if an error occurred.

resolvePartDefaults()

 

Recursively resolves surface parts with default appearances by replacing these defaults with the inherited appearance references stored by the parent surface, if such a value exists. The nearest non-default ancestor value will be used to set the default appearances on the part.

Returns: None

rotate2D(center, angle)

 

Rotates the contained surfaces 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 of the rotation.
  • angle (float) - The angle in degrees.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

scale(xscale, yscale, zscale)

 

Scales the contained surfaces by the scaling factors, relative to the origin.

Parameters:
  • xscale (float) - The x scale factor.
  • yscale (float) - The y scale factor.
  • zscale (float) - The z scale factor.
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 multisurface. 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 multisurfaces use the default appearance instead of a specific appearance. Contained multisurfaces may be found within nested multisurfaces, geometry instances that reference geometries containing multisurfaces, or as multisurfaces or multi-multisurfaces. The second parameter controls whether this action should take place on the front of the contained multisurfaces 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 multisurface.
Returns: None
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.