ExtrusionLoop.xsp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "libslic3r/ExtrusionEntity.hpp"
  5. %}
  6. %name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
  7. ExtrusionLoop();
  8. ~ExtrusionLoop();
  9. Clone<ExtrusionLoop> clone()
  10. %code{% RETVAL = THIS; %};
  11. void reverse();
  12. bool make_clockwise();
  13. bool make_counter_clockwise();
  14. Clone<Point> first_point();
  15. Clone<Point> last_point();
  16. Clone<Polygon> polygon();
  17. void append(ExtrusionPath* path)
  18. %code{% THIS->paths.push_back(*path); %};
  19. double length();
  20. bool split_at_vertex(Point* point)
  21. %code{% RETVAL = THIS->split_at_vertex(*point); %};
  22. void split_at(Point* point, int prefer_non_overhang = 0, double scaled_epsilon = 0.)
  23. %code{% THIS->split_at(*point, prefer_non_overhang != 0, scaled_epsilon); %};
  24. ExtrusionPaths clip_end(double distance)
  25. %code{% THIS->clip_end(distance, &RETVAL); %};
  26. bool has_overhang_point(Point* point)
  27. %code{% RETVAL = THIS->has_overhang_point(*point); %};
  28. ExtrusionRole role() const;
  29. ExtrusionLoopRole loop_role() const;
  30. Polygons polygons_covered_by_width();
  31. Polygons polygons_covered_by_spacing();
  32. %{
  33. SV*
  34. ExtrusionLoop::arrayref()
  35. CODE:
  36. AV* av = newAV();
  37. av_fill(av, THIS->paths.size()-1);
  38. for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
  39. av_store(av, it - THIS->paths.begin(), perl_to_SV_ref(*it));
  40. }
  41. RETVAL = newRV_noinc((SV*)av);
  42. OUTPUT:
  43. RETVAL
  44. %}
  45. };
  46. %package{Slic3r::ExtrusionLoop};
  47. %{
  48. IV
  49. _constant()
  50. ALIAS:
  51. EXTRL_ROLE_DEFAULT = elrDefault
  52. EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
  53. EXTRL_ROLE_SKIRT = elrSkirt
  54. PROTOTYPE:
  55. CODE:
  56. RETVAL = ix;
  57. OUTPUT: RETVAL
  58. %}