fmeobjects.FMEExtrusion

Inheritance diagram of fmeobjects.FMEExtrusion

FMEExtrusion.boundingBox()

This method returns the bounding box of the geometry.

FMEExtrusion.boundingCube()

This method returns the bounding cube of the geometry.

FMEExtrusion.bounds()

Returns the bounds of the geometry.

FMEExtrusion.clearMeasures()

Remove all measures from the geometry.

FMEExtrusion.copyAttributesFromFeature(...)

Copies all the attributes from the given feature to traits on this geometry, if they match the (optional) regular expression.

FMEExtrusion.copyNameFromGeometry(sourceGeometry)

Copies the name of the 'sourceGeometry' onto this geometry.

FMEExtrusion.copyTraitsFromGeometry(...)

Copies all the traits from the given geometry that match the (optional) regular expression.

FMEExtrusion.copyTraitsToFeature(...)

Copies all the traits from this geometry to attributes on the given feature, if they match the (optional) regular expression.

FMEExtrusion.deleteName()

Deletes the geometry's name.

FMEExtrusion.force2D()

Reduces the geometry to 2D.

FMEExtrusion.force3D(newZ)

This sets the geometry's dimension to 3D.

FMEExtrusion.getAppearanceReference(front)

This method returns the appearance reference within the Library associated with this solid.

FMEExtrusion.getArea()

Area calculation.

FMEExtrusion.getAsBRepSolid()

Returns a boundary-representation solid of this extrusion.

FMEExtrusion.getAsWireFrame()

Returns the wireframe of the solid as a FMEMultiCurve.

FMEExtrusion.getBaseAsFace()

Gets the base of this extrusion solid as a face.

FMEExtrusion.getEndCapAsFace()

Returns the face that results from extruding the base of this extrusion solid.

FMEExtrusion.getExtrusionVectorXYZ()

Gets the extrusion vector of this extrusion solid.

FMEExtrusion.getMeasureNames()

Retrieve the names of the measures on this geometry.

FMEExtrusion.getName()

This routine retrieves the 'name' of this geometry as a str.

FMEExtrusion.getTrait(traitName)

Retrieves the geometry trait value of the specified trait name.

FMEExtrusion.getTraitNames()

Retrieve the names of the traits on this geometry.

FMEExtrusion.getTraitNullMissingAndType(...)

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.

FMEExtrusion.getTraitType(traitName)

Returns the type of given trait.

FMEExtrusion.hasMeasures()

Check if this geometry or any sub part of this geometry has measures.

FMEExtrusion.hasName()

Returns whether or not the geometry has a name.

FMEExtrusion.is3D()

Returns whether or not the geometry is 3D.

FMEExtrusion.isCollection()

Check if the geometry is an aggregate or multi-part collection.

FMEExtrusion.isOriented(orientation)

Returns True if the solid is oriented with the desired orientation.

FMEExtrusion.measureExists(measureName)

Returns True if the specified measure exists and False otherwise.

FMEExtrusion.offset(offsetPoint)

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

FMEExtrusion.orient(orientation)

Reorients the solid such that either all the surface normals face out from the solid geometry or all the surface normals face in to the solid geometry.

FMEExtrusion.removeMeasure(measureName)

Removes the measure with name 'measureName' if supplied, or the default measure, if there is one.

FMEExtrusion.removeTraits(regexp)

This method has 4 modes:

FMEExtrusion.renameMeasure(oldMeasureName, ...)

Renames the measure specified by 'oldMeasureName' to the new name, specified by 'newMeasureName'.

FMEExtrusion.reorient()

Flips the underlying surfaces that make up the solid, such that the front and back of each surface is switched.

FMEExtrusion.reverse()

This reverses the order of the solid's points.

FMEExtrusion.rotate2D(center, angle)

Rotates this solid about the z-axis by the specified angle, in degrees.

FMEExtrusion.scale(xScale, yScale, zScale)

Scale the feature by the given amounts.

FMEExtrusion.setAppearanceReference(...)

This method associates an appearance within the Library with this solid.

FMEExtrusion.setBase(base)

Sets the base of this extrusion solid as the specified face.

FMEExtrusion.setExtrusionVectorXYZ(x, y, z)

Sets the extrusion vector of this extrusion solid.

FMEExtrusion.setName(name)

Sets the geometry's name with a str.

FMEExtrusion.setTrait(traitName, traitValue)

Sets a geometry trait with the specified value.

FMEExtrusion.setTraitNullWithType(traitName, ...)

This method supplies a null trait value with a type to the geometry.

class FMEExtrusion

FME Extrusion Class

Create an instance of an Extrusion geometry object.

init(face, extrusionVector)

Creates an extrusion by a face and extrusion vector.

Parameters:
  • face (FMEFace) – A face representing the base of the extrusion.

  • extrusionVector (tuple[float]) – The extrusion vector as an (x, y, z) tuple.

Return type:

FMEExtrusion

Returns:

An instance of an Extrusion geometry object.

init(extrusion)

Create a copy of the passed in Extrusion geometry object.

Parameters:

extrusion (FMEExtrusion) – The Extrusion geometry object to create a copy of.

Return type:

FMEExtrusion

Returns:

An instance of an Extrusion Geometry object.

__init__(*args, **kwargs)
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.

clearMeasures()

Remove all measures from the geometry.

Return type:

None

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:

None

copyNameFromGeometry(sourceGeometry)

Copies the name of the ‘sourceGeometry’ onto this geometry. If ‘sourceGeometry’s name is blank or None, this geometry’s name will become None.

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, or is an empty string, 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:

None

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, or is an empty string, 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:

None

deleteName()

Deletes the geometry’s name. If a name existed prior to this call then True is returned; otherwise False is returned.

Return type:

bool

Returns:

Returns a boolean indicating whether or not the name existed before deletion.

force2D()

Reduces the geometry to 2D.

Return type:

None

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 solid. The front parameter controls whether this query should return the front or the back appearance reference. Both can be fetched independently. If this solid is a regular solid with no geometry instance, a FMEException will be thrown.

Parameters:

front (bool) – Indicates whether the appearance reference should be fetched for the front or back.

Return type:

int

Returns:

The unique appearance reference for this appearance.

Raises:

FMEException – An exception is raised if an error occurred or this solid is a regular solid with no geometry instance.

getArea()

Area calculation.

Return type:

float

Returns:

The calculated area.

getAsBRepSolid()

Returns a boundary-representation solid of this extrusion.

Return type:

FMEBRepSolid

Returns:

The BRepSolid of this extrusion.

getAsWireFrame()

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

Return type:

FMEMultiCurve or None

Returns:

The wireframe of the solid as a FMEMultiCurve.

getBaseAsFace()

Gets the base of this extrusion solid as a face.

Return type:

FMEFace

Returns:

The base of the extrusion as a face

getEndCapAsFace()

Returns the face that results from extruding the base of this extrusion solid.

Return type:

FMEFace

Returns:

The end cap of the extrusion as a face

getExtrusionVectorXYZ()

Gets the extrusion vector of this extrusion solid.

Return type:

tuple[float]

Returns:

An immutable list of the extrusion vector’s x, y and z coordinates.

getMeasureNames()

Retrieve the names of the measures on this geometry.

Return type:

tuple[str]

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, and FMECompositeSurface, 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 str. This will return None if it did not have a name associated with it.

Return type:

str or None

Returns:

The geometry’s name.

getTrait(traitName)

Retrieves the geometry trait value of the specified trait name. 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, float, str, 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 is False. The second boolean is True if ‘traitName’ maps to a no value on the geometry. Otherwise it is False. 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.

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 and False otherwise.

is3D()

Returns whether or not the geometry is 3D.

Return type:

bool

Returns:

Returns True if the geometry is 3D and False otherwise. For FMENull, this method will always return True. For FMEAggregate, FMEMultiPoint, FMEMultiArea, FMEMultiText and FMEMultiCurve, this method will return True if any one of the sub-parts is 3D. If the collection is empty or all of its members are 2D, this method will return False.

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.

isOriented(orientation)

Returns True if the solid is oriented with the desired orientation.

Parameters:

orientation (int) – Indicates the desired orientation: 0 for the front side facing out; 1 for the front side facing in.

Return type:

bool

measureExists(measureName)

Returns True if the specified measure exists and False 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.

offset(offsetPoint)

Offsets the solid by the coords specified by ‘offsetPoint’.

Parameters:

offsetPoint (FMEPoint) – The FMEPoint to offset the solid by.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

orient(orientation)

Reorients the solid such that either all the surface normals face out from the solid geometry or all the surface normals face in to the solid geometry.

Parameters:

orientation (int) – Indicates the desired orientation: 0 for the front side facing out; 1 for the front side facing in.

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:

  1. Remove all traits at the top level: regex == NULL

  2. Remove some traits at the top level: regex == <string>

  3. Remove all traits at all levels: regex == kFME_RecurseAll

  4. 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:
  • oldMeasureName (str) – The original name of the measure.

  • newMeasureName (str) – The new name of the measure.

Return type:

None

reorient()

Flips the underlying surfaces that make up the solid, such that the front and back of each surface is switched. This has the effect of flipping the solid inside-out. The front and back vertex normals are swapped.

Return type:

None

reverse()

This reverses the order of the solid’s points.

Return type:

None

rotate2D(center, angle)

Rotates this solid 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 solid.

  • angle (float) – The angle by which the solid is rotated.

Return type:

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.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

setAppearanceReference(appearanceRef, front)

This method associates an appearance within the Library with this solid. 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 FMESolid 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 solids, 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 solid.

Return type:

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.

setBase(base)

Sets the base of this extrusion solid as the specified face. Any existing base that exists in this solid will be replaced. By setting the base, the surface normals automatically adjust so that all normals are pointing away from the extrusion. If None is passed in, an error will result.

Parameters:

base (FMEFace) – The base of the FMEExtrusion as a face.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

setExtrusionVectorXYZ(x, y, z)

Sets the extrusion vector of this extrusion solid. By setting the extrusion vector, the surface normals automatically adjust so that all normals are pointing away from the extrusion.

Parameters:
  • x (float) – The x coordinate.

  • y (float) – The y coordinate.

  • z (float) – The z coordinate.

Return type:

None

setName(name)

Sets the geometry’s name with a str. By supplying a blank name as input, this method will act as deleteName().

Parameters:

name (str) – 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

Binary values are to be specified as bytearray values or bytes values.

Parameters:
Return type:

None

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:
  • traitName (str) – The trait’s name.

  • traitType (int) – An integer representing the trait type.

Return type:

None