def plotDecalagedMomentumDesignDiagram(self, ax=None, fig=None, **options): """ Plot DecalagedMomentumDesignDiagram. """ fig, ax = getAxis() if ax == None else (fig, ax) ax.set_aspect("auto") x, momentum_positive, momentum_negative = self.getDecalagedMomentumDesignDiagram( **options) ax.plot(x, momentum_positive) ax.plot(x, momentum_negative) plt.gca().invert_yaxis() return make_dxf(ax, **options)
def plot(self, c=2, ax=None, fig=None, color_plot="blue", **options): """ Plot the transversal vision of the transversal bar. """ height, width, diameter = self.height, self.width, self.diameter x0, y0 = -width / 2, c fig, ax = getAxis((x0, diameter), (x0 + diameter + width - diameter, c + height)) if ax == None else (fig, ax) left_bar = plt.Rectangle((x0, y0), diameter, height, hatch="/", fill=False) right_bar = plt.Rectangle((width / 2 - diameter, y0), diameter, height, hatch="/", fill=False) top_bar = plt.Rectangle((x0 + diameter, y0 + height - diameter), width - 2 * diameter, diameter, hatch="/", fill=False) bottom_bar = plt.Rectangle((x0 + diameter, y0), width - 2 * diameter, diameter, hatch="/", fill=False) anchor = plt.Rectangle( (width / 2 + diameter / 2, y0 + height - diameter / 2), diameter, self.anchor, hatch="|", fill=False, angle=135) #anchor ax.add_artist(left_bar) ax.add_artist(right_bar) ax.add_artist(top_bar) ax.add_artist(bottom_bar) ax.add_artist(anchor) return make_dxf(ax, **options) # if return_ax else None
def plotTransversal(self, concrete_beam, x, ax=None, fig=None, color_plot="red", **options): """ Plot the transversal vision of the longitudinal bars. """ fig, ax = getAxis((-20, 0), (20, 50)) if ax == None else (fig, ax) for long_bar in self.getBarTransversalPosition(concrete_beam, x): circle = plt.Circle((long_bar[0], long_bar[1]), long_bar[2]) ax.add_artist(circle) return make_dxf(ax, **options) # if return_ax else None
def plot(self, column_height=30, beam_color="b", **options): _, ax = getAxis() first_beam_element = self.beam_elements[0] last_beam_element = self.beam_elements[-1] ax.plot([first_beam_element.n1.x, first_beam_element.n1.x], [ first_beam_element.section.y0, first_beam_element.section.y0 + first_beam_element.section.height ], color=beam_color) ax.plot([last_beam_element.n2.x, last_beam_element.n2.x], [ last_beam_element.section.y0, last_beam_element.section.y0 + last_beam_element.section.height ], color=beam_color) # print beam for beam_number, beam_element in enumerate(self.beam_elements): positions = [beam_element.n1.x, beam_element.n2.x] ax.plot(positions, np.repeat(beam_element.section.y0, 2), color=beam_color) ax.plot(positions, np.repeat( beam_element.section.y0 + beam_element.section.height, 2), color=beam_color) if beam_number + 1 != len(self.beam_elements): ax.plot([beam_element.n2.x, beam_element.n2.x], [ beam_element.section.y0 + beam_element.section.height, self.beam_elements[beam_number + 1].section.y0 + self.beam_elements[beam_number + 1].section.height ], color=beam_color) # print column for node in self.initial_beam_elements.nodes: if node.length != 0: ax.plot((node.x - node.length / 2, node.x - node.length / 2), (0, -column_height), color=beam_color) ax.plot((node.x + node.length / 2, node.x + node.length / 2), (0, -column_height), color=beam_color) return make_dxf(ax, **options)
def plot(self, N=100, color_plot="red", ax=None, fig=None, **options): """ Plot the section. """ height = self.height fig, ax = getAxis() if ax == None else (fig, ax) y = np.linspace(0, height, N) x = np.array([self.function_width(xi) for xi in y]) x_base = np.linspace(-x[0], x[0], 100) x_top = np.linspace(-x[-1], x[-1], 100) ax.plot(x, y, color=color_plot) # plot right simetry ax.plot(2 * y[0] - x, y, color=color_plot) # plot left simetry ax.plot(x_base, np.zeros(len(y)), color=color_plot) # plot base ax.plot(x_top, height * np.ones(len(y)), color=color_plot) # plot top return make_dxf(ax, **options)
def plot(self, prop='area_accumulated', **options): """ Plot the lonfitudinal vision of the longitudinal bars. """ _, ax = getAxis() ax.set_aspect("auto") if prop == 'area_accumulated': plt.gca().invert_yaxis() #xs, ys = [], [] for steelbar in self.steel_bars: x, y = steelbar.getPlotInfo(prop) ax.plot(x, y) #xs, ys = [*xs, x[np.invert(np.nan(x))]], [*ys, y[np.invert(np.nan(y))]] #min_y = min(ys) #for x, y in zip(xs, ys): # min_y += space_between_bars # ax.plot(x, min_y) return make_dxf(ax, **options)