Geometry.xsp 762 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "libslic3r/Geometry.hpp"
  5. #include "libslic3r/Geometry/ConvexHull.hpp"
  6. #include "libslic3r/ShortestPath.hpp"
  7. %}
  8. %package{Slic3r::Geometry};
  9. %{
  10. Clone<Polygon>
  11. convex_hull(points)
  12. Points points
  13. CODE:
  14. RETVAL = Slic3r::Geometry::convex_hull(points);
  15. OUTPUT:
  16. RETVAL
  17. double
  18. rad2deg(angle)
  19. double angle
  20. CODE:
  21. RETVAL = Slic3r::Geometry::rad2deg(angle);
  22. OUTPUT:
  23. RETVAL
  24. double
  25. deg2rad(angle)
  26. double angle
  27. CODE:
  28. RETVAL = Slic3r::Geometry::deg2rad(angle);
  29. OUTPUT:
  30. RETVAL
  31. IV
  32. _constant()
  33. ALIAS:
  34. X = X
  35. Y = Y
  36. Z = Z
  37. PROTOTYPE:
  38. CODE:
  39. RETVAL = ix;
  40. OUTPUT: RETVAL
  41. %}