ladybug_display.geometry3d.polyface module

A polyface in 3D space with display properties.

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

Bases: _SingleColorModeBase3D

A polyface in 3D space with display properties.

Parameters:
  • geometry – A ladybug-geometry Polyface3D.

  • 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

  • faces

  • edges

  • naked_edges

  • internal_edges

  • non_manifold_edges

  • face_indices

  • edge_indices

  • edge_types

  • min

  • max

  • center

  • area

  • volume

  • is_solid

  • user_data

ToString()
duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Initialize a DisplayPolyface3D from a dictionary.

Parameters:

data – A dictionary representation of an DisplayPolyface3D 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()[source]

Return DisplayPolyface3D as a dictionary.

property area

Get the area of the polyface.

property center

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

property color

Get or set a color for this object.

property display_mode

Get or set text to indicate the display mode.

property edge_indices

Get a tuple of edge tuples with integers corresponding to indices of vertices.

property edge_types

Get a tuple of integers for each edge that denotes the type of edge.

0 denotes a naked edge, 1 denotes an internal edge, and anything higher is a non-manifold edge.

property edges

Get a tuple of all edges in this polyface as LineSegment3D objects.

property face_indices

Get a tuple of face tuples with integers corresponding to indices of vertices.

property faces

Get a tuple of all Face3D objects making up this polyface.

property geometry

Get a ladybug_geometry object.

property internal_edges

Get a tuple of all internal edges in this polyface as LineSegment3D objects.

property is_solid

Get a boolean to note whether the polyface is solid (True) or is open (False).

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 naked_edges

Get a tuple of all naked edges in this polyface as LineSegment3D objects.

property non_manifold_edges

Get a tuple of all non-manifold edges as LineSegment3D objects.

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 tuple of vertices in the polyface.

property volume

Get the volume of the polyface.