Skip to content

Commit

Permalink
fix issues in Cython code
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Nov 10, 2023
1 parent a8780fd commit 665b374
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ezdxf/acc/bezier4p.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def cubic_bezier_from_ellipse(ellipse: 'ConstructionEllipse',
cdef CppVec3 center = Vec3(ellipse.center).to_cpp_vec3()
cdef CppVec3 x_axis = Vec3(ellipse.major_axis).to_cpp_vec3()
cdef CppVec3 y_axis = Vec3(ellipse.minor_axis).to_cpp_vec3()
cdef Vec3 cp,
cdef Vec3 cp
cdef CppVec3 c_res
cdef list res
for control_points in cubic_bezier_arc_parameters(
Expand Down
6 changes: 3 additions & 3 deletions src/ezdxf/acc/matrix44.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ from .vector cimport Vec3

cdef class Matrix44:
cdef double m[16]
cdef Vec3 get_ux(self)
cdef Vec3 get_uy(self)
cdef Vec3 get_uz(self)
cdef Vec3 get_ux(self: Matrix44)
cdef Vec3 get_uy(self: Matrix44)
cdef Vec3 get_uz(self: Matrix44)

cdef inline swap(double *a, double *b):
cdef double tmp = a[0]
Expand Down
4 changes: 2 additions & 2 deletions src/ezdxf/acc/vector.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from ._cpp_vec3 cimport CppVec3

cdef class Vec2:
cdef readonly double x, y
cdef CppVec3 to_cpp_vec3(self)
cdef CppVec3 to_cpp_vec3(self: Vec2)

# Vec2 C-functions:
cdef Vec2 v2_add(Vec2 a, Vec2 b)
Expand All @@ -35,7 +35,7 @@ cdef Vec2 v2_from_cpp_vec3(CppVec3)

cdef class Vec3:
cdef readonly double x, y, z
cdef CppVec3 to_cpp_vec3(self)
cdef CppVec3 to_cpp_vec3(self: Vec2)

# Vec3 C-functions:
cdef Vec3 v3_add(Vec3 a, Vec3 b)
Expand Down
6 changes: 3 additions & 3 deletions src/ezdxf/acc/vector.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ cdef extern from "constants.h":
const double REL_TOL
const double M_TAU

cdef double RAD2DEG = 180.0 / M_PI;
cdef double DEG2RAD = M_PI / 180.0;
cdef double RAD2DEG = 180.0 / M_PI
cdef double DEG2RAD = M_PI / 180.0

if TYPE_CHECKING:
from ezdxf.math import AnyVec, UVec
Expand Down Expand Up @@ -274,7 +274,7 @@ cdef class Vec2:
cdef Vec2 o = Vec2(other)
return v2_angle_between(self, o)

def rotate(self, double angle: float) -> Vec2:
def rotate(self, double angle) -> Vec2:
cdef double self_angle = atan2(self.y, self.x)
cdef double magnitude = hypot(self.x, self.y)
return v2_from_angle(self_angle + angle, magnitude)
Expand Down

0 comments on commit 665b374

Please sign in to comment.