Combine Enums

This commit is contained in:
2024-06-20 17:37:03 +02:00
parent 627bec0324
commit 4c695bc058
7 changed files with 39 additions and 46 deletions

View File

@@ -1,31 +0,0 @@
from enum import Enum
class DIRECTION(Enum):
WEST = 0
EAST = 1
NORTH = 2
SOUTH = 3
class COLLUMN_STYLE(Enum):
INNER = 1
OUTER = 2
BOTH = 3
class LINE_OVERLAP(Enum):
NONE = 0
MAJOR = 1
MINOR = 2
class LINE_THICKNESS_MODE(Enum):
MIDDLE = 0
DRAW_COUNTERCLOCKWISE = 1
DRAW_CLOCKWISE = 2
class ROTATION(Enum):
CLOCKWISE = 0
COUNTERCLOCKWISE = 1

View File

@@ -33,9 +33,11 @@ def main():
# editor.placeBlock( # editor.placeBlock(
# (c[1][i][j].x, 110, c[1][i][j].y), Block("red_concrete")) # (c[1][i][j].x, 110, c[1][i][j].y), Block("red_concrete"))
Road([Point3D(464, 85, -225), Point3D(408, 105, -224), # Road([Point3D(464, 85+10, -225), Point3D(408, 105+10, -224),
Point3D(368, 104, -249), Point3D(368, 85, -296), Point3D(457, 79, -292)], 15) # Point3D(368, 104+10, -249), Point3D(368, 85+10, -296), Point3D(457, 79+10, -292)], 15)
# rectangle_house_mountain, rectangle_building, skeleton_highway, skeleton_mountain, road_grid = world_maker() Road([Point3D(526, 70, -415), Point3D(497, 76, -420), Point3D(483, 70, -381), Point3D(460, 71, -360), Point3D(430, 78, -383), Point3D(410, 71, -364), Point3D(381,
71, -383), Point3D(350, 76, -375), Point3D(332, 79, -409), Point3D(432, 71, -460), Point3D(450, 70, -508), Point3D(502, 81, -493), Point3D(575, 85, -427)], 15)
# rectangle_house_mountain, rectangle_building, ske,leton_highway, skeleton_mountain, road_grid = world_maker()
# editor = Editor(buffering=True) # editor = Editor(buffering=True)
# buildArea = editor.getBuildArea() # buildArea = editor.getBuildArea()

View File

@@ -3,7 +3,7 @@ from typing import List, Union
import numpy as np import numpy as np
from Enums import ROTATION from utils.Enums import ROTATION
class Point2D: class Point2D:

View File

@@ -2,7 +2,7 @@ from typing import List, Union
import numpy as np import numpy as np
from Enums import LINE_OVERLAP, LINE_THICKNESS_MODE from utils.Enums import LINE_OVERLAP, LINE_THICKNESS_MODE
from networks.geometry.Point2D import Point2D from networks.geometry.Point2D import Point2D

View File

@@ -1,5 +1,5 @@
from typing import List from typing import List
from Enums import LINE_OVERLAP from utils.Enums import LINE_OVERLAP
from networks.geometry.Point3D import Point3D from networks.geometry.Point3D import Point3D

View File

@@ -7,7 +7,7 @@ from networks.geometry.Point2D import Point2D
from networks.geometry.Segment2D import Segment2D from networks.geometry.Segment2D import Segment2D
from networks.geometry.Segment3D import Segment3D from networks.geometry.Segment3D import Segment3D
from networks.geometry.Circle import Circle from networks.geometry.Circle import Circle
from Enums import LINE_THICKNESS_MODE from utils.Enums import LINE_THICKNESS_MODE
from gdpc import Block, Editor from gdpc import Block, Editor
@@ -98,7 +98,7 @@ class Road:
# Circle # Circle
circle, gaps = Circle(self.polyline.centers[i]).circle_thick_by_line(int( circle, gaps = Circle(self.polyline.centers[i]).circle_thick_by_line(int(
(self.polyline.radii[i]-self.width/2)), int((self.polyline.radii[i]+self.width/2)+1)) (self.polyline.radii[i]-self.width/2)), int((self.polyline.radii[i]+self.width/2)))
# Better to do here than drawing circle arc inside big triangle! # Better to do here than drawing circle arc inside big triangle!
double_point_a = Point2D.from_arrays(Point2D.to_arrays(self.polyline.acrs_intersections[i][0]) + 5 * (Point2D.to_arrays( double_point_a = Point2D.from_arrays(Point2D.to_arrays(self.polyline.acrs_intersections[i][0]) + 5 * (Point2D.to_arrays(
@@ -176,7 +176,7 @@ class Road:
self.segment_total_line_output[i].x, reference[self.segment_total_line_output[i].nearest(Point3D.to_2d(reference, 'y'), True)[0]].y, self.segment_total_line_output[i].y), Block("black_concrete"))) self.segment_total_line_output[i].x, reference[self.segment_total_line_output[i].nearest(Point3D.to_2d(reference, 'y'), True)[0]].y, self.segment_total_line_output[i].y), Block("black_concrete")))
def place(self): def place(self):
editor = Editor(buffering=True) editor = Editor(buffering=False)
for i in range(len(self.output_block)): for i in range(len(self.output_block)):
editor.placeBlock(self.output_block[i][0], editor.placeBlock(self.output_block[i][0],
self.output_block[i][1]) self.output_block[i][1])

View File

@@ -1,28 +1,50 @@
from enum import Enum from enum import Enum
class DIRECTION(Enum): class DIRECTION(Enum):
NORTH = 0 NORTH = 0
EAST = 1 EAST = 1
SOUTH = 2 SOUTH = 2
WEST = 3 WEST = 3
class COLLUMN_STYLE(Enum): class COLLUMN_STYLE(Enum):
NONE = 0 NONE = 0
INNER = 1 INNER = 1
OUTER = 2 OUTER = 2
BOTH = 3 BOTH = 3
class WINDOW_BORDER_RADIUS(Enum): class WINDOW_BORDER_RADIUS(Enum):
NONE = 0 NONE = 0
TOP = 1 TOP = 1
TOP_AND_BOTTOM = 2 TOP_AND_BOTTOM = 2
class BALCONY_BORDER_RADIUS(Enum): class BALCONY_BORDER_RADIUS(Enum):
NONE = 0 NONE = 0
MEDIUM = 1 MEDIUM = 1
FULL = 2 FULL = 2
class INTER_FLOOR_BORDER(Enum): class INTER_FLOOR_BORDER(Enum):
NONE = 0 NONE = 0
SLAB = 1 SLAB = 1
STAIRS = 2 STAIRS = 2
class LINE_OVERLAP(Enum):
NONE = 0
MAJOR = 1
MINOR = 2
class LINE_THICKNESS_MODE(Enum):
MIDDLE = 0
DRAW_COUNTERCLOCKWISE = 1
DRAW_CLOCKWISE = 2
class ROTATION(Enum):
CLOCKWISE = 0
COUNTERCLOCKWISE = 1