Cone
- class compas.geometry.Cone[source]
Bases:
Shape
A cone is defined by a frame, radius, and height.
The cone is oriented along the z-axis of the frame. The base point of the cone (i.e. the centre of the base circle) is at the origin of the frame. The entire cone is in the positive z-direction.
- Parameters:
- frame
compas.geometry.Frame
, optional The local coordinate system of the cone. Default is
None
, in which case the world coordinate system is used.- radiusfloat, optional
The radius of the base of the cone.
- heightfloat, optional
The height of the cone along the z-axis of the frame. The base of the cone is at the origin of the frame. The entire cone is above the XY plane of the frame.
- namestr, optional
The name of the shape.
- frame
- Attributes:
- areafloat, read-only
The surface area of the cone.
- axis
compas.geometry.Line
, read-only The central axis of the cone.
- base
compas.geometry.Point
, read-only The base point of the cone. The base point is at the origin of the local coordinate system.
- circle
compas.geometry.Circle
, read-only The base circle of the cone. The center of the circle is at the origin of the local coordinate system.
- diameterfloat, read-only
The diameter of the base circle of the cone.
- frame
compas.geometry.Frame
The local coordinate system of the cone. The cone is oriented along the local z-axis.
- heightfloat
The height of the cone.
- plane
compas.geometry.Plane
, read-only The plane of the cone. The base point of the plane is at the origin of the local coordinate system. The normal of the plane is in the direction of the z-axis of the local coordinate system.
- radiusfloat
The radius of the base circle of the cone.
- transformation
compas.geometry.Transformation
The transformation of the cone to global coordinates.
- volumefloat, read-only
The volume of the cone.
Examples
>>> frame = Frame.worldXY() >>> cone = Cone(frame=frame, radius=0.3, height=1.0) >>> cone = Cone(radius=0.3, height=1.0) >>> cone = Cone(0.3, 1.0)
Methods
Compute the faces of the discrete representation of the cone.
Compute the vertices of the discrete representation of the cone.
Construct a cone from a circle and a height.
Construct a cone from a line and a radius.
Returns a BRep representation of the cone.
Inherited Methods
Converts the instance to a string.
Compute the axis-aligned bounding box of the geometry.
Compute the edges of the discrete representation of the shape.
Compute the oriented bounding box of the geometry.
Compute the triangles of the discrete representation of the shape.
Verify if a point is inside the shape.
Verify if a list of points are inside the shape.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Rotate the shape.
Returns a rotated copy of this geometry.
Scale the shape.
Returns a scaled copy of this geometry.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Returns a mesh representation of the box.
Convert the shape to a polyhedron.
Convert the shape to a list of vertices and faces.
Transform the shape.
Returns a transformed copy of this geometry.
Translate the shape.
Returns a translated copy of this geometry.
Validate the data against the object's data schema.