Torus
- class compas.geometry.Torus(plane, radius_axis, radius_pipe, **kwargs)[source]
Bases:
Shape
A torus is defined by a plane and two radii.
- Parameters
plane ([point, normal] |
Plane
) – The plane of the torus.radius_axis (float) – The radius of the axis.
radius_pipe (float) – The radius of the pipe.
- Attributes
Examples
>>> from compas.geometry import Plane >>> from compas.geometry import Torus >>> torus = Torus(Plane.worldXY(), 5., 2.)
>>> from compas.geometry import Plane >>> from compas.geometry import Torus >>> torus = Torus(Plane.worldXY(), 5, 2) >>> sdict = {'plane': Plane.worldXY().data, 'radius_axis': 5., 'radius_pipe': 2.} >>> sdict == torus.data True
Methods
Construct a torus from its data representation.
Returns a list of vertices and faces
Transform the torus.
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.