#! python3 import rhinoscriptsyntax as rs import random rs.DeleteObjects(rs.AllObjects()) #### Grundplatte###### # Define the corner point and the dimensions of the cuboid corner = (-500, -500, -10) # Starting point (x, y, z) width = 1000 # Width of the cuboid depth = 1000 # Depth of the cuboid (length in the Z-axis) height = 10 # Height of the cuboid # Define the opposite corner based on the dimensions opposite_corner = (corner[0] + width, corner[1] + depth, corner[2] + height) # Create the cuboid (box) using the corner points box = rs.AddBox([corner, (corner[0] + width, corner[1], corner[2]), (corner[0] + width, corner[1] + depth, corner[2]), (corner[0], corner[1] + depth, corner[2]), (corner[0], corner[1], corner[2] + height), (corner[0] + width, corner[1], corner[2] + height), (corner[0] + width, corner[1] + depth, corner[2] + height), (corner[0], corner[1] + depth, corner[2] + height)]) rs.SelectObject(box) #### Skyline ###### def draw_building(x, y, width, height): corner = (x, y, 0) # Setzt den Startpunkt des Gebäudes opposite_corner = (x + width, y + width, height) # Berechnet das obere gegenüberliegende Eckpunkt # Fügt das Rechteck rs.AddBox([corner, (x + width, y, 0), (x + width, y + width, 0), (x, y + width, 0), (x, y, height), (x + width, y, height), (x + width, y + width, height), (x, y + width, height)]) def draw_skyline(start_x, start_y, num_rows, num_buildings, max_width, max_height, min_width, min_height, row_gap): for row in range(num_rows): x_position = start_x # Startposition für das erste Gebäude in dieser Reihe y_position = start_y + row * row_gap # Vertikale Position der Reihe for _ in range(num_buildings): width = random.randint(min_width, max_width) # Zufällige Breite für jedes Gebäude height = random.randint(min_height, max_height) # Zufällige Höhe für jedes Gebäude draw_building(x_position, y_position, width, height) # Position für das nächste Gebäude x_position += width + random.randint(10, 30) # Abstand zwischen den Gebäuden # Startpunkt (x=0, y=0), 5 Reihen, Abstand zwischen den Reihen (row_gap) von 150 draw_skyline(100, -300, 7, 5, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): corner = (x, y, 0) # Setzt den Startpunkt des Gebäudes opposite_corner = (x + width, y + width, height) # Berechnet das obere gegenüberliegende Eckpunkt # Fügt das Rechteck (Gebäude) zur Rhino-Welt hinzu rs.AddBox([corner, (x + width, y, 0), (x + width, y + width, 0), (x, y + width, 0), (x, y, height), (x + width, y, height), (x + width, y + width, height), (x, y + width, height)]) def draw_skyline(start_x, start_y, num_rows, num_buildings, max_width, max_height, min_width, min_height, row_gap): for row in range(num_rows): x_position = start_x # Startposition für das erste Gebäude in dieser Reihe y_position = start_y + row * row_gap # Vertikale Position der Reihe for _ in range(num_buildings): width = random.randint(min_width, max_width) # Zufällige Breite für jedes Gebäude height = random.randint(min_height, max_height) # Zufällige Höhe für jedes Gebäude draw_building(x_position, y_position, width, height) # Position für das nächste Gebäude x_position += width + random.randint(10, 30) # Abstand # Startpunkt (x=0, y=0), 5 Reihen, Abstand zwischen den Reihen (row_gap) von 150 draw_skyline(-300, -300, 7, 4, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): corner = (x, y, 0) # Setzt den Startpunkt des Gebäudes opposite_corner = (x + width, y + width, height) # Berechnet das obere gegenüberliegende Eckpunkt # Fügt das Rechteck (Gebäude) zur Rhino-Welt hinzu rs.AddBox([corner, (x + width, y, 0), (x + width, y + width, 0), (x, y + width, 0), (x, y, height), (x + width, y, height), (x + width, y + width, height), (x, y + width, height)]) def draw_skyline(start_x, start_y, num_rows, num_buildings, max_width, max_height, min_width, min_height, row_gap): for row in range(num_rows): x_position = start_x # Startposition für das erste Gebäude in dieser Reihe y_position = start_y + row * row_gap # Vertikale Position der Reihe for _ in range(num_buildings): width = random.randint(min_width, max_width) # Zufällige Breite für jedes Gebäude height = random.randint(min_height, max_height) # Zufällige Höhe für jedes Gebäude draw_building(x_position, y_position, width, height) # Position für das nächste Gebäude x_position += width + random.randint(10, 30) # Abstand # Startpunkt (x=0, y=0), 5 Reihen, Abstand zwischen den Reihen (row_gap) von 150 draw_skyline(-80, -300, 2, 3, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): corner = (x, y, 0) # Setzt den Startpunkt des Gebäudes opposite_corner = (x + width, y + width, height) # Berechnet das obere gegenüberliegende Eckpunkt # Fügt das Rechteck (Gebäude) zur Rhino-Welt hinzu rs.AddBox([corner, (x + width, y, 0), (x + width, y + width, 0), (x, y + width, 0), (x, y, height), (x + width, y, height), (x + width, y + width, height), (x, y + width, height)]) def draw_skyline(start_x, start_y, num_rows, num_buildings, max_width, max_height, min_width, min_height, row_gap): for row in range(num_rows): x_position = start_x # Startposition für das erste Gebäude in dieser Reihe y_position = start_y + row * row_gap # Vertikale Position der Reihe for _ in range(num_buildings): width = random.randint(min_width, max_width) # Zufällige Breite für jedes Gebäude height = random.randint(min_height, max_height) # Zufällige Höhe für jedes Gebäude draw_building(x_position, y_position, width, height) # Position für das nächste Gebäude x_position += width + random.randint(10, 30) # Abstand # Beispiel: Skyline mit 5 Reihen, 10 Gebäuden pro Reihe, Breiten von 10 bis 50 und Höhen von 50 bis 200 # Startpunkt (x=0, y=0), 5 Reihen, Abstand zwischen den Reihen (row_gap) von 150 draw_skyline(-80, 100, 3, 3, 50, 200, 20, 50, 100) #### Kurven für Ocolus seite 1 ###### # Kurve 010 def create_curve010_with_fixed_points(): control_points = [ (-10, -3, 0), # Startpunkt (-10, -1, 7), # Kontrollpunkt 1 (-10, -3, 12), # Kontrollpunkt 2 (-10, -1, 24.5), # Kontrollpunkt 3 (-10, 35, 51) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 09 def create_curve09_with_fixed_points(): control_points = [ (-9, -2.5, 0), # Startpunkt (-9, -1, 7), # Kontrollpunkt 1 (-9, -3, 12), # Kontrollpunkt 2 (-9, -1, 24.5), # Kontrollpunkt 3 (-9, 34, 50) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 08 def create_curve08_with_fixed_points(): control_points = [ (-8, -2, 0), # Startpunkt (-8, -1, 7), # Kontrollpunkt 1 (-8, -3, 12), # Kontrollpunkt 2 (-8, -1, 24.5), # Kontrollpunkt 3 (-8, 33, 49) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 07 def create_curve07_with_fixed_points(): control_points = [ (-7, -1.5, 0), # Startpunkt (-7, -1, 7), # Kontrollpunkt 1 (-7, -3, 12), # Kontrollpunkt 2 (-7, -1, 24.5), # Kontrollpunkt 3 (-7, 32, 48) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 06 def create_curve06_with_fixed_points(): control_points = [ (-6, -1, 0), # Startpunkt (-6, -1, 7), # Kontrollpunkt 1 (-6, -3, 12), # Kontrollpunkt 2 (-6, -1, 24.5), # Kontrollpunkt 3 (-6, 31, 47) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 05 def create_curve05_with_fixed_points(): control_points = [ (-5, -0.5, 0), # Startpunkt (-5, -1, 7), # Kontrollpunkt 1 (-5, -3, 12), # Kontrollpunkt 2 (-5, -1, 24.5), # Kontrollpunkt 3 (-5, 30, 46) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 04 def create_curve04_with_fixed_points(): control_points = [ (-4, 0, 0), # Startpunkt (-4, -1, 7), # Kontrollpunkt 1 (-4, -3, 12), # Kontrollpunkt 2 (-4, -1, 24.5), # Kontrollpunkt 3 (-4, 29, 45) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 03 def create_curve03_with_fixed_points(): control_points = [ (-3, 0.5, 0), # Startpunkt (-3, -1, 7), # Kontrollpunkt 1 (-3, -3, 12), # Kontrollpunkt 2 (-3, -1, 24.5), # Kontrollpunkt 3 (-3, 28, 44) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 02 def create_curve02_with_fixed_points(): control_points = [ (-2, 1, 0), # Startpunkt (-2, -1, 7), # Kontrollpunkt 1 (-2, -3, 12), # Kontrollpunkt 2 (-2, -1, 24.5), # Kontrollpunkt 3 (-2, 27, 43) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 01 def create_curve01_with_fixed_points(): control_points = [ (-1, 1.5, 0), # Startpunkt (-1, -1, 7), # Kontrollpunkt 1 (-1, -3, 12), # Kontrollpunkt 2 (-1, -1, 24.5), # Kontrollpunkt 3 (-1, 26, 42) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 0 def create_curve0_with_fixed_points(): control_points = [ (0, 2, 0), # Startpunkt (0, -1, 7), # Kontrollpunkt 1 (0, -3, 12), # Kontrollpunkt 2 (0, -1, 24.5), # Kontrollpunkt 3 (0, 25, 41) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 1 def create_curve1_with_fixed_points(): control_points = [ (1, 2.5, 0), # Startpunkt (1, -1, 7), # Kontrollpunkt 1 (1, -3, 12), # Kontrollpunkt 2 (1, -1, 24.2), # Kontrollpunkt 3 (1, 24, 40) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 2 def create_curve2_with_fixed_points(): control_points = [ (2, 3.2, 0), # Startpunkt (2, -1, 7), # Kontrollpunkt 1 (2, -3, 12), # Kontrollpunkt 2 (2, -1, 23.8), # Kontrollpunkt 3 (2, 23, 39) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 3 def create_curve3_with_fixed_points(): control_points = [ (3, 3.4, 0), # Startpunkt (3, -1, 7), # Kontrollpunkt 1 (3, -3, 12), # Kontrollpunkt 2 (3, -1, 23.5), # Kontrollpunkt 3 (3, 22, 38) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 4 def create_curve4_with_fixed_points(): control_points = [ (4, 3.6, 0), # Startpunkt (4, -1, 7), # Kontrollpunkt 1 (4, -3, 12), # Kontrollpunkt 2 (4, -1, 23.2), # Kontrollpunkt 3 (4, 21, 37) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 5 def create_curve5_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) control_points = [ (5, 3.8, 0), # Startpunkt (5, -1, 7), # Kontrollpunkt 1 (5, -3, 12), # Kontrollpunkt 2 (5, -1, 22.9), # Kontrollpunkt 3 (5, 20, 36) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 6 def create_curve6_with_fixed_points(): control_points = [ (6, 3.9, 0), # Startpunkt (6, -1, 7), # Kontrollpunkt 1 (6, -3, 12), # Kontrollpunkt 2 (6, -1, 22.6), # Kontrollpunkt 3 (6, 19, 35) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 7 def create_curve7_with_fixed_points(): control_points = [ (7, 4, 0), # Startpunkt (7, -1, 7), # Kontrollpunkt 1 (7, -3, 12), # Kontrollpunkt 2 (7, -1, 22.3), # Kontrollpunkt 3 (7, 18, 34) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 8 def create_curve8_with_fixed_points(): control_points = [ (8, 4, 0), # Startpunkt (8, -1, 7), # Kontrollpunkt 1 (8, -3, 12), # Kontrollpunkt 2 (8, -1, 22), # Kontrollpunkt 3 (8, 17, 33) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 9 def create_curve9_with_fixed_points(): control_points = [ (9, 4, 0), # Startpunkt (9, -1, 7), # Kontrollpunkt 1 (9, -3, 12), # Kontrollpunkt 2 (9, -1, 21.5), # Kontrollpunkt 3 (9, 16, 32) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 10 def create_curve10_with_fixed_points(): control_points = [ (10, 3.9, 0), # Startpunkt (10, -1, 7), # Kontrollpunkt 1 (10, -3, 12), # Kontrollpunkt 2 (10, -1, 21), # Kontrollpunkt 3 (10, 15, 31) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 11 def create_curve11_with_fixed_points(): control_points = [ (11, 3.8, 0), # Startpunkt (11, -1, 7), # Kontrollpunkt 1 (11, -3, 12), # Kontrollpunkt 2 (11, -1, 20.5), # Kontrollpunkt 3 (11, 14, 30) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 12 def create_curve12_with_fixed_points(): control_points = [ (12, 3.6, 0), # Startpunkt (12, -1, 7), # Kontrollpunkt 1 (12, -3, 12), # Kontrollpunkt 2 (12, -1, 20), # Kontrollpunkt 3 (12, 13, 29) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 13 def create_curve13_with_fixed_points(): control_points = [ (13, 3.4, 0), # Startpunkt (13, -1, 7), # Kontrollpunkt 1 (13, -3, 12), # Kontrollpunkt 2 (13, -1, 19.5), # Kontrollpunkt 3 (13, 12, 28) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 14 def create_curve14_with_fixed_points(): control_points = [ (14, 3.2, 0), # Startpunkt (14, -1, 7), # Kontrollpunkt 1 (14, -3, 12), # Kontrollpunkt 2 (14, -1, 19), # Kontrollpunkt 3 (14, 11, 27) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 15 def create_curve15_with_fixed_points(): control_points = [ (15, 2.5, 0), # Startpunkt (15, -1, 7), # Kontrollpunkt 1 (15, -3, 12), # Kontrollpunkt 2 (15, -1, 18.5), # Kontrollpunkt 3 (15, 10, 26) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 16 def create_curve16_with_fixed_points(): control_points = [ (16, 2, 0), # Startpunkt (16, -1, 7), # Kontrollpunkt 1 (16, -3, 12), # Kontrollpunkt 2 (16, -1, 18), # Kontrollpunkt 3 (16, 9, 25) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 17 def create_curve17_with_fixed_points(): control_points = [ (17, 1.5, 0), # Startpunkt (17, -1, 7), # Kontrollpunkt 1 (17, -3, 12), # Kontrollpunkt 2 (17, -1, 17.5), # Kontrollpunkt 3 (17, 8, 24) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 18 def create_curve18_with_fixed_points(): control_points = [ (18, 1, 0), # Startpunkt (18, -1, 7), # Kontrollpunkt 1 (18, -3, 12), # Kontrollpunkt 2 (18, -1, 17), # Kontrollpunkt 3 (18, 7, 23) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 19 def create_curve19_with_fixed_points(): control_points = [ (19, 0.5, 0), # Startpunkt (19, -1, 7), # Kontrollpunkt 1 (19, -3, 12), # Kontrollpunkt 2 (19, -1, 16.5), # Kontrollpunkt 3 (19, 6, 22) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 20 def create_curve20_with_fixed_points(): control_points = [ (20, 0, 0), # Startpunkt (20, -1, 7), # Kontrollpunkt 1 (20, -3, 12), # Kontrollpunkt 2 (20, -1, 16), # Kontrollpunkt 3 (20, 5, 21) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 21 def create_curve21_with_fixed_points(): control_points = [ (21, -0.5, 0), # Startpunkt (21, -1, 7), # Kontrollpunkt 1 (21, -3, 12), # Kontrollpunkt 2 (21, -1, 15.5), # Kontrollpunkt 3 (21, 4, 20) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 22 def create_curve22_with_fixed_points(): control_points = [ (22, -1, 0), # Startpunkt (22, -1, 7), # Kontrollpunkt 1 (22, -3, 12), # Kontrollpunkt 2 (22, -1, 15), # Kontrollpunkt 3 (22, 3, 19) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 23 def create_curve23_with_fixed_points(): control_points = [ (23, -1.4, 0), # Startpunkt (23, -1, 7), # Kontrollpunkt 1 (23, -3, 12), # Kontrollpunkt 2 (23, -1, 14.5), # Kontrollpunkt 3 (23, 2, 18) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 24 def create_curve24_with_fixed_points(): control_points = [ (24, -1.6, 0), # Startpunkt (24, -1, 7), # Kontrollpunkt 1 (24, -3, 12), # Kontrollpunkt 2 (24, -1, 14.2), # Kontrollpunkt 3 (24, 1, 17) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 25 def create_curve25_with_fixed_points(): control_points = [ (25, -1.8, 0), # Startpunkt (25, -1, 7), # Kontrollpunkt 1 (25, -3, 12), # Kontrollpunkt 2 (25, -1, 14), # Kontrollpunkt 3 (25, 0, 15) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 26 def create_curve26_with_fixed_points(): control_points = [ (0, -2, 0), # Startpunkt (0, -1, 7), # Kontrollpunkt 1 (0, -3, 12), # Kontrollpunkt 2 (0, -1, 24.2), # Kontrollpunkt 3 (0, 26, 41) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve ################################################################################################################## #### Rechtecke am Startpunkt der Kurve plus Extrusion sowie Spiegelung für Ocolus ###### ################################################################################################################## def create_rectangle_at_point(base_point, width, height): x, y, z = base_point corner1 = (x - width / 2, y - height / 2, z) corner2 = (x + width / 2, y - height / 2, z) corner3 = (x + width / 2, y + height / 2, z) corner4 = (x - width / 2, y + height / 2, z) rectangle = rs.AddPolyline([corner1, corner2, corner3, corner4, corner1]) return rectangle # Extrusion erstellen und an der Y-Achse bei x = -10 spiegeln def extrude_and_mirror_rectangle(): width = 0.7 # Breite des Rechtecks height = 2 # Höhe des Rechtecks # Funktionen, um die Kurven zu erstellen (bitte deine eigenen Funktionen anpassen) curve_functions = [ create_curve010_with_fixed_points, create_curve09_with_fixed_points, create_curve08_with_fixed_points, create_curve07_with_fixed_points, create_curve06_with_fixed_points, create_curve05_with_fixed_points, create_curve04_with_fixed_points, create_curve03_with_fixed_points, create_curve02_with_fixed_points, create_curve01_with_fixed_points, create_curve0_with_fixed_points, create_curve1_with_fixed_points, create_curve2_with_fixed_points, create_curve3_with_fixed_points, create_curve4_with_fixed_points, create_curve5_with_fixed_points, create_curve6_with_fixed_points, create_curve7_with_fixed_points, create_curve8_with_fixed_points, create_curve9_with_fixed_points, create_curve10_with_fixed_points, create_curve11_with_fixed_points, create_curve12_with_fixed_points, create_curve13_with_fixed_points, create_curve14_with_fixed_points, create_curve15_with_fixed_points, create_curve16_with_fixed_points, create_curve17_with_fixed_points, create_curve18_with_fixed_points, create_curve19_with_fixed_points, create_curve20_with_fixed_points, create_curve21_with_fixed_points, create_curve22_with_fixed_points, create_curve23_with_fixed_points, create_curve24_with_fixed_points, create_curve25_with_fixed_points ] for func in curve_functions: curve = func() # Kurve erstellen if curve: # Startpunkt der Kurve abrufen start_point = rs.CurveStartPoint(curve) if start_point: # Rechteck erstellen rectangle = create_rectangle_at_point(start_point, width, height) if rectangle: # Rechteck entlang der Kurve extrudieren extrusion = rs.ExtrudeCurve(rectangle, curve) if extrusion: rs.CapPlanarHoles(extrusion) # Optional: Flächen schließen # Extrusion entlang der Y-Achse spiegeln (direkt ohne Kopieren) rs.MirrorObject(extrusion, (0, -6.5, 20), (0.1, -6.5, 0)) # Spiegeln in der Y-Achse # Kurve löschen, nachdem sie extrudiert wurde rs.DeleteObject(curve) # Löscht die Kurve # Rechteck entfernen, falls nicht mehr benötigt rs.DeleteObject(rectangle) extrude_and_mirror_rectangle() #### Kurven für Ocolus seite 2 ###### # Kurve 1010 def create_curve1010_with_fixed_points(): control_points = [ (25, -3, 0), # Startpunkt (25, -1, 7), # Kontrollpunkt 1 (25, -3, 12), # Kontrollpunkt 2 (25, -1, 24.5), # Kontrollpunkt 3 (25, 35, 51) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 109 def create_curve109_with_fixed_points(): control_points = [ (24, -2.5, 0), # Startpunkt (24, -1, 7), # Kontrollpunkt 1 (24, -3, 12), # Kontrollpunkt 2 (24, -1, 24.5), # Kontrollpunkt 3 (24, 34, 50) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 108 def create_curve108_with_fixed_points(): control_points = [ (23, -2, 0), # Startpunkt (23, -1, 7), # Kontrollpunkt 1 (23, -3, 12), # Kontrollpunkt 2 (23, -1, 24.5), # Kontrollpunkt 3 (23, 33, 49) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 107 def create_curve107_with_fixed_points(): control_points = [ (22, -1.5, 0), # Startpunkt (22, -1, 7), # Kontrollpunkt 1 (22, -3, 12), # Kontrollpunkt 2 (22, -1, 24.5), # Kontrollpunkt 3 (22, 32, 48) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 106 def create_curve106_with_fixed_points(): control_points = [ (21, -1, 0), # Startpunkt (21, -1, 7), # Kontrollpunkt 1 (21, -3, 12), # Kontrollpunkt 2 (21, -1, 24.5), # Kontrollpunkt 3 (21, 31, 47) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 105 def create_curve105_with_fixed_points(): control_points = [ (20, -0.5, 0), # Startpunkt (20, -1, 7), # Kontrollpunkt 1 (20, -3, 12), # Kontrollpunkt 2 (20, -1, 24.5), # Kontrollpunkt 3 (20, 30, 46) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 104 def create_curve104_with_fixed_points(): control_points = [ (19, 0, 0), # Startpunkt (19, -1, 7), # Kontrollpunkt 1 (19, -3, 12), # Kontrollpunkt 2 (19, -1, 24.5), # Kontrollpunkt 3 (19, 29, 45) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 103 def create_curve103_with_fixed_points(): control_points = [ (18, 0.5, 0), # Startpunkt (18, -1, 7), # Kontrollpunkt 1 (18, -3, 12), # Kontrollpunkt 2 (18, -1, 24.5), # Kontrollpunkt 3 (18, 28, 44) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 102 def create_curve102_with_fixed_points(): control_points = [ (17, 1, 0), # Startpunkt (17, -1, 7), # Kontrollpunkt 1 (17, -3, 12), # Kontrollpunkt 2 (17, -1, 24.5), # Kontrollpunkt 3 (17, 27, 43) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 101 def create_curve101_with_fixed_points(): control_points = [ (16, 1.5, 0), # Startpunkt (16, -1, 7), # Kontrollpunkt 1 (16, -3, 12), # Kontrollpunkt 2 (16, -1, 24.5), # Kontrollpunkt 3 (16, 26, 42) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 100 def create_curve100_with_fixed_points(): control_points = [ (15, 2, 0), # Startpunkt (15, -1, 7), # Kontrollpunkt 1 (15, -3, 12), # Kontrollpunkt 2 (15, -1, 24.5), # Kontrollpunkt 3 (15, 25, 41) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 91 def create_curve91_with_fixed_points(): control_points = [ (14, 2.5, 0), # Startpunkt (14, -1, 7), # Kontrollpunkt 1 (14, -3, 12), # Kontrollpunkt 2 (14, -1, 24.2), # Kontrollpunkt 3 (14, 24, 40) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 92 def create_curve92_with_fixed_points(): control_points = [ (13, 3.2, 0), # Startpunkt (13, -1, 7), # Kontrollpunkt 1 (13, -3, 12), # Kontrollpunkt 2 (13, -1, 23.8), # Kontrollpunkt 3 (13, 23, 39) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 93 def create_curve93_with_fixed_points(): control_points = [ (12, 3.4, 0), # Startpunkt (12, -1, 7), # Kontrollpunkt 1 (12, -3, 12), # Kontrollpunkt 2 (12, -1, 23.5), # Kontrollpunkt 3 (12, 22, 38) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 94 def create_curve94_with_fixed_points(): control_points = [ (11, 3.6, 0), # Startpunkt (11, -1, 7), # Kontrollpunkt 1 (11, -3, 12), # Kontrollpunkt 2 (11, -1, 23.2), # Kontrollpunkt 3 (11, 21, 37) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 95 def create_curve95_with_fixed_points(): control_points = [ (10, 3.8, 0), # Startpunkt (10, -1, 7), # Kontrollpunkt 1 (10, -3, 12), # Kontrollpunkt 2 (10, -1, 22.9), # Kontrollpunkt 3 (10, 20, 36) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 96 def create_curve96_with_fixed_points(): control_points = [ (9, 3.9, 0), # Startpunkt (9, -1, 7), # Kontrollpunkt 1 (9, -3, 12), # Kontrollpunkt 2 (9, -1, 22.6), # Kontrollpunkt 3 (9, 19, 35) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 97 def create_curve97_with_fixed_points(): control_points = [ (8, 4, 0), # Startpunkt (8, -1, 7), # Kontrollpunkt 1 (8, -3, 12), # Kontrollpunkt 2 (8, -1, 22.3), # Kontrollpunkt 3 (8, 18, 34) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 98 def create_curve98_with_fixed_points(): control_points = [ (7, 4, 0), # Startpunkt (7, -1, 7), # Kontrollpunkt 1 (7, -3, 12), # Kontrollpunkt 2 (7, -1, 22), # Kontrollpunkt 3 (7, 17, 33) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 99 def create_curve99_with_fixed_points(): control_points = [ (6, 4, 0), # Startpunkt (6, -1, 7), # Kontrollpunkt 1 (6, -3, 12), # Kontrollpunkt 2 (6, -1, 21.5), # Kontrollpunkt 3 (6, 16, 32) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 910 def create_curve910_with_fixed_points(): control_points = [ (5, 3.9, 0), # Startpunkt (5, -1, 7), # Kontrollpunkt 1 (5, -3, 12), # Kontrollpunkt 2 (5, -1, 21), # Kontrollpunkt 3 (5, 15, 31) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 911 def create_curve911_with_fixed_points(): control_points = [ (4, 3.8, 0), # Startpunkt (4, -1, 7), # Kontrollpunkt 1 (4, -3, 12), # Kontrollpunkt 2 (4, -1, 20.5), # Kontrollpunkt 3 (4, 14, 30) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 912 def create_curve912_with_fixed_points(): control_points = [ (3, 3.6, 0), # Startpunkt (3, -1, 7), # Kontrollpunkt 1 (3, -3, 12), # Kontrollpunkt 2 (3, -1, 20), # Kontrollpunkt 3 (3, 13, 29) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 913 def create_curve913_with_fixed_points(): control_points = [ (2, 3.4, 0), # Startpunkt (2, -1, 7), # Kontrollpunkt 1 (2, -3, 12), # Kontrollpunkt 2 (2, -1, 19.5), # Kontrollpunkt 3 (2, 12, 28) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 914 def create_curve914_with_fixed_points(): control_points = [ (1, 3.2, 0), # Startpunkt (1, -1, 7), # Kontrollpunkt 1 (1, -3, 12), # Kontrollpunkt 2 (1, -1, 19), # Kontrollpunkt 3 (1, 11, 27) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 915 def create_curve915_with_fixed_points(): control_points = [ (0, 2.5, 0), # Startpunkt (0, -1, 7), # Kontrollpunkt 1 (0, -3, 12), # Kontrollpunkt 2 (0, -1, 18.5), # Kontrollpunkt 3 (0, 10, 26) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 916 def create_curve916_with_fixed_points(): control_points = [ (-1, 2, 0), # Startpunkt (-1, -1, 7), # Kontrollpunkt 1 (-1, -3, 12), # Kontrollpunkt 2 (-1, -1, 18), # Kontrollpunkt 3 (-1, 9, 25) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 917 def create_curve917_with_fixed_points(): control_points = [ (-2, 1.5, 0), # Startpunkt (-2, -1, 7), # Kontrollpunkt 1 (-2, -3, 12), # Kontrollpunkt 2 (-2, -1, 17.5), # Kontrollpunkt 3 (-2, 8, 24) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 918 def create_curve918_with_fixed_points(): control_points = [ (-3, 1, 0), # Startpunkt (-3, -1, 7), # Kontrollpunkt 1 (-3, -3, 12), # Kontrollpunkt 2 (-3, -1, 17), # Kontrollpunkt 3 (-3, 7, 23) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 919 def create_curve919_with_fixed_points(): control_points = [ (-4, 0.5, 0), # Startpunkt (-4, -1, 7), # Kontrollpunkt 1 (-4, -3, 12), # Kontrollpunkt 2 (-4, -1, 16.5), # Kontrollpunkt 3 (-4, 6, 22) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 920 def create_curve920_with_fixed_points(): control_points = [ (-5, 0, 0), # Startpunkt (-5, -1, 7), # Kontrollpunkt 1 (-5, -3, 12), # Kontrollpunkt 2 (-5, -1, 16), # Kontrollpunkt 3 (-5, 5, 21) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 921 def create_curve921_with_fixed_points(): control_points = [ (-6, -0.5, 0), # Startpunkt (-6, -1, 7), # Kontrollpunkt 1 (-6, -3, 12), # Kontrollpunkt 2 (-6, -1, 15.5), # Kontrollpunkt 3 (-6, 4, 20) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 922 def create_curve922_with_fixed_points(): control_points = [ (-7, -1, 0), # Startpunkt (-7, -1, 7), # Kontrollpunkt 1 (-7, -3, 12), # Kontrollpunkt 2 (-7, -1, 15), # Kontrollpunkt 3 (-7, 3, 19) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 923 def create_curve923_with_fixed_points(): control_points = [ (-8, -1.4, 0), # Startpunkt (-8, -1, 7), # Kontrollpunkt 1 (-8, -3, 12), # Kontrollpunkt 2 (-8, -1, 14.5), # Kontrollpunkt 3 (-8, 2, 18) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 924 def create_curve924_with_fixed_points(): control_points = [ (-9, -1.6, 0), # Startpunkt (-9, -1, 7), # Kontrollpunkt 1 (-9, -3, 12), # Kontrollpunkt 2 (-9, -1, 14.2), # Kontrollpunkt 3 (-9, 1, 17) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 925 def create_curve925_with_fixed_points(): control_points = [ (-10, -1.8, 0), # Startpunkt (-10, -1, 7), # Kontrollpunkt 1 (-10, -3, 12), # Kontrollpunkt 2 (-10, -1, 14), # Kontrollpunkt 3 (-10, 0, 15) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Kurve 926 def create_curve926_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) control_points = [ (0, -2, 0), # Startpunkt (0, -1, 7), # Kontrollpunkt 1 (0, -3, 12), # Kontrollpunkt 2 (0, -1, 24.2), # Kontrollpunkt 3 (0, 26, 41) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) return curve # Hauptfunktion, um die beiden Kurven zu erstellen und anzuzeigen def create_curves(): curve1010 = create_curve1010_with_fixed_points() curve109 = create_curve109_with_fixed_points() curve108 = create_curve108_with_fixed_points() curve107 = create_curve107_with_fixed_points() curve106 = create_curve106_with_fixed_points() curve105 = create_curve105_with_fixed_points() curve104 = create_curve104_with_fixed_points() curve103 = create_curve103_with_fixed_points() curve102 = create_curve102_with_fixed_points() curve101 = create_curve101_with_fixed_points() curve91 = create_curve91_with_fixed_points() curve92 = create_curve92_with_fixed_points() curve93 = create_curve93_with_fixed_points() curve94 = create_curve94_with_fixed_points() curve95 = create_curve95_with_fixed_points() curve96 = create_curve96_with_fixed_points() curve97 = create_curve97_with_fixed_points() curve98 = create_curve98_with_fixed_points() curve99 = create_curve99_with_fixed_points() curve910 = create_curve910_with_fixed_points() curve911 = create_curve911_with_fixed_points() curve912 = create_curve912_with_fixed_points() curve913 = create_curve913_with_fixed_points() curve914 = create_curve914_with_fixed_points() curve915 = create_curve915_with_fixed_points() curve916 = create_curve916_with_fixed_points() curve917 = create_curve917_with_fixed_points() curve918 = create_curve918_with_fixed_points() curve919 = create_curve919_with_fixed_points() curve920 = create_curve920_with_fixed_points() curve921 = create_curve921_with_fixed_points() curve922 = create_curve922_with_fixed_points() curve923 = create_curve923_with_fixed_points() curve924 = create_curve924_with_fixed_points() curve925 = create_curve925_with_fixed_points() curve100 = create_curve100_with_fixed_points() #### Rechtecke am Startpunkt der Kurve plus Extrusion sowie Spiegelung für Ocolus ###### def create_rectangle_at_point(base_point, width, height): x, y, z = base_point corner1 = (x - width / 2, y - height / 2, z) corner2 = (x + width / 2, y - height / 2, z) corner3 = (x + width / 2, y + height / 2, z) corner4 = (x - width / 2, y + height / 2, z) rectangle = rs.AddPolyline([corner1, corner2, corner3, corner4, corner1]) return rectangle # Extrusion erstellen und an der Y-Achse bei x = -10 spiegeln (nicht mehr) def extrude_and_mirror_rectangle(): width = 0.7 # Breite des Rechtecks height = 2 # Höhe des Rechtecks curve_functions = [ create_curve1010_with_fixed_points, create_curve109_with_fixed_points, create_curve108_with_fixed_points, create_curve107_with_fixed_points, create_curve106_with_fixed_points, create_curve105_with_fixed_points, create_curve104_with_fixed_points, create_curve103_with_fixed_points, create_curve102_with_fixed_points, create_curve101_with_fixed_points, create_curve100_with_fixed_points, create_curve91_with_fixed_points, create_curve92_with_fixed_points, create_curve93_with_fixed_points, create_curve94_with_fixed_points, create_curve95_with_fixed_points, create_curve96_with_fixed_points, create_curve97_with_fixed_points, create_curve98_with_fixed_points, create_curve99_with_fixed_points, create_curve910_with_fixed_points, create_curve911_with_fixed_points, create_curve912_with_fixed_points, create_curve913_with_fixed_points, create_curve914_with_fixed_points, create_curve915_with_fixed_points, create_curve916_with_fixed_points, create_curve917_with_fixed_points, create_curve918_with_fixed_points, create_curve919_with_fixed_points, create_curve920_with_fixed_points, create_curve921_with_fixed_points, create_curve922_with_fixed_points, create_curve923_with_fixed_points, create_curve924_with_fixed_points, create_curve925_with_fixed_points ] for func in curve_functions: curve = func() # Kurve erstellen if curve: # Startpunkt der Kurve abrufen start_point = rs.CurveStartPoint(curve) if start_point: # Rechteck erstellen rectangle = create_rectangle_at_point(start_point, width, height) if rectangle: # Rechteck entlang der Kurve extrudieren extrusion = rs.ExtrudeCurve(rectangle, curve) if extrusion: rs.CapPlanarHoles(extrusion) # Optional: Flächen schließen # Kurve löschen, nachdem sie extrudiert wurde rs.DeleteObject(curve) # Löscht die Kurve # Rechteck entfernen, falls nicht mehr benötigt rs.DeleteObject(rectangle) extrude_and_mirror_rectangle() #### Kurfe für Extrusion Mittelteil für Ocolus Seite 1 ##### def create_pipe_along_curve(): # Definiere 3 Kontrollpunkte für die erste Kurve curve_points_1 = [(29.8, -7, 6.8), (5, -6.5, 15.5), (-14.8, -5.8, 6.8)] # Beispielpunkte # Erstelle die erste Kurve mit den 3 Punkten curve_1 = rs.AddInterpCurve(curve_points_1) # Rohr entlang der ersten Kurve erstellen mit einem Durchmesser von 0.3 radius = 0.3 / 2 # Der Durchmesser ist 0.3, also Radius 0.15 pipe_1 = rs.AddPipe(curve_1, 0, radius) # Definiere 5 Kontrollpunkte für die zweite Kurve curve_points_2 = [(29.8, -7, 6.8), (5, -5, 15), (-14.8, -5.8, 6.8)] # Beispielpunkte # Erstelle die zweite Kurve mit den 5 Punkten curve_2 = rs.AddInterpCurve(curve_points_2) pipe_2 = rs.AddPipe(curve_2, 0, radius) # Kontrollpunkte für die dritte Kurve curve_points_3 = [(29.8, -7, 6.8), (5, -8, 15), (-14.8, -5.8, 6.8)] # Beispielpunkte # Erstelle die dritte Kurve mit den 5 Punkten curve_3 = rs.AddInterpCurve(curve_points_3) # Überprüfen, ob die dritte Kurve erfolgreich erstellt wurde if not curve_3: return # Rohr entlang der dritten Kurve erstellen pipe_3 = rs.AddPipe(curve_3, 0, radius) # Loft zwischen der ersten und zweiten Kurve erstellen loft_1_2 = rs.AddLoftSrf([curve_1, curve_2]) loft_material_1_2 = rs.AddMaterialToObject(loft_1_2[0]) rs.MaterialTransparency(loft_material_1_2, 0.41) loft_1_3 = rs.AddLoftSrf([curve_1, curve_3]) # Transparenz einstellen loft_material_1_3 = rs.AddMaterialToObject(loft_1_3[0]) rs.MaterialTransparency(loft_material_1_3, 0.41) # 0.5 für 50% Transparenz create_pipe_along_curve() #### Kurfe für Extrusion Mittelteil Seitenteil links ###### def create_curves_and_pipes(): # Definiere die Kontrollpunkte für die beiden Kurven curve1_points = [(29.8, -7, 6.8), (5, -5, 15), (-14.8, -5.8, 6.8)] # Erste Kurve curve2_points = [(29.8, -7, 6.8), (22, -3.5, 10), (5, -3.3, 14), (-9, -3.1, 10), (-14.8, -5.8, 6.8)] # Zweite Kurve # Kurven aus den Kontrollpunkten erstellen curve1 = rs.AddInterpCurve(curve1_points) # Erste Kurve curve2 = rs.AddInterpCurve(curve2_points) # Zweite Kurve radius = 0.1 # Erstellen von Rohren entlang der beiden Kurven pipe1 = rs.AddPipe(curve1, 0, radius) # Rohr entlang der ersten Kurve pipe2 = rs.AddPipe(curve2, 0, radius) # Rohr entlang der zweiten Kurve # Loft-Fläche zwischen den beiden Kurven erstellen loft_surface = rs.AddLoftSrf([curve1, curve2]) create_curves_and_pipes() #### Kurfe für Extrusion Mittelteil Seitenteil rechts ###### def create_curves_and_pipes(): # Definiere die Kontrollpunkte für die beiden Kurven curve1_points = [(29.8, -7, 6.8), (5, -8, 15), (-14.8, -5.8, 6.8)] # Erste Kurve curve2_points = [(29.8, -7, 6.8), (22, -10, 10), (5, -9, 14), (-9, -8.5, 10), (-14.8, -5.8, 6.8)] # Zweite Kurve # Kurven aus den Kontrollpunkten erstellen curve1 = rs.AddInterpCurve(curve1_points) # Erste Kurve curve2 = rs.AddInterpCurve(curve2_points) # Zweite Kurve if not curve1 or not curve2: return radius = 0.1 # Erstellen von Rohren entlang der beiden Kurven pipe1 = rs.AddPipe(curve1, 0, radius) # Rohr entlang der ersten Kurve pipe2 = rs.AddPipe(curve2, 0, radius) # Rohr entlang der zweiten Kurve # Loft-Fläche zwischen den beiden Kurven erstellen loft_surface = rs.AddLoftSrf([curve1, curve2]) create_curves_and_pipes() #### Vorder Hinterteil rechts ################################################################################### def create_loft_surface_with_5_points(): curve1_points = [(26, -1, 0), (26, 0, 7), (26, -2, 12), (26, 0, 24.5), (26, 35, 51)] curve2_points = [(26, -4, 0), (26, -2, 7), (26, -4, 12), (26, -3, 24.5), (26, 35, 51)] # Zweite Kurve außen # Kurven aus den Kontrollpunkten erstellen curve1 = rs.AddInterpCurve(curve1_points) curve2 = rs.AddInterpCurve(curve2_points) # Loft-Fläche zwischen den beiden Kurven erstellen loft = rs.AddLoftSrf([curve1, curve2]) copied_loft = rs.CopyObject(loft) # Drehen der kopierten Loft-Fläche um 180 Grad rs.RotateObject(copied_loft, (0, 0, 0), 180, (0, 0, 1)) # Drehung um 180 Grad in der XY-Ebene # Verschieben der gedrehten Loft-Fläche in X- und Y-Richtung move_vector = (15, -12.7, 0) # Verschiebung in X- und Y-Richtung rs.MoveObject(copied_loft, move_vector) # Löschen der ursprünglichen Kurven (curve1 und curve2) if curve1: rs.DeleteObject(curve1) if curve2: rs.DeleteObject(curve2) create_loft_surface_with_5_points() ######### untere rechte Surface def create_patch_surface(): # Kontrollpunkte für die erste und zweite Kurve curve3_points = [(26, -1, 0), (26, 0, 7), (26, -2, 12), (26, 0, 24.5), (26, 35, 51)] # Erste Kurve curve4_points = [(30, -7, 6), (27.8, -3.5, 7.5), (27, -3, 12), (27, -2, 24.5), (26, 35, 51)] # Zweite Kurve # Erstellen der ersten und zweiten interpolierten Kurve curve3 = rs.AddInterpCurve(curve3_points) curve4 = rs.AddInterpCurve(curve4_points) # Polylinie erstellen polyline_points = [(26, -1, 0), (27, -1.5, 6), (30, -7, 6)] polyline = rs.AddPolyline(polyline_points) # Überprüfen, ob die Kurven erfolgreich erstellt wurden if not (curve3 and curve4 and polyline): return # Die drei Kurven zu einer einzigen Kurve kombinieren combined_curve = rs.JoinCurves([curve3, curve4, polyline], delete_input=True) if not combined_curve: return # UV-Spannungen für die Patch-Fläche bestimmen uv_spans = (80, 80) # Anzahl der Spannungen in U- und V-Richtung # Erstellen der Patch-Fläche patch_surface = rs.AddPatch(combined_curve, uv_spans) if patch_surface: copied_patch = rs.CopyObject(patch_surface) if copied_patch: # Drehen der kopierten Patch-Fläche um 180 Grad in der XY-Ebene rs.RotateObject(copied_patch, (0, 0, 0), 180, (0, 0, 1)) # Drehung um 180 Grad in der XY-Ebene # Verschieben der gedrehten Patch-Fläche in X- und Y-Richtung move_vector = (15, -12.7, 0) # Verschiebung in X- und Y-Richtung rs.MoveObject(copied_patch, move_vector) if curve3: rs.DeleteObject(curve3) if curve4: rs.DeleteObject(curve4) if combined_curve: rs.DeleteObject(combined_curve) if polyline: rs.DeleteObject(polyline) create_patch_surface() ########## Obere rechte Surface def create_loft_surface_with_5_points(): # Definiere die Kontrollpunkte für die beiden Kurven curve1_points = [(30, -7, 7), (29, -6, 8), (26, -5, 12), (26, -3.5, 24.5), (26, 35, 51)] # Erste Kurve außen curve2_points = [(30, -7, 6), (27.8, -3.5, 7.5), (27, -3, 12), (27, -2, 24.5), (26, 35, 51)] # Zweite Kurve curve1 = rs.AddInterpCurve(curve1_points) # Erste Kurve curve2 = rs.AddInterpCurve(curve2_points) # Zweite Kurve loft = rs.AddLoftSrf([curve1, curve2]) if loft: copied_loft = rs.CopyObject(loft) if copied_loft: # Drehen der kopierten Loft-Fläche um 180 Grad in der XY-Ebene rs.RotateObject(copied_loft, (0, 0, 0), 180, (0, 0, 1)) # Drehung um 180 Grad in der XY-Ebene # Verschieben der gedrehten Loft-Fläche in X- und Y-Richtung move_vector = (15, -12.7, 0) # Verschiebung in X- und Y-Richtung rs.MoveObject(copied_loft, move_vector) # Löschen der ursprünglichen Kurven (curve1 und curve2) if curve1: rs.DeleteObject(curve1) if curve2: rs.DeleteObject(curve2) create_loft_surface_with_5_points() #### Vorder Hinterteil links ###### def create_patch_surface(): # Kontrollpunkte für die erste und zweite Kurve curve3_points = [(30, -7, 6), (27.8, -11, 8), (27, -10.5, 11), (26, -10.5, 13.5), (26, -13, 15)] # Erste Kurve curve4_points = [(26, -12, 0), (26, -13, 8), (26, -11.5, 10.5), (26, -11, 13.5), (26, -13, 15)] # Zweite Kurve außen # Erstellen der ersten und zweiten interpolierten Kurve curve3 = rs.AddInterpCurve(curve3_points) curve4 = rs.AddInterpCurve(curve4_points) polyline_points = [(26, -12, 0), (27, -12, 6), (30, -7, 6)] polyline = rs.AddPolyline(polyline_points) # Überprüfen, ob die Kurven erfolgreich erstellt wurden if not (curve3 and curve4 and polyline): return # Die drei Kurven zu einer einzigen Kurve kombinieren combined_curve = rs.JoinCurves([curve3, curve4, polyline], delete_input=True) if not combined_curve: return # UV-Spannungen für die Patch-Fläche bestimmen uv_spans = (80, 80) # Anzahl der Spannungen in U- und V-Richtung patch_surface = rs.AddPatch(combined_curve, uv_spans) if patch_surface: copied_patch = rs.CopyObject(patch_surface) if copied_patch: rs.RotateObject(copied_patch, (0, 0, 0), 180, (0, 0, 1)) # Drehung um 180 Grad in der XY-Ebene # Verschieben der gedrehten Patch-Fläche in X- und Y-Richtung move_vector = (15, -12.7, 0) # Verschiebung in X- und Y-Richtung rs.MoveObject(copied_patch, move_vector) # Löschen der ursprünglichen Kurven (combined_curve, curve3, curve4) if combined_curve: rs.DeleteObject(combined_curve) if curve3: rs.DeleteObject(curve3) if curve4: rs.DeleteObject(curve4) create_patch_surface() ###### Obere rechte Surface def create_loft_surface_with_5_points(): # Definiere die Kontrollpunkte für die beiden Kurven curve1_points = [(30, -7, 7), (27.8, -8.5, 8.5), (27, -9, 11), (26, -10, 13.5), (26, -13, 15)] # Erste Kurve oben curve2_points = [(30, -7, 6), (27.8, -11, 8), (27, -10.5, 11), (26, -10.5, 13.5), (26, -13, 15)] # Zweite Kurve # Kurven aus den Kontrollpunkten erstellen curve1 = rs.AddInterpCurve(curve1_points) # Erste Kurve curve2 = rs.AddInterpCurve(curve2_points) # Zweite Kurve # Loft-Fläche zwischen den beiden Kurven erstellen loft = rs.AddLoftSrf([curve1, curve2]) # Überprüfen, ob die Loft-Fläche erfolgreich erstellt wurde if loft: copied_loft = rs.CopyObject(loft) if copied_loft: # Drehen der kopierten Loft-Fläche um 180 Grad in der XY-Ebene rs.RotateObject(copied_loft, (0, 0, 0), 180, (0, 0, 1)) # Drehung um 180 Grad in der XY-Ebene # Verschieben der gedrehten Loft-Fläche in X- und Y-Richtung move_vector = (15, -12.7, 0) # Verschiebung in X- und Y-Richtung rs.MoveObject(copied_loft, move_vector) if curve1: rs.DeleteObject(curve1) if curve2: rs.DeleteObject(curve2) create_loft_surface_with_5_points() #### Eingang ###### def create_quader0(): base_point = (25, -12, 0) # Ursprungspunkt (x, y, z) width = 2 # Breite depth = 10.6 # Tiefe height = 6 # Höhe corner1 = base_point corner2 = (base_point[0] + width, base_point[1] + depth, base_point[2] + height) quader0 = rs.AddBox([ corner1, (corner1[0] + width, corner1[1], corner1[2]), (corner1[0] + width, corner1[1] + depth, corner1[2]), (corner1[0], corner1[1] + depth, corner1[2]), (corner1[0], corner1[1], corner1[2] + height), (corner1[0] + width, corner1[1], corner1[2] + height), corner2, (corner1[0], corner1[1] + depth, corner1[2] + height) ]) return quader0 def create_quader1(): # Grundpunkt des Quaders base_point = (23, -11.5, 0) # Ursprungspunkt (x, y, z) width = 4 # Breite depth = 1.4 # Tiefe height = 4 # Höhe # Eckpunkte des Quaders berechnen corner1 = base_point corner2 = (base_point[0] + width, base_point[1] + depth, base_point[2] + height) quader1 = rs.AddBox([ corner1, (corner1[0] + width, corner1[1], corner1[2]), (corner1[0] + width, corner1[1] + depth, corner1[2]), (corner1[0], corner1[1] + depth, corner1[2]), (corner1[0], corner1[1], corner1[2] + height), (corner1[0] + width, corner1[1], corner1[2] + height), corner2, (corner1[0], corner1[1] + depth, corner1[2] + height) ]) if quader1: quader_list = [quader1] translations = [(0, 1.5, 0), (0, 3, 0), (0, 5, 0), (0, 6.5, 0), (0, 8, 0)] for i, translation in enumerate(translations, start=2): new_quader = rs.CopyObject(quader1, translation) if new_quader: quader_list.append(new_quader) return quader_list quader0 = create_quader0() quader_list = create_quader1() if quader0 and quader_list: # Boolesche Differenz ausführen result = rs.BooleanDifference(quader0, quader_list) if result: # Sicherstellen, dass die Differenz ein Objekt zurückgibt result_quader = result[0] if isinstance(result, list) else result # Falls die Differenz als Liste zurückkommt if result_quader: copied_quader = rs.CopyObject(result_quader) if copied_quader: # Verschiebe den kopierten Quader in X- und Y-Richtung move_vector = (-36.9, 0.65, 0) # Verschiebung in X- und Y-Richtung (5 Einheiten in beide Richtungen) rs.MoveObject(copied_quader, move_vector) ####glas def create_quader(): # Grundpunkt des Quaders base_point = (25.5, -11.5, 0) # Ursprungspunkt (x, y, z) width = 1 # Breite depth = 10.2 # Tiefe height = 5.5 # Höhe # Eckpunkte des Quaders berechnen corner1 = base_point corner2 = (base_point[0] + width, base_point[1] + depth, base_point[2] + height) quader = rs.AddBox([ corner1, (corner1[0] + width, corner1[1], corner1[2]), (corner1[0] + width, corner1[1] + depth, corner1[2]), (corner1[0], corner1[1] + depth, corner1[2]), (corner1[0], corner1[1], corner1[2] + height), (corner1[0] + width, corner1[1], corner1[2] + height), corner2, (corner1[0], corner1[1] + depth, corner1[2] + height) ]) if quader: # Material mit Transparenz erstellen material_index = rs.AddMaterialToObject(quader) rs.MaterialColor(material_index, (255, 255, 255)) # Farbe Weiß rs.MaterialTransparency(material_index, 0.40) # 50% Transparenz rs.ObjectMaterialIndex(quader, material_index) create_quader() def create_quader(): # Grundpunkt des Quaders base_point = (-11, -11.5, 0) # Ursprungspunkt (x, y, z) width = 1 # Breite depth = 10.2 # Tiefe height = 5.5 # Höhe corner1 = base_point corner2 = (base_point[0] + width, base_point[1] + depth, base_point[2] + height) quader = rs.AddBox([ corner1, (corner1[0] + width, corner1[1], corner1[2]), (corner1[0] + width, corner1[1] + depth, corner1[2]), (corner1[0], corner1[1] + depth, corner1[2]), (corner1[0], corner1[1], corner1[2] + height), (corner1[0] + width, corner1[1], corner1[2] + height), corner2, (corner1[0], corner1[1] + depth, corner1[2] + height) ]) if quader: # Material mit Transparenz erstellen material_index = rs.AddMaterialToObject(quader) rs.MaterialColor(material_index, (255, 255, 255)) # Farbe Weiß rs.MaterialTransparency(material_index, 0.40) # 50% Transparenz rs.ObjectMaterialIndex(quader, material_index) create_quader()