#! python3 import rhinoscriptsyntax as rs 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)]) # Optionally, highlight the box rs.SelectObject(box) ################################################################################################################## #### Skyline ###### ################################################################################################################## import rhinoscriptsyntax as rs import random def draw_building(x, y, width, height): """ Zeichnet ein Gebäude (Rechteck) an der Position (x, y) mit gegebener Breite und Höhe. """ 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): """ Zeichnet eine Skyline mit mehreren Reihen von zufällig generierten Gebäuden in Rhino. """ 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 # 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(100, -300, 7, 5, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): """ Zeichnet ein Gebäude (Rechteck) an der Position (x, y) mit gegebener Breite und Höhe. """ 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): """ Zeichnet eine Skyline mit mehreren Reihen von zufällig generierten Gebäuden in Rhino. """ 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 # 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(-300, -300, 7, 4, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): """ Zeichnet ein Gebäude (Rechteck) an der Position (x, y) mit gegebener Breite und Höhe. """ 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): """ Zeichnet eine Skyline mit mehreren Reihen von zufällig generierten Gebäuden in Rhino. """ 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 # 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, -300, 2, 3, 50, 200, 20, 50, 100) def draw_building(x, y, width, height): """ Zeichnet ein Gebäude (Rechteck) an der Position (x, y) mit gegebener Breite und Höhe. """ 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): """ Zeichnet eine Skyline mit mehreren Reihen von zufällig generierten Gebäuden in Rhino. """ 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 # 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(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 09 def create_curve09_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 08 def create_curve08_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 07 def create_curve07_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 06 def create_curve06_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 05 def create_curve05_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 04 def create_curve04_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 03 def create_curve03_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 02 def create_curve02_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 01 def create_curve01_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 0 def create_curve0_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.5), # Kontrollpunkt 3 (0, 25, 41) # Endpunkt ] # Kurve durch die Kontrollpunkte erstellen curve = rs.AddInterpCurve(control_points) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 1 def create_curve1_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 2 def create_curve2_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 3 def create_curve3_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 4 def create_curve4_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 6 def create_curve6_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 7 def create_curve7_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 8 def create_curve8_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 9 def create_curve9_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 10 def create_curve10_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 11 def create_curve11_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 12 def create_curve12_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 13 def create_curve13_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 14 def create_curve14_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 15 def create_curve15_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 16 def create_curve16_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 17 def create_curve17_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 18 def create_curve18_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 19 def create_curve19_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 20 def create_curve20_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 21 def create_curve21_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 22 def create_curve22_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 23 def create_curve23_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 24 def create_curve24_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 25 def create_curve25_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 26 def create_curve26_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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve ################################################################################################################## #### Rechtecke am Startpunkt der Kurve plus Extrusion sowie Spiegelung für Ocolus ###### ################################################################################################################## # Rechteck erstellen def create_rectangle_at_point(base_point, width, height): """ Erzeugt ein Rechteck an einem gegebenen Punkt. :param base_point: Der Mittelpunkt des Rechtecks (x, y, z) :param width: Breite des Rechtecks :param height: Höhe des Rechtecks :return: Rechteck-Kurve """ 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) # Hauptfunktion aufrufen extrude_and_mirror_rectangle() ################################################################################################################## #### Kurven für Ocolus seite 2 ###### ################################################################################################################## # Kurve 1010 def create_curve1010_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 109 def create_curve109_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 108 def create_curve108_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 107 def create_curve107_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 106 def create_curve106_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 105 def create_curve105_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 104 def create_curve104_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 103 def create_curve103_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 102 def create_curve102_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 101 def create_curve101_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 100 def create_curve100_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 91 def create_curve91_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 92 def create_curve92_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 93 def create_curve93_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 94 def create_curve94_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 95 def create_curve95_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 96 def create_curve96_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 97 def create_curve97_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 98 def create_curve98_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 99 def create_curve99_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 910 def create_curve910_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 911 def create_curve911_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 912 def create_curve912_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 913 def create_curve913_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 914 def create_curve914_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 915 def create_curve915_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 916 def create_curve916_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 917 def create_curve917_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 918 def create_curve918_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 919 def create_curve919_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 920 def create_curve920_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 921 def create_curve921_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 922 def create_curve922_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 923 def create_curve923_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 924 def create_curve924_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") return curve # Kurve 925 def create_curve925_with_fixed_points(): # 5 Kontrollpunkte festlegen (x, y, z) 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) print("Kurve 2 mit 5 festen Kontrollpunkten wurde erstellt.") 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) print("Kurve 1 mit 5 festen Kontrollpunkten wurde erstellt.") 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 ###### ################################################################################################################## # Rechteck erstellen def create_rectangle_at_point(base_point, width, height): """ Erzeugt ein Rechteck an einem gegebenen Punkt. :param base_point: Der Mittelpunkt des Rechtecks (x, y, z) :param width: Breite des Rechtecks :param height: Höhe des Rechtecks :return: Rechteck-Kurve """ 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 # Funktionen, um die Kurven zu erstellen 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) # Hauptfunktion aufrufen extrude_and_mirror_rectangle() ################################################################################################################## #### Kurve für Extrusion Mittelteil für Ocolus Seite 1 ###### ################################################################################################################## def create_curve1_with_5_points(): # Definiere die 5 Punkte entlang der X-Achse points = [ (-15, -5, 6), # Punkt 1 (-10, -4, 11), # Punkt 2 (10, -4.5, 16), # Punkt 3 (28, -6, 12), # Punkt 4 (30, -8, 6) # Punkt 5 ] # Erstelle eine interpolierte Kurve durch die Punkte curve1 = rs.AddInterpCurve(points) # Überprüfen, ob die Kurve erfolgreich erstellt wurde if curve1: print("Kurve 1 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 1.") return curve1 def create_curve2_with_5_points(): # Definiere die 5 Punkte entlang der X-Achse points = [ (-15, -5, 6), # Punkt 1 (0, -6, 16), # Punkt 2 (10, -6, 18), # Punkt 3 (22, -6, 16), # Punkt 4 (30, -8, 6) # Punkt 5 ] # Erstelle eine interpolierte Kurve durch die Punkte curve2 = rs.AddInterpCurve(points) # Überprüfen, ob die Kurve erfolgreich erstellt wurde if curve2: print("Kurve 2 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 2.") return curve2 def create_surface1_between_curves(): # Kurven erstellen curve1 = create_curve1_with_5_points() curve2 = create_curve2_with_5_points() if curve1 and curve2: # Fläche zwischen den beiden Kurven erstellen surface1 = rs.AddLoftSrf([curve1, curve2]) if surface1: print("Fläche erfolgreich erstellt.") else: print("Fehler beim Erstellen der Fläche.") else: print("Kurven konnten nicht erstellt werden.") # Fläche zwischen den beiden Kurven erstellen create_surface1_between_curves() ########################################################################################################## def create_curve3_with_5_points(): # Definiere die 5 Punkte entlang der X-Achse points = [ (-15, -5, 6), # Punkt 1 (-10, -9, 11), # Punkt 2 (10, -10, 16), # Punkt 3 (28, -9, 12), # Punkt 4 (30, -8, 6) # Punkt 5 ] # Erstelle eine interpolierte Kurve durch die Punkte curve3 = rs.AddInterpCurve(points) # Überprüfen, ob die Kurve erfolgreich erstellt wurde if curve3: print("Kurve 3 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 3.") return curve3 def create_curve4_with_5_points(): # Definiere die 5 Punkte entlang der X-Achse points = [ (-15, -5, 6), # Punkt 1 (0, -7, 16), # Punkt 2 (10, -7, 18), # Punkt 3 (22, -7, 16), # Punkt 4 (30, -8, 6) # Punkt 5 ] # Erstelle eine interpolierte Kurve durch die Punkte curve4 = rs.AddInterpCurve(points) # Überprüfen, ob die Kurve erfolgreich erstellt wurde if curve4: print("Kurve 4 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 4.") return curve4 def create_surface2_between_curves(): # Kurven erstellen curve3 = create_curve3_with_5_points() curve4 = create_curve4_with_5_points() if curve3 and curve4: # Fläche zwischen den beiden Kurven erstellen surface2 = rs.AddLoftSrf([curve3, curve4]) if surface2: print("Fläche erfolgreich erstellt.") else: print("Fehler beim Erstellen der Fläche.") else: print("Kurven konnten nicht erstellt werden.") # Fläche zwischen den beiden Kurven erstellen create_surface2_between_curves() ########################################################################################################## ########################################################################################################## def create_curve5_with_5_points(): points = [ (-15, -5, 6), # Punkt 1 (-12, -2, 2), # Punkt 2 (10, 3, 0), # Punkt 3 (28, -5, 2), # Punkt 4 (30, -8, 6) # Punkt 5 ] curve5 = rs.AddInterpCurve(points) if curve5: print("Kurve 5 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 5.") return curve5 def create_surface3_between_curves(): curve1 = create_curve1_with_5_points() curve5 = create_curve5_with_5_points() # Korrekt: Kurve 5 verwenden if curve1 and curve5: # Fläche zwischen den beiden Kurven erstellen surface3 = rs.AddLoftSrf([curve1, curve5]) if surface3: print("Fläche erfolgreich erstellt.") else: print("Fehler beim Erstellen der Fläche.") else: print("Kurven konnten nicht erstellt werden.") # Fläche zwischen den beiden Kurven erstellen create_surface3_between_curves()#! python3 ########################################################################################################## def create_curve6_with_5_points(): # Definiere die 5 Punkte entlang der X-Achse points = [ (-15, -5, 6), # Punkt 1 (-10, -10, 2), # Punkt 2 (10, -12, 0), # Punkt 3 (28, -10, 2), # Punkt 4 (30, -8, 6) # Punkt 5 ] curve6 = rs.AddInterpCurve(points) if curve6: print("Kurve 5 erfolgreich erstellt.") else: print("Fehler beim Erstellen von Kurve 5.") return curve6 def create_surface4_between_curves(): curve3 = create_curve3_with_5_points() curve6 = create_curve6_with_5_points() # Korrekt: Kurve 5 verwenden if curve3 and curve6: # Fläche zwischen den beiden Kurven erstellen surface3 = rs.AddLoftSrf([curve3, curve6]) if surface3: print("Fläche erfolgreich erstellt.") else: print("Fehler beim Erstellen der Fläche.") else: print("Kurven konnten nicht erstellt werden.") # Fläche zwischen den beiden Kurven erstellen create_surface4_between_curves()#! python3