In [5]:
%load_ext autoreload
%autoreload 2
In [6]:
import numpy as np
from city import *
In [43]:
coordinates = np.array(
[[7.000, 1.000],
[4.000, 2.732],
[3.000, 1.000],
[5.000, 1.000],
[3.000, 4.464],
[1.000, 4.464],
[6.000, 2.732],
[1.000, 1.000],
[7.000, 4.464],
[2.000, 2.732],
[5.000, 4.464]])
In [44]:
my_plan = Plan(coordinates)
my_plan.define_triangles()
my_plan.get_all_sides();
In [45]:
my_plan.try_triangles()
# my_plan.plot_triangles(triangle_id=-10);
In [50]:
my_plan.refine_mesh()
my_plan.plot_coordinates();
In [ ]:
my_plan = Plan(coordinates)
my_plan.plot_coordinates();
In [ ]:
print(my_plan.side_length)
In [ ]:
triangles = [[7, 9, 8]]
my_plan = Plan(coordinates)
my_plan.try_triangles([[7, 9, 2],
[9, 1, 2]], triangle_id=range(2))
In [ ]:
my_plan.define_triangles()
In [ ]:
my_plan.plot_triangles()
print(len(my_plan.triangles))
my_plan.triangles
Out[ ]:
In [ ]:
my_plan.define_shared_sides()
print(my_plan.shared_sides)
my_plan.plot_shared_sides([my_plan.shared_sides[2]])
Out[ ]:
In [ ]:
my_plan.get_all_sides()
Out[ ]:
In [ ]:
In [ ]:
len([[2, 3, 5]])
In [ ]:
triangles = [[7, 9, 2],
[9, 1, 2],
[1, 3, 6],
[3, 6, 0],
[5, 9, 4],
[9, 4, 1],
[4, 1, 10],
[1, 10, 6],
[10, 6, 8],
[1, 2, 3]]
my_plan = Plan(coordinates, triangles)
# my_plan.plot_triangle(9)
my_plan.plot_triangle(range(10))
# my_plan.plot_triangle([2, 7])
my_plan.check_triangles()
In [ ]:
# my_plan.define_shared_sides([[[9, 2], [0, 1]]])
sides = [[[9, 2], [0, 8]]]
my_plan.define_shared_sides(sides)
my_plan.plot_shared_sides(range(len(sides)));
In [ ]:
my_plan.get_kapsalon_coordinates()
my_plan.get_bar_coordinates()
my_plan.plot_everything();
In [ ]:
Task 3:
Run the cell below to check your work, but don't change anything. If the cell runs without error, you will pass the assignment once you commit it and push it to GitHub.
In [ ]:
x=1
assert (
x==1), (
'cool')
In [ ]:
import numpy as np
import sys
# np.set_printoptions()
np.set_printoptions(precision=3,
threshold=sys.maxsize,
floatmode='fixed')
x = np.array([[1.312323,2.,3.],[1.,2.,3.]])
print(x)
End of notebook.
© Copyright 2024 MUDE TU Delft.
This work is licensed under a CC BY 4.0 License.