### Run a Concrete Material Example in Python Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/sprint-guide.md Demonstrates how to create a ConcreteMaterial object with a specified strength class and print its design strength. This example requires the Blueprints library to be installed. ```python from blueprints.materials.concrete import ConcreteMaterial, ConcreteStrengthClass concrete = ConcreteMaterial(concrete_class=ConcreteStrengthClass.C30_37) print(f"Design strength: {concrete.f_cd} MPa") ``` -------------------------------- ### Install Blueprints Dependencies and Setup Environment Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md The `blueprints install` command synchronizes all project dependencies. It automatically creates a virtual environment (venv) if one is not detected. ```bash blueprints install ``` -------------------------------- ### Install Packages with Flags using blueprints install Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs packages using the blueprints CLI, supporting various flags for customization. Examples include upgrading all packages to their latest versions or specifying a particular Python version for the installation environment. ```bash blueprints install --upgrade ``` ```bash blueprints install --python 3.13 ``` -------------------------------- ### Install Development Version from GitHub (uv) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs the latest development version of Blueprints from GitHub using uv. This method fetches the code directly from the repository. ```bash uv add git+https://github.com/Blueprints-org/blueprints.git ``` -------------------------------- ### Verify Blueprints Installation (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Python code snippet to verify the Blueprints installation by importing the library and printing its version. This confirms that the package was installed correctly and is accessible. ```python import blueprints print(blueprints.__version__) ``` -------------------------------- ### Install Development Version from GitHub (pip) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs the latest development version of Blueprints directly from its GitHub repository using pip. This is useful for testing the newest features or contributing to the project. ```bash pip install git+https://github.com/Blueprints-org/blueprints.git ``` -------------------------------- ### Install uv CLI Tool Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs the `uv` command-line tool, a requirement for the Blueprints CLI. Installation can be done via pip or by following the provided GitHub link. ```bash pip install uv # or visit https://github.com/astral-sh/uv ``` -------------------------------- ### Serve Documentation Locally with blueprints docs Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Starts a local documentation server with live reload capabilities. The server opens at http://localhost:8000 and automatically refreshes the browser when documentation files are updated. This is ideal for actively working on documentation. Press Ctrl+C to stop the server. ```bash blueprints docs ``` -------------------------------- ### Install Latest Blueprints Release (uv) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs the latest stable release of the Blueprints package using the uv package installer. This is an alternative to pip for managing Python packages. ```bash uv add blue-prints ``` -------------------------------- ### Install Latest Blueprints Release (pip) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs the latest stable release of the Blueprints package from PyPI using pip. Ensure you have pip installed and a compatible Python version. ```bash pip install blue-prints ``` -------------------------------- ### Install Blueprints CLI Dependencies Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs the Blueprints CLI along with its necessary dependencies using the `uv sync` command with the `cli` group. ```bash uv sync --group cli ``` -------------------------------- ### Install Specific Blueprints Version (uv) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs a specific version of the Blueprints package using uv. Replace '0.5.2' with the desired version number. ```bash uv add blue-prints==0.5.2 ``` -------------------------------- ### Install uv Package Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs the 'uv' package, a fast Python package installer and resolver. This is a prerequisite for using 'uv' commands. ```bash pip install uv ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/sprint-guide.md Installs all project dependencies, including development and testing groups, using the uv package manager. This command ensures all necessary packages are available for development. ```shell uv sync --all-groups ``` -------------------------------- ### Install Blueprints CLI Dependencies Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs the necessary dependencies for the Blueprints CLI. This can be done using either pip or uv, ensuring the 'cli' extra is included. ```bash # With pip pip install blue-prints[cli] ``` ```bash # With uv uv sync --group cli ``` -------------------------------- ### Install Specific Blueprints Version (pip) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Installs a specific version of the Blueprints package from PyPI using pip. Replace '0.5.2' with the desired version number. ```bash pip install blue-prints==0.5.2 ``` -------------------------------- ### Show Blueprints CLI Help Information Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Displays general help information for the Blueprints CLI or specific help for individual commands. The `bp` alias can also be used. ```console blueprints --help # Show general help blueprints --help # Show command-specific help ``` ```console ======================================================================== Blueprints CLI - vx.y.z ======================================================================== Usage: blueprints [OPTIONS] COMMAND [ARGS]... Blueprints - Development automation CLI ╭─ Options ────────────────────────────────────────────────────────────╮ │ --version -v Show the CLI version. │ --help Show this message and exit. ╰──────────────────────────────────────────────────────────────────────╯ ╭─ Commands ───────────────────────────────────────────────────────────╮ │ install Sync all dependencies and create venv if needed. │ lint Lint with Ruff. │ formatting Enforce formatting compliance using Ruff's formatter. │ typecheck Run static type checks with ty. │ test Run tests with pytest. │ coverage Run tests and generate coverage reports. │ check Run all quality checks before making a PR. │ docs Serve documentation locally with live reload. ╰──────────────────────────────────────────────────────────────────────╯ ``` -------------------------------- ### Check Blueprints CLI Version Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Displays the current version of the Blueprints CLI. This command is useful for verifying the installed version and ensuring compatibility. ```bash blueprints --version ``` -------------------------------- ### Export Report to PDF File (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Shows how to save a report directly to a PDF file. This requires a LaTeX distribution (like MiKTeX or TeX Live) with `pdflatex` installed on your system. ```python from blueprints.utils.report import Report # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_paragraph("Some content here.") # Save to PDF file report.to_pdf("report.pdf") ``` -------------------------------- ### Check Python Version (Bash) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/installation.md Command to check the currently installed Python version. This is a prerequisite for installing Blueprints, which requires Python 3.12 or higher. ```bash python --version ``` -------------------------------- ### Install Test Dependencies for Blueprints Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Installs the 'test' group dependencies, which includes 'pytest', to resolve 'No module named pytest' errors during testing. Reinstalling with the 'test' group ensures all testing requirements are met. ```bash uv sync --group test ``` -------------------------------- ### Export Report to Word Document Bytes (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Illustrates how to get the Word document content as bytes, which is useful for in-memory processing, web downloads, or email attachments without saving to a file directly. ```python from blueprints.utils.report import Report from io import BytesIO # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_paragraph("Some content here.") # Write to bytes (useful for web downloads, email attachments, etc.) docx_bytes = report.to_word() print(f"Document size: {len(docx_bytes)} bytes") ``` -------------------------------- ### Apply Eurocode Formula for Concrete Cover (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/quick_start.md This snippet demonstrates using a specific Eurocode formula (4.1) to calculate nominal concrete cover. It requires importing the relevant formula class (`Form4Dot1NominalConcreteCover`) from `blueprints.codes.eurocode` and providing the necessary input parameters like `c_min` and `delta_c_dev`. ```python # Create a Formula instance using Eurocode formula 4.1: c_nom = c_min + Δc_dev from blueprints.codes.eurocode.nen_en_1992_1_1_a1_2020.chapter_4_durability_and_cover.formula_4_1 import Form4Dot1NominalConcreteCover c_min = 25.0 # mm delta_c_dev = 10.0 # mm concrete_cover = Form4Dot1NominalConcreteCover(c_min=c_min, delta_c_dev=delta_c_dev) print(f"Formula result: {concrete_cover} mm") print(f"Formula label: {concrete_cover.label}") print(f"Source document: {concrete_cover.source_document}") print(f"Stored parameters: c_min={concrete_cover.c_min}, delta_c_dev={concrete_cover.delta_c_dev}") ``` -------------------------------- ### Check Project with Blueprints CLI Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/sprint-guide.md Runs the Blueprints command-line interface check command. This command verifies the project's code quality, style, and test coverage, ensuring it meets project standards. ```shell blueprints check ``` -------------------------------- ### Calculate Concrete Material Properties (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/quick_start.md This snippet demonstrates how to create a concrete material object and access its properties like characteristic strength (fck) and design strength (fcd) according to Eurocode standards. It requires the `ConcreteMaterial` and `ConcreteStrengthClass` from the `blueprints.materials.concrete` module. ```python from blueprints.materials.concrete import ConcreteMaterial, ConcreteStrengthClass # Create a C30/37 concrete material concrete = ConcreteMaterial(concrete_class=ConcreteStrengthClass.C30_37) # Access material properties print(f"Concrete: {concrete.name}") print(f"Characteristic strength (fck): {concrete.f_ck} MPa") print(f"Design strength (fcd): {concrete.f_cd} MPa") print(f"Mean tensile strength (fctm): {concrete.f_ctm:.2f} MPa") ``` -------------------------------- ### Format Code with blueprints formatting Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Applies code formatting using Ruff. By default, this command modifies files in place. To only check for formatting compliance without making changes, use the `--check` flag. Specific formatting options like line length can also be configured. ```bash blueprints formatting ``` ```bash blueprints formatting --check ``` ```bash blueprints formatting --line-length 100 ``` -------------------------------- ### Run Tests with blueprints test Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Executes all tests in parallel using pytest with the xdist plugin. The `--light` flag can be used to skip slow tests for faster iteration. Additional pytest flags can be passed through to customize test execution, such as filtering tests or enabling verbose output. ```bash blueprints test ``` ```bash blueprints test --light ``` ```bash blueprints test -k test_specific ``` ```bash blueprints test --verbose --pdb ``` ```bash blueprints test -x ``` ```bash blueprints test --light -k test_fast ``` -------------------------------- ### Perform Linting with blueprints lint Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Runs the Ruff linter to check code style and quality. This command helps ensure code consistency across the project. It can also accept flags to auto-fix issues or select specific linting rules. ```bash blueprints lint ``` ```bash blueprints lint --fix ``` ```bash blueprints lint --select E501 ``` ```bash blueprints lint --show-fixes ``` -------------------------------- ### Generate Coverage Reports with blueprints coverage Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Runs tests with coverage reporting and enforces 100% coverage by default. Generates a terminal report and can optionally produce XML and HTML reports for CI/CD integration and detailed analysis. The `--no-enforce` flag disables the 100% coverage requirement. ```bash blueprints coverage ``` ```bash blueprints coverage --xml ``` ```bash blueprints coverage --html ``` ```bash blueprints coverage --xml --html ``` ```bash blueprints coverage --no-enforce ``` ```bash blueprints coverage -k test_pattern ``` -------------------------------- ### Perform Type Checking with blueprints typecheck Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/contribute/cli.md Executes the ty static type checker on the blueprints package. This command helps catch type-related errors before runtime. Options for verbose or quiet output are available. ```bash blueprints typecheck ``` ```bash blueprints typecheck --verbose ``` ```bash blueprints typecheck --quiet ``` -------------------------------- ### Create Standard Steel Strip Profile Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_strip_profile.ipynb Instantiates a standard steel strip profile using a predefined type, such as STRIP160x5. This allows for quick creation of common steel sections. ```python strip_profile = Strip.STRIP160x5 ``` -------------------------------- ### Calculate Reinforcement Steel Properties (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/quick_start.md This snippet shows how to instantiate a reinforcement steel material object and retrieve its key mechanical properties such as characteristic yield strength (fyk) and design yield strength (fyd). It utilizes the `ReinforcementSteelMaterial` and `ReinforcementSteelQuality` classes from `blueprints.materials.reinforcement_steel`. ```python from blueprints.materials.reinforcement_steel import ReinforcementSteelMaterial, ReinforcementSteelQuality # Create B500B reinforcement steel rebar = ReinforcementSteelMaterial(steel_quality=ReinforcementSteelQuality.B500B) print(f"Steel quality: {rebar.name}") print(f"Characteristic yield strength (fyk): {rebar.f_yk} MPa") print(f"Design yield strength (fyd): {rebar.f_yd:.2f} MPa") print(f"Modulus of elasticity (Es): {rebar.e_s} MPa") ``` -------------------------------- ### Export Report to PDF Bytes (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Demonstrates obtaining the PDF report content as bytes. This is useful for streaming, email attachments, or storing in databases without creating a physical file. ```python from blueprints.utils.report import Report # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_paragraph("Some content here.") # Get PDF bytes directly pdf_bytes = report.to_pdf() print(f"PDF size: {len(pdf_bytes)} bytes") # Now you can stream it, send as email attachment, store in database, etc. ``` -------------------------------- ### Export Report to PDF with Debugging Files (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Explains how to generate a PDF report while keeping auxiliary LaTeX files (like `.aux`, `.log`, `.out`) for debugging purposes. Set `cleanup=False` to retain these files. ```python from blueprints.utils.report import Report # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_paragraph("Some content here.") # Keep .aux, .log, .out files alongside the PDF for debugging LaTeX issues report.to_pdf("report.pdf", cleanup=False) ``` -------------------------------- ### Export Report to Word Document File (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Demonstrates exporting a report to a Word document (`.docx`) and saving it to a specified file path. This method is useful for direct document creation. ```python from blueprints.utils.report import Report # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_paragraph("Some content here.") # Save to file report.to_word("report.docx") ``` -------------------------------- ### Create and Plot Rectangular Reinforced Cross-Section (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/getting_started/quick_start.md This snippet illustrates the creation of a rectangular reinforced concrete cross-section, including applying concrete cover and adding longitudinal reinforcement. It then generates a plot of the cross-section. Dependencies include classes for covers, reinforced sections, and plotting utilities. The output is an SVG representation of the plot. ```python from blueprints.structural_sections.concrete.covers import CoversRectangular from blueprints.structural_sections.concrete.reinforced_concrete_sections.rectangular import RectangularReinforcedCrossSection applied_cover = 5 + concrete_cover # Define a rectangular reinforced cross-section cs = RectangularReinforcedCrossSection( width=1000, height=800, covers=CoversRectangular(upper=applied_cover, right=applied_cover, lower=applied_cover, left=applied_cover), concrete_material=concrete, ) # Add reinforcement to the upper edge cs.add_longitudinal_reinforcement_by_quantity( n=10, diameter=16, edge="lower", material=rebar, ) # Plot the cross-section fig = cs.plot(show=False) #change show to True in your local example to show the plot directly from io import StringIO # markdown-exec: hide import matplotlib.pyplot as plt # markdown-exec: hide buffer = StringIO() # markdown-exec: hide plt.savefig(buffer, format="svg") # markdown-exec: hide print(buffer.getvalue()) # markdown-exec: hide ``` -------------------------------- ### Create Custom Steel Profiles (Python) Source: https://context7.com/blueprints-org/blueprints/llms.txt Shows how to define custom asymmetric I-profiles and circular hollow sections using dedicated classes. It includes setting dimensions, material properties, calculating section properties (area, moments of inertia), and plotting the profile. This allows for non-standard geometries. ```python from blueprints.structural_sections.steel.profile_definitions import IProfile, CHSProfile # Custom asymmetric I-profile custom_i = IProfile( top_flange_width=300, # mm top_flange_thickness=20, # mm bottom_flange_width=200, # mm bottom_flange_thickness=10, # mm total_height=600, # mm web_thickness=10, # mm top_radius=15, # mm - fillet radius bottom_radius=8, # mm ) # Get section properties props = custom_i.section_properties() print(f"Area: {props.area:.0f} mm^2") print(f"Ixx: {props.ixx_g:.2e} mm^4") print(f"Iyy: {props.iyy_g:.2e} mm^4") # Plot the custom profile fig = custom_i.plot(show=True) # Custom circular hollow section custom_chs = CHSProfile( outer_diameter=400, # mm wall_thickness=12, # mm ) chs_props = custom_chs.section_properties() ``` -------------------------------- ### Create Engineering Report with Blueprints (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md This Python code demonstrates how to create a detailed engineering report using the `Report` class. It includes adding headings, paragraphs with formatting, standalone and inline equations, formulas from Eurocode standards, tables, figures, and various list types. The output is a LaTeX formatted string. ```python from blueprints.utils.report import Report from blueprints.codes.eurocode.en_1993_1_1_2005.chapter_6_ultimate_limit_state import formula_6_5 from blueprints.codes.eurocode.en_1992_1_1_2004.chapter_6_ultimate_limit_state import formula_6_6n # Create report with title report = Report(title="Steel Member Design Verification") # --- HEADINGS (3 levels) --- report.add_heading("Introduction") report.add_heading("Project Background", level=2) report.add_heading("Design Standards", level=3) # --- PARAGRAPHS (text formatting) --- report.add_paragraph("This report verifies the tensile capacity of a steel member.") report.add_paragraph("All calculations follow Eurocode standards.", bold=True) report.add_paragraph("Values shown are for demonstration purposes.", italic=True) report.add_paragraph("Critical results are highlighted.", bold=True, italic=True) report.add_newline() # --- EQUATIONS (standalone and inline) --- report.add_heading("Theoretical Background", level=2) report.add_paragraph("The fundamental relationship for stress is:") report.add_equation(equation=r"\sigma = \frac{F}{A}", tag="Stress Formula") report.add_paragraph("Where ").add_equation(r"\sigma", inline=True).add_paragraph(" is stress, ") report.add_equation(r"F", inline=True).add_paragraph(" is force, and ") report.add_equation(r"A", inline=True).add_paragraph(" is area.") report.add_newline(n=2) # --- BLUEPRINTS FORMULAS (all options) --- report.add_heading("Design Calculations") report.add_heading("Tensile Strength Check", level=2) unty_check = formula_6_5.Form6Dot5UnityCheckTensileStrength(n_ed=150000, n_t_rd=200000) # Short form (result only) report.add_paragraph("Quick result:", bold=True) report.add_formula(unity_check, options="short") # Complete form (full derivation) report.add_paragraph("Full calculation:", bold=True) report.add_formula(unity_check, options="complete") # Without source document in tag report.add_paragraph("Formula number only:", bold=True) report.add_formula(unity_check, options="complete", include_source=False) # Inline formula report.add_paragraph("The unity check ").add_formula(unity_check, options="short", inline=True) report.add_paragraph(" confirms the member is adequate.") report.add_newline() # Another formula with units report.add_heading("Strength Reduction Factor", level=2) strength_factor = formula_6_6n.Form6Dot6nStrengthReductionFactor(f_ck=35) report.add_formula(strength_factor, options="complete_with_units") # --- TABLES --- report.add_heading("Results Summary") report.add_table( headers=[r"\text{Check}", r"\text{Utilization}", r"\text{Status}"], rows=[ [r"\text{Tensile strength}", "0.750", r"\text{PASS}"], [r"\text{Buckling}", "0.823", r"\text{PASS}"], [r"\text{Combined}", "0.891", r"\text{PASS}"], ] ) # --- FIGURES --- report.add_heading("Diagrams", level=2) report.add_figure("cross_section.png", width=0.5) report.add_figure("stress_diagram.png", width=0.7, caption="Stress distribution along member length") # --- LISTS (bulleted, numbered, nested) --- report.add_heading("Conclusions") # Bulleted list report.add_paragraph("Key findings:", bold=True) report.add_list([ "All unity checks passed", "Maximum utilization: 89.1%", "Safety margin: adequate", ], style="bulleted") # Numbered list report.add_paragraph("Recommended actions:", bold=True) report.add_list([ "Verify connection details", "Check fabrication tolerances", "Confirm material certificates", ], style="numbered") # Nested list report.add_paragraph("Design verification steps:", bold=True) report.add_list([ "Material properties", ["Yield strength", "Ultimate strength", "Elastic modulus"], "Cross-section checks", ["Classification", "Local buckling", ["Web", "Flange"]] ], style="numbered") # --- SPACING --- report.add_newline(n=2) report.add_paragraph("End of report.", italic=True) # Get LaTeX document latex = report.to_latex() print(latex) ``` -------------------------------- ### Create Standard HEB-Profile Instance (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_i_profile.ipynb Instantiates a standard HEB I-profile using a predefined profile size, such as HEB600. This creates an object representing the specific I-beam section. ```python heb_profile = HEB.HEB600 ``` -------------------------------- ### Visualize Circular Reinforced Cross-section Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/reinforced_concrete_sections/circular_reinforced_concrete_cross_section.ipynb Plots the designed circular reinforced concrete cross-section using matplotlib. It requires matplotlib to be installed and generates a visual representation of the cross-section with all its reinforcement details. ```python # Plot the cross-section import matplotlib.pyplot as plt fig = cs.plot(show=False) # Create the plot but don't show it yet plt.show() ``` -------------------------------- ### Create and Add Content to a Report (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Demonstrates creating a report object, adding headings, paragraphs, and formulas. It utilizes method chaining for a concise workflow. The `add_formula` method automatically includes source and formula numbers. ```python from blueprints.utils.report import Report from blueprints.codes.eurocode.en_1993_1_1_2005.chapter_6_ultimate_limit_state import formula_6_5 # Create a report report = Report(title="Steel Connection Analysis") # Add sections and content report.add_heading("Design Checks") report.add_paragraph("We verify the tensile strength capacity:") # Add a formula formula = formula_6_5.Form6Dot5UnityCheckTensileStrength( n_ed=150000, # Applied force (N) n_t_rd=200000, # Resistance (N) ) report.add_formula(formula, options="complete") # Generate the complete LaTeX document latex_code = report.to_latex() print(latex_code) ``` -------------------------------- ### Create Standard CHS Profile Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_chs_profile.ipynb Instantiates a standard CHS profile using a predefined profile name. This allows for quick creation of common steel sections. ```python chs_profile = CHS.CHS139_7x10 ``` -------------------------------- ### Add Sections to Report (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Adds headings to a report using the `add_heading()` method. The `level` parameter controls the heading hierarchy (e.g., level 1 for main titles, level 2 for subheadings). The report can then be exported, for example, to LaTeX. ```python from blueprints.utils.report import Report # Create a report report = Report(title="My report") report.add_heading("Introduction") report.add_heading("Background", level=2) report.add_heading("Technical Details", level=3) print(report.to_latex()) ``` -------------------------------- ### Define Concrete Material Properties for Cover Calculation Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/other_examples/nominal_concrete_cover.ipynb Defines the concrete material properties, specifically the concrete strength class, which is a crucial input for determining the structural class and subsequently the nominal concrete cover. This example uses `ConcreteStrengthClass.C30_37`. ```python concrete_material = ConcreteMaterial(concrete_class=ConcreteStrengthClass.C30_37) ``` -------------------------------- ### Python: Formula Composition with Eurocode Formulas Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/concepts/formulas.md Demonstrates composing formulas by using the output of one Formula object (Form4Dot2MinimumConcreteCover) as the input for another (Form4Dot1NominalConcreteCover). This showcases how Formula objects seamlessly integrate into calculations, preserving their metadata and enabling traceability. ```python # Demonstrate composition using real Eurocode formulas # Formula 4.2 calculates minimum concrete cover c_min_b = 16.0 # mm - minimum cover for bond requirements c_min_dur = 20.0 # mm - minimum cover for durability min_cover = Form4Dot2MinimumConcreteCover( c_min_b=c_min_b, c_min_dur=c_min_dur, delta_c_dur_gamma=0, # reduction for stainless steel delta_c_dur_st=0, # reduction for additional protection delta_c_dur_add=0, # reduction for additional measures ) # Formula 4.1 uses the result of Formula 4.2 as input # Notice how we pass the entire Formula object, not just its value delta_c_dev = 10.0 # mm - construction tolerance nominal_cover = Form4Dot1NominalConcreteCover( c_min=min_cover, # This is a Formula object! delta_c_dev=delta_c_dev, ) print(f"Minimum cover (Formula 4.2): {min_cover} mm") print(f"Nominal cover (Formula 4.1): {nominal_cover} mm") print("\nComposition verification:") print(f" Formula 4.1 received c_min as: {nominal_cover.c_min}") print(f" Type of c_min input: {type(nominal_cover.c_min).__name__}") print(f" Original Formula 4.2 label: {nominal_cover.c_min.label}") ``` -------------------------------- ### Python: Accessing and Using Standard Steel Profiles Source: https://context7.com/blueprints-org/blueprints/llms.txt This Python code demonstrates how to access and utilize standard steel profiles like HEB, IPE, CHS, and RHS from the blueprints library. It shows how to retrieve profile dimensions, apply corrosion allowances, calculate section properties, and visualize the profiles. ```python from blueprints.structural_sections.steel.standard_profiles import HEB, IPE, CHS, RHS # Access standard HEB profile heb200 = HEB.HEB200 print(f"Profile: {heb200.name}") print(f"Height: {heb200.total_height} mm") print(f"Flange width: {heb200.top_flange_width} mm") print(f"Web thickness: {heb200.web_thickness} mm") # Apply corrosion allowance heb200_corroded = heb200.with_corrosion(corrosion=1.5) # mm reduction # Get section properties (area, moment of inertia, etc.) props = heb200.section_properties() # Plot the profile fig = heb200.plot(show=True) # Access IPE profile ipe300 = IPE.IPE300 print(f"IPE300 height: {ipe300.total_height} mm") # Circular hollow section chs = CHS.CHS219_1x6_3 # 219.1mm diameter, 6.3mm wall thickness print(f"CHS outer diameter: {chs.outer_diameter} mm") print(f"CHS wall thickness: {chs.wall_thickness} mm") ``` -------------------------------- ### Plot Standard Steel Strip Profile Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_strip_profile.ipynb Generates and displays a visual plot of the standard steel strip profile. The `plot()` method visualizes the shape of the profile, and `show=True` makes it visible. ```python plot = strip_profile.plot(show=True) ``` -------------------------------- ### Create Custom Steel Strip Profile Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_strip_profile.ipynb Defines a custom steel strip profile by explicitly providing its width and height. This allows for non-standard dimensions tailored to specific design needs. ```python from blueprints.structural_sections.steel.profile_definitions import StripProfile custom_strip_profile = StripProfile( width=100, height=41, ) ``` -------------------------------- ### Export Report to LaTeX File (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/utils/report.md Shows how to save the generated report directly to a LaTeX file (`.tex`). This file can then be compiled using any LaTeX editor or command-line tool. ```python # Save the complete LaTeX document to your local disk (ready for Overleaf or pdflatex) report.to_latex('report.tex') ``` -------------------------------- ### Python: Formula Result Behavior and Metadata Source: https://context7.com/blueprints-org/blueprints/llms.txt Demonstrates how formula results in Python behave like floats while preserving associated metadata such as labels, sources, and parameters. It also shows how to use these results directly in calculations and generate LaTeX documentation. ```python print(f"Result: {concrete_cover} mm") # Output: 35.0 mm print(f"Is float: {isinstance(concrete_cover, float)}") # Output: True # But preserves metadata print(f"Formula label: {concrete_cover.label}") # Output: 4.1 print(f"Source: {concrete_cover.source_document}") # Output: EN 1992-1-1:2004 print(f"Parameters: c_min={concrete_cover.c_min}, delta_c_dev={concrete_cover.delta_c_dev}") # Use in calculations directly total_depth = 500 # mm effective_depth = total_depth - concrete_cover - 16/2 # subtract cover and half bar diameter print(f"Effective depth: {effective_depth} mm") # Output: 457.0 mm # Generate LaTeX documentation latex = concrete_cover.latex() print(f"LaTeX equation: {latex.equation}") # Output: c_{min}+\Delta c_{dev} print(f"Numeric equation: {latex.numeric_equation}") # Output: 25.0+10.0 print(f"Complete: {latex.complete}") # Full formatted equation # Formula composition - use Formula 4.2 result as input to Formula 4.1 min_cover = Form4Dot2MinimumConcreteCover( c_min_b=16.0, # minimum cover for bond c_min_dur=20.0, # minimum cover for durability delta_c_dur_gamma=0, delta_c_dur_st=0, delta_c_dur_add=0, ) nominal_cover = Form4Dot1NominalConcreteCover( c_min=min_cover, # Pass Formula object directly! delta_c_dev=10.0, ) print(f"Composed result: {nominal_cover} mm") # Output: 30.0 mm print(f"Input was Formula: {type(nominal_cover.c_min).__name__}") # Output: Form4Dot2MinimumConcreteCover ``` -------------------------------- ### Import Blueprints Steel Strip Module Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_strip_profile.ipynb Imports the Strip class from the Blueprints library for working with standard steel strip profiles. This is a prerequisite for creating and manipulating standard strip sections. ```python from blueprints.structural_sections.steel.standard_profiles import Strip ``` -------------------------------- ### Python: Rectangular Reinforced Concrete Cross-Section Creation and Visualization Source: https://context7.com/blueprints-org/blueprints/llms.txt This Python code demonstrates how to create a rectangular reinforced concrete cross-section using the `RectangularReinforcedCrossSection` class. It includes defining materials, setting custom covers, adding longitudinal reinforcement and stirrups, and visualizing the section. ```python from blueprints.materials.concrete import ConcreteMaterial, ConcreteStrengthClass from blueprints.materials.reinforcement_steel import ReinforcementSteelMaterial, ReinforcementSteelQuality from blueprints.structural_sections.concrete.covers import CoversRectangular from blueprints.structural_sections.concrete.reinforced_concrete_sections.rectangular import \ RectangularReinforcedCrossSection # Define materials concrete = ConcreteMaterial(concrete_class=ConcreteStrengthClass.C35_45) steel = ReinforcementSteelMaterial(steel_quality=ReinforcementSteelQuality.B500B) # Create rectangular cross-section with custom covers cs = RectangularReinforcedCrossSection( width=1000, # mm height=800, # mm covers=CoversRectangular(upper=45, right=30, lower=35, left=50), concrete_material=concrete, ) # Add longitudinal reinforcement to edges # Lower edge - main tension reinforcement (larger bars) cs.add_longitudinal_reinforcement_by_quantity( n=4, # number of bars diameter=40, # mm edge="lower", material=steel, ) # Upper edge - compression reinforcement cs.add_longitudinal_reinforcement_by_quantity( n=5, diameter=14, edge="upper", material=steel, ) # Side reinforcement for shear cs.add_longitudinal_reinforcement_by_quantity(n=5, diameter=14, edge="right", material=steel) cs.add_longitudinal_reinforcement_by_quantity(n=5, diameter=14, edge="left", material=steel) # Add stirrups along edges cs.add_stirrup_along_edges( diameter=8, distance=150, # mm spacing material=steel, ) # Add additional stirrups in center zone cs.add_stirrup_in_center( diameter=12, width=500, # mm - ctc of legs distance=300, # mm spacing material=steel, ) # Visualize the cross-section fig = cs.plot(show=True) # Access cross-section properties print(f"Width: {cs.width} mm") print(f"Height: {cs.height} mm") print(f"Covers: upper={cs.covers.upper}, lower={cs.covers.lower}") ``` -------------------------------- ### Import Necessary Classes for Nominal Concrete Cover Calculation Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/other_examples/nominal_concrete_cover.ipynb Imports the required classes and constants from the Blueprints library for calculating nominal concrete cover. This includes the main `NominalConcreteCover` class and various components for defining concrete properties, structural classes, and constants specific to EN 1992-1-1:2004. ```python from blueprints.checks.eurocode.concrete.nominal_concrete_cover import NominalConcreteCover from blueprints.codes.eurocode.en_1992_1_1_2004.chapter_4_durability_and_cover.constants import ( AbrasionClass, CastingSurface, NominalConcreteCoverConstants, ) from blueprints.codes.eurocode.en_1992_1_1_2004.chapter_4_durability_and_cover.table_4_3 import Table4Dot3ConcreteStructuralClass from blueprints.materials.concrete import ConcreteMaterial, ConcreteStrengthClass ``` -------------------------------- ### Create Standard RHS Profile Instance Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_rhs_profile.ipynb Instantiates a standard RHS profile using a predefined designation, such as 'RHS300x200x16'. This creates an object representing a specific steel profile. ```python rhs_profile = RHS.RHS300x200x16 ``` -------------------------------- ### Import Libraries for Rectangular Cross-sections Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/reinforced_concrete_sections/rectangular_reinforced_concrete_cross_section.ipynb Imports necessary modules from the blueprints library for creating concrete materials, reinforcement steel, custom covers, and the rectangular reinforced cross-section itself. ```python """Rectangular reinforced concrete cross-section example.""" from blueprints.materials.concrete import ConcreteMaterial, ConcreteStrengthClass from blueprints.materials.reinforcement_steel import ReinforcementSteelMaterial, ReinforcementSteelQuality from blueprints.structural_sections.concrete.covers import CoversRectangular from blueprints.structural_sections.concrete.reinforced_concrete_sections.rectangular import RectangularReinforcedCrossSection ``` -------------------------------- ### Generate LaTeX Representation of Concrete Cover Calculation Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/other_examples/nominal_concrete_cover.ipynb Generates a LaTeX representation of the nominal concrete cover calculation. This output can be used in LaTeX documents or rendered using external services to visualize the calculation details in a formatted manner. ```python print(calculation.latex()) ``` -------------------------------- ### Import CHS Profile Library Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_chs_profile.ipynb Imports the necessary CHS class from the Blueprints structural sections library. This is the first step to working with CHS profiles. ```python from blueprints.structural_sections.steel.standard_profiles import CHS ``` -------------------------------- ### Define Custom I-Profile (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_i_profile.ipynb Creates a custom I-profile by explicitly defining all its geometric parameters, including flange dimensions, web thickness, total height, and fillet radii. This allows for non-standard I-beam designs. ```python from blueprints.structural_sections.steel.profile_definitions import IProfile custom_i_profile = IProfile( top_flange_width=300, # mm top_flange_thickness=20, # mm bottom_flange_width=200, # mm bottom_flange_thickness=10, # mm total_height=600, # mm web_thickness=10, # mm top_radius=15, # mm (fillet radius at top flange) bottom_radius=8, # mm (fillet radius at bottom flange) ) ``` -------------------------------- ### Create Standard LNP Profile Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_lnp_profile.ipynb Instantiates a standard LNP steel profile using a predefined profile name, such as 'LNP_100x65x9'. This method provides a quick way to access common profile dimensions. ```python lnp_profile = LNP.LNP100x65x9 ``` -------------------------------- ### Import HEB Standard Profile Class (Python) Source: https://github.com/blueprints-org/blueprints/blob/main/docs/guides/examples/steel_profile_shapes/steel_i_profile.ipynb Imports the HEB class from the blueprints.structural_sections.steel.standard_profiles module, which is used for creating standard I-profile sections. ```python from blueprints.structural_sections.steel.standard_profiles import HEB ``` -------------------------------- ### Define Basic Geometric Profiles (Python) Source: https://context7.com/blueprints-org/blueprints/llms.txt Illustrates the creation of basic geometric profiles such as rectangular, circular, and tubular (hollow circular) sections. These classes are fundamental for defining shapes used in section calculations and provide access to properties like area. ```python from blueprints.structural_sections.geometric_profiles import ( RectangularProfile, CircularProfile, TubularProfile, ) # Rectangular profile rect = RectangularProfile( width=400, # mm height=600, # mm name="Beam Section", ) print(f"Area: {rect.polygon.area:.0f} mm^2") # Circular profile circle = CircularProfile( diameter=500, # mm name="Column Section", ) # Tubular (hollow circular) profile tube = TubularProfile( outer_diameter=400, # mm inner_diameter=350, # mm ) ```