fmeobjects.FMEMesh¶

FMEMesh.addMeshPart (appearanceReference, …) |
This routine adds a new mesh part to the mesh. |
FMEMesh.addMeshPartExtended (hasAFront, …) |
This routine extends the functionality of addMeshPart() , allowing double-sided mesh parts to be added. |
FMEMesh.appendMesh (otherMesh) |
Appends a mesh passed in to the mesh, by appending the vertices, vertex normals and texture coordinates and then by appending mesh parts with updated indices. |
FMEMesh.appendTextureCoordinates (coords) |
Appends the texture coordinates to the end of the texture coordinate list. |
FMEMesh.appendVertex (x, y, z) |
Appends the point to the end of the vertex list. |
FMEMesh.appendVertexNormal (x, y, z) |
Appends the point to the end of the vertex normal list. |
FMEMesh.appendVertexNormals (points) |
Appends the vertex normals to the end of the vertex normal list. |
FMEMesh.appendVertices (points) |
Appends the vertices to the end of the vertex list. |
FMEMesh.boundingBox () |
This method returns the bounding box of the geometry. |
FMEMesh.boundingCube () |
This method returns the bounding cube of the geometry. |
FMEMesh.bounds () |
Returns the bounds of the geometry. |
FMEMesh.clearMeasures () |
Remove all measures from the geometry. |
FMEMesh.copyAttributesFromFeature (…) |
Copies all the attributes from the given feature to traits on this geometry, if they match the (optional) regular expression. |
FMEMesh.copyNameFromGeometry (sourceGeometry) |
Copies the name of the ‘sourceGeometry’ onto this geometry. |
FMEMesh.copyTraitsFromGeometry (…) |
Copies all the traits from the given geometry that match the (optional) regular expression. |
FMEMesh.copyTraitsToFeature (destFeature, …) |
Copies all the traits from this geometry to attributes on the given feature, if they match the (optional) regular expression. |
FMEMesh.deleteName () |
Deletes the geometry’s name. |
FMEMesh.deleteSide (front) |
This method deletes the side specified by ‘front’ and indicates whether or not it existed before being deleted. |
FMEMesh.force2D () |
Reduces the geometry to 2D. |
FMEMesh.force3D (newZ) |
This sets the geometry’s dimension to 3D. |
FMEMesh.getAppearanceReference (front) |
This method returns the appearance reference within the Library associated with this surface. |
FMEMesh.getArea () |
Area calculation. |
FMEMesh.getAsCompositeSurface () |
Returns a composite surface representation of this mesh. |
FMEMesh.getAsMultiSurface () |
Returns a multi-surface representation of this mesh. |
FMEMesh.getAsWireFrame () |
Returns the wireframe of the surface as a FMEMultiCurve . |
FMEMesh.getMeasureNames () |
Retrieve the names of the measures on this geometry. |
FMEMesh.getName () |
This routine retrieves the ‘name’ of this geometry as a six.text_type . |
FMEMesh.getTextureCoordinateAt |
getTextureCoordinateAt(index), |
FMEMesh.getTextureCoordinates () |
Retrieves the texture coordinate list with texture coordinates in the same index position as referenced by the faces. |
FMEMesh.getTrait (traitName) |
Retrieves the geometry trait value of the specified trait name. |
FMEMesh.getTraitNames () |
Retrieve the names of the traits on this geometry. |
FMEMesh.getTraitNullMissingAndType (traitName) |
This method returns a tuple of a boolean, indicating if the trait is null, a boolean, indicating if the trait is missing, and an integer representing the type of the trait. |
FMEMesh.getTraitType (traitName) |
Returns the type of given trait. |
FMEMesh.getTransformationMatrix () |
Gets this mesh’s transformation matrix. |
FMEMesh.getVertexAt (index) |
Retrieve the vertex, in global coordinates (i.e., the transformation matrix is applied, if it exists), at the specified index. |
FMEMesh.getVertexNormalAt (index) |
Retrieve the vertex normal, in global coordinates (i.e., the transformation matrix is applied, if it exists), at the specified index. |
FMEMesh.getVertexNormals () |
Retrieves the vertex normal list with vertex normals, in global coordinates (i.e., the transformation matrix is applied, if it exists), in the same index position as referenced by the faces. |
FMEMesh.getVertexNormalsInLocalCoordinates () |
This is the same as getVertexNormals() with the exception that the transformation matrix is not applied. |
FMEMesh.getVertices () |
Retrieves the vertex list with vertices, in global coordinates (i.e., the transformation matrix is applied, if it exists), in the same index position as referenced by the faces. |
FMEMesh.getVerticesInLocalCoordinates () |
This is the same as getVertices() with the exception that the transformation matrix is not applied. |
FMEMesh.hasMeasures () |
Check if this geometry or any sub part of this geometry has measures. |
FMEMesh.hasName () |
Returns whether or not the geometry has a name. |
FMEMesh.hasTextureCoordinatesQ () |
Returns True if the texture coordinates stored have the specified component. |
FMEMesh.hasTextureCoordinatesU () |
Returns True if the texture coordinates stored have the specified component. |
FMEMesh.hasTextureCoordinatesV () |
Returns True if the texture coordinates stored have the specified component. |
FMEMesh.hasTextureCoordinatesW () |
Returns True if the texture coordinates stored have the specified component. |
FMEMesh.hasTransformationMatrix () |
This method determines if the mesh has a transformation matrix or not. |
FMEMesh.is3D () |
Returns whether or not the geometry is 3D. |
FMEMesh.isCollection () |
Check if the geometry is an aggregate or multi-part collection. |
FMEMesh.isInPlane (tolerance, normalVector, …) |
Works similarly to isPlanar() , but checks planarity with respect to given normal or given plane (if plane equation D is specified - see below). |
FMEMesh.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. |
FMEMesh.isPlanar (tolerance) |
Returns True if this is planar within the given tolerance, and False otherwise. |
FMEMesh.maxEdgeNumber () |
Returns the maximum number of edges the mesh can contain. |
FMEMesh.measureExists (measureName) |
Returns True if the specified measure exists and False otherwise. |
FMEMesh.numParts () |
This returns the number of faces that are contained in this simple surface. |
FMEMesh.numTextureCoordinates () |
Returns the number of texture coordinates that are contained in this mesh. |
FMEMesh.numVertexNormals () |
Returns the number of vertex normals that are contained in this mesh. |
FMEMesh.numVertices () |
Returns the number of vertices that are contained in this mesh. |
FMEMesh.offset (offsetPoint) |
Offsets the surface by the coords specified by ‘offsetPoint’. |
FMEMesh.optimizeVertexPool () |
Optimizes the mesh by removing all duplicate and unreferenced vertices, vertex normals, and texture coordinates. |
FMEMesh.orient () |
Flips the front and the back of parts of the surface as required to create a surface that is oriented. |
FMEMesh.removeDegenerateTriangleMeshParts () |
Removes this mesh’s degenerate triangle parts. |
FMEMesh.removeMeasure (measureName) |
Removes the measure with name ‘measureName’ if supplied, or the default measure, if there is one. |
FMEMesh.removeTraits (regexp) |
This method has 4 modes: |
FMEMesh.removeTransformationMatrix () |
Removes this mesh’s transformation matrix. |
FMEMesh.renameMeasure (oldMeasureName, …) |
Renames the measure specified by ‘oldMeasureName’ to the new name, specified by ‘newMeasureName’. |
FMEMesh.reorient () |
Flips the surface such that the front and back of the surface are switched. |
FMEMesh.resolvePartDefaults () |
This call assumes that the mesh has been triangulated. |
FMEMesh.reverse () |
This reverses the order of the surface’s points. |
FMEMesh.rotate2D (center, angle) |
Rotates this surface about the z-axis by the specified angle, in degrees. |
FMEMesh.scale (xScale, yScale, zScale) |
Scale the feature by the given amounts. |
FMEMesh.setAppearanceReference (…) |
This method associates an appearance within the Library with this surface. |
FMEMesh.setName (name) |
Sets the geometry’s name with a six.text_type . |
FMEMesh.setTrait (traitName, traitValue) |
Sets a geometry trait with the specified value. |
FMEMesh.setTraitNullWithType (traitName, …) |
This method supplies a null trait value with a type to the geometry. |
FMEMesh.setTransformationMatrix |
setTransformationMatrix(matrix), |
FMEMesh.sideExists (front) |
This method checks whether the side specified by ‘front’ exists. |
-
class
FMEMesh
¶ Bases:
fmeobjects.FMESimpleSurface
FME Mesh Class
Create an instance of a Mesh geometry object.
init()
Default
FMEMesh
constructor.Return type: FMEMesh Returns: An instance of a Mesh geometry object. init(mesh)
Create a copy of the passed in Mesh geometry object.
Parameters: mesh (FMEMesh) – The Mesh geometry object to create a copy of. Return type: FMEMesh Returns: An instance of a Mesh geometry object. -
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
addMeshPart
(appearanceReference, vertexIndices, vertexNormalIndices, textureCoordinateIndices)¶ This routine adds a new mesh part to the mesh. The ‘vertexNormalIndices’ and ‘textureCoordinateIndices’ may be passed in as
None
if the user does not want to specify vertex normals or texture coordinates for the mesh part. The first indices of the mesh part should match the respective last indices, indicating a closed face. If this is not the case, the mesh part will be closed by the method.Parameters: - appearanceReference (int) – Should refer to a valid appearance in the shared object library, but no checking is done during this call. The appearance reference of 0 implies that this part will inherit the appearance reference of the mesh.
- vertexIndices (list[int]) – Should refer to valid vertices in the vertex list of the mesh, but no validation is done by the method.
- vertexNormalIndices (list[int] or None) – Should refer to valid vertex normals stored in the mesh.
- textureCoordinateIndices (list[int] or None) – Should refer to valid texture coordinates of the mesh.
Return type: Returns: Boolean indicating whether or not the addition was successful.
-
addMeshPartExtended
(hasAFront, hasABack, frontAppRef, backAppRef, vertexIndices, vertexNormalIndices, frontTextCoordIndices, backTextCoordIndices)¶ This routine extends the functionality of
addMeshPart()
, allowing double-sided mesh parts to be added. When both ‘hasAFront’ and ‘hasABack’ areTrue
, a double sided part will be added. If one of these parameters isFalse
, the corresponding appearance reference and texture coordinates will not be ignore.Parameters: - hasAFront (bool) – Boolean indicating whether or not the mesh has a front.
- hasABack (bool) – Boolean indicating whether or not the mesh has a back.
- frontAppRef (int) – Appearance reference for the front of the Mesh. Should refer to a valid appearance in the shared object library, but no checking is done during this call. The appearance reference of 0 implies that this part will inherit the appearance reference of the mesh. If ‘hasAFront’ is
False
the value of this parameter is not important, but it must be a valid int. - backAppRef (int) – Appearance reference for the back of the Mesh. Should refer to a valid appearance in the shared object library, but no checking is done during this call. The appearance reference of 0 implies that this part will inherit the appearance reference of the mesh. If ‘hasAback’ is
False
the value of this parameter is not important, but it must be a valid int. - vertexIndices (list of int) – Should refer to valid vertices in the vertex list of the mesh, but no validation is done by the method.
- vertexNormalIndices (list[int] or None) – Should refer to valid vertex normals stored in the mesh.
- frontTextCoordIndices (list[int] or None) – Should refer to valid texture coordinates of the mesh.
- backTextCoordIndices (list[int] or None) – Should refer to valid texture coordinates of the mesh.
Return type: Returns: Boolean indicating whether or not the addition was successful.
-
appendMesh
(otherMesh)¶ Appends a mesh passed in to the mesh, by appending the vertices, vertex normals and texture coordinates and then by appending mesh parts with updated indices.
Parameters: otherMesh (FMEMesh) – Another mesh to append to this mesh. Return type: None
-
appendTextureCoordinates
(coords)¶ Appends the texture coordinates to the end of the texture coordinate list. If there are already texture coordinates stored, the components that previously returned
False
tohasTextureCoordinates[U|V|W|Q]
will be back filled with 0. Parameters set toNone
will be ignored.Parameters: coords (list[tuple[float]]) – The list of texture coordinates. The coordinates are represented as (u, v, w, q) tuples Return type: None
-
appendVertex
(x, y, z)¶ Appends the point to the end of the vertex list. This method will assume that passed vertices are in local coordinates (i.e. the transformation matrix will be applied to these vertices).
Parameters: Return type:
-
appendVertexNormal
(x, y, z)¶ Appends the point to the end of the vertex normal list.
Parameters: Return type:
-
appendVertexNormals
(points)¶ Appends the vertex normals to the end of the vertex normal list.
Parameters: points (list[tuple[float]]) – The list of vertices to be added. The vertices are represented as (x, y, z) tuples. Return type: None
-
appendVertices
(points)¶ Appends the vertices to the end of the vertex list. This method will assume that passed vertices are in local coordinates (i.e. the transformation matrix will be applied to these vertices).
Parameters: points (list[tuple[float]]) – The list of vertices to be added. The vertices are represented as (x, y, z) tuples. Return type: None
-
boundingBox
()¶ This method returns the bounding box of the geometry.
Return type: tuple[tuple[float]] Returns: The bounding box of the Geometry, in the form ((minx, miny), (maxx, maxy)).
-
boundingCube
()¶ This method returns the bounding cube of the geometry.
Return type: tuple[tuple[float]] Returns: The bounding box of the Geometry, in the form ((minx, miny, minz), (maxx, maxy, maxz)).
-
bounds
()¶ Returns the bounds of the geometry.
Return type: tuple[FMEPoint] Returns: The min point and max point of the bounds. None
is returned if the geometry contains no points.
-
copyAttributesFromFeature
(sourceFeature, overwriteExisting, regexp, prefix)¶ Copies all the attributes from the given feature to traits on this geometry, if they match the (optional) regular expression.
Parameters: - sourceFeature (FMEFeature) – The feature to copy attributes from.
- overwriteExisting (bool) – Existing traits will be overwritten only if overwriteExisting is
True
. - regexp (str) – (Optional) The regular expression to match the attributes against. If regexp is not specified, then all attributes will be copied.
- prefix (str) – (Optional) The prefix is put on all the trait names as they are copied. If it is not specified, a prefix will not be added to the trait names.
Return type:
-
copyNameFromGeometry
(sourceGeometry)¶ Copies the name of the ‘sourceGeometry’ onto this geometry. If ‘sourceGeometry’s name is blank or
None
, this geometry’s name will becomeNone
.Parameters: sourceGeometry (FMEGeometry) – The geometry to copy the name from. Return type: None
-
copyTraitsFromGeometry
(sourceGeometry, overwriteExisting, regexp, prefix)¶ Copies all the traits from the given geometry that match the (optional) regular expression.
Parameters: - sourceGeometry (FMEGeometry) – The geometry to copy traits from.
- overwriteExisting (bool) – Existing traits will be overwritten only if overwriteExisting is
True
. - regexp (str) – (Optional) The regular expression to match the traits against. If regexp is not specified, then all traits will be copied.
- prefix (str) – (Optional) The prefix is put on all the trait names as they are copied. If it is not specified, a prefix will not be added to the trait names.
Return type:
-
copyTraitsToFeature
(destFeature, overwriteExisting, regexp, prefix)¶ Copies all the traits from this geometry to attributes on the given feature, if they match the (optional) regular expression.
Parameters: - destFeature (FMEFeature) – The feature to copy traits to.
- overwriteExisting (bool) – Existing attributes will be overwritten only if overwriteExisting is
True
. - regexp (str) – (Optional) The regular expression to match the traits against. If regexp is not specified, then all traits will be copied.
- prefix (str) – (Optional) The prefix is put on all the attribute names as they are copied. If it is not specified, a prefix will not be added to the attribute names.
Return type:
-
deleteName
()¶ Deletes the geometry’s name. If a name existed prior to this call then
True
is returned; otherwiseFalse
is returned.Return type: bool Returns: Returns a boolean indicating whether or not the name existed before deletion.
-
deleteSide
(front)¶ This method deletes the side specified by ‘front’ and indicates whether or not it existed before being deleted.
Parameters: front (bool) – If True
then the front side will be deleted, otherwise the back side will be deleted.Return type: bool Returns: Returns True
if the side existed before being deleted and returnsFalse
if it didn’t exist.
-
force3D
(newZ)¶ This sets the geometry’s dimension to 3D. All Z values are set to the value passed in, even if the geometry is already 3D.
Parameters: newZ (float) – The new Z value. Return type: None
-
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 indicating whether the appearance reference should be retrieved for the front or back of the surface. Return type: int Returns: 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.
-
getAsCompositeSurface
()¶ Returns a composite surface representation of this mesh.
None
is returned when an error is encountered.Return type: FMECompositeSurface or None Returns: Returns a composite surface representation of this mesh or none.
-
getAsMultiSurface
()¶ Returns a multi-surface representation of this mesh.
None
is returned when an error is encountered.Return type: FMEMultiSurface or None Returns: Returns a multi-surface representation of this mesh or None
.
-
getAsWireFrame
()¶ Returns the wireframe of the surface as a
FMEMultiCurve
.None
is returned if a wireframe cannot be generated.Return type: FMEMultiCurve or None Returns: The wireframe of the surface as a FMEMultiCurve
.
-
getMeasureNames
()¶ Retrieve the names of the measures on this geometry.
Return type: tuple[string] Returns: Return a tuple storing the names of the measures on this geometry. This will return an empty tuple if there are no measures. For FMEAggregate
,FMEMultiSurface
, andFMECompositeSurface
, this will return the union of all measure names of all of its parts.
-
getName
()¶ This routine retrieves the ‘name’ of this geometry as a
six.text_type
. This will returnNone
if it did not have a name associated with it.Return type: six.text_type or None Returns: The geometry’s name.
-
getTextureCoordinateAt
()¶ getTextureCoordinateAt(index),
Retrieve the texture coordinate at the specified index. Only components of the texture coordinate that return
True
fromhasTextureCoordinates[U|V|W|Q]
will be fetched. A value ofNone
means that the texture coordinate value doesn’t exist at that index. An error is returned if the index is out of range.Return type: tuple[float] or None Returns: The coordinate at the index represented as a (u, v, w, q) tuple or none. Raises: FMEException – An exception is raised if an error occurred.
-
getTextureCoordinates
()¶ Retrieves the texture coordinate list with texture coordinates in the same index position as referenced by the faces. Only components where
hasTextureCoordinates[U|V|W|Q]
is true will be fetched.Return type: list[tuple[float]] Returns: The list of coordinates represented as (u, v, w, q) tuples. Raises: FMEException – An exception is raised if an error occurred.
-
getTrait
(traitName)¶ Retrieves the geometry trait value of the specified trait name. For Python 2.7, strings are returned as one of two possible types - system encoded strings or unicode strings, if the source trait was encoded. Null trait values will be returned as an empty string. Binary blob traits are returned as a bytearray.
None
is returned when the trait is not found on the geometry.Parameters: traitName (str) – The name of the geometry trait. Return type: bool, int, long, float, six.string_types, bytearray, bytes or None Returns: The trait value. Raises: FMEException – An exception is raised if there was a problem in retrieving the trait value.
-
getTraitNames
()¶ Retrieve the names of the traits on this geometry.
Return type: tuple[str] Returns: Return a tuple storing the names of the traits on this geometry. This will return an empty tuple if there are no traits. For all collections and containers, this will only return the names of traits on the outermost object only.
-
getTraitNullMissingAndType
(traitName)¶ This method returns a tuple of a boolean, indicating if the trait is null, a boolean, indicating if the trait is missing, and an integer representing the type of the trait. The first boolean is
True
if ‘traitName’ maps to a null trait value on the geometry. Otherwise it isFalse
. The second boolean isTrue
if ‘traitName’ maps to a no value on the geometry. Otherwise it isFalse
. If the trait is absent,FME_ATTR_UNDEFINED
is returned for the type.The possible trait types are
FME_ATTR_UNDEFINED
,FME_ATTR_BOOLEAN
,FME_ATTR_INT8
,FME_ATTR_UINT8
,FME_ATTR_INT16
,FME_ATTR_UINT16
,FME_ATTR_INT32
,FME_ATTR_UINT32
,FME_ATTR_REAL32
,FME_ATTR_REAL64
,FME_ATTR_REAL80
,FME_ATTR_STRING
,FME_ATTR_ENCODED_STRING
,FME_ATTR_INT64
,FME_ATTR_UINT64
.Parameters: traitName (str) – The trait’s name. Return type: tuple[bool, bool, int] Returns: A tuple of 2 boolean values the first indicating whether or not the value of the trait is null, the second indicating whether or not the trait is missing, and an integer representing the trait type.
-
getTraitType
(traitName)¶ Returns the type of given trait. If the trait cannot be found,
FME_ATTR_UNDEFINED
will be returned.Returns one of
FME_ATTR_UNDEFINED
,FME_ATTR_BOOLEAN
,FME_ATTR_INT8
,FME_ATTR_UINT8
,FME_ATTR_INT16
,FME_ATTR_UINT16
,FME_ATTR_INT32
,FME_ATTR_UINT32
,FME_ATTR_REAL32
,FME_ATTR_REAL64
,FME_ATTR_REAL80
,FME_ATTR_STRING
,FME_ATTR_ENCODED_STRING
,FME_ATTR_INT64
,FME_ATTR_UINT64
.Parameters: traitName (str) – The trait’s name. Return type: int Returns: The trait type.
-
getTransformationMatrix
()¶ Gets this mesh’s transformation matrix. If the mesh does not have such a matrix, an identity matrix is returned. Only the top three rows of the matrix will be returned, as the bottom row is always [ 0 0 0 1 ].
Return type: list[list[float]] Returns: The mesh’s tranformation matrix, formatted [[dddd][dddd][dddd]].
-
getVertexAt
(index)¶ Retrieve the vertex, in global coordinates (i.e., the transformation matrix is applied, if it exists), at the specified index. An error is returned if the index is out of range.
Return type: tuple[float] or None Returns: The vertex at the index represented as a (x, y, z) tuple or none. Raises: FMEException – An exception is raised if an error occurred.
-
getVertexNormalAt
(index)¶ Retrieve the vertex normal, in global coordinates (i.e., the transformation matrix is applied, if it exists), at the specified index. An error is returned if the index is out of range.
Return type: tuple[float] or None Returns: The vertex at the index represented as a (x, y, z) tuple or none. Raises: FMEException – An exception is raised if an error occurred.
-
getVertexNormals
()¶ Retrieves the vertex normal list with vertex normals, in global coordinates (i.e., the transformation matrix is applied, if it exists), in the same index position as referenced by the faces.
Return type: list[tuple[float]] Returns: The list of vertex normals represented as (x, y, z) tuples. Raises: FMEException – An exception is raised if an error occurred.
-
getVertexNormalsInLocalCoordinates
()¶ This is the same as
getVertexNormals()
with the exception that the transformation matrix is not applied.Return type: list[tuple[float]] Returns: The list of vertex normals represented as (x, y, z) tuples. Raises: FMEException – An exception is raised if an error occurred.
-
getVertices
()¶ Retrieves the vertex list with vertices, in global coordinates (i.e., the transformation matrix is applied, if it exists), in the same index position as referenced by the faces.
Return type: list[tuple[float]] Returns: The list of vertices represented as (x, y, z) tuples. Raises: FMEException – An exception is raised if an error occurred.
-
getVerticesInLocalCoordinates
()¶ This is the same as
getVertices()
with the exception that the transformation matrix is not applied.Return type: list[tuple[float]] Returns: The list of vertices represented as (x, y, z) tuples. Raises: FMEException – An exception is raised if an error occurred.
-
hasMeasures
()¶ Check if this geometry or any sub part of this geometry has measures.
Return type: bool Returns: True
if this geometry or any sub part of this geometry has measures,False
otherwise.
-
hasName
()¶ Returns whether or not the geometry has a name.
Return type: bool Returns: Returns True
if the geometry has a name andFalse
otherwise.
-
hasTextureCoordinatesQ
()¶ Returns
True
if the texture coordinates stored have the specified component. ReturnsFalse
if no texture coordinates are stored or the specified component of the texture coordinates is not valid for this mesh.Return type: bool Returns: Returns True
if the texture coordinates stored have the specified component, andFalse
otherwise.
-
hasTextureCoordinatesU
()¶ Returns
True
if the texture coordinates stored have the specified component. ReturnsFalse
if no texture coordinates are stored or the specified component of the texture coordinates is not valid for this mesh.Return type: bool Returns: Returns True
if the texture coordinates stored have the specified component, andFalse
otherwise.
-
hasTextureCoordinatesV
()¶ Returns
True
if the texture coordinates stored have the specified component. ReturnsFalse
if no texture coordinates are stored or the specified component of the texture coordinates is not valid for this mesh.Return type: bool Returns: Returns True
if the texture coordinates stored have the specified component, andFalse
otherwise.
-
hasTextureCoordinatesW
()¶ Returns
True
if the texture coordinates stored have the specified component. ReturnsFalse
if no texture coordinates are stored or the specified component of the texture coordinates is not valid for this mesh.Return type: bool Returns: Returns True
if the texture coordinates stored have the specified component, andFalse
otherwise.
-
hasTransformationMatrix
()¶ This method determines if the mesh has a transformation matrix or not.
Return type: bool Returns: Returns True
if this mesh has a transformation matrix, andFalse
otherwise.
-
is3D
()¶ Returns whether or not the geometry is 3D.
Return type: bool Returns: Returns True
if the geometry is 3D andFalse
otherwise. ForFMENull
, this method will always returnTrue
. ForFMEAggregate
,FMEMultiPoint
,FMEMultiArea
,FMEMultiText
andFMEMultiCurve
, this method will returnTrue
if any one of the sub-parts is 3D. If the collection is empty or all of its members are 2D, this method will returnFalse
.
-
isCollection
()¶ Check if the geometry is an aggregate or multi-part collection.
Return type: bool Returns: True
if the geometry is an aggregate or multi-part collection.
-
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 toFalse
, the passed in value of D will be used in the calculation. If ‘recalcualteD’ is set toTrue
, 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’ toTrue
, and then use this value for future calls with ‘recalculateD’ toFalse
.Parameters: Return type: Returns: 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.Return type: bool Returns: Returns True
if the surface is oriented,False
otherwise.
-
isPlanar
(tolerance)¶ Returns
True
if this is planar within the given tolerance, andFalse
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. Return type: bool Returns: Whether the surface is planar within the tolerance supplied.
-
maxEdgeNumber
()¶ Returns the maximum number of edges the mesh can contain.
Return type: int Returns: Returns the maximum number of edges.
-
measureExists
(measureName)¶ Returns
True
if the specified measure exists andFalse
otherwise. If the ‘measureName’ parameter is not specified then the default measure is checked.Parameters: measureName (str) – (Optional) The measure’s name. Return type: bool Returns: Boolean indicating whether or not the measure exists.
-
numParts
()¶ This returns the number of faces that are contained in this simple surface.
Return type: int Returns: The number of faces in the simple surface.
-
numTextureCoordinates
()¶ Returns the number of texture coordinates that are contained in this mesh.
Return type: int Returns: Returns the number of texture coordinates that are contained in this mesh.
-
numVertexNormals
()¶ Returns the number of vertex normals that are contained in this mesh.
Return type: int Returns: Returns the number of vertex normals in this mesh.
-
numVertices
()¶ Returns the number of vertices that are contained in this mesh.
Return type: int Returns: Returns the number of vertices in this mesh.
-
offset
(offsetPoint)¶ Offsets the surface by the coords specified by ‘offsetPoint’.
Parameters: offsetPoint (FMEPoint) – The FMEPoint
to offset the surface by.Return type: None Raises: FMEException – An exception is raised if an error occurred.
-
optimizeVertexPool
()¶ Optimizes the mesh by removing all duplicate and unreferenced vertices, vertex normals, and texture coordinates. This will modify the underlying vertex pools and update the mesh part indices. This is a potentially expensive operation and should not be called unless necessary.
Return type: None
-
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).Return type: None
-
removeDegenerateTriangleMeshParts
()¶ Removes this mesh’s degenerate triangle parts.
Return type: None
-
removeMeasure
(measureName)¶ Removes the measure with name ‘measureName’ if supplied, or the default measure, if there is one.
Parameters: measureName (str) – (Optional) The name of the measure to remove. Return type: None
-
removeTraits
(regexp)¶ This method has 4 modes:
- Remove all traits at the top level: regex == NULL
- Remove some traits at the top level: regex == <string>
- Remove all traits at all levels: regex ==
kFME_RecurseAll
- Remove some traits at all levels: regex ==
kFME_RecurseSome
<string>
For example, specifying regex == NULL for a multi-surface will remove all traits at the root level of the multi-surface, whereas specifying regex ==
kFME_RecurseSome
<string> will remove all traits from all levels of the multi surface that match <string>. If <string> is an illegal regular expression, no traits will be removed.Return type: None
-
renameMeasure
(oldMeasureName, newMeasureName)¶ Renames the measure specified by ‘oldMeasureName’ to the new name, specified by ‘newMeasureName’.
Parameters: Return type:
-
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:FMETriangleStrip
have a method calledisFlipped()
that is to be used in conjunction with the geometry to determine which side is the front. WhenisFlipped()
returnsTrue
, the front is actually the opposite side of what the coordinates of the first triangle in the strip indicate.Return type: None
-
resolvePartDefaults
()¶ This call assumes that the mesh has been triangulated. It will remove any mesh parts that do not have three edges and will also remove triangles with repeated vertex indices. It will return true if any parts are removed by the call. This method assumes that duplicate indices have already been removed from the mesh.
Return type: bool Returns: Returns True
if any parts are removed by the call andFalse
otherwise.
-
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: Return type: Raises: FMEException – An exception is raised if an error occurred.
-
scale
(xScale, yScale, zScale)¶ Scale the feature by the given amounts.
Parameters: Return type: 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 aFMEException
. This is an unhealthy situation as it represents a ‘dangling reference’.Parameters: 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.
-
setName
(name)¶ Sets the geometry’s name with a
six.text_type
. By supplying a blank name as input, this method will act asdeleteName()
.Parameters: name (six.text_type) – The geometry’s new name. Return type: None
-
setTrait
(traitName, traitValue)¶ Sets a geometry trait with the specified value. If the geometry trait already exists, its value and type will be changed. The following type numeric mappings are used:
PyInt ==> FME_Int32
PyFloat ==> FME_Real64
PyLong ==> FME_Int64
For Python 2.7, strings can be input as one of two possible types: system encoded strings or unicode strings. Binary values are to be specified as bytearray values or bytes values for Python 3 and as bytearray values for Python 2.7.
Parameters: Return type:
-
setTraitNullWithType
(traitName, traitType)¶ This method supplies a null trait value with a type to the geometry. If a trait with the same name already exists, it is overwritten.
Trait type must be one of
FME_ATTR_UNDEFINED
,FME_ATTR_BOOLEAN
,FME_ATTR_INT8
,FME_ATTR_UINT8
,FME_ATTR_INT16
,FME_ATTR_UINT16
,FME_ATTR_INT32
,FME_ATTR_UINT32
,FME_ATTR_REAL32
,FME_ATTR_REAL64
,FME_ATTR_REAL80
,FME_ATTR_STRING
,FME_ATTR_ENCODED_STRING
,FME_ATTR_INT64
,FME_ATTR_UINT64
.Parameters: Return type:
-
setTransformationMatrix
()¶ setTransformationMatrix(matrix),
Sets this mesh’s transformation matrix, replacing the existing matrix if it exists. Only three rows are expected in the input array, as a bottom row of [ 0 0 0 1 ] is assumed.
Parameters: matrix (list[list[float]]) – The transformation matrix, formatted [[dddd][dddd][dddd]]. Return type: None
-