Metadata-Version: 2.4
Name: compas_masonry
Version: 0.4.0
Summary: COMPAS Masonry is a masonry assessment toolbox for Rhino based on the COMPAS framework.
Author-email: tom van mele <tom.v.mele@gmail.com>
License: MIT License
        
        ETH Zurich - Block Research Group
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://blockresearchgroup.github.io/compas_masonry
Project-URL: Documentation, https://blockresearchgroup.github.io/compas_masonry
Project-URL: Repository, https://github.com/blockresearchgroup/compas_masonry
Project-URL: Changelog, https://github.com/blockresearchgroup/compas_masonry/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/blockresearchgroup/compas_masonry/issues
Project-URL: Forum, https://forum.compas-framework.org/
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: compas>=2.14.1
Requires-Dist: compas_cgal>=0.9.1
Requires-Dist: compas_dem>=0.6.0
Requires-Dist: compas_libigl>=0.7.6
Requires-Dist: compas_rui>=0.6
Requires-Dist: compas_session>=0.7
Requires-Dist: compas_tna>=0.7
Requires-Dist: compas_tno>=0.3
Requires-Dist: compas_lmgc90>=0.1.11
Requires-Dist: compas_rbe
Requires-Dist: compas_3dec>=0.2.0
Requires-Dist: compas_cra>=0.8.0
Requires-Dist: pyomo<6.9,>=6.7.3
Provides-Extra: dev
Requires-Dist: bump-my-version; extra == "dev"
Requires-Dist: compas_invocations2; extra == "dev"
Requires-Dist: invoke>=0.14; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: sphinx_compas2_theme; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Provides-Extra: viz
Requires-Dist: compas_notebook; extra == "viz"
Dynamic: license-file

# COMPAS Masonry

> [!WARNING]
> This plugin is under active development,
> and its functionality will frequently change.

![COMPAS Masonry](compas-Masonry.png)

COMPAS Masonry is a plugin for Rhino for the assessment of masonry structures,
and for the stability analsis of Discrete Element Models in general.

The current version of this plugin is based on COMPAS 2 and is only available for Rhino 8.

## Installation

To install COMPAS-Masonry, use Rhino's package manager Yak.
To open Yak, type `PackageManager` on the Rhino command line.
Then search for "COMPAS Masonry" and install.

## COMPAS Packages

COMPAS-Masonry uses the following COMPAS packages:

* [compas](https://github.com/compas-dev/compas)
* [compas_cgal](https://github.com/compas-dev/compas_cgal)
* [compas_dem](https://github.com/blockresearchgroup/compas_dem)
* [compas_libigl](https://github.com/compas-dev/compas_libigl)
* [compas_model](https://github.com/blockresearchgroup/compas_model)
* [compas_rui](https://github.com/blockresearchgroup/compas_rui)
* [compas_session](https://github.com/blockresearchgroup/compas_session)
* [compas_tna](https://github.com/blockresearchgroup/compas_tna)
* [compas_tno](https://github.com/blockresearchgroup/compas_tno)

After installing COMPAS-Masonry with Yak, these requirements will be installed automatically if necessary.
The tool might be unresponsive during this process, which might take up to 1 or 2 mins.
The packages are installed in a separate virtual environment named `COMPAS-Masonry`.

## Solvers

Equilibrium analysis runs through [compas_cra](https://github.com/blockresearchgroup/compas_cra):

* **RBE** — rigid block equilibrium
* **CRA** — coupled rigid block analysis, with an optional penalty formulation

Both return **contact forces** rather than displacements.

> [!IMPORTANT]
> These need **compas_cra >= 0.8.0**, which solves IPOPT **in-process** through a
> bundled native binding. There is no `ipopt` executable to install and nothing
> to put on `PATH`: wheels are published for CPython 3.9-3.13 on macOS (arm64 and
> x86_64), manylinux and Windows, each carrying the compiled solver, so a plain
> `pip install` is the whole setup. compas_cra 0.4.0 cannot be used in a NumPy 2
> environment, and 0.5.0-0.7.0 have been withdrawn from PyPI.
>
> compas_cra still solves for self-weight only — `external_force_setup(assembly,
> density)` takes no external load vector. A problem carrying any boundary
> condition is therefore refused by `check_ready()` and has to go to LMGC90 or
> 3DEC instead.

**LMGC90** provides contact dynamics and displacements in-process through
`compas_lmgc90`.

**3DEC** provides staged gravity, load, and prescribed-displacement analyses
through `compas_3dec` and a **licensed external Itasca 3DEC installation**. The
Python adapter ships as a base requirement, so a 3DEC solver can be configured
and saved on any machine — the parameters belong to the problem, not to the
computer that runs it. The 3DEC executable itself is discovered automatically,
or its path and run workspace can be set in `CM_Problem_setsolver`.

> [!NOTE]
> 3DEC is Windows software, and `compas_3dec` discovers it only under the Windows
> `Program Files\Itasca` locations. On macOS and Linux a 3DEC solve is refused up
> front, before any stage prompt, rather than failing inside a subprocess launch.
> An explicit executable path is honoured on every platform, so a reachable
> licensed install is used wherever it is found.

CRA and RBE exclude support blocks from the equilibrium system, so they have no
displacement degrees of freedom and refuse a problem carrying a prescribed
displacement. Use LMGC90 or 3DEC for those problems.

## User Interface

COMPAS-Masonry defines 28 Rhino commands, all prefixed `CM_` and grouped by the
stage they belong to:

| Group | Commands |
|---|---|
| **Session** | `CM_Masonry_start`, `CM_Session_undo`, `CM_Session_redo`, `CM_Session_import`, `CM_Session_save`, `CM_Session_redraw`, `CM_Session_clear`, `CM_Session_settings` |
| **Model** | `CM_Model_blocks`, `CM_Model_contacts`, `CM_Model_supports`, `CM_Model_material`, `CM_Model_materialassign` |
| **Problem** | `CM_Problem_create`, `CM_Problem_contactlaw`, `CM_Problem_setsolver`, `CM_Problem_loads`, `CM_Problem_displacements`, `CM_Problem_solve` |
| **Results** | `CM_Results_show`, `CM_Results_print`, `CM_Results_block` |
| **TNA** | `CM_TNA_envelope`, `CM_TNA_formdiagram`, `CM_TNA_supports`, `CM_TNA_loads`, `CM_TNA_analysis`, `CM_TNA_blockexport` |

A typical run goes left to right through those groups: build the model, compute
its contacts, mark supports, assign a material, create a problem with a contact
law and a solver, add loads, solve, and draw the results.

**A problem is the load case.** Loads and prescribed movements are added straight
to a problem; solving applies all of them. To compare two load cases, duplicate
the problem in `CM_Problem_create`.

Saving works the way RhinoVAULT's does: `CM_Session_save` writes the whole
session to one JSON file and `CM_Session_import` opens it. There are no
per-artefact import/export commands. Results are left out deliberately — they are
re-derived by `CM_Problem_solve`.

These commands can be executed using the Rhino command line (simply start typing the command name),
or with the corresponding buttons of the COMPAS-Masonry toolbar.

![COMPAS-Masonry toolbar](/gitbook/.gitbook/assets/COMPAS-Masonry_toolbar.png)

If the toolbar is not visible after installing COMPAS-Masonry,
you can load it from the "Toolbars" page.
To open the "Toolbars" page, type `Toolbar` on the Rhino command line...

![Rhino Toolbars](/gitbook/.gitbook/assets/Rhino_toolbars.png)

## Documentation

For further "getting started" instructions, a tutorial, examples, and an detailed description of the individual commands and the user interface, please check out the online documentation here: [COMPAS-Masonry Gitbook](https://blockresearchgroup.gitbook.io/COMPAS-Masonry)

## Issues

Please report problems using the issue tracker of the github repo: <https://github.com/blockresearchgroup/compas-Masonry/issues>
