Cylinder
- class compas.geometry.Cylinder(circle, height, **kwargs)[source]
Bases:
Shape
A cylinder is defined by a circle and a height.
- Parameters
circle ([plane, radius] |
Circle
) – The circle of the cylinder.height (float) – The height of the cylinder.
- Attributes
plane (
Plane
) – The plane of the cylinder.circle (
Circle
) – The circle of the cylinder.center (
Point
) – The center of the cylinder.radius (float) – The radius of the cylinder.
height (float) – The height of the cylinder.
normal (
Vector
, read-only) – The normal of the cylinder.diameter (float, read-only) – The diameter of the cylinder.
area (float, read-only) – The surface area of the cylinder.
volume (float, read-only) – The volume of the cylinder.
Examples
>>> from compas.geometry import Plane >>> from compas.geometry import Cylinder >>> plane = Plane([0, 0, 0], [0, 0, 1]) >>> circle = Circle(plane, 5) >>> cylinder = Cylinder(circle, 7)
Methods
Construct a cylinder from its data representation.
Returns a list of vertices and faces.
Transform the cylinder.
Inherited Methods
Make an independent copy of the data object.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Returns a transformed copy of this geometry.
Validate the object's data against its data schema.
Validate the object's data against its json schema.