3D Space Frame Analysis using Python and Blender

3D Space Frame Analysis using Python and Blender

Imagine, build and analyse 3D space frames using the Direct Stiffness Method in Python

⏰ 7 h 42 min | 43 lessons
Published: November 2020, (updated 1 year ago)
After completing this course...
You’ll be able to apply the Direct Stiffness Method to analyse 3D space frame structures in Python.
You’ll be able to use Blender, a powerful open source 3D modelling software to build, visualise and export your structural models.
You’ll have your own analysis programme to identify displacements, reactions and internal member forces for any 3D space frame.
You’ll have the tools, knowledge and confidence to expand your code even further beyond what we cover in the course.

In this course, we leave the two-dimensional world and expand our horizons into the world of three-dimensional structural analysis! After completing this course, you’ll be able to turn a structure from your imagination, into a 3D model that you can analyse using the Direct Stiffness Method, implemented in Python.

We often simplify our real-world structures down into 2D models. This can greatly simplify our analysis and in many cases we lose very little information as a result. 2D analysis often gives us the right balance between speed, simplicity and accuracy. For this reason, most undergraduate engineering courses focus almost exclusively on 2D planar structural analysis.

2D Truss

However, 2D structural analysis has its limitations. As the geometry of our structures becomes more complex the degree to which they can be accurately represented with planar models diminishes. As a result, the accuracy of our models deteriorates and model output drifts further and further from reality. At this point, it can help to expand into the third dimension.

Lattice truss transmission tower

The popularity of Biomimetic Architecture and the complex geometric forms it produces also call for more fidelity in our structural models. The challenge of trying to model the behaviour of space frame or shell structures with complex geometry and compound curvatures is a daunting one. Norman Foster’s Gherkin Tower (2003) has a hexagonal skin inspired by the Venus Flower Basket Sponge. The fully triangulated perimeter structure makes the building rigid enough without any extra reinforcements [1]. By combining some 3D modelling skills with knowledge of matrix based structural analysis we can start to decipher the structural behaviour of this structure.

The Gherkin building in London
The Gherkin building modelled in Blender
The Gherkin building axial force distribution
The Gherkin building deflected shape

In this course we’re going to build on what we learned in our study of The Direct Stiffness Method for Truss Analysis with Python. We’ll expand the code developed in that course to accommodate 3D space frame structures.

You’ll see that expansion of the Direct Stiffness Method from 2D to 3D is readily achieved with some logical alterations to our code. You should only take this course after first completing the prerequisite course. This will give you the foundation you need to get the most from this course.

Once our analysis code is complete, we’ll turn our attention towards how best to generate the geometric data that defines our structure. For this we’ll turn to a powerful open-source 3D modelling tool called Blender . By harnessing some simple 3D modelling tools, we open the door to analysing the behaviour of any structure. We are limited only by our imagination! With its powerful 3D modelling tools and Python API, Blender is an excellent fit for our structural analysis workflow.

Structural modelling in Blender

After familiarising ourselves with how to generate structural models in Blender, we’ll develop some simple scripts that allow us to easily transfer model data back and forth between Blender and our structural analysis Jupyter notebook.

We’ll develop our Python code using the versatile Jupyter development environment. When you complete this course you will have a standalone 3D analysis Jupyter Notebook to deploy on your own projects.

Course Breakdown

The course is broken into 7 sections

Section 1: Welcome and Preliminaries

After some brief introductions in section one, we install some helpful tools that make life a little easier inside your Jupyter Notebooks. We won’t hang around for long in section one. With the housekeeping taken care of, we quickly move onto some structural analysis in section 2.

Section 2: Expanding from 2 to 3 Dimensions

In section 2 we’re going to explain exactly how we can expand the direct stiffness method for 3 dimensions. This theory section, is well worth watching and taking your time with so that you fully understand the foundations of what we’re doing for the rest of the course. You’ll be pleased to hear that this expansion is a lot more straightforward than you might imagine.

Section 3: Coding the Third Dimension

After explaining the underlying theory in section 2, in section 3 we’re going to actually implement the required changes to our code. Our starting point here is the code we developed for plane truss analysis in the prerequisite course. We’ll work our way systematically though the code over the course of a few lectures and tackle each of the amendments one by one, explaining as we go.

Section 4: Improving the User Experience

In section 4, we’re going to make a couple of small changes to our code that improve its usability. This is a short section in which we implement a colormap to better visualise the magnitudes of member forces and we’ll also implement some user interface widgets to make plot manipulation a little easier. With these modifications we will have successfully modified our code and technically completed all of the modifications we need to make. From here on our efforts are going to be on making it easier to develop larger 3D structural models that play nicely with our Jupyter Notebook.

Section 5: Building 3D Structures in Blender

So, in section 5, we dive headfirst into Blender, our 3D modelling software. After getting Blender installed, I’ll give you a whistle stop tour of the interface and demonstrate some modelling tools to give you a sense of how we’ll be using it to build our structural models. Blender is a huge programme with a lot of functionality, but we’ll keep things fairly focused here on just what we need to know to build our structural models.

Section 6: Jupyter/Blender Data Transfer

At this point, we have a very nice piece of structural analysis software in the form of our Jupyter Notebook. We also have a very powerful 3D modelling tool in which our structural models live. However, things really come to life when we start to move data between the two. So section 6 is all about facilitating that data transfer between Blender and our Jupyter Notebook and vice versa.

Section 7: Case Study Structures

Finally in section 7, we take a victory lap and use our shiny new skills to model some interesting structures and run them through our 3D solver. We’ll do some minor code development in section 7 to further streamline our workflow between Blender and our Jupyter Notebook. You’ll also find it helpful to see more examples of how to take advantage of Blender’s modelling capabilities.

Course Updates:

This section is where ongoing course updates and new lectures are added. These may be from student suggestions or new ideas that come to mind after the course is published. In the latest update, we focus on building a better axial force data visualisation using Blender. In this update, you’ll learn how to use Blender’s Python API to programmatically build the structure and assign properties, colour in this case, based on structural analysis data. With this under your belt, you can expand and start exploring other data visualisation options using Blender.

Visualising axial forces in Blender

Who this course is for

  • Students and engineers who’ve studied matrix analysis methods but never explored the 3D potential of this analysis technique.
  • Students and engineers who’ve taken our truss analysis or beam and frame analysis course and want to continue learning and expanding their abilities.
  • Anyone who wants to leverage programming as a tool for structural analysis or within their day-to-day study or work.

Although not absolutely essential, it is highly recommended that you complete the prerequisite course before starting this course.

The codes developed in this course are for educational purposes only and are not tested or certified for use beyond the educational scope of this course. Always employ your own engineering judgement first and foremost, regardless of what the computer says!

Section 2
Expanding from 2 to 3 dimensions
4. Section 2 overview
00:42 (Preview)
5. A quick review of transformations in 2D
6. Expanding to a 3D transformation matrix
7. The 6x6 element stiffness matrix
Section 3
Coding the third dimension
8. Section 3 overview
00:49 (Preview)
9. Visualising our 3D structure 📂
10. Adding node number annotations
11. Calculating 3D orientations and lengths
12. Building the 3D structure stiffness matrix
13. Solving for displacements, reactions and member forces
14. Visualising axial forces and the deflected shape
15. Producing text output
Section 4
Improving the user experience
16. Section 4 overview
00:40 (Preview)
17. Adding a colour map for axial forces 📂
18. Adding UI widgets for plot adjustments
Section 5
Building 3D structures in Blender
19. Section 5 overview
01:21 (Preview)
20. How can Blender help us?
21. Downloading and installing Blender
22. Blender overview and interface basics
23. Object versus edit mode
24. Basic modelling - rectilinear structures
25. Basic modelling - organic/curved structures 📂
18:26 (Preview)
Section 6
Jupyter/Blender data transfer
26. Section 6 overview
01:05 (Preview)
27. Exporting our model data from Blender 📂
28. Importing model data into our Jupyter Notebook 📂
29. Exporting structural deflections
30. Importing and visualising deflections in Blender
Section 7
Case study structures
31. Section 7 overview
00:36 (Preview)
32. Case study 1 - Transmission Tower: Modelling 📂
33. Case study 1 - Transmission Tower: Analysis 📂
34. Case study 2 - Geodesic Dome: Modelling and data export 📂
35. Case study 2 - Geodesic Dome: Analysis and data import 📂
36. Case study 3 - Gherkin-esk Tower 📂
37. Case study 4 - Space frame roof 📂
38. Course wrap up
Section 8
Course updates
39. Including self-weight in the analysis 📂
40. Blender data-viz - Structure setup & force data 📂
41. Blender data-viz - Blocking out the code 📂
42. Blender data-viz - The transformation matrix
43. Blender data-viz - Generating materials from force data
Completion certificate
Completion certificate
  • Download your personalised Certificate of Completion once you’ve finished all course lectures.

  • Applying for jobs? Use your Certificate of Completion to show prospective employers what you’ve been doing to improve your capabilities.

  • Independently completing an online course is an achievement. Let people know about it by posting your Certificate of Completion on your Linkedin profile or workplace CPD portfolio.

Ready to get started?
This is the best online course I have found to date on complex engineering calculations. Seán has a thorough and well considered approach to sharing his knowledge of the art of structural engineering. I look forward to keeping an eye on his future material!
Drew Beattie
Dr Seán Carroll
BEng (Hons), MSc, PhD, CEng MIEI, FHEA
Hi, I’m Seán, the founder of EngineeringSkills.com (formerly DegreeTutors.com). I hope you found this tutorial helpful. After spending 10 years as a university lecturer in structural engineering, I started this site to help more people understand engineering and get as much enjoyment from studying it as I do. Feel free to get in touch or follow me on any of the social accounts.

Do you have some knowledge or expertise you'd like to share with the EngineeringSkills community?
Check out our guest writer programme - we pay for every article we publish.
You Might Also be Interested In...
The Direct Stiffness Method for Truss Analysis with Python
The Direct Stiffness Method for Truss Analysis with Python
Build your own finite element truss analysis software using Python and tackle large scale structures.
Non-linear Finite Element Analysis of 2D Catenary & Cable Structures using Python
Non-linear Finite Element Analysis of 2D Catenary & Cable Structures using Python
Build an iterative solution toolbox to analyse structures that exhibit geometric non-linearity due to large deflections.

The Direct Stiffness Method Course Bundle

The complete starter pack for learning the Direct Stiffness Method with Python.

  • The Direct Stiffness Method for Truss Analysis with Python
  • Beam and Frame Analysis using the Direct Stiffness Method in Python
  • 3D Space Frame Analysis using Python and Blender

Frequently asked questions