anastruct.preprocess.truss ========================== .. py:module:: anastruct.preprocess.truss Classes ------- .. autoapisummary:: anastruct.preprocess.truss.HoweFlatTruss anastruct.preprocess.truss.PrattFlatTruss anastruct.preprocess.truss.WarrenFlatTruss anastruct.preprocess.truss.KingPostRoofTruss anastruct.preprocess.truss.QueenPostRoofTruss anastruct.preprocess.truss.FinkRoofTruss anastruct.preprocess.truss.HoweRoofTruss anastruct.preprocess.truss.PrattRoofTruss anastruct.preprocess.truss.FanRoofTruss anastruct.preprocess.truss.ModifiedQueenPostRoofTruss anastruct.preprocess.truss.DoubleFinkRoofTruss anastruct.preprocess.truss.DoubleHoweRoofTruss anastruct.preprocess.truss.ModifiedFanRoofTruss anastruct.preprocess.truss.AtticRoofTruss Functions --------- .. autoapisummary:: anastruct.preprocess.truss.create_truss Module Contents --------------- .. py:class:: 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: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: 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: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: WarrenFlatTruss(width: float, height: float, unit_width: float, end_type: EndType = 'triangle_down', supports_loc: SupportLoc = 'bottom_chord', top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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". .. py:attribute:: EndType .. py:attribute:: SupportLoc .. py:attribute:: unit_width :type: float .. py:attribute:: end_type :type: WarrenFlatTruss.EndType .. py:attribute:: supports_loc :type: WarrenFlatTruss.SupportLoc .. py:attribute:: n_units :type: int .. py:attribute:: end_width :type: float .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: KingPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: QueenPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: FinkRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: HoweRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: PrattRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: FanRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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). .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: ModifiedQueenPostRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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). .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: DoubleFinkRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: DoubleHoweRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: ModifiedFanRoofTruss(width: float, roof_pitch_deg: float, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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. .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:class:: AtticRoofTruss(width: float, roof_pitch_deg: float, attic_width: float, attic_height: Optional[float] = None, overhang_length: float = 0.0, top_chord_section: Optional[anastruct._types.SectionProps] = None, bottom_chord_section: Optional[anastruct._types.SectionProps] = None, web_section: Optional[anastruct._types.SectionProps] = None, web_verticals_section: Optional[anastruct._types.SectionProps] = None) Bases: :py:obj:`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 .. py:attribute:: attic_width :type: float .. py:attribute:: attic_height :type: float .. py:attribute:: wall_x :type: float .. py:attribute:: wall_y :type: float .. py:attribute:: ceiling_y :type: float .. py:attribute:: ceiling_x :type: float .. py:attribute:: wall_ceiling_intersect :type: bool :value: False .. py:property:: type :type: str Return the human-readable name of the truss type. .. py:method:: define_nodes() -> None Generate node coordinates and populate self.nodes list. Must be implemented by subclasses. Should create Vertex objects representing all node locations in the truss. .. py:method:: define_connectivity() -> None 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 .. py:function:: create_truss(truss_type: str, **kwargs: Any) -> anastruct.preprocess.truss_class.Truss 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)