anastruct.preprocess.truss

Classes

HoweFlatTruss

Howe flat truss with vertical web members and diagonal members in compression.

PrattFlatTruss

Pratt flat truss with vertical web members and diagonal members in tension.

WarrenFlatTruss

Warren flat truss with diagonal-only web members forming a zigzag pattern.

KingPostRoofTruss

King Post roof truss - simplest pitched roof truss with single center vertical.

QueenPostRoofTruss

Queen Post roof truss with two vertical members and diagonal bracing.

FinkRoofTruss

Fink roof truss with W-shaped web configuration.

HoweRoofTruss

Howe roof truss with vertical posts and diagonal compression members.

PrattRoofTruss

Pratt roof truss with vertical posts and diagonal tension members.

FanRoofTruss

Fan roof truss with radiating diagonal members forming a fan pattern.

ModifiedQueenPostRoofTruss

Modified Queen Post roof truss with enhanced web configuration.

DoubleFinkRoofTruss

Double Fink roof truss with two W-shaped web patterns.

DoubleHoweRoofTruss

Double Howe roof truss with enhanced vertical and diagonal web pattern.

ModifiedFanRoofTruss

Modified Fan roof truss with enhanced radiating web pattern.

AtticRoofTruss

Attic (or Room-in-Roof) truss with habitable space under the roof.

Functions

create_truss(→ anastruct.preprocess.truss_class.Truss)

Factory function to create truss instances by type name.

Module Contents

class anastruct.preprocess.truss.HoweFlatTruss(width: float, height: float, unit_width: float, end_type: EndType = 'triangle_down', supports_loc: SupportLoc = 'bottom_chord', min_end_fraction: float = 0.5, enforce_even_units: bool = True, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.FlatTruss

Howe flat truss with vertical web members and diagonal members in compression.

The Howe truss features vertical web members and diagonal members sloping toward the center. Under gravity loads, diagonals are typically in compression and verticals in tension, making it efficient for steel trusses.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.PrattFlatTruss(width: float, height: float, unit_width: float, end_type: EndType = 'triangle_down', supports_loc: SupportLoc = 'bottom_chord', min_end_fraction: float = 0.5, enforce_even_units: bool = True, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.FlatTruss

Pratt flat truss with vertical web members and diagonal members in tension.

The Pratt truss features vertical web members and diagonal members sloping away from the center. Under gravity loads, diagonals are typically in tension and verticals in compression, making it efficient for a wide range of applications.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.WarrenFlatTruss(width: float, height: float, unit_width: float, end_type: EndType = 'triangle_down', supports_loc: SupportLoc = 'bottom_chord', top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.FlatTruss

Warren flat truss with diagonal-only web members forming a zigzag pattern.

The Warren truss has no vertical web members (except optionally at midspan). Diagonal members alternate direction, creating a series of equilateral or isosceles triangles. This configuration is simple and efficient.

Note: Warren trusses don’t support the “flat” end_type - only “triangle_down” or “triangle_up”.

EndType[source]
SupportLoc[source]
unit_width: float[source]
end_type: WarrenFlatTruss.EndType[source]
supports_loc: WarrenFlatTruss.SupportLoc[source]
n_units: int[source]
end_width: float[source]
property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.KingPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

King Post roof truss - simplest pitched roof truss with single center vertical.

Features a single vertical member (king post) at the center supporting the peak. Suitable for short spans (up to ~8m). No diagonal web members.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.QueenPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Queen Post roof truss with two vertical members and diagonal bracing.

Features two vertical members (queen posts) at quarter points with diagonal members from center to quarter points. Suitable for medium spans (8-15m). More efficient than King Post for longer spans.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.FinkRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Fink roof truss with W-shaped web configuration.

Features diagonal members forming a W pattern between peak and supports. Efficient for medium to long spans (10-20m). The symmetrical W pattern distributes loads effectively with minimal material usage.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.HoweRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Howe roof truss with vertical posts and diagonal compression members.

Features vertical posts with diagonals sloping toward the peak. Under gravity loads, diagonals are in compression and verticals in tension. Suitable for medium to long spans with good load distribution.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.PrattRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Pratt roof truss with vertical posts and diagonal tension members.

Features vertical posts with diagonals sloping away from the peak. Under gravity loads, diagonals are in tension and verticals in compression. Widely used for its efficiency and simple construction.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.FanRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Fan roof truss with radiating diagonal members forming a fan pattern.

Features diagonal members radiating from lower chord panel points up to the top chord, creating a fan-like appearance. Provides excellent load distribution for longer spans (15-25m).

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.ModifiedQueenPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Modified Queen Post roof truss with enhanced web configuration.

An enhanced version of the Queen Post truss with additional web members for better load distribution and reduced member forces. Suitable for medium to long spans (12-20m).

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.DoubleFinkRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Double Fink roof truss with two W-shaped web patterns.

An extension of the Fink truss with additional web members creating two W patterns. Suitable for longer spans (20-30m) where a standard Fink would have excessive member lengths.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.DoubleHoweRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Double Howe roof truss with enhanced vertical and diagonal web pattern.

An extension of the Howe truss with additional verticals and diagonals for increased load capacity and reduced member lengths. Suitable for long spans (20-30m) or heavy loading conditions.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.ModifiedFanRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Modified Fan roof truss with enhanced radiating web pattern.

An enhanced version of the Fan truss with additional web members for improved structural performance. Suitable for long spans (20-30m) with excellent load distribution characteristics.

property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

class anastruct.preprocess.truss.AtticRoofTruss(width: float, roof_pitch_deg: float, attic_width: float, attic_height: float | None = None, overhang_length: float = 0.0, top_chord_section: anastruct._types.SectionProps | None = None, bottom_chord_section: anastruct._types.SectionProps | None = None, web_section: anastruct._types.SectionProps | None = None, web_verticals_section: anastruct._types.SectionProps | None = None)[source]

Bases: anastruct.preprocess.truss_class.RoofTruss

Attic (or Room-in-Roof) truss with habitable space under the roof.

Creates a truss with vertical walls and a flat ceiling to provide usable attic space. The geometry includes: - Vertical attic walls at the edges of the attic space - Horizontal ceiling beam - Sloped top chords from walls to peak - Diagonal and vertical web members for support

The attic space is defined by attic_width (floor width) and attic_height (ceiling height). If attic_height is not specified, it defaults to the height where the vertical walls meet the sloped roof.

Attributes:

attic_width (float): Width of the attic floor (interior dimension) attic_height (float): Height of the attic ceiling wall_x (float): Horizontal position where attic walls are located wall_y (float): Height at top of attic walls where they meet the roof slope ceiling_y (float): Vertical position of the ceiling beam (equals attic_height) ceiling_x (float): Horizontal position where ceiling meets the sloped top chord wall_ceiling_intersect (bool): True if wall top and ceiling intersection coincide

attic_width: float[source]
attic_height: float[source]
wall_x: float[source]
wall_y: float[source]
ceiling_y: float[source]
ceiling_x: float[source]
wall_ceiling_intersect: bool = False[source]
property type: str[source]

Return the human-readable name of the truss type.

define_nodes() None[source]

Generate node coordinates and populate self.nodes list.

Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss.

define_connectivity() None[source]

Define element connectivity by populating node ID lists.

Must be implemented by subclasses. Should populate: - self.top_chord_node_ids - self.bottom_chord_node_ids - self.web_node_pairs - self.web_verticals_node_pairs

anastruct.preprocess.truss.create_truss(truss_type: str, **kwargs: Any) anastruct.preprocess.truss_class.Truss[source]

Factory function to create truss instances by type name.

Provides a convenient way to create trusses without importing specific classes. Type names are case-insensitive and can use underscores or hyphens as separators.

Args:
truss_type (str): Name of the truss type. Supported types:

Flat trusses: “howe”, “pratt”, “warren” Roof trusses: “king_post”, “queen_post”, “fink”, “howe_roof”, “pratt_roof”,

“fan”, “modified_queen_post”, “double_fink”, “double_howe”, “modified_fan”, “attic”

**kwargs: Arguments to pass to the truss constructor

Returns:

Truss: An instance of the requested truss type

Raises:

ValueError: If truss_type is not recognized

Examples:
>>> truss = create_truss("howe", width=20, height=2.5, unit_width=2.0)
>>> truss = create_truss("king-post", width=10, roof_pitch_deg=30)