Example 3: Vertical load transfers#
The notebook and its PDF are in Examples/Example 3 in the repository.
%load_ext autoreload
%autoreload 2
The autoreload extension is already loaded. To reload it, use:
%reload_ext autoreload
from decimal import Decimal
from papermodels.paper.pdf import load_pdf_annotations
from papermodels.datatypes.geometry_graph import GeometryGraph
from papermodels.datatypes.joist_models import JoistArrayModel
1. Create the graph#
graph = GeometryGraph.from_pdf_file("sketch_to_scale-vertical-loads.pdf", scale=Decimal(1 / 72 * 4))
graph.assign_collector_behaviour(JoistArrayModel, spacing=1.0)
les = graph.create_loaded_elements()
graph.plot_connectivity()
graph.plot_annotations(2)
# Note: The "Wall bottom" annotation transfers as a line load onto the FB2.2 beam and not onto the WT1.0 element on the page below
# The extent of the distributed load matches its location on the FB2.2 beam
les['FB2.2'].model()
{'element_attributes': {'tag': 'FB2.2',
'length': 11.127203479760764,
'orientation': 'horizontal',
'vert_correspondent_below': [],
'vert_correspondent_above': [],
'horz_intersects_above': ['WB2.0'],
'horz_intersects_below': ['CT2.1', 'CT2.2']},
'element_geometry': {'geometry': 'LINESTRING (33.3956 22.3455, 33.4044 33.4727)',
'supports': [{'location': 0.31170009747658084, 'fixity': 'pin'},
{'location': 10.69420334435056, 'fixity': 'roller'}]},
'loads': {'point_loads': [],
'distributed_loads': [{'transfer_source': 'WB2.0',
'transfer_reaction_index': 0,
'occupancy': '',
'load_components': {},
'applied_area': 0.0,
'start_loc': 0.4181001307505899,
'start_magnitude': 1.0,
'end_loc': 10.775003369618789,
'end_magnitude': 1.0,
'direction': 'gravity'}]}}
# The last elements on the page (the point loads) correctly display their transfers from above
les['CB0.4'].model()
{'element_attributes': {'tag': 'CB0.4',
'length': {},
'orientation': 'vertical',
'vert_correspondent_below': [],
'vert_correspondent_above': ['CT1.5'],
'horz_intersects_above': [],
'horz_intersects_below': []},
'element_geometry': {'geometry': 'POLYGON ((14.8897 22.0142, 14.8897 22.6935, 15.569 22.6935, 15.569 22.0142, 14.8897 22.0142))',
'supports': []},
'loads': {'point_loads': [{'location': [],
'magnitude': 0.0,
'transfer_source': 'CT1.5',
'transfer_reaction_index': 0,
'direction': 'gravity'}],
'distributed_loads': []}}
2. Output the model files#
Each LoadedElement is written to a JSON file, which can be read back into a dictionary with the standard library json module.
import pathlib
output_dir = pathlib.Path("model_files") / "json"
output_dir.mkdir(parents=True, exist_ok=True)
for tag, loaded_element in les.items():
with open(output_dir / f"{tag}.json", "w") as file:
loaded_element.dump_json(file)