Skip to content

Commit

Permalink
update requeriments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoavelino committed Oct 18, 2022
1 parent 8afa720 commit e2ba9bd
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 33 deletions.
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We highly recommend to install ``compas_tno`` and related packages in a separate

In this guide, we will create and use an environmenment based on Python 3.8 with the name ``tno``.

Open your terminal and type the following to create a new environmenment and install the dependencies `COMPAS <https://compas.dev>`_ and `triangle <https://www.cs.cmu.edu/~quake/triangle.html>`_:
Open your terminal and type the following to create a new environmenment and install the dependencies `COMPAS <https://compas.dev>`_, `triangle <https://www.cs.cmu.edu/~quake/triangle.html>`_ and the COMPAS Standalone `Viewer <https://github.com/compas-dev/compas_view2>`_:

.. raw:: html

Expand All @@ -37,7 +37,7 @@ Open your terminal and type the following to create a new environmenment and ins

.. code-block:: bash
conda create -n tno -c conda-forge python=3.8 COMPAS triangle
conda create -n tno -c conda-forge python COMPAS triangle compas_view2
.. raw:: html

Expand All @@ -46,7 +46,7 @@ Open your terminal and type the following to create a new environmenment and ins

.. code-block:: bash
conda create -n tno -c conda-forge python=3.8 python.app COMPAS triangle
conda create -n tno -c conda-forge python python.app COMPAS triangle compas_view2
.. raw:: html

Expand Down
44 changes: 44 additions & 0 deletions examples/_tutorial/0_arch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# from compas_tno.diagrams import FormDiagram
# from compas_tno.viewers import Viewer
# from compas_tno.shapes import Shape

# H = 1.0
# L = 2.0
# b = 0.5
# discr = 20

# arch = Shape.create_arch(H=H, L=L, b=b)

# form = FormDiagram.create_arch(H=H, L=L, discretisation=discr)

# view = Viewer(form, arch)
# view.draw_form()
# view.draw_shape()
# view.show()


import compas
from compas.datastructures import Mesh
from compas.geometry import Translation
from compas.geometry import Scale

from compas_view2.app import App

mesh = Mesh.from_obj(compas.get('faces.obj'))
mesh.transform(Translation.from_vector([0.5, 0, 0.1]))

mesh2 = mesh.transformed(Translation.from_vector([-11, 0, 0]))

# =============================================================================
# Visualization
# =============================================================================

viewer = App(width=1600, height=900)
viewer.view.camera.rx = -60
viewer.view.camera.rz = 0
viewer.view.camera.ty = -2
viewer.view.camera.distance = 10

viewer.add(mesh, hide_coplanaredges=False)
viewer.add(mesh2, hide_coplanaredges=True)
viewer.show()
17 changes: 0 additions & 17 deletions examples/tutorial/0_arch.py

This file was deleted.

15 changes: 8 additions & 7 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
autopep8
black
attrs >=17.4
bump2version >=0.5.11
bump2version >=1.0.1
check-manifest >=0.36
doc8
flake8
Expand All @@ -9,12 +9,13 @@ invoke >=0.14
ipykernel
ipython >=5.8
isort
m2r
m2r2
nbsphinx
pydocstyle
pytest >=3.2
sphinx_compas_theme >=0.13
sphinx >=3.4
pytest <7.1
sphinx_compas_theme >=0.15.18
sphinx ==4.5
twine
matplotlib
wheel
jinja2 >= 3.0
-e .
5 changes: 4 additions & 1 deletion src/compas_tno/solvers/solver_MATLAB.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from compas_tno.algorithms import xyz_from_q

import matlab.engine
try:
import matlab.engine
except:
print('matlab not available in the system')
import time

from numpy import array
Expand Down
4 changes: 2 additions & 2 deletions src/compas_tno/utilities/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from compas.datastructures import Mesh
from compas.geometry import add_vectors, scale_vector

from compas_assembly.datastructures import Assembly


def extended_dual(form, cls=None):
"""Create the extended dual of the mesh, which is the centroid dual added with the faces in the boundary.
Expand Down Expand Up @@ -58,6 +56,8 @@ def blocks_from_dual(dual, thk):
idos = dual.copy()
edos = dual.copy()

from compas_assembly.datastructures import Assembly

assembly = Assembly()

for vertex in dual.vertices():
Expand Down
1 change: 0 additions & 1 deletion src/compas_tno/utilities/form.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# from compas_tno.diagrams import FormDiagram
from symbol import factor
from compas.geometry import intersection_segment_segment_xy
from compas.geometry import distance_point_point_xy
from compas.geometry import Translation
Expand Down
4 changes: 2 additions & 2 deletions src/compas_tno/viewers/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def draw_thrust(self, scale_width=True, absolute_scale=True, cull_negative=False
Xi = [Xb[0] + (Xa[0] - Xb[0]) * coef, Xb[1] + (Xa[1] - Xb[1]) * coef, 0.0]
line = Line(Xa, Xi)
if not scale_width:
self.app.add(line, name=str((u, v)), linewidth=base_thick, color=self.settings['color.edges.thrust'])
self.app.add(line, name=str((u, v)), linewidth=base_thick, linecolor=self.settings['color.edges.thrust'])
continue
q = self.thrust.edge_attribute((u, v), 'q')
length = self.thrust.edge_length(u, v)
Expand All @@ -270,7 +270,7 @@ def draw_thrust(self, scale_width=True, absolute_scale=True, cull_negative=False
forces.append(force)
thks.append(thk)
if force > self.settings['tol.forces'] * 2:
self.app.add(line, name=str((u, v)), linewidth=thk, color=self.settings['color.edges.thrust'])
self.app.add(line, name=str((u, v)), linewidth=thk, linecolor=self.settings['color.edges.thrust'])

# print('Min / Max thks:', min(thks), max(thks))
# print('Min / Max forces:', min(forces), max(forces))
Expand Down

0 comments on commit e2ba9bd

Please sign in to comment.