Skip to content

TubeFilter

Introduction

vtkTubeFilter - A filter that generates tubes around lines

vtkTubeFilter is a filter that generates a tube around each input line. The tubes are made up of triangle strips and rotate around the tube with the rotation of the line normals. (If no normals are present, they are computed automatically.) The radius of the tube can be set to vary with scalar or vector value. If the radius varies with scalar value the radius is linearly adjusted. If the radius varies with vector value, a mass flux preserving variation is used. The number of sides for the tube also can be specified. You can also specify which of the sides are visible. This is useful for generating interesting striping effects. Other options include the ability to cap the tube and generate texture coordinates. Texture coordinates can be used with an associated texture map to create interesting effects such as marking the tube with stripes corresponding to length or time.

This filter is typically used to create thick or dramatic lines. Another common use is to combine this filter with vtkStreamTracer to generate streamtubes.

!!! warning The number of tube sides must be greater than 3.

!!! warning The input line must not have duplicate points, or normals at points that are parallel to the incoming/outgoing line segments. If a line does not meet this criteria, then that line is not tubed.

Methods

extend

Method used to decorate a given object (publicAPI+model) with vtkTubeFilter characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesITubeFilterInitialValuesNo(default: {})

getCapping

Get whether the capping is enabled or not.

getDefaultNormal

Get the default normal value.

getGenerateTCoords

Get generateTCoords value.

getNumberOfSides

Get the number of sides for the tube.

getOffset

Get offset value.

getOnRatio

Get onRatio value.

getOutputPointsPrecision

Get the desired precision for the output types.

getRadius

Get the minimum tube radius.

getRadiusFactor

Get the maximum tube radius in terms of a multiple of the minimum radius.

getSidesShareVertices

Get sidesShareVertices value.

getTextureLength

Get textureLength value.

getUseDefaultNormal

Get useDefaultNormal value.

getVaryRadius

Get variation of tube radius with scalar or vector values.

newInstance

Method used to create a new instance of vtkTubeFilter

ArgumentTypeRequiredDescription
initialValuesITubeFilterInitialValuesNofor pre-setting some of its content

requestData

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setCapping

Enable / disable capping the ends of the tube with polygons.

ArgumentTypeRequiredDescription
cappingBooleanYes

setDefaultNormal

Set the default normal to use if no normals are supplied. Requires that useDefaultNormal is set.

ArgumentTypeRequiredDescription
defaultNormalYes

setGenerateTCoords

Control whether and how texture coordinates are produced. This is useful for stripping the tube with length textures, etc. If you use scalars to create the texture, the scalars are assumed to be monotonically increasing (or decreasing).

ArgumentTypeRequiredDescription
generateTCoordsGenerateTCoordsYes

setNumberOfSides

Set the number of sides for the tube. At a minimum, number of sides is 3.

ArgumentTypeRequiredDescription
numberOfSidesNumberYes

setOffset

Control the stripping of tubes. The offset sets the first tube side that is visible. Offset is generally used with onRatio to create nifty stripping effects.

ArgumentTypeRequiredDescription
offsetNumberYes

setOnRatio

Control the stripping of tubes. If OnRatio is greater than 1, then every nth tube side is turned on, beginning with the offset side.

ArgumentTypeRequiredDescription
onRatioNumberYes

setOutputPointsPrecision

Set the desired precision for the output types.

ArgumentTypeRequiredDescription
outputPointsPrecisionDesiredOutputPrecisionYes

setRadius

Set the minimum tube radius (minimum because the tube radius may vary).

ArgumentTypeRequiredDescription
radiusNumberYes

setRadiusFactor

Set the maximum tube radius in terms of a multiple of the minimum radius.

ArgumentTypeRequiredDescription
radiusFactorNumberYes

setSidesShareVertices

Control whether the tube sides should share vertices. This creates independent strips, with constant normals so the tube is always faceted in appearance.

ArgumentTypeRequiredDescription
sidesShareVerticesBooleanYes

setTextureLength

Control the conversion of units during texture coordinates calculation. The texture length indicates what length (whether calculated from scalars or length) is mapped to [0, 1) texture space.

ArgumentTypeRequiredDescription
textureLengthNumberYes

setUseDefaultNormal

Control whether to use the defaultNormal.

ArgumentTypeRequiredDescription
useDefaultNormalBooleanYes

setVaryRadius

Enable or disable variation of tube radius with scalar or vector values.

ArgumentTypeRequiredDescription
varyRadiusVaryRadiusYes