def create_geometry(self): bg = Circle((0, 0), 10) r1 = Rectangle.from_center((3, 0), 3) r2 = Rectangle.from_center((3, 0), 1) c = Circle((-3, 3), 2) self.model_geometry.add_domain('bg', bg, sigma=1) self.model_geometry.add_domain('fg', r1, sigma=1) self.model_geometry.add_domain('fg2', r2, sigma=1) self.model_geometry.add_domain('fg3', c, sigma=1)
def add_geometry(self, **kwargs): circle = Circle([5, 10], 5) square = Rectangle([5, 10], 10, 10) # the circle is added before the square meaning the square will obscure the circle self.model_geometry.add_domain("bottom", circle, sigma=1) self.model_geometry.add_domain("top", square, sigma=2)
def create_geometry(self, **_): """Create rectangles and a circle for display.""" background = Rectangle.from_center([0, 0], 10, 10) r1 = Rectangle([0, 0], 1, 2) r2 = Rectangle([-3, -3], 2, 1) c = Circle([3, 3], 1) self.model_geometry.add_domain("bg", background, sigma=1) self.model_geometry.add_domain("f1", r1, sigma=1) self.model_geometry.add_domain("f2", r2, c, sigma=1)
def add_geometry(self, **kwargs): prey = Circle((3, 2), 0.5) self.model_geometry.add_domain("prey", prey, sigma=1)
def add_geometry(self, **kwargs): rod = Circle([5, 5], 2) self.model_geometry.add_domain("rod_domain", rod, sigma=1e6)
def add_geometry(self, object_x, object_y, **kwargs): obj = Circle([object_x, object_y], 3) self.model_geometry.add_domain("object_domain", obj, sigma=1)
"""Example with how to create a circle.""" import matplotlib.pyplot as plt from fish2eod import Circle r = 1 # 1cm radius p = [0, 5] # location of center (x,y) = (0cm, 5cm) circle = Circle(p, r) circle.draw() # this is for display purposes and not necessary for the general use plt.title("Circles")
def add_geometry(self, **kwargs): """Add a circular object to carry the current.""" source = Circle([0, 3], 1) self.model_geometry.add_domain("fg", source, sigma=1)
def add_geometry(self, prey_x, prey_y, **kwargs): prey = Circle([prey_x, prey_y], 0.5) self.model_geometry.add_domain("prey_domain", prey, sigma=1)