ladybug_display.geometry3d.face module

A single planar face that can be displayed in 3D space.

class ladybug_display.geometry3d.face.DisplayFace3D(geometry, color=None, display_mode='Surface')[source]

Bases: _SingleColorModeBase3D

A single planar face in 3D space with display properties.

Parameters:
  • geometry – A ladybug-geometry Face3D.

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

  • display_mode

    Text to indicate the display mode (surface, wireframe, etc.). Choose from the following. (Default: Surface).

    • Surface

    • SurfaceWithEdges

    • Wireframe

    • Points

Properties:
  • geometry

  • color

  • display_mode

  • vertices

  • normal

  • center

  • area

  • perimeter

  • min

  • max

  • altitude

  • azimuth

  • user_data

ToString()
duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Initialize a DisplayFace3D from a dictionary.

Parameters:

data – A dictionary representation of an DisplayFace3D object.

move(moving_vec)

Move this geometry along a vector.

Parameters:

moving_vec – A ladybug_geometry Vector with the direction and distance to move the geometry.

reflect(plane)

Reflect this geometry across a plane.

Parameters:

plane – A ladybug_geometry Plane across which the object will be reflected.

rotate(axis, angle, origin)

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.

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

rotate_xy(angle, origin)

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

Parameters:
  • angle – An angle in degrees.

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

scale(factor, origin=None)

Scale this geometry by a factor from an origin point.

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

  • origin – A ladybug_geometry Point representing the origin from which to scale. If None, it will be scaled from the World origin.

to_dict(include_plane=True)[source]

Return DisplayFace3D as a dictionary.

Parameters:

include_plane – Boolean to note wether the plane of the Face3D should be included in the output. This can preserve the orientation of the X/Y axes of the plane but is not required and can be removed to keep the dictionary smaller. (Default: True).

property altitude

Get the altitude of the geometry between +90 (up) and -90 (down).

property area

Get the area of the face.

property azimuth

Get the azimuth of the geometry, between 0 and 360.

Given Y-axis as North, 0 = North, 90 = East, 180 = South, 270 = West This will be zero if the Face3D is perfectly horizontal.

property center

Get a Point3D for the center of the face.

Note that this is the center of the bounding rectangle around this geometry and not the area centroid.

property color

Get or set a color for this object.

property display_mode

Get or set text to indicate the display mode.

property geometry

Get a ladybug_geometry object.

property max

Get a Point3D for the maximum of the bounding box around the object.

property min

Get a Point3D for the minimum of the bounding box around the object.

property normal

Get a Vector3D for the direction in which the face is pointing.

property perimeter

Get the perimeter of the face. This includes the length of holes in the face.

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 vertices

Get a list of vertices for the face (in counter-clockwise order).