ladybug_geometry.geometry3d.cylinder module

Cylinder

class ladybug_geometry.geometry3d.cylinder.Cylinder(center, axis, radius)[source]

Bases: object

Cylinder object.

Parameters
  • center – A Point3D at the center of the bottom base of the cylinder.

  • axis – A Vector3D representing the direction and height of the cylinder. The vector extends from the bottom base center to the top base center.

  • radius – A number representing the radius of the cylinder.

Properties:
  • center

  • axis

  • radius

  • center_end

  • diameter

  • height

  • area

  • volume

  • min

  • max

  • base_bottom

  • base_top

ToString()[source]

Overwrite .NET ToString.

duplicate()[source]

Get a copy of this object.

classmethod from_dict(data)[source]

Create a Cylinder from a dictionary.

Parameters

data – A python dictionary in the following format

{
    "type": "Cylinder"
    "center": (10, 0, 0),
    "axis": (0, 0, 1),
    "radius": 1.0
}
classmethod from_start_end(p1, p2, radius)[source]

Initialize a new cylinder from start and end points.

Parameters
  • p1 – The start point of the cylinder, represents the center of the bottom base of the cylinder.

  • p2 – The end point of the cylinder, represents the center of the top base of the cylinder

  • radius – A number representing the radius of the cylinder.

move(moving_vec)[source]

Get a Cylinder that has been moved along a vector.

Parameters

moving_vec – A Vector3D with the direction and distance to move the Cylinder.

reflect(normal, origin)[source]

Get a Cylinder reflected across a plane with the input normal vector and origin.

Parameters
  • normal – A Vector3D representing the normal vector for the plane across which the arc will be reflected. THIS VECTOR MUST BE NORMALIZED.

  • origin – A Point3D representing the origin from which to reflect.

rotate(axis, angle, origin)[source]

Rotate this Cylinder by a certain angle around an axis and origin.

Right hand rule applies: If axis has a positive orientation, rotation will be clockwise. If axis has a negative orientation, rotation will be counterclockwise.

Parameters
  • axis – A Vector3D axis representing the axis of rotation.

  • angle – An angle for rotation in radians.

  • origin – A Point3D for the origin around which the cylinder will be rotated.

rotate_xy(angle, origin)[source]

Get a Cylinder that is rotated counterclockwise in the world XY plane by an angle.

Parameters
  • angle – An angle for rotation in radians.

  • origin – A Point3D for the origin around which the cylinder will be rotated.

scale(factor, origin=None)[source]

Scale a Cylinder by a factor from an origin point.

Parameters
  • factor – A number representing how much the Cylinder should be scaled.

  • origin – A Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).

to_dict()[source]

Get Cylinder as a dictionary.

property area

Surface area of a Cylinder

property axis

Axis of Cylinder.

property base_bottom

Get an Arc3D representing the bottom circular base of the cylinder.

property base_top

Get an Arc3D representing the top circular base of the cylinder.

property center

Center of Cylinder.

property center_end

Center of the opposite end of Cylinder.

property diameter

Diameter of Cylinder

property height

Height of Cylinder

property max

A Point3D for the maximum bounding box vertex around this geometry.

property min

A Point3D for the minimum bounding box vertex around this geometry.

property radius

Radius of Cylinder

property volume

Volume of a Cylinder