예제 #1
0
    def draw(self, layer=None, clear_layer=True, settings=None):
        """Draw the force diagram in Rhino.

        Parameters
        ----------
        layer : str, optional
            The layer in which the drawing should be contained.
        clear_layer : bool, optional
            Clear the layer if ``True``.
            Default is ``True``.
        settings : dict, optional
            A dictionary of settings overwriting the default settings of the artist.
        """
        from compas_tna.rhino import ForceArtist
        artist = ForceArtist(self, layer=layer)
        if clear_layer:
            artist.clear_layer()
        if not settings:
            settings = {}
        vertexcolor = {}
        vertexcolor.update({
            key: '#00ff00'
            for key in self.vertices_where({'is_fixed': True})
        })
        artist.draw_vertices(color=vertexcolor)
        artist.draw_edges()
        artist.redraw()
예제 #2
0
 def draw(self, layer=None, clear_layer=True, settings=None):
     from compas_tna.rhino import ForceArtist
     artist = ForceArtist(self, layer=layer)
     if clear_layer:
         artist.clear_layer()
     if not settings:
         settings = {}
     vertexcolor = {}
     vertexcolor.update({key: '#00ff00' for key in self.vertices_where({'is_fixed': True})})
     artist.draw_vertices(color=vertexcolor)
     artist.draw_edges()
     artist.redraw()
예제 #3
0
# ------------------------------------------------------------------------------
horizontal(form, force, kmax=100)

# ------------------------------------------------------------------------------
# vertical equilibrium
# ------------------------------------------------------------------------------
vertical_from_zmax(form, force, zmax=5.)
vertical_from_self(form, force)
vertical_from_formforce(form, force)

# ------------------------------------------------------------------------------
# rhino drawings
# ------------------------------------------------------------------------------

# form diagram -----------------------------------------------------------------
artist = FormArtist(form, layer='FormDiagram')
artist.clear_layer()
artist.draw_vertices(keys=list(form.vertices_where({'is_external': False})))
artist.draw_edges(keys=list(form.edges_where({'is_edge': True, 'is_external': False})))
artist.draw_faces(fkeys=list(form.faces_where({'is_loaded': True})), join_faces=True)
artist.draw_reactions(scale=.1)
artist.draw_forces(scale=.003)
artist.redraw()

# force diagram ----------------------------------------------------------------
artist_ = ForceArtist(force, layer='ForceDiagram')
artist_.clear_layer()
artist_.draw_vertices()
artist_.draw_edges()
artist_.redraw()