Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d778e47
Added class Model_3dec inherited from compas_model
adellendice Feb 12, 2024
039eb0f
pipeline from input geometry to update blocks in compas_model
adellendice Feb 26, 2024
44cacbe
interactions from 3dec - polygon, neighbours -
adellendice Feb 27, 2024
32df4b8
conversion 3dec interaction
adellendice Feb 28, 2024
e4919bc
implenting scene
adellendice Mar 4, 2024
e53766a
implemented scene notebook element and interaction
adellendice Mar 6, 2024
3086608
notebook implementation
adellendice Mar 8, 2024
78204de
change github worksflows files
adellendice Mar 8, 2024
d26d156
update requirements
adellendice Mar 8, 2024
a548a7c
implementation rhino scenefor block and interaction
adellendice Mar 8, 2024
b7049f7
roadmap and rhino scene
adellendice Mar 11, 2024
1821f71
displacement analysis setup
adellendice Mar 13, 2024
818bcb0
damping and load implementation 1st part
adellendice Mar 14, 2024
9e12969
load implementation 2nd part
adellendice Mar 14, 2024
d9b0ed2
resultant calculation and initial model-problem splitting
adellendice Apr 24, 2024
98f7a9e
problem wip and if statements interaction_3dec
adellendice May 15, 2024
d7bdeb8
CHANGE problem_example change according to the new model
petrasvestartas May 17, 2024
11505f5
ADD roadmap
petrasvestartas May 21, 2024
3e71085
ADD road_map.drawio
petrasvestartas May 22, 2024
408e366
ADD contact properties
petrasvestartas May 23, 2024
b601026
ADD block class
petrasvestartas May 27, 2024
8dcaecf
Add Rhino toolbar
petrasvestartas May 27, 2024
1839ee7
new prblem function: assign_group_to_meshes,update to_geometry_3dec
adellendice May 27, 2024
6556877
Merge branch 'wip_1' of https://github.com/BRG-research/compas_3dec i…
adellendice May 27, 2024
82ab3a7
ADD Rhino Toolbar build
petrasvestartas May 27, 2024
391c272
Merge branch 'wip_1' of https://github.com/BRG-research/compas_3dec i…
petrasvestartas May 27, 2024
e2aa60a
problem serialisation and deserialisation
adellendice Aug 15, 2024
f21dd54
tuning visualisation methods
adellendice Aug 16, 2024
aa3e294
1st clean up 2025
adellendice Jan 10, 2025
b1373c6
update docs
adellendice Feb 21, 2025
4979739
init pav vault
adellendice Mar 17, 2025
8f599b0
add name attribute to Block
adellendice Mar 28, 2025
14906cf
big clean up and documentation update
adellendice Sep 5, 2025
29ad02e
barrel vault
adellendice Sep 5, 2025
314138f
examples: barrel vault, arch, rhino meshes
adellendice Sep 5, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
os: [windows-latest]
python: ['3.9', '3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
os: [windows-latest]
python: ['3.9', '3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ __pycache__/
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Added
- class Model_3dec inherited from compas_model.

### Changed

### Removed
- big cleaning, update documentation

185 changes: 185 additions & 0 deletions docs/_images/.$roadmap.drawio.dtmp

Large diffs are not rendered by default.

212 changes: 212 additions & 0 deletions docs/_images/roadmap.drawio

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ API Reference

.. toctree::
:maxdepth: 1
:titlesonly:

api/compas_3dec.datastructure

api/compas_3dec
15 changes: 15 additions & 0 deletions docs/api/compas_3dec.datastructure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
********************************************************************************
datastructure
********************************************************************************


.. currentmodule:: compas_3dec.datastructure

Classes
=======

.. autosummary::
:toctree: generated/
:nosignatures:

Problem3dec
3 changes: 3 additions & 0 deletions docs/api/compas_3dec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
compas_3dec
********************************************************************************


.. currentmodule:: compas_3dec


.. toctree::
:maxdepth: 1

compas_3dec.datastructure
40 changes: 40 additions & 0 deletions docs/examples/Arch/00_create_block_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#! python 3
# r: compas, tessagon
# venv: himass1

import os
import compas
from compas.colors import Color
from compas.geometry import Point, Line
from compas_dem.templates import ArchTemplate
from compas_dem.models import BlockModel
from compas.scene import Scene


# =============================================================================
# Create Arch
# =============================================================================
rise = 2
span = 5
thickness = 0.3
depth = 0.3
n = 20
arch = BlockModel.from_template(ArchTemplate(rise,span,thickness,depth,n))

# =============================================================================
# Save Blockmodel
# =============================================================================
HERE = os.path.dirname(__file__)
FILE_O = os.path.join(HERE, 'arch_00.json')
compas.json_dump(arch, FILE_O)

# =============================================================================
# View in Rhino
# =============================================================================
scene = Scene()
scene.clear_context()
import rhinoscriptsyntax as rs
for block in arch.blocks():
scene.add(block._geometry)
rs.AddTextDot(block.graphnode,block._geometry.centroid())
scene.draw()
41 changes: 41 additions & 0 deletions docs/examples/Arch/01_add_supports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! python 3
# r: compas, tessagon
# venv: himass1

import os
import compas
from compas.scene import Scene
from compas_dem.models.blockmodel import BlockModel

# =============================================================================
# Load Blockmodel
# =============================================================================
HERE = os.path.dirname(__file__)
FILE = os.path.join(HERE, 'arch_00.json')
arch = compas.json_load(FILE)

# =============================================================================
# Select supports
# =============================================================================
supports = [0,19]
for block in arch.blocks():
if block.graphnode in supports:
block.is_support = True

# =============================================================================
# Save Blockmodel
# =============================================================================
HERE = os.path.dirname(__file__)
FILE_O = os.path.join(HERE, 'arch_01.json')
compas.json_dump(arch, FILE_O)

# =============================================================================
# View in Rhino
# =============================================================================
scene = Scene()
scene.clear_context()
for block in arch.blocks():
scene.add(block._geometry)
for support in arch.supports():
scene.add(support._geometry, color= (255,0,0))
scene.draw()
74 changes: 74 additions & 0 deletions docs/examples/Arch/02_to_3dec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#! python3
# r: compas, tessagon
# venv: himass1

import time
start = time.time()
import os
import compas
from compas.colors import Color
from compas.scene import Scene
from compas_dem.models import BlockModel
from compas_3dec.datastructure import Problem3dec, Group, MohrCoulomb

# =============================================================================
# Load Blockmodel
# =============================================================================
HERE = os.path.dirname(__file__)
FILE = os.path.join(HERE, 'arch_01.json')
arch: BlockModel= compas.json_load(FILE)

# =============================================================================
# Convert to 3DEC model
# =============================================================================
problem: Problem3dec = Problem3dec.from_blockmodel(arch, working_path=HERE)

# =============================================================================
# add/assign groups
# =============================================================================
block_group = Group(name="Blocks")
support_group = Group(name="Supports")
problem.add_group(block_group)
problem.add_group(support_group)

for b in problem.blocks:
if not b.is_support:
b.group = block_group.name
else:
b.group = support_group.name
b.color = Color.from_rgb255(89,154,255)

# =============================================================================
# add material
# =============================================================================
marble = problem.add_material(name="Marble", E=2.5e10, poisson=0.2, rho=2500, group = [block_group.name, support_group.name])

# =============================================================================
# add contact_properties
# =============================================================================
stiffness = problem.set_joint_stiffness_one_material(
block_height=0.5,
reduction_factor=1,
block_length=None,
material=marble)

failure_criteria = MohrCoulomb(friction=35)
contact_property = problem.add_contact_property(stiffness, failure_criteria, [block_group.name, support_group.name])

# =============================================================================
# Save problem_init
# =============================================================================
FILE_O = os.path.join(HERE, 'problem_init.json')
compas.json_dump(problem, FILE_O)
end = time.time()
print('time', end - start,'s')

# =============================================================================
# View
# =============================================================================
scene = Scene()
scene.clear_context()
for block in problem.blocks:
scene.add(block.mesh, color=block.color)
scene.draw()

50 changes: 50 additions & 0 deletions docs/examples/Arch/03_gravity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#! python 3
# r: compas, tessagon
# venv: himass1

import time
start = time.time()
import os
import compas
from compas_3dec.datastructure.problem_3dec import Problem3dec

# =============================================================================
# Input problem_init
# =============================================================================
HERE = os.path.dirname(__file__)
FILE_I = os.path.join(HERE, 'problem_init.json')
problem: Problem3dec = compas.json_load(FILE_I)

# =============================================================================
# To 3DEC geometry
# =============================================================================
problem.to_geometry_3dec()

# =============================================================================
# create gravity.dat
# =============================================================================
gravity_file = problem.gravity()

# =============================================================================
# run 3DEC
# =============================================================================
problem.run([gravity_file])


# # =============================================================================
# # read results blocks and interactions
# # =============================================================================
init_dict = problem.from_3dec_blocks("init_state.txt")
mapping_dict = problem.mapping(init_dict)
grav_dict = problem.from_3dec_blocks("grav_state.txt")
problem.solve_ratio_check("grav_state.txt")
problem.update_blocks(grav_dict,mapping_dict)
output_3dec_per_vertex = problem.from_3dec_contacts("contact_grav.txt")

# =============================================================================
# save problem gravity
# =============================================================================
FILE_O = os.path.join(HERE, 'problem_gravity.json')
compas.json_dump(problem, FILE_O)
end = time.time()
print('analysis_3dec time', end - start, 's')
59 changes: 59 additions & 0 deletions docs/examples/Arch/04_view_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#! python3
# r: compas, tessagon
# venv: himass1

import os
import compas
from compas_3dec.datastructure import Problem3dec, Interaction3dec
from compas.colors import Color

# =============================================================================
# Input problem init
# =============================================================================
HERE = os.path.dirname(__file__)
FILE_I1 = os.path.join(HERE, 'problem_init.json')
problem_init: Problem3dec = compas.json_load(FILE_I1)

# =============================================================================
# Input problem gravity
# =============================================================================
FILE_I2 = os.path.join(HERE, 'problem_gravity.json')
problem_gravity: Problem3dec = compas.json_load(FILE_I2)

# =============================================================================
# View
# =============================================================================
from compas.scene import Scene
scene = Scene()
scene.clear_context()

# =============================================================================
# show blocks
# =============================================================================
for block in problem_gravity.blocks:
scene.add(block.mesh, color = block.color_equilibrium)

# =============================================================================
# show contact forces
# =============================================================================
for interaction in problem_gravity.interactions:
interaction: Interaction3dec
if interaction.forces_per_contact:
application_point = interaction.display_resultant_application_point()
resultant_force = interaction.display_resultant_force(0.02)
scene.add(application_point)
for line in resultant_force:
scene.add(line, color=(0, 81, 12), width=20.0)

# =============================================================================
# show support reaction magnitudes
# =============================================================================
resultants, magnitudes, components, resultant_points = problem_gravity.support_resultants(0.02)
import rhinoscriptsyntax as rs
for magnitude, point in zip(magnitudes, resultant_points):
rs.AddTextDot(str(magnitude), point)

# =============================================================================
# draw geometry
# =============================================================================
scene.draw()
Loading
Loading