ladybug_display.geometry3d.vector module

A vector that can be displayed in 3D space.

class ladybug_display.geometry3d.vector.DisplayVector3D(geometry, color=None)[source]

Bases: _DisplayBase

A vector in 3D space with display properties.

Parameters
  • geometry – A ladybug-geometry Vector3D object.

  • color – A ladybug Color object. If None, a default black color will be used. (Default: None).

Properties:
  • geometry

  • color

  • x

  • y

  • z

  • magnitude

  • user_data

ToString()
angle(other)[source]

Get the angle between this vector and another DisplayVector3D in degrees.

cross(other)[source]

Get the cross product of this vector and another DisplayVector3D.

dot(other)[source]

Get the dot product of this vector with another DisplayVector3D.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Initialize a DisplayVector3D from a dictionary.

Parameters

data – A dictionary representation of an DisplayVector3D object.

normalize()[source]

Ensure that this DisplayVector3D is a unit vector (magnitude=1).

reflect(normal)[source]

Reflect this geometry across a plane with the input normal vector.

Parameters

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

reverse()[source]

Reverse this DisplayVector3D.

rotate(axis, angle)[source]

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

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

  • angle – An angle for rotation in degrees.

rotate_xy(angle)[source]

Rotate this geometry counterclockwise in the world XY plane by an angle.

Parameters

angle – An angle in degrees.

to_dict()[source]

Return DisplayVector3D as a dictionary.

property color

Get or set a color for this object.

property geometry

Get a ladybug_geometry object.

property magnitude

Get the magnitude of the vector.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list, dict)

property x

Get the X coordinate.

property y

Get the Y coordinate.

property z

Get the Z coordinate.