{"id":22122896,"url":"https://github.com/leo27945875/python_stable_3d_truss_analysis","last_synced_at":"2025-07-25T14:31:16.756Z","repository":{"id":45747335,"uuid":"435043082","full_name":"leo27945875/Python_Stable_3D_Truss_Analysis","owner":"leo27945875","description":"slientruss3d : Python for stable truss analysis and optimization tool","archived":false,"fork":false,"pushed_at":"2023-02-14T04:01:55.000Z","size":5709,"stargazers_count":23,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T15:44:17.983Z","etag":null,"topics":["architecture","civil-engineering","deep-learning","generate-truss-data","genetic-algorithm","graph-deep-learning","optimization","python","python3","pytorch","pytorch-geometric","slientruss3d","structural-analysis","structural-engineering","structure-optimization","truss","truss-analysis","truss-optimization","truss-solver"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leo27945875.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-05T00:55:35.000Z","updated_at":"2024-10-09T15:15:47.000Z","dependencies_parsed_at":"2022-07-19T21:59:39.348Z","dependency_job_id":null,"html_url":"https://github.com/leo27945875/Python_Stable_3D_Truss_Analysis","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo27945875%2FPython_Stable_3D_Truss_Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo27945875%2FPython_Stable_3D_Truss_Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo27945875%2FPython_Stable_3D_Truss_Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo27945875%2FPython_Stable_3D_Truss_Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leo27945875","download_url":"https://codeload.github.com/leo27945875/Python_Stable_3D_Truss_Analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227584712,"owners_count":17789738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","civil-engineering","deep-learning","generate-truss-data","genetic-algorithm","graph-deep-learning","optimization","python","python3","pytorch","pytorch-geometric","slientruss3d","structural-analysis","structural-engineering","structure-optimization","truss","truss-analysis","truss-optimization","truss-solver"],"created_at":"2024-12-01T15:28:13.104Z","updated_at":"2024-12-01T15:28:13.790Z","avatar_url":"https://github.com/leo27945875.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **slientruss3d** : Python for stable truss analysis and deep learning research\n\n[![Python](https://img.shields.io/pypi/pyversions/slientruss3d)](https://pypi.org/project/slientruss3d/)\n[![Version](https://img.shields.io/pypi/v/slientruss3d)](https://pypi.org/project/slientruss3d/)\n[![GitHub release](https://img.shields.io/github/release/leo27945875/Python_Stable_3D_Truss_Analysis.svg)](https://github.com/leo27945875/Python_Stable_3D_Truss_Analysis/releases)\n[![Downloads_Week](https://img.shields.io/pypi/dm/slientruss3d?color=red)](https://pypi.org/project/slientruss3d/)\n[![Downloads_Day](https://img.shields.io/pypi/dd/slientruss3d?color=red)](https://pypi.org/project/slientruss3d/)\n[![License](https://img.shields.io/github/license/leo27945875/Python_Stable_3D_Truss_Analysis)](https://github.com/leo27945875/Python_Stable_3D_Truss_Analysis/blob/master/LICENSE.txt)\n\n---\n\n## Description\n\n**`slientruss3d`** is a python package which can solve the resistances, internal forces and joint dispalcements in a stable 2D or 3D truss by `direct stiffness method`. And also can do truss optimization by `Genetic Algorithm (GA)`, `generate truss data` and `work with pytorch-geometric` conveniencely.  \n  \nThis repo is writen by  :\n\n```text\nTaiwan                                          (臺灣)\nDepartment of Civil Engineering                 (土木工程學系)\nNational Yang Ming Chiao Tung University (NYCU) (國立陽明交通大學)\nShih-Chi Cheng                                  (鄭適其)\n```\n\n![Show](./plot/bar-6_plot_0.png)\n\n## Content\n\n1. **Installaltion**\n    - [Install](#Install)\n    - [Time consuming](#Time-consuming)\n    - [Update log](#Update-log)\n2. **Quick start**\n    - [Basic example](./detail/how_to_use.md#Basic-example) \u003e( Just read this if you aren't familiar with coding 😎 )\n    - [Truss](./detail/how_to_use.md#Truss)\n    - [Member](./detail/how_to_use.md#Member)\n    - [MemberType](./detail/how_to_use.md#Define-a-new-member)\n    - [SupportType](./detail/how_to_use.md#Define-a-new-joint)\n3. **Combine with JSON**\n    - [Example code](./detail/combine_with_JSON.md#Example)\n    - [Embed in Web APP](./detail/combine_with_JSON.md#Embed-in-Web-APP)\n    - [Format of JSON](./detail/combine_with_JSON.md#Format-of-JSON)\n4. **Plot your truss**\n    - [Example code](./detail/plot_your_truss.md#Example-code)\n    - [Example figures](./detail/plot_your_truss.md#Example-figures)\n5. **Truss optimization**\n    - [Introduction](./detail/truss_optimization.md#Introduction)\n    - [Gene](./detail/truss_optimization.md#Gene-data-structure)\n    - [Fitness function](./detail/truss_optimization.md#Fitness-function)\n    - [Crossover](./detail/truss_optimization.md#Crossover)\n    - [Evolution policy](./detail/truss_optimization.md#Evolution-policy)\n    - [Example code](./detail/truss_optimization.md#Example)\n    - [Geneic algorithm](./detail/truss_optimization.md#Geneic-algorithm)\n    - [Customization](./detail/truss_optimization.md#Customization)\n6. **Generate truss data automatically**\n    - [Introduction](./detail/gen_truss.md#Introduction)\n    - [Generate cube-like truss](./detail/gen_truss.md#Generate-cube-like-truss)\n    - [Data Augmentation](./detail/gen_truss.md#data-augmentation)\n7. **Convert Truss to Pytorch-Geometric HeteroData**\n    - [Introduction](./detail/to_PyG.md#introduction)\n    - [Installation](./detail/to_PyG.md#installation)\n    - [How to use it ?](./detail/to_PyG.md#how-to-use-it)\n    - [Fields in HeteroData](./detail/to_PyG.md#fields-in-heterodata)\n    - [Example code](./detail/to_PyG.md#example-code)\n\n---\n\n## Install\n\nFirst, check your python version:\n\n```text\nPython must \u003e= 3.9.7\n```\n\nSecond, download the **`slientruss3d`** package:\n\n```text\npip install slientruss3d \n```\n\n---\n\n## Time consuming\n\nThe following are time consuming tests for doing structural analysis for each truss (Each testing runs for 30 times and takes average !).\n\n- **`6-bar truss`**\u0026ensp;\u0026ensp; : 0.00037(s)\n- **`10-bar truss`**\u0026ensp; : 0.00050(s)\n- **`25-bar truss`**\u0026ensp; : 0.00126(s)\n- **`47-bar truss`**\u0026ensp; : 0.00253(s)\n- **`72-bar truss`**\u0026ensp; : 0.00323(s)\n- **`120-bar truss`** : 0.00557(s)\n- **`942-bar truss`** : 0.05253(s)\n\nTesting on :\n\n```text\nCPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz\nRAM: 8GB DDR4 * 2\n```\n\n---\n\n## Update log\n\n### New feature in v2.0.0 update !\n\n- _**Important API adjustment**_ : We `simplified the JSON format` in slientruss3d, see the details in [Format of JSON](./detail/combine_with_JSON.md#Format-of-JSON). You can use the `v1_to_v2.py` module in the root folder to convert the old JSON format to the new one rapidly.\n\n- _**Data Augmentation**_ : You can use some new method in **`slientruss3d.generate`** module to do data augmentation to generated cube-like trusses ! See more details in [Data Augmentation](./detail/gen_truss.md#data-augmentation).  For example:  \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./detail/figure/before_aug.png\" alt=\"drawing\" width=\"400\"/\u003e\n    \u003cimg src=\"./detail/figure/after_aug.png\" alt=\"drawing\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n- _**Graph Deep Learning**_ : With the increasing importance of deep learning in the field of truss design, we also provide a solution to let our users convert the `Truss` object to the data structure of [`Pytorch-Geometric`](https://github.com/pyg-team/pytorch_geometric) conveniently. See the details in [Convert Truss to Pytorch-Geometric HeteroData](./detail/to_PyG.md#convert-truss-to-pytorch-geometric-heterodata).\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/pyg-team/pyg_sphinx_theme/master/pyg_sphinx_theme/static/img/pyg_logo_text.svg?sanitize=true\" alt=\"drawing\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u0026ensp;  \n\n### An important API adjustment after v1.3.25 !\n\nAfter slientruss3d v1.3.25, the method [`Truss.Solve()`](./detail/how_to_use.md#Do-structural-analysis) will return `None` instead of the result of structural analysis. If you want to get the result of structural analysis, please use other getters defined in Truss object such as:\n\n```python\n# Get result of structural analysis:\ndisplace, stress, resistance = truss.GetDisplacements(), truss.GetInternalStresses(), truss.GetResistances()\nreturn displace, stress, resistance\n```\n\n### New feature in v1.3.0 update !\n\nAfter slientruss3d v1.3.0, you can use **`slientruss3d.generate`** module to generate truss data automatically. For now, only simple `cube-like` truss can be generated by slientruss3d, but I think this is still a helpful way for anyone who suffers from lake of truss data.\n\n\u003e More details are in [Generate truss data automatically](./detail/gen_truss.md)\n\n![ShowCube](./detail/figure/show_cube.png)\n\n### New feature in v1.2.0 update !\n\nAfter slientruss3d v1.2.0, you could use **`slientruss3d.ga`** module to do `member type selection optimization` conveniencely with `Genetic Algorithm (GA)`! Just simply define the topology of the truss and what member types you want to use, and then you could start the optimization.  \n\n\u003e More details are in [Truss optimization](./detail/truss_optimization.md)\n\nBesides GA, there are some new useful methods in the `Truss` object:\n\n```python\nclass Truss:\n\n    ...\n\n    # Check whether all internal forces are in allowable range or not:\n    def IsInternalStressAllowed(self, limit, isGetSumViolation=False) -\u003e tuple[bool, dict | float]: \n        ...\n\n    # Check whether all internal displacements are in allowable range or not:\n    def IsDisplacementAllowed(self, limit, isGetSumViolation=False) -\u003e tuple[bool, dict | float]:\n        ...\n\n```\n\n---\n\n## Enjoy 😎 !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo27945875%2Fpython_stable_3d_truss_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleo27945875%2Fpython_stable_3d_truss_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo27945875%2Fpython_stable_3d_truss_analysis/lists"}