CAN.add_component( Pipe(1.0, 1.0, Point(-3.0, -3.0), face_color=(0.0, 0.0, 0.597659))) CAN.add_component( Pipe(1.0, 1.0, Point(-1.5, -3.0), face_color=(0.19531, 0.19531, 0.67578))) CAN.add_component( Pipe(1.0, 1.0, Point(0.0, -3.0), face_color=(0.2968, 0.2968, 0.71484))) CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -3.0), face_color=(0.3984, 0.3984, 0.7539))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -3.0), face_color=(0.49609, 0.49609, 0.796875))) CAN.add_component( Pipe(1.0, 1.0, Point(4.5, -3.0), face_color=(0.5976, 0.5976, 0.8359))) # Purples CAN.add_component( Pipe(1.0, 1.0, Point(-3.0, -4.5), face_color=(0.30, 0.12, 0.40))) CAN.add_component( Pipe(1.0, 1.0, Point(-1.5, -4.5), face_color=(0.37, 0.20, 0.46))) CAN.add_component( Pipe(1.0, 1.0, Point(0.0, -4.5), face_color=(0.44, 0.29, 0.52))) CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -4.5), face_color=(0.51, 0.38, 0.58))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -4.5), face_color=(0.58, 0.47, 0.64))) CAN.add_component( Pipe(1.0, 1.0, Point(4.5, -4.5), face_color=(0.65, 0.56, 0.70))) print(Component.stats) CAN.draw(save_file=None, display=True, print_information=False)
simple.add_component( Pipe( 1.0, 0.5, Point(4.0, 0.0), name = 'Pipe 3', angle = 0.0, label_location = 'center', label_pad = 0.0, label_angle = 0.0 ) ) simple.add_node(1.5, 0.0, name = 'Node 1') simple.add_node(1.5, 1.0, name = 'Node 2') simple.add_node(3.5, 1.0, name = 'Node 3') simple.add_node(3.5, 0.0, name = 'Node 4') simple.connect( 'Pipe 1:outlet', 'Node 1', 'Node 2', 'Pipe 2:inlet', name = 'Junction 1', label_edge_number = 0, label_location = 'top', label_pad = 1.0, label_angle = 0.0, label_shift = 1.0 ) simple.connect( 'Pipe 2:outlet', 'Node 3', 'Node 4', 'Pipe 3:inlet', name = 'Junction 2', label_edge_number = 2, label_location = 'top', label_pad = 1.0, label_angle = 0.0, label_shift = -1.0 ) CAN = Canvas(border_thickness = 0.05, grid = True) CAN.add_system(simple) CAN.draw(save_file = 'test.pdf', display = True, print_information = False)
command_line_parser = ExampleDebugger("A simple system.") command_line_parser.parse() from schematics import Canvas from schematics import System from schematics import Pipe from schematics import Pump from schematics import CoreChannel from schematics import Point tmi = System("tmi") radius = 1.0 px = 0.0 py = 0.0 y = (0.5 * radius) + py x = (3.0 * radius) + px tmi.add_node(x, y, name="outlet") PumpA = Pump(radius, Point(px, py), name="Pump", ref=None, angle=90.0, label_angle=0.0) tmi.add_component(PumpA) tmi.connect("Pump:outlet", "outlet") CAN = Canvas(border_thickness=0.05, grid=True) CAN.add_system(tmi) CAN.draw(save_file="tmi.pdf", display=True)
y = HXA.center_of_rotation.y - hx_length - 0.4 tmi.add_node(x, y, name = 'Branch6-A:1') tmi.add_node(-1.0 * x, y, name = 'Branch6-B:1') x = Pipe2CLA.center_of_rotation.x + 0.4 tmi.add_node(x, y, name = 'Branch6-A:2') tmi.add_node(-1.0 * x, y, name = 'Branch6-B:2') y = Pipe2CLA.center_of_rotation.y tmi.add_node(x, y, name = 'Branch6-A:3') tmi.add_node(-1.0 * x, y, name = 'Branch6-B:3') tmi.connect( 'HX-A(primary):outlet', 'Branch6-A:1', 'Branch6-A:2', 'Branch6-A:3', 'pipe2-CL-A:inlet', name = 'Branch6-A', label_edge_number = 1, label_location = 'bottom', label_pad = 1.0, label_angle = 0.0, label_shift = 1.0 ) tmi.connect( 'HX-B(primary):outlet', 'Branch6-B:1', 'Branch6-B:2', 'Branch6-B:3', 'pipe2-CL-B:inlet', name = 'Branch6-B', label_edge_number = 1, label_location = 'top', label_pad = 1.0, label_angle = 0.0, label_shift = 1.0 ) # draw CAN = Canvas(border_thickness = 0.0, grid = False) CAN.add_system(tmi) CAN.draw(save_file = 'tmi.pdf', display = True)
CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -1.5), face_color = (0.83, 0.65, 0.15))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -1.5), face_color = (0.0, 0.0, 0.0))) # CAN.add_component( Pipe(1.0, 1.0, Point(4.5, -1.5), face_color = (1.0, 1.0, 1.0, 1.0))) # Summertime Loving, Loving in the Summer (Time) CAN.add_component( Pipe(1.0, 1.0, Point(-3.0, -3.0), label_location = 'left', label_string = 'Summertime Loving,\nLoving in the Summer\n(Time)', label_pad = 0.25, face_color = (1.00, 0.75, 0.31))) CAN.add_component( Pipe(1.0, 1.0, Point(-1.5, -3.0), face_color = (0.42, 0.82, 0.86))) CAN.add_component( Pipe(1.0, 1.0, Point(0.0, -3.0), face_color = (0.05, 0.65, 0.71))) CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -3.0), face_color = (0.05, 0.27, 0.49))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -3.0), face_color = (0.91, 0.44, 0.16))) # CAN.add_component( Pipe(1.0, 1.0, Point(4.5, -3.0), face_color = ())) # Winters CAN.add_component( Pipe(1.0, 1.0, Point(-3.0, -4.5), label_location = 'left', label_string = 'Winters', face_color = (0.24, 0.39, 0.36))) CAN.add_component( Pipe(1.0, 1.0, Point(-1.5, -4.5), face_color = (0.27, 0.08, 0.28))) CAN.add_component( Pipe(1.0, 1.0, Point(0.0, -4.5), face_color = (0.82, 0.83, 0.75))) CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -4.5), face_color = (0.02, 0.00, 0.22))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -4.5), face_color = (0.48, 0.48, 0.48))) # CAN.add_component( Pipe(1.0, 1.0, Point(4.5, -4.5), face_color = ())) # The Monarch's Lair CAN.add_component( Pipe(1.0, 1.0, Point(-3.0, -6.0), label_location = 'left', label_string = "The Monarch's Lair", face_color = (0.64, 0.05, 0.71))) CAN.add_component( Pipe(1.0, 1.0, Point(-1.5, -6.0), face_color = (0.95, 0.63, 0.15))) CAN.add_component( Pipe(1.0, 1.0, Point(0.0, -6.0), face_color = (0.98, 0.79, 0.00))) CAN.add_component( Pipe(1.0, 1.0, Point(1.5, -6.0), face_color = (0.64, 0.04, 0.49))) CAN.add_component( Pipe(1.0, 1.0, Point(3.0, -6.0), face_color = (0.91, 0.71, 0.86))) print Component.stats CAN.draw(save_file = None, display = True, print_information = False)
n = deepcopy(self.name, memo), ll = deepcopy(self.label_location, memo), ls = deepcopy(self.label_string, memo), la = deepcopy(self.label_angle, memo), lp = deepcopy(self.label_pad, memo), fs = deepcopy(self.font_size, memo), a = deepcopy(self.angle, memo), ref = deepcopy(self.reflect, memo), fc = deepcopy(self.face_color, memo), ec = deepcopy(self.edge_color, memo), lw = deepcopy(self.line_width, memo) ) # debugging routine if __name__ == '__main__': from schematics import component_debug_switch debugging = component_debug_switch('The component Pipe') from schematics import Canvas component = Pipe( 1.0, 0.5, Point(0.0, 0.0), name = 'Pipe', a = 0.0, ll = 'top', lp = 1.0, ls = 'Component', la = 0.0, fs = 12 ) CAN = Canvas(border_thickness = 0.05, grid = False) CAN.add_component(component) CAN.add_graph(component.graph) CAN.draw(display = True)
ref=deepcopy(self.reflect, memo), fc=deepcopy(self.face_color, memo), ec=deepcopy(self.edge_color, memo), lw=deepcopy(self.line_width, memo)) # debugging routine if __name__ == '__main__': from schematics import component_debug_switch debugging = component_debug_switch('The component Pipe') from schematics import Canvas component = Pipe(1.0, 0.5, Point(0.0, 0.0), name='Pipe', a=0.0, ll='top', lp=1.0, ls='Component', la=0.0, fs=12) CAN = Canvas(border_thickness=0.05, grid=False) CAN.add_component(component) CAN.add_graph(component.graph) CAN.draw(display=True)