TopologicPythonBindings wrapper package
Project description
Topologic
Introduction
Topologic is a FOSS software modelling library enabling hierarchical and topological representations of architectural spaces, buildings and artefacts through non-manifold topology. Topologic is designed as a core library and additional plugins to visual data flow programming (VDFP) applications and parametric modelling platforms commonly used in architectural design practice. These applications provide workspaces with visual programming nodes and connections for architects to interact with Topologic and perform architectural design and analysis tasks.
Topologic is well-suited to create a lightweight representation of a building as an external envelope and the subdivision of the enclosed space into separate spaces and zones using zero-thickness internal surfaces. Because Topologic maintains topological consistency, a user can query these cellular spaces and surfaces regarding their topological data and thus conduct various analyses. For example, this lightweight and consistent representation was found to be well-matched with the input data requirements for energy analysis simulation software. Because Topologic allows entities with mixed dimensionalities and those that are optionally independent (e.g. a line, a surface, a volume) to co-exist, structural models can be represented in a coherent manner where lines can represent columns and beams, surfaces can represent walls and slabs, and volumes can represent solids. In addition, non-building entities, such as structural loads can be efficiently attached to the structure. This creates a lightweight model that is well-matched with the input data requirements for structural analysis simulation software.
Examples of use
Toplogic can be used to support energy modelling - say dimensioning the windows on different sides of a hospital to avoid summer overheating. Topologic can be be used to plot paths such as fire egress routes, the least disruptive route for a new service pipe or compute the most congested location in a city layout.
Rigorous Class Hierarchy
TopologicCore contains the following main classes:
- Topology: A Topology is an abstract superclass that stores constructors, properties and methods used by other subclasses that extend it.
- Vertex: A Vertex is a zero-dimensional entity equivalent to a geometry point.
- Edge: An Edge is a one-dimensional entity defined by two vertices. It is important to note that while a topologic edge is made of two vertices, its geometry can be a curve with multiple control vertices.
- Wire: A Wire is a contiguous collection of Edges where adjacent Edges are connected by shared Vertices. It may be open or closed and may be manifold or non-manifold.
- Face: A Face is a two-dimensional region defined by a collection of closed Wires. The geometry of a face can be flat or undulating.
- Shell: A Shell is a contiguous collection of Faces, where adjacent Faces are connected by shared Edges. It may be open or closed and may be manifold or non-manifold.
- Cell: A Cell is a three-dimensional region defined by a collection of closed Shells. It may be manifold or non- manifold.
- CellComplex: A CellComplex is a contiguous collection of Cells where adjacent Cells are connected by shared Faces. It is non- manifold.
- Cluster: A Cluster is a collection of any topologic entities. It may be contiguous or not and may be manifold or non- manifold. Clusters can be nested within other Clusters.
Build Instructions
Get source code
Clone the repository, switch to the branch and initialize submodules
(pybind11
):
git clone https://github.com/wassimj/Topologic
cd Topologic
git submodule update --init
Use pre-made build recipes for Linux, Windows, and macOS
Prerequisites:
- Anaconda or Miniconda (optional)
- On Windows: Microsoft Visual Studio 2022 with "Desktop development with C++" workload installed
There are pre-made recipes to build Topologic Python bindings for Linux, macOS,
and Windows which you may find in the directory recipe/
.
Pre-made recipe for Linux x86_64
Compilation using Anaconda/Miniconda: recipe/build_linux_x86_64_conda.sh
This script installs Miniconda if it is not found in $HOME/miniconda
and
builds Topologic Python bindings for Linux with Miniconda. Currently, Miniconda
runs with Python up to v3.12. Below commands should work (312
corresponds to
Python v3.12, and so on):
recipe/build_linux_x86_64_conda.sh 312
recipe/build_linux_x86_64_conda.sh 311
recipe/build_linux_x86_64_conda.sh 310
recipe/build_linux_x86_64_conda.sh 39
recipe/build_linux_x86_64_conda.sh 38
Compilation without using Anaconda/Miniconda: recipe/build_linux_x86_64_noconda.sh
This script builds Topologic Python bindings for Linux without using
Anaconda/Miniconda as it is not shipped with Python greater than 3.12 yet.
Assumed, you have Python installed on your Linux machine, and it is added into
your environment paths, so pip
just works in command line.
The script will also download and build openCASCADE 7.8 what may take around 1h:
recipe/build_linux_x86_64_noconda.sh
To build only openCASCADE:
recipe/build_linux_x86_64_noconda.sh --only-deps
Do not build openCASCADE:
recipe/build_linux_x86_64_noconda.sh --no-deps
Pre-made recipe for macOS ARM64
Compilation using Anaconda/Miniconda: recipe/build_macos_arm64_conda.sh
This script installs Miniconda if it is not found in $HOME/miniconda
and
builds Topologic Python bindings for macOS with Miniconda. Currently, Miniconda
runs with Python up to v3.12. Below commands should work (the build will target
macOS 11.0; 312
corresponds to Python v3.12, and so on):
recipe/build_macos_arm64_conda.sh 312 11
recipe/build_macos_arm64_conda.sh 311 11
recipe/build_macos_arm64_conda.sh 310 11
recipe/build_macos_arm64_conda.sh 39 11
recipe/build_macos_arm64_conda.sh 38 11
Compilation without using Anaconda/Miniconda: recipe/build_macos_arm64_noconda.sh
This script builds Topologic Python bindings for macOS without Miniconda as it
is not shipped with Python greater than 3.12 yet. Assumed, you have Python
installed on your macOS machine, and it is added into your environment paths, so
pip
just works in command line. The build will target your current macOS
version:
recipe/build_macos_arm64_noconda.sh
Pre-made recipe for Windows amd64
Compilation using Anaconda/Miniconda:recipe\build_win_amd64_conda.bat
This script installs Miniconda if it is not found in C:\Miniconda
and builds
Topologic Python bindings for Windows with Miniconda. Currently, Miniconda runs
with Python up to v3.12. Below commands should work (312
corresponds to Python
v3.12, and so on):
recipe\build_win_amd64_conda.bat /createenv 312
recipe\build_win_amd64_conda.bat /useenv 312
recipe\build_win_amd64_conda.bat /createenv 311
recipe\build_win_amd64_conda.bat /useenv 311
recipe\build_win_amd64_conda.bat /createenv 310
recipe\build_win_amd64_conda.bat /useenv 310
recipe\build_win_amd64_conda.bat /createenv 39
recipe\build_win_amd64_conda.bat /useenv 39
recipe\build_win_amd64_conda.bat /createenv 38
recipe\build_win_amd64_conda.bat /useenv 38
Compilation without using Anaconda/Miniconda: recipe\build_win_amd64_noconda.bat
This script builds Topologic Python bindings for Windows without Miniconda as it
is not shipped with Python greater than 3.12 yet. Assumed, you have Python
installed on your Windows machine, and it is added into your environment paths,
so pip
just works in command line.
The script will use compiled openCASCADE 7.8 for Windows AMD64 from the official portal:
recipe/build_win_amd64_noconda.bat
Alternative build instructions for Anaconda/Miniconda users and writers of alternative build recipes
If the above pre-made build recipes are not working for you for some reason, you may have Anaconda/Miniconda prepared your way.
Prerequisites:
- Anaconda or Miniconda (mandatory)
- On Windows: Microsoft Visual Studio 2022 with "Desktop development with C++" workload installed
The instructions for using purely with Anaconda/Miniconda
- Create the Conda-based build environment for the target Python version: the files
conda_env_topologic_*.yml
where*
ispy310
,py311
, etc. for Python 3.10, 3.11, etc. define Conda environments namedtopologic_py310
,topologic_py311
, etc. that contain the build dependencies, notably OpenCASCADE, and build tools.
As of 20221217, Blender comes with Python 3.10; the following instructions are for this version.
conda env create -f conda_env_topologic_py310.yml
(Developer note: keep the contents of the conda_env_topologic_*.yml
files in sync.)
- Activate the Conda environment:
conda activate topologic_py310
- To build TopologicCore separately, if needed:
python build.py --build-type Release --source-dir . --build-dir build --build-target TopologicCore
The built library is found in build/TopologicCore/
.
- To build the Python extension:
- Windows
cd TopologicPythonBindings
python build_windows.py
- Linux
cd TopologicPythonBindings
python build_linux.py
- MacOS
cd TopologicPythonBindings
python build_macos.py
Conclusion
The build output is found in wheelhouse/
.
The build output is a Python wheel that contains the extension module with TopologicCore linked into it and its OpenCASCADE dependecies "vendored-in" from the Conda-based build environment. It can be installed with pip
or its contents can be unzipped.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for topologic_core-7.0.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43111ddf799e84165adcd58c48079db4687c7ed126393af106cffdc6a04aee15 |
|
MD5 | 670042f86598908d6e91ce5d544bb48a |
|
BLAKE2b-256 | d34cdb38a503361facb7bf48e54dbf00a43fe47f9dd86c5b9a5e752f157a977a |
Hashes for topologic_core-7.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60300b14cc10a06412a776ba5c9a2bdf8f2fd0e3a476fbc2f6744a0c675f761f |
|
MD5 | 332ae6eb8572794d778af0a70ccb2b73 |
|
BLAKE2b-256 | 99718101d9e2ed4122784ef859d30d4f64fb6e6865afe372fb37a32ee22ff9df |
Hashes for topologic_core-7.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9a590141c1cb80a19fef9f8f2fe7fddb21a694f3b8f021c6fe3302b8321632c |
|
MD5 | 6ffb026a2f6a819f5a3cb3d4ac6664a5 |
|
BLAKE2b-256 | acdbc82b2220a6eeab9201169a308719e2e71b0d12993d4b38fc707634f554a6 |
Hashes for topologic_core-7.0.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0b27d1a2d15b8e36dd5f511a8968289d52e402e32cd2894a29fc35a3724612d |
|
MD5 | e544049b33fbd240fe0d3cb989ad392d |
|
BLAKE2b-256 | c3eef7a8257fcdb17d55c12969a7379cdba263e09eb9b32b4f20a197ea507148 |
Hashes for topologic_core-7.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb20768102085ade7e3b8cae6ede0a978f93e42547f9afb248d07f1a3866c4ac |
|
MD5 | 03b22120d270cc682dcc8267583676ae |
|
BLAKE2b-256 | 733eeefe4140fcd89b5fd7c0bb2bbadce750a9ea464d7a0fd68a6a6e8e79e90a |
Hashes for topologic_core-7.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9394228ce7db437feb0801f06cd77a2dc383bb47d433605f3fd4dd0463d02836 |
|
MD5 | 43b86ad301c74ac883cc9d263daa13b8 |
|
BLAKE2b-256 | ef835a43456399e0f2c7781a88ed26bc3a71ec673cd4d3d090ec690b1d5555f9 |
Hashes for topologic_core-7.0.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6af4a12e9affc0a96ad16935958a0c1a0a8f71a6e42d36809fa7db9537533cca |
|
MD5 | 44089ed8f89da89ec5d53a35c60b1e7f |
|
BLAKE2b-256 | 899c8e3e5577e9df89311b5f70a08b72a33e64c50720f67e6aae8af86dcfe10d |
Hashes for topologic_core-7.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 682d9f8f9d4f898eb50866978009e3a4cccc9ced626252206a0738de2e526267 |
|
MD5 | 02e520b4fe97eb9ad73663acd5b692c1 |
|
BLAKE2b-256 | 4528942ccf2820404b3da07708de969ade87a4ea651dcf766b8ff5ffc4be8323 |
Hashes for topologic_core-7.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd66ebfc4a9500394b5bcaf344febaf1db9e25aebd83ac2be9976f6bae19cbe5 |
|
MD5 | 5ebc7f429656e1286fe45c0a33f20541 |
|
BLAKE2b-256 | 59ee6f394eb8010909a24aeb53076348124eb950c02e395435797508fd2c502e |