Cylinder¶
(Source code, svg)
- class otmeshing.Cylinder(*args)¶
Generalized cylinder.
- Parameters:
- base
openturns.Mesh Cylinder base
- extension
openturns.Interval Extension range
- injectionsequence of int
Dimension indices of the extension
- discretizationint
Discretization number along dimensions of the extension
- base
Methods
Bounding box accessor.
Accessor to the object's name.
getName()Accessor to the object's name.
Vertices accessor.
Volume accessor.
hasName()Test if the object is named.
setName(name)Accessor to the object's name.
Examples
Create a cylinder with an octogonal base, extended in the z-axis over [0, 5]:
>>> import otmeshing >>> import openturns as ot >>> import math >>> polyline = [] >>> n = 8 >>> for i in range(n): ... theta = i * 2.0 * math.pi / n ... polyline.append([math.cos(theta), math.sin(theta)]) >>> base = otmeshing.PolygonMesher().build(polyline) >>> extension = ot.Interval([0.0], [5.0]) # z-range >>> injection = [2] # extension in the z-axis >>> M = 4 # number of cells in the z-axis >>> cylinder = otmeshing.Cylinder(base, extension, injection, M)
- __init__(*args)¶
- getBoundingBox()¶
Bounding box accessor.
- Returns:
- bbox
openturns.Interval Cylinder bounding box.
- bbox
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getVertices()¶
Vertices accessor.
- Returns:
- vertices
openturns.Sample Cylinder vertices.
- vertices
- getVolume()¶
Volume accessor.
- Returns:
- volumefloat
Cylinder volume.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
otmeshing