Commit 107ff4dc authored by sumpfralle's avatar sumpfralle

fixed code-style issues


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@491 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 93ba4797
...@@ -23,7 +23,7 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>. ...@@ -23,7 +23,7 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
try: try:
import OpenGL.GL as GL import OpenGL.GL as GL
GL_enabled = True GL_enabled = True
except: except ImportError:
GL_enabled = False GL_enabled = False
...@@ -31,16 +31,20 @@ import math ...@@ -31,16 +31,20 @@ import math
class Line: class Line:
id=0 id = 0
def __init__(self,p1,p2):
def __init__(self, p1, p2):
self.id = Line.id self.id = Line.id
Line.id += 1 Line.id += 1
self.p1 = p1 self.p1 = p1
self.p2 = p2 self.p2 = p2
self._dir = None
self._len = None
def __repr__(self): def __repr__(self):
return "Line<%g,%g,%g>-<%g,%g,%g>" % (self.p1.x,self.p1.y,self.p1.z, return "Line<%g,%g,%g>-<%g,%g,%g>" % (self.p1.x, self.p1.y, self.p1.z,
self.p2.x,self.p2.y,self.p2.z) self.p2.x, self.p2.y, self.p2.z)
def __cmp__(self, other): def __cmp__(self, other):
""" Two lines are equal if both pairs of points are at the same """ Two lines are equal if both pairs of points are at the same
locations. locations.
...@@ -58,13 +62,13 @@ class Line: ...@@ -58,13 +62,13 @@ class Line:
return cmp(str(self), str(other)) return cmp(str(self), str(other))
def dir(self): def dir(self):
if not hasattr(self,"_dir"): if self._dir is None:
self._dir = self.p2.sub(self.p1) self._dir = self.p2.sub(self.p1)
self._dir.normalize() self._dir.normalize()
return self._dir return self._dir
def len(self): def len(self):
if not hasattr(self,"_len"): if self._len is None:
self._len = self.p2.sub(self.p1).norm() self._len = self.p2.sub(self.p1).norm()
return self._len return self._len
...@@ -73,14 +77,14 @@ class Line: ...@@ -73,14 +77,14 @@ class Line:
def closest_point(self, p): def closest_point(self, p):
v = self.dir() v = self.dir()
l = self.p1.dot(v)-p.dot(v) l = self.p1.dot(v) - p.dot(v)
return self.p1.sub(v.mul(l)) return self.p1.sub(v.mul(l))
def dist_to_point_sq(self, p): def dist_to_point_sq(self, p):
return p.sub(self.closest_point(p)).normsq() return p.sub(self.closest_point(p)).normsq()
def dist_to_point(self, p): def dist_to_point(self, p):
return sqrt(self.dist_to_point_sq(p)) return math.sqrt(self.dist_to_point_sq(p))
def minx(self): def minx(self):
return min(self.p1.x, self.p2.x) return min(self.p1.x, self.p2.x)
...@@ -117,10 +121,14 @@ class Line: ...@@ -117,10 +121,14 @@ class Line:
line_size = math.sqrt((line[0] ** 2) + (line[1] ** 2)) line_size = math.sqrt((line[0] ** 2) + (line[1] ** 2))
ortho_size = math.sqrt((ortho[0] ** 2) + (ortho[1] ** 2)) ortho_size = math.sqrt((ortho[0] ** 2) + (ortho[1] ** 2))
ortho_dest_size = line_size / 10.0 ortho_dest_size = line_size / 10.0
ortho = (ortho[0] * ortho_dest_size / ortho_size, ortho[1] * ortho_dest_size / ortho_size) ortho = (ortho[0] * ortho_dest_size / ortho_size,
line_back = (-line[0] * ortho_dest_size / line_size, -line[1] * ortho_dest_size / line_size) ortho[1] * ortho_dest_size / ortho_size)
p3 = (self.p2.x + ortho[0] + line_back[0], self.p2.y + ortho[1] + line_back[1], self.p2.z) line_back = (-line[0] * ortho_dest_size / line_size,
p4 = (self.p2.x - ortho[0] + line_back[0], self.p2.y - ortho[1] + line_back[1], self.p2.z) -line[1] * ortho_dest_size / line_size)
p3 = (self.p2.x + ortho[0] + line_back[0],
self.p2.y + ortho[1] + line_back[1], self.p2.z)
p4 = (self.p2.x - ortho[0] + line_back[0],
self.p2.y - ortho[1] + line_back[1], self.p2.z)
GL.glVertex3f(p3[0], p3[1], p3[2]) GL.glVertex3f(p3[0], p3[1], p3[2])
GL.glVertex3f(self.p2.x, self.p2.y, self.p2.z) GL.glVertex3f(self.p2.x, self.p2.y, self.p2.z)
GL.glVertex3f(p4[0], p4[1], p4[2]) GL.glVertex3f(p4[0], p4[1], p4[2])
......
...@@ -20,13 +20,13 @@ You should have received a copy of the GNU General Public License ...@@ -20,13 +20,13 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
""" # various matrix related functions for PyCAM
various matrix related functions for PyCAM
"""
from pycam.Geometry.Point import Point from pycam.Geometry.Point import Point
import math import math
def get_dot_product(a, b): def get_dot_product(a, b):
""" calculate the dot product of two 3d vectors """ calculate the dot product of two 3d vectors
...@@ -37,7 +37,7 @@ def get_dot_product(a, b): ...@@ -37,7 +37,7 @@ def get_dot_product(a, b):
@rtype: float @rtype: float
@return: the dot product is (a0*b0 + a1*b1 + a2*b2) @return: the dot product is (a0*b0 + a1*b1 + a2*b2)
""" """
return sum(map(lambda l1, l2: l1 * l2, a, b)) return sum(l1 * l2 for l1, l2 in zip(a, b))
def get_cross_product(a, b): def get_cross_product(a, b):
""" calculate the cross product of two 3d vectors """ calculate the cross product of two 3d vectors
...@@ -103,7 +103,8 @@ def get_rotation_matrix_from_to(v_orig, v_dest): ...@@ -103,7 +103,8 @@ def get_rotation_matrix_from_to(v_orig, v_dest):
arcsin = -1.0 arcsin = -1.0
rot_angle = math.asin(arcsin) rot_angle = math.asin(arcsin)
# calculate the rotation axis # calculate the rotation axis
# the rotation axis is equal to the cross product of the original and destination vectors # The rotation axis is equal to the cross product of the original and
# destination vectors.
rot_axis = Point(v_orig[1] * v_dest[2] - v_orig[2] * v_dest[1], rot_axis = Point(v_orig[1] * v_dest[2] - v_orig[2] * v_dest[1],
v_orig[2] * v_dest[0] - v_orig[0] * v_dest[2], v_orig[2] * v_dest[0] - v_orig[0] * v_dest[2],
v_orig[0] * v_dest[1] - v_orig[1] * v_dest[0]) v_orig[0] * v_dest[1] - v_orig[1] * v_dest[0])
...@@ -124,7 +125,7 @@ def get_rotation_matrix_from_to(v_orig, v_dest): ...@@ -124,7 +125,7 @@ def get_rotation_matrix_from_to(v_orig, v_dest):
t * rot_axis.z * rot_axis.z + c) t * rot_axis.z * rot_axis.z + c)
def get_rotation_matrix_axis_angle(rot_axis, rot_angle): def get_rotation_matrix_axis_angle(rot_axis, rot_angle):
""" calculate rotation matrix for a normalized "rot_axis" vector and an angle """ calculate rotation matrix for a normalized vector and an angle
see http://mathworld.wolfram.com/RotationMatrix.html see http://mathworld.wolfram.com/RotationMatrix.html
@type rot_axis: tuple(float) @type rot_axis: tuple(float)
......
...@@ -25,13 +25,7 @@ import pycam.Exporters.STLExporter ...@@ -25,13 +25,7 @@ import pycam.Exporters.STLExporter
from pycam.Geometry import Triangle, Line, Point from pycam.Geometry import Triangle, Line, Point
from pycam.Geometry.TriangleKdtree import TriangleKdtree from pycam.Geometry.TriangleKdtree import TriangleKdtree
from pycam.Toolpath import Bounds from pycam.Toolpath import Bounds
from utils import INFINITE from pycam.Geometry.utils import INFINITE
try:
import OpenGL.GL as GL
GL_enabled = True
except:
GL_enabled = False
MODEL_TRANSFORMATIONS = { MODEL_TRANSFORMATIONS = {
...@@ -146,9 +140,12 @@ class BaseModel(object): ...@@ -146,9 +140,12 @@ class BaseModel(object):
for point in item.get_points(): for point in item.get_points():
if not point.id in processed: if not point.id in processed:
processed.append(point.id) processed.append(point.id)
x = point.x * matrix[0][0] + point.y * matrix[0][1] + point.z * matrix[0][2] + matrix[0][3] x = point.x * matrix[0][0] + point.y * matrix[0][1] \
y = point.x * matrix[1][0] + point.y * matrix[1][1] + point.z * matrix[1][2] + matrix[1][3] + point.z * matrix[0][2] + matrix[0][3]
z = point.x * matrix[2][0] + point.y * matrix[2][1] + point.z * matrix[2][2] + matrix[2][3] y = point.x * matrix[1][0] + point.y * matrix[1][1] \
+ point.z * matrix[1][2] + matrix[1][3]
z = point.x * matrix[2][0] + point.y * matrix[2][1] \
+ point.z * matrix[2][2] + matrix[2][3]
point.x = x point.x = x
point.y = y point.y = y
point.z = z point.z = z
...@@ -188,6 +185,7 @@ class Model(BaseModel): ...@@ -188,6 +185,7 @@ class Model(BaseModel):
self._kdtree_dirty = True self._kdtree_dirty = True
# enable/disable kdtree # enable/disable kdtree
self._use_kdtree = use_kdtree self._use_kdtree = use_kdtree
self._t_kdtree = None
def append(self, item): def append(self, item):
super(Model, self).append(item) super(Model, self).append(item)
...@@ -313,7 +311,8 @@ class ContourModel(BaseModel): ...@@ -313,7 +311,8 @@ class ContourModel(BaseModel):
finished = False finished = False
while not finished: while not finished:
if len(new_group) > 1: if len(new_group) > 1:
# calculate new intersections for each pair of adjacent lines # Calculate new intersections for each pair of adjacent
# lines.
for index in range(len(new_group)): for index in range(len(new_group)):
if (index == 0) and (not closed_group): if (index == 0) and (not closed_group):
# skip the first line if the group is not closed # skip the first line if the group is not closed
...@@ -324,7 +323,8 @@ class ContourModel(BaseModel): ...@@ -324,7 +323,8 @@ class ContourModel(BaseModel):
do_lines_intersection(l1, l2) do_lines_intersection(l1, l2)
# Remove all lines that were marked as obsolete during # Remove all lines that were marked as obsolete during
# intersection calculation. # intersection calculation.
clean_group = [line for line in new_group if not line.p1 is None] clean_group = [line for line in new_group
if not line.p1 is None]
finished = len(new_group) == len(clean_group) finished = len(new_group) == len(clean_group)
if (len(clean_group) == 1) and closed_group: if (len(clean_group) == 1) and closed_group:
new_group = [] new_group = []
......
...@@ -26,6 +26,7 @@ don't really need complete "Point" instances that consume a lot of memory. ...@@ -26,6 +26,7 @@ don't really need complete "Point" instances that consume a lot of memory.
Since python 2.6 the "namedtuple" factory is available. Since python 2.6 the "namedtuple" factory is available.
This reduces the memory consumption of a toolpath down to 1/3. This reduces the memory consumption of a toolpath down to 1/3.
""" """
try: try:
# this works for python 2.6 or above (saves memory) # this works for python 2.6 or above (saves memory)
import collections.namedtuple import collections.namedtuple
...@@ -43,7 +44,7 @@ class Path: ...@@ -43,7 +44,7 @@ class Path:
Path.id += 1 Path.id += 1
self.top_join = None self.top_join = None
self.bot_join = None self.bot_join = None
self.winding=0 self.winding = 0
self.points = [] self.points = []
def __repr__(self): def __repr__(self):
...@@ -54,7 +55,7 @@ class Path: ...@@ -54,7 +55,7 @@ class Path:
if first: if first:
first = False first = False
else: else:
s +="-" s += "-"
s += "%d(%g,%g,%g)" % (p.id, p.x, p.y, p.z) s += "%d(%g,%g,%g)" % (p.id, p.x, p.y, p.z)
return s return s
......
...@@ -20,7 +20,6 @@ You should have received a copy of the GNU General Public License ...@@ -20,7 +20,6 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
from Point import *
class Plane: class Plane:
id = 0 id = 0
...@@ -31,5 +30,5 @@ class Plane: ...@@ -31,5 +30,5 @@ class Plane:
self.n = n self.n = n
def __repr__(self): def __repr__(self):
return "Plane<%s,%s>" % (self.p,self.n) return "Plane<%s,%s>" % (self.p, self.n)
...@@ -27,17 +27,19 @@ def _is_near(x, y): ...@@ -27,17 +27,19 @@ def _is_near(x, y):
class Point: class Point:
id=0 id = 0
def __init__(self,x,y,z): def __init__(self, x, y, z):
self.id = Point.id self.id = Point.id
Point.id += 1 Point.id += 1
self.x = float(x) self.x = float(x)
self.y = float(y) self.y = float(y)
self.z = float(z) self.z = float(z)
self._norm = None
self._normsq = None
def __repr__(self): def __repr__(self):
return "Point%d<%g,%g,%g>" % (self.id,self.x,self.y,self.z) return "Point%d<%g,%g,%g>" % (self.id, self.x, self.y, self.z)
def __cmp__(self, other): def __cmp__(self, other):
""" Two points are equal if all dimensions are identical. """ Two points are equal if all dimensions are identical.
...@@ -57,30 +59,31 @@ class Point: ...@@ -57,30 +59,31 @@ class Point:
return cmp(str(self), str(other)) return cmp(str(self), str(other))
def mul(self, c): def mul(self, c):
return Point(self.x*c,self.y*c,self.z*c) return Point(self.x * c, self.y * c, self.z * c)
def div(self, c): def div(self, c):
return Point(self.x/c,self.y/c,self.z/c) return Point(self.x / c, self.y / c, self.z / c)
def add(p1, p2): def add(self, p):
return Point(p1.x+p2.x,p1.y+p2.y,p1.z+p2.z) return Point(self.x + p.x, self.y + p.y, self.z + p.z)
def sub(p1, p2): def sub(self, p):
return Point(p1.x-p2.x,p1.y-p2.y,p1.z-p2.z) return Point(self.x - p.x, self.y - p.y, self.z - p.z)
def dot(p1, p2): def dot(self, p):
return p1.x*p2.x + p1.y*p2.y + p1.z*p2.z return self.x * p.x + self.y * p.y + self.z * p.z
def cross(p1, p2): def cross(self, p):
return Point(p1.y*p2.z-p2.y*p1.z, p2.x*p1.z-p1.x*p2.z, p1.x*p2.y-p2.x*p1.y) return Point(self.y * p.z - p.y * self.z, p.x * self.z - self.x * p.z,
self.x * p.y - p.x * self.y)
def normsq(self): def normsq(self):
if not hasattr(self, "_normsq"): if self._normsq is None:
self._normsq = self.dot(self) self._normsq = self.dot(self)
return self._normsq return self._normsq
def norm(self): def norm(self):
if not hasattr(self, "_norm"): if self._norm is None:
self._norm = math.sqrt(self.normsq()) self._norm = math.sqrt(self.normsq())
return self._norm return self._norm
......
...@@ -20,21 +20,21 @@ You should have received a copy of the GNU General Public License ...@@ -20,21 +20,21 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
import math from pycam.Geometry.utils import epsilon
from pycam.Geometry.Point import Point
from Point import * from pycam.Geometry.kdtree import Node, kdtree
from Line import *
from Triangle import *
from kdtree import *
class PointKdtree(kdtree): class PointKdtree(kdtree):
def __init__(self, points=[],cutoff=5, cutoff_distance=0.5, tolerance=0.001): def __init__(self, points=None, cutoff=5, cutoff_distance=0.5,
tolerance=epsilon):
if points is None:
points = []
self._n = None self._n = None
self.tolerance=tolerance self.tolerance = tolerance
nodes = [] nodes = []
for p in points: for p in points:
n = Node(); n = Node()
n.point = p n.point = p
n.bound = [] n.bound = []
n.bound.append(p.x) n.bound.append(p.x)
...@@ -54,19 +54,18 @@ class PointKdtree(kdtree): ...@@ -54,19 +54,18 @@ class PointKdtree(kdtree):
if self._n: if self._n:
n = self._n n = self._n
else: else:
n = Node(); n = Node()
n.bound = [] n.bound = []
n.bound.append(x) n.bound.append(x)
n.bound.append(y) n.bound.append(y)
n.bound.append(z) n.bound.append(z)
(nn,dist) = self.nearest_neighbor(n, self.dist) (nn, dist) = self.nearest_neighbor(n, self.dist)
if nn and dist<self.tolerance: if nn and (dist < self.tolerance):
self._n = n self._n = n
return nn.p return nn.p
else: else:
n.p = Point(x,y,z) n.p = Point(x, y, z)
self._n = None self._n = None
self.insert(n) self.insert(n)
return n.p return n.p
This diff is collapsed.
This diff is collapsed.
...@@ -20,73 +20,73 @@ You should have received a copy of the GNU General Public License ...@@ -20,73 +20,73 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
import math from pycam.Geometry.kdtree import kdtree, Node
from Point import * overlaptest = True
from Line import *
from Triangle import *
from kdtree import *
overlaptest=True def SearchKdtree2d(tree, minx, maxx, miny, maxy):
if tree.bucket:
def SearchKdtree2d(kdtree, minx, maxx, miny, maxy):
if kdtree.bucket:
triangles = [] triangles = []
for n in kdtree.nodes: for n in tree.nodes:
global tests, hits, overlaptest
if not overlaptest: if not overlaptest:
triangles.append(n.triangle) triangles.append(n.triangle)
else: else:
if not (n.bound[0]>maxx if not (n.bound[0] > maxx
or n.bound[1]<minx or n.bound[1] < minx
or n.bound[2]>maxy or n.bound[2] > maxy
or n.bound[3]<miny): or n.bound[3] < miny):
triangles.append(n.triangle) triangles.append(n.triangle)
return triangles return triangles
else: else:
if kdtree.cutdim==0: if tree.cutdim == 0:
if maxx<kdtree.minval: if maxx < tree.minval:
return [] return []
elif maxx<kdtree.cutval: elif maxx < tree.cutval:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy)
else: else:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy)+SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy) \
elif kdtree.cutdim==1: + SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
if minx>kdtree.maxval: elif tree.cutdim == 1:
if minx > tree.maxval:
return [] return []
elif minx>kdtree.cutval: elif minx > tree.cutval:
return SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
else: else:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy)+SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy) \
elif kdtree.cutdim==2: + SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
if maxy<kdtree.minval: elif tree.cutdim == 2:
if maxy < tree.minval:
return [] return []
elif maxy<kdtree.cutval: elif maxy < tree.cutval:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy)
else: else:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy)+SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy) \
elif kdtree.cutdim==3: + SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
if miny>kdtree.maxval: elif tree.cutdim == 3:
if miny > tree.maxval:
return [] return []
elif miny>kdtree.cutval: elif miny > tree.cutval:
return SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
else: else:
return SearchKdtree2d(kdtree.lo, minx, maxx, miny, maxy)+SearchKdtree2d(kdtree.hi, minx, maxx, miny, maxy) return SearchKdtree2d(tree.lo, minx, maxx, miny, maxy) \
+ SearchKdtree2d(tree.hi, minx, maxx, miny, maxy)
class TriangleKdtree(kdtree): class TriangleKdtree(kdtree):
def __init__(self, triangles, cutoff=3, cutoff_distance=1.0): def __init__(self, triangles, cutoff=3, cutoff_distance=1.0):
nodes = [] nodes = []
for t in triangles: for t in triangles:
n = Node(); n = Node()
n.triangle = t n.triangle = t
n.bound = [] n.bound = []
n.bound.append(min(min(t.p1.x,t.p2.x),t.p3.x)) n.bound.append(min(t.p1.x, t.p2.x, t.p3.x))
n.bound.append(max(max(t.p1.x,t.p2.x),t.p3.x)) n.bound.append(max(t.p1.x, t.p2.x, t.p3.x))
n.bound.append(min(min(t.p1.y,t.p2.y),t.p3.y)) n.bound.append(min(t.p1.y, t.p2.y, t.p3.y))
n.bound.append(max(max(t.p1.y,t.p2.y),t.p3.y)) n.bound.append(max(t.p1.y, t.p2.y, t.p3.y))
nodes.append(n) nodes.append(n)
kdtree.__init__(self, nodes, cutoff, cutoff_distance) super(TriangleKdtree, self).__init__(nodes, cutoff, cutoff_distance)
def Search(self, minx, maxx, miny, maxy): def Search(self, minx, maxx, miny, maxy):
return SearchKdtree2d(self, minx, maxx, miny, maxy) return SearchKdtree2d(self, minx, maxx, miny, maxy)
...@@ -25,10 +25,9 @@ __all__ = ["utils", "Line", "Model", "Path", "Plane", "Point", "Triangle", ...@@ -25,10 +25,9 @@ __all__ = ["utils", "Line", "Model", "Path", "Plane", "Point", "Triangle",
"PolygonExtractor", "TriangleKdtree", "intersection", "kdtree", "PolygonExtractor", "TriangleKdtree", "intersection", "kdtree",
"Matrix"] "Matrix"]
from Point import Point from pycam.Geometry.Point import Point
from Line import Line from pycam.Geometry.Line import Line
from Triangle import Triangle from pycam.Geometry.Triangle import Triangle
from Path import Path from pycam.Geometry.Path import Path
from Plane import Plane from pycam.Geometry.Plane import Plane
from utils import * from pycam.Geometry.PolygonExtractor import PolygonExtractor
from PolygonExtractor import PolygonExtractor
This diff is collapsed.
This diff is collapsed.
...@@ -26,24 +26,3 @@ epsilon = 0.0001 ...@@ -26,24 +26,3 @@ epsilon = 0.0001
def sqr(x): def sqr(x):
return x*x return x*x
def min3(x,y,z):
if x<y:
xy = x
else:
xy = y
if xy<z:
return xy
else:
return z
def max3(x,y,z):
if x>y:
xy = x
else:
xy = y
if xy>z:
return xy
else:
return z
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment