From 0b2d24f48fd7727e96edd25eedff726c4262f3ca Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Mon, 4 Mar 2024 22:53:09 +0100 Subject: [PATCH] remove rhino --- src/compas_bender/rhino/__init__.py | 27 ----- src/compas_bender/rhino/artists/__init__.py | 0 .../rhino/artists/bendnetworkartist.py | 110 ------------------ 3 files changed, 137 deletions(-) delete mode 100644 src/compas_bender/rhino/__init__.py delete mode 100644 src/compas_bender/rhino/artists/__init__.py delete mode 100644 src/compas_bender/rhino/artists/bendnetworkartist.py diff --git a/src/compas_bender/rhino/__init__.py b/src/compas_bender/rhino/__init__.py deleted file mode 100644 index 77347b6..0000000 --- a/src/compas_bender/rhino/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -******************************************************************************** -rhino -******************************************************************************** - -.. currentmodule:: compas_bender.rhino - - -Classes -======= - -.. autosummary:: - :toctree: generated/ - :nosignatures: - - BendNetworkArtist - -""" - -from __future__ import print_function -from __future__ import absolute_import -from __future__ import division - -from .artists.bendnetworkartist import BendNetworkArtist - - -__all__ = ["BendNetworkArtist"] diff --git a/src/compas_bender/rhino/artists/__init__.py b/src/compas_bender/rhino/artists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/compas_bender/rhino/artists/bendnetworkartist.py b/src/compas_bender/rhino/artists/bendnetworkartist.py deleted file mode 100644 index 798bfc6..0000000 --- a/src/compas_bender/rhino/artists/bendnetworkartist.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import print_function -from __future__ import absolute_import -from __future__ import division - -import math -import compas_rhino - -from compas.geometry import scale_vector -from compas.geometry import length_vector -from compas.geometry import add_vectors - -from compas_rhino.artists import NetworkArtist - - -class BendNetworkArtist(NetworkArtist): - """ - Artist for bending-active networks. - """ - - def draw_axial(self, scale=1.0, tol=1e-3): - """ - Draw axial forces as cylinders around the corresponding edges. - - Parameters - ---------- - scale : float, optional - Scale for the cylinder radius. - tol : float, optional - Cylinders with a radius (after scaling) - smaller than this tolerance will not be drawn. - - Returns - ------- - list[guid] - The identifiers of the objects that were added to the Rhino model space. - - """ - fabs = math.fabs - cylinders = [] - for edge, attr in self.network.edges(True): - force = attr["f"] - if force > 0: - color = (255, 0, 0) - elif force < 0: - color = (0, 0, 255) - else: - continue - radius = 0.5 * fabs(force) * scale - if radius < tol: - continue - start, end = self.network.edge_coordinates(*edge) - cylinders.append( - {"start": start, "end": end, "radius": radius, "color": color} - ) - return compas_rhino.draw_cylinders( - cylinders, layer=self.layer, clear=False, redraw=False - ) - - def draw_reactions(self, scale=1.0, tol=1e-3): - """ - Draw reaction forces as force vectors at the anchored nodes. - - Parameters - ---------- - scale : float, optional - Scale for the length of the vectors. - tol : float, optional - Vectors with a length (after scaling) - smaller than this tolerance will not be drawn. - - Returns - ------- - list[guid] - The identifiers of the objects that were added to the Rhino model space. - - """ - lines = [] - for node, attr in self.network.nodes_where({"is_anchor": True}, True): - start = self.network.node_coordinates(node) - vector = [attr["rx"], attr["ry"], attr["rz"]] - length = length_vector(vector) - if length * scale < tol: - continue - end = add_vectors(start, scale_vector(vector, scale)) - lines.append( - {"start": start, "end": end, "arrow": "end", "color": (0, 255, 0)} - ) - return compas_rhino.draw_lines( - lines, layer=self.layer, clear=False, redraw=False - ) - - # def draw_shear(self, scale=1.0, tol=1e-3): - # """Draw shear forces at nodes of the splines. - - # Parameters - # ---------- - # scale : float, optional - # Scale for the shear forces. - # Default is ``1.0``. - # tol : float, optional - # Shear forces with a length (after scaling) - # smaller than this tolerance will not be drawn. - # Default is ``1e-3``. - - # Returns - # ------- - # list[guid] - # The identifiers of the objects that were added to the Rhino model space. - # """ - # for spline in self.network.splines: