anastruct.preprocess.truss
Classes
Howe flat truss with vertical web members and diagonal members in compression. |
|
Pratt flat truss with vertical web members and diagonal members in tension. |
|
Warren flat truss with diagonal-only web members forming a zigzag pattern. |
|
King Post roof truss - simplest pitched roof truss with single center vertical. |
|
Queen Post roof truss with two vertical members and diagonal bracing. |
|
Fink roof truss with W-shaped web configuration. |
|
Howe roof truss with vertical posts and diagonal compression members. |
|
Pratt roof truss with vertical posts and diagonal tension members. |
|
Fan roof truss with radiating diagonal members forming a fan pattern. |
|
Modified Queen Post roof truss with enhanced web configuration. |
|
Double Fink roof truss with two W-shaped web patterns. |
|
Double Howe roof truss with enhanced vertical and diagonal web pattern. |
|
Modified Fan roof truss with enhanced radiating web pattern. |
|
Attic (or Room-in-Roof) truss with habitable space under the roof. |
Functions
|
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.FlatTrussHowe 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.
- 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.FlatTrussPratt 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.
- 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.FlatTrussWarren 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”.
- 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.RoofTrussKing 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.
- 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.RoofTrussQueen 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.
- 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.RoofTrussFink 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.
- 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.RoofTrussHowe 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.
- 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.RoofTrussPratt 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.
- 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.RoofTrussFan 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).
- 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.RoofTrussModified 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).
- 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.RoofTrussDouble 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.
- 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.RoofTrussDouble 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.
- 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.RoofTrussModified 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.
- 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.RoofTrussAttic (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
- 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)