ladybug_display.geometry3d.text module¶
Class for specifying text within the 3D scene.
- class ladybug_display.geometry3d.text.DisplayText3D(text, plane, height, color=None, font='Arial', horizontal_alignment='Left', vertical_alignment='Bottom')[source]¶
Bases:
_SingleColorBase3D
A text object in 3D space with display properties.
- Parameters:
text – A text string to be displayed in the 3D scene.
plane – A ladybug-geometry Plane object to locate and orient the text in the 3D scene.
height – A number for the height of the text in the 3D scene.
color – A ladybug Color object. If None, a default black color will be used. (Default: None).
font – A text string for the font in which to draw the text. Note that this field may not be interpreted the same on all machines and in all interfaces, particularly when a machine lacks a given font. (Default: Arial)
horizontal_alignment –
String to specify the horizontal alignment of the text. (Default: Left). Choose from:
Left
Center
Right
vertical_alignment –
String to specify the vertical alignment of the text. (Default: Bottom). Choose from:
Top
Middle
Bottom
- Properties:
text
plane
geometry
height
color
font
horizontal_alignment
vertical_alignment
min
max
user_data
- ToString()¶
- duplicate()¶
Get a copy of this object.
- classmethod from_dict(data)[source]¶
Initialize a DisplayText3D from a dictionary.
- Parameters:
data – A dictionary representation of an DisplayText3D 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.
- HORIZONTAL_ALIGN = ('Left', 'Center', 'Right')¶
- VERTICAL_ALIGN = ('Top', 'Middle', 'Bottom')¶
- property color¶
Get or set a color for this object.
- property font¶
Get or set a string for the font in which to draw the text.
- property geometry¶
Get a ladybug_geometry object.
- property height¶
Get or set a number for the height of the text in the 3D scene.
- property horizontal_alignment¶
Get or set text to specify the horizontal alignment.
- 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 plane¶
Get a ladybug_geometry Plane for the text.
- property text¶
Get or set a text string to be displayed in the 3D scene.
- 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 vertical_alignment¶
Get or set text to specify the vertical alignment.