Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: latest
commands:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv python install 3.13
- uv sync -p 3.13 --frozen --extra rhino --extra dxf --no-group dev --no-group lint --no-group test
- uv run -p 3.13 --no-sync -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
python: "3.13"
jobs:
# https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv python install 3.13
create_environment:
- uv venv -p 3.13
install:
- uv sync -p 3.13 --frozen --extra rhino --extra dxf --no-group dev --no-group lint --no-group test
build:
html:
- uv run -p 3.13 --no-sync sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
10 changes: 5 additions & 5 deletions docs/examples/geometry/section_library.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"source": [
"### Import Modules\n",
"\n",
"We start by importing the [timber_rectangular_section()](../../gen/sectionproperties.pre.library.timber_sections.timber_rectangular_section.rst#sectionproperties.pre.library.timber_sections.timber_rectangular_section) function from the section library, and the [Material()](../../gen/sectionproperties.pre.pre.Material.rst#sectionproperties.pre.pre.Material) object to define our timber material."
"We start by importing the [timber_rectangular_section()](../../gen/sectionproperties.pre.library.timber_sections.clt_rectangular_section.rst#sectionproperties.pre.library.timber_sections.clt_rectangular_section) function from the section library, and the [Material()](../../gen/sectionproperties.pre.pre.Material.rst#sectionproperties.pre.pre.Material) object to define our timber material."
]
},
{
Expand All @@ -317,7 +317,7 @@
"source": [
"### Create Geometry\n",
"\n",
"Create a 120 deep by 1000 wide crosslaminated timber slab.\n",
"Create a 120 deep by 1000 wide cross-laminated timber slab.\n",
"\n",
"The following material properties are used:\n",
"\n",
Expand Down Expand Up @@ -378,7 +378,7 @@
"outputs": [],
"source": [
"geom_maj = clt_rectangular_section(\n",
" d=[40, 40, 40], lay_orient=[timber0, timber90, timber0], b=1000\n",
" d=[40, 40, 40], layer_mat=[timber0, timber90, timber0], b=1000\n",
")"
]
},
Expand Down Expand Up @@ -461,7 +461,7 @@
"outputs": [],
"source": [
"geom_min = clt_rectangular_section(\n",
" d=[40, 40, 40], lay_orient=[timber90, timber0, timber90], b=1000\n",
" d=[40, 40, 40], layer_mat=[timber90, timber0, timber90], b=1000\n",
")"
]
},
Expand Down Expand Up @@ -721,7 +721,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.13.3"
}
},
"nbformat": 4,
Expand Down
61 changes: 46 additions & 15 deletions src/sectionproperties/pre/library/timber_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,64 @@


def clt_rectangular_section(
d: list[float], lay_orient: list[pre.Material], b: float
d: list[float],
layer_mat: list[pre.Material],
b: float,
) -> geometry.CompoundGeometry:
"""Constructs a timber rectangular section.
"""Constructs a CLT rectangular section.

Constructs a timber rectangular section of depth ``d`` and width ``b``.

.. note::
Constructs a CLT rectangular section, with layer depths ``d``, layer materials
``layer_mat``, and width ``b``.

Args:
d: Timber layer section thickness
lay_orient: A list of materials for each layer from top to bottom
defined by the user.
b: Timber section width

Raises:
ValueError: Geometry generation failed
d: CLT layer section thickness
layer_mat: A list of timber materials for each layer (from top to bottom)
b: CLT section width

Returns:
Timber rectangular section geometry
CLT rectangular section geometry

Example:
The following example creates a 120mm CLT cross-section.
The following example creates a 120mm CLT cross-section:

.. plot::
:include-source: True
:caption: 120mm CLT section geometry

from sectionproperties.pre import Material
from sectionproperties.pre.library import clt_rectangular_section
from sectionproperties.analysis import Section

timber0 = Material(
name="Timber0",
elastic_modulus=9.5e3,
poissons_ratio=0.35,
density=4.4e-7,
yield_strength=5.5,
color="burlywood",
)
timber90 = Material(
name="Timber90",
elastic_modulus=317,
poissons_ratio=0.35,
density=4.4e-7,
yield_strength=5.5,
color="orange",
)

geom = clt_rectangular_section(
d=[40, 40, 40],
layer_mat=[timber0, timber90, timber0],
b=1000
)

geom.create_mesh(mesh_sizes=[0]) # a size of zero creates a coarse mesh
Section(geometry=geom).plot_mesh()
"""
layer_geom: list[geometry.Geometry] = []
for idx in range(len(d)):
di = float(d[idx])
layer = lay_orient[idx]
layer = layer_mat[idx]

timb_mat = layer

Expand Down
2 changes: 1 addition & 1 deletion tests/section_library/test_timber_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_timber_clt_rectangular_section(get_materials):
timber0, timber90 = get_materials

rect = ts.clt_rectangular_section(
d=[40, 40, 40], lay_orient=[timber0, timber90, timber0], b=1000
d=[40, 40, 40], layer_mat=[timber0, timber90, timber0], b=1000
)

# check geometry is created correctly
Expand Down