Text

class compas_timber.fabrication.Text[source]

Bases: BTLxProcessing

Represents a Text feature to be made on a beam.

Parameters:
textstr

The text to be engraved on the beam.

start_xfloat, optional

The start x-coordinate of the cut in parametric space of the reference side. -100000.0 < start_x < 100000.0. Default is 0.0.

start_yfloat, optional

The start y-coordinate of the cut in parametric space of the reference side. -50000.0 < start_y < 50000.0. Default is 0.0.

anglefloat, optional

The horizontal angle of the first cut. -180.0 < angle < 180.0. Default is 0.0.

alignment_vertical{AlignmentType.BOTTOM, AlignmentType.CENTER or AlignmentType.TOP}, optional

The vertical alignment of the text. Default is AlignmentType.BOTTOM.

alignment_horizontal{AlignmentType.LEFT, AlignmentType.CENTER or AlignmentType.RIGHT}, optional

The horizontal alignment of the text. Default is AlignmentType.LEFT.

alignment_multiline{AlignmentType.LEFT, AlignmentType.CENTER or AlignmentType.RIGHT}, optional

The alignment of the text in multiline mode. Default is AlignmentType.LEFT.

stacked_markingbool, optional

If the text is a stacked marking. Default is False.

text_height_autobool, optional

If the text height is automatically calculated. Default is True.

text_heightfloat, optional

The height of the text. 0 < text_height < 50000.0. Default is 20.0.

Methods

apply

Apply the feature to the beam geometry.

create_text_curves_for_element

This returns translated and scaled curves which correspond to the text and the element the text is engraved on.

scale

Scale the parameters of this processing by a given factor.

Inherited Methods

ToString

Converts the instance to a string.

add_subprocessing

Add a nested subprocessing.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

scaled

Returns a new instance of the processing with the parameters scaled by a given factor.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

validate_data

Validate the data against the object's data schema.