Clipper.xsp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "clipper.hpp"
  5. #include "libslic3r/ClipperUtils.hpp"
  6. %}
  7. %package{Slic3r::Geometry::Clipper};
  8. %{
  9. IV
  10. _constant()
  11. ALIAS:
  12. JT_MITER = jtMiter
  13. JT_ROUND = jtRound
  14. JT_SQUARE = jtSquare
  15. CODE:
  16. RETVAL = ix;
  17. OUTPUT: RETVAL
  18. Polygons
  19. offset(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3)
  20. Polygons polygons
  21. const float delta
  22. ClipperLib::JoinType joinType
  23. double miterLimit
  24. CODE:
  25. RETVAL = offset(polygons, delta, joinType, miterLimit);
  26. OUTPUT:
  27. RETVAL
  28. ExPolygons
  29. offset_ex(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3)
  30. Polygons polygons
  31. const float delta
  32. ClipperLib::JoinType joinType
  33. double miterLimit
  34. CODE:
  35. RETVAL = offset_ex(polygons, delta, joinType, miterLimit);
  36. OUTPUT:
  37. RETVAL
  38. Polygons
  39. offset2(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3)
  40. Polygons polygons
  41. const float delta1
  42. const float delta2
  43. ClipperLib::JoinType joinType
  44. double miterLimit
  45. CODE:
  46. RETVAL = offset2(polygons, delta1, delta2, joinType, miterLimit);
  47. OUTPUT:
  48. RETVAL
  49. ExPolygons
  50. offset2_ex(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3)
  51. Polygons polygons
  52. const float delta1
  53. const float delta2
  54. ClipperLib::JoinType joinType
  55. double miterLimit
  56. CODE:
  57. RETVAL = offset2_ex(polygons, delta1, delta2, joinType, miterLimit);
  58. OUTPUT:
  59. RETVAL
  60. Polygons
  61. diff(subject, clip, safety_offset = false)
  62. Polygons subject
  63. Polygons clip
  64. bool safety_offset
  65. CODE:
  66. RETVAL = diff(subject, clip, safety_offset);
  67. OUTPUT:
  68. RETVAL
  69. ExPolygons
  70. diff_ex(subject, clip, safety_offset = false)
  71. Polygons subject
  72. Polygons clip
  73. bool safety_offset
  74. CODE:
  75. RETVAL = diff_ex(subject, clip, safety_offset);
  76. OUTPUT:
  77. RETVAL
  78. Polylines
  79. diff_pl(subject, clip)
  80. Polylines subject
  81. Polygons clip
  82. CODE:
  83. RETVAL = diff_pl(subject, clip);
  84. OUTPUT:
  85. RETVAL
  86. Polygons
  87. intersection(subject, clip, safety_offset = false)
  88. Polygons subject
  89. Polygons clip
  90. bool safety_offset
  91. CODE:
  92. RETVAL = intersection(subject, clip, safety_offset);
  93. OUTPUT:
  94. RETVAL
  95. ExPolygons
  96. intersection_ex(subject, clip, safety_offset = false)
  97. Polygons subject
  98. Polygons clip
  99. bool safety_offset
  100. CODE:
  101. RETVAL = intersection_ex(subject, clip, safety_offset);
  102. OUTPUT:
  103. RETVAL
  104. Polylines
  105. intersection_pl(subject, clip)
  106. Polylines subject
  107. Polygons clip
  108. CODE:
  109. RETVAL = intersection_pl(subject, clip);
  110. OUTPUT:
  111. RETVAL
  112. Polygons
  113. union(subject, safety_offset = false)
  114. Polygons subject
  115. bool safety_offset
  116. CODE:
  117. RETVAL = union_(subject, safety_offset);
  118. OUTPUT:
  119. RETVAL
  120. ExPolygons
  121. union_ex(subject, safety_offset = false)
  122. Polygons subject
  123. bool safety_offset
  124. CODE:
  125. RETVAL = union_ex(subject, safety_offset);
  126. OUTPUT:
  127. RETVAL
  128. %}