compas-nest 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. compas_nest-0.1.0/.github/workflows/build.yml +80 -0
  2. compas_nest-0.1.0/.github/workflows/docs.yml +31 -0
  3. compas_nest-0.1.0/.gitignore +31 -0
  4. compas_nest-0.1.0/.gitmodules +3 -0
  5. compas_nest-0.1.0/=2.12 +0 -0
  6. compas_nest-0.1.0/=3.15 +0 -0
  7. compas_nest-0.1.0/CHANGELOG.md +20 -0
  8. compas_nest-0.1.0/CMakeLists.txt +107 -0
  9. compas_nest-0.1.0/LICENSE +21 -0
  10. compas_nest-0.1.0/PKG-INFO +109 -0
  11. compas_nest-0.1.0/README.md +94 -0
  12. compas_nest-0.1.0/bash/build.sh +51 -0
  13. compas_nest-0.1.0/bash/install.sh +105 -0
  14. compas_nest-0.1.0/data/.gitkeep +0 -0
  15. compas_nest-0.1.0/data/elements_strips.json +1 -0
  16. compas_nest-0.1.0/data/output/.gitkeep +0 -0
  17. compas_nest-0.1.0/docs/changelog.md +1 -0
  18. compas_nest-0.1.0/docs/credits.md +45 -0
  19. compas_nest-0.1.0/docs/examples.md +77 -0
  20. compas_nest-0.1.0/docs/images/.gitkeep +0 -0
  21. compas_nest-0.1.0/docs/images/01_collision_viewer.png +0 -0
  22. compas_nest-0.1.0/docs/images/02_nfp_viewer.png +0 -0
  23. compas_nest-0.1.0/docs/images/03_nfp_animated.gif +0 -0
  24. compas_nest-0.1.0/docs/images/04_collision_dataset.gif +0 -0
  25. compas_nest-0.1.0/docs/images/05_attributes.png +0 -0
  26. compas_nest-0.1.0/docs/index.md +46 -0
  27. compas_nest-0.1.0/docs/installation.md +48 -0
  28. compas_nest-0.1.0/docs/reference.md +36 -0
  29. compas_nest-0.1.0/environment.yml +29 -0
  30. compas_nest-0.1.0/examples/01_collision_viewer.py +49 -0
  31. compas_nest-0.1.0/examples/02_nfp_viewer.py +50 -0
  32. compas_nest-0.1.0/examples/03_nfp_animated.py +29 -0
  33. compas_nest-0.1.0/examples/04_collision_dataset.py +29 -0
  34. compas_nest-0.1.0/examples/05_attributes.py +51 -0
  35. compas_nest-0.1.0/external/nest/.git +1 -0
  36. compas_nest-0.1.0/external/nest/README.md +11 -0
  37. compas_nest-0.1.0/external/nest/nest_physics_cpp/CMakeLists.txt +62 -0
  38. compas_nest-0.1.0/external/nest/nest_physics_cpp/README.md +17 -0
  39. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/collision_engine.hpp +199 -0
  40. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/common.hpp +78 -0
  41. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/convex_hull.hpp +34 -0
  42. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/obstacle.hpp +118 -0
  43. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/polygon.hpp +437 -0
  44. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/primitives.hpp +403 -0
  45. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/quadtree.hpp +365 -0
  46. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/scene.hpp +217 -0
  47. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/shape.hpp +34 -0
  48. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/shape_ops.hpp +241 -0
  49. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/slotmap.hpp +114 -0
  50. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/strip_packing.hpp +180 -0
  51. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/surrogate.hpp +61 -0
  52. compas_nest-0.1.0/external/nest/nest_physics_cpp/geometry/transform.hpp +120 -0
  53. compas_nest-0.1.0/external/nest/nest_physics_cpp/nest_physics.cpp +193 -0
  54. compas_nest-0.1.0/external/nest/nest_physics_cpp/nest_physics_capi.cpp +729 -0
  55. compas_nest-0.1.0/external/nest/nest_physics_cpp/nest_physics_capi.h +101 -0
  56. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/config.hpp +72 -0
  57. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/constants.hpp +32 -0
  58. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/driver.hpp +508 -0
  59. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/evaluator.hpp +234 -0
  60. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/optimizer.hpp +528 -0
  61. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/overlap.hpp +267 -0
  62. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/rng.hpp +85 -0
  63. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/sampler.hpp +288 -0
  64. compas_nest-0.1.0/external/nest/nest_physics_cpp/solver/util.hpp +113 -0
  65. compas_nest-0.1.0/external/nest/opennest_cpp/CMakeLists.txt +91 -0
  66. compas_nest-0.1.0/external/nest/opennest_cpp/src/ClipperUtil.h +50 -0
  67. compas_nest-0.1.0/external/nest/opennest_cpp/src/D3.h +97 -0
  68. compas_nest-0.1.0/external/nest/opennest_cpp/src/GeneticAlgorithm.cpp +613 -0
  69. compas_nest-0.1.0/external/nest/opennest_cpp/src/GeneticAlgorithm.h +65 -0
  70. compas_nest-0.1.0/external/nest/opennest_cpp/src/GeometryUtil.cpp +944 -0
  71. compas_nest-0.1.0/external/nest/opennest_cpp/src/GeometryUtil.h +133 -0
  72. compas_nest-0.1.0/external/nest/opennest_cpp/src/HelperTypes.h +188 -0
  73. compas_nest-0.1.0/external/nest/opennest_cpp/src/MinkowskiConvolution.cpp +261 -0
  74. compas_nest-0.1.0/external/nest/opennest_cpp/src/MinkowskiConvolution.h +32 -0
  75. compas_nest-0.1.0/external/nest/opennest_cpp/src/NFP.h +205 -0
  76. compas_nest-0.1.0/external/nest/opennest_cpp/src/NestConfig.h +55 -0
  77. compas_nest-0.1.0/external/nest/opennest_cpp/src/NestingContext.cpp +420 -0
  78. compas_nest-0.1.0/external/nest/opennest_cpp/src/NestingContext.h +67 -0
  79. compas_nest-0.1.0/external/nest/opennest_cpp/src/NestingEngine.cpp +874 -0
  80. compas_nest-0.1.0/external/nest/opennest_cpp/src/NestingEngine.h +65 -0
  81. compas_nest-0.1.0/external/nest/opennest_cpp/src/NfpWorker.cpp +1767 -0
  82. compas_nest-0.1.0/external/nest/opennest_cpp/src/NfpWorker.h +172 -0
  83. compas_nest-0.1.0/external/nest/opennest_cpp/src/Point.h +32 -0
  84. compas_nest-0.1.0/external/nest/opennest_cpp/src/Random.h +125 -0
  85. compas_nest-0.1.0/external/nest/opennest_cpp/src/Simplify.h +116 -0
  86. compas_nest-0.1.0/external/nest/opennest_cpp/src/capi/nfp_nest_capi.cpp +350 -0
  87. compas_nest-0.1.0/external/nest/opennest_cpp/src/capi/nfp_nest_capi.h +92 -0
  88. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.core.h +1057 -0
  89. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.engine.cpp +3149 -0
  90. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.engine.h +641 -0
  91. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.h +769 -0
  92. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.minkowski.h +120 -0
  93. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.offset.cpp +645 -0
  94. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.offset.h +124 -0
  95. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.rectclip.cpp +1028 -0
  96. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.rectclip.h +82 -0
  97. compas_nest-0.1.0/external/nest/opennest_cpp/src/clipper2/clipper.version.h +6 -0
  98. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi/borland_prefix.hpp +27 -0
  99. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi/borland_suffix.hpp +12 -0
  100. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi/msvc_prefix.hpp +22 -0
  101. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi/msvc_suffix.hpp +8 -0
  102. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi_prefix.hpp +25 -0
  103. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/abi_suffix.hpp +25 -0
  104. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx03.hpp +211 -0
  105. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx11.hpp +209 -0
  106. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx14.hpp +47 -0
  107. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx17.hpp +59 -0
  108. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx20.hpp +56 -0
  109. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/assert_cxx98.hpp +23 -0
  110. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/auto_link.hpp +525 -0
  111. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/borland.hpp +338 -0
  112. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/clang.hpp +355 -0
  113. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/clang_version.hpp +77 -0
  114. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/codegear.hpp +384 -0
  115. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/comeau.hpp +59 -0
  116. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/common_edg.hpp +182 -0
  117. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/compaq_cxx.hpp +19 -0
  118. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/cray.hpp +445 -0
  119. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/diab.hpp +26 -0
  120. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/digitalmars.hpp +142 -0
  121. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/gcc.hpp +376 -0
  122. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/gcc_xml.hpp +113 -0
  123. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/greenhills.hpp +28 -0
  124. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/hp_acc.hpp +148 -0
  125. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/intel.hpp +576 -0
  126. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/kai.hpp +33 -0
  127. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/metrowerks.hpp +197 -0
  128. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/mpw.hpp +139 -0
  129. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/nvcc.hpp +61 -0
  130. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/pathscale.hpp +137 -0
  131. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/pgi.hpp +23 -0
  132. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/sgi_mipspro.hpp +29 -0
  133. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/sunpro_cc.hpp +215 -0
  134. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/vacpp.hpp +185 -0
  135. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/visualc.hpp +380 -0
  136. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/xlcpp.hpp +291 -0
  137. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/compiler/xlcpp_zos.hpp +172 -0
  138. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/cxx_composite.hpp +201 -0
  139. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/posix_features.hpp +95 -0
  140. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/select_compiler_config.hpp +157 -0
  141. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/select_platform_config.hpp +147 -0
  142. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/select_stdlib_config.hpp +121 -0
  143. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/detail/suffix.hpp +1235 -0
  144. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/header_deprecated.hpp +26 -0
  145. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/helper_macros.hpp +37 -0
  146. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/no_tr1/cmath.hpp +28 -0
  147. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/no_tr1/complex.hpp +28 -0
  148. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/no_tr1/functional.hpp +28 -0
  149. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/no_tr1/memory.hpp +28 -0
  150. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/no_tr1/utility.hpp +28 -0
  151. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/aix.hpp +33 -0
  152. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/amigaos.hpp +15 -0
  153. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/beos.hpp +26 -0
  154. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/bsd.hpp +83 -0
  155. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/cloudabi.hpp +18 -0
  156. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/cray.hpp +18 -0
  157. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/cygwin.hpp +71 -0
  158. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/haiku.hpp +31 -0
  159. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/hpux.hpp +87 -0
  160. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/irix.hpp +31 -0
  161. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/linux.hpp +106 -0
  162. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/macos.hpp +87 -0
  163. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/qnxnto.hpp +31 -0
  164. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/solaris.hpp +31 -0
  165. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/symbian.hpp +97 -0
  166. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/vms.hpp +25 -0
  167. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/vxworks.hpp +422 -0
  168. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/wasm.hpp +23 -0
  169. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/win32.hpp +90 -0
  170. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/platform/zos.hpp +32 -0
  171. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/pragma_message.hpp +31 -0
  172. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/requires_threads.hpp +92 -0
  173. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/dinkumware.hpp +309 -0
  174. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/libcomo.hpp +93 -0
  175. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/libcpp.hpp +217 -0
  176. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/libstdcpp3.hpp +443 -0
  177. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/modena.hpp +79 -0
  178. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/msl.hpp +98 -0
  179. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/roguewave.hpp +208 -0
  180. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/sgi.hpp +168 -0
  181. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/stlport.hpp +258 -0
  182. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/vacpp.hpp +74 -0
  183. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/stdlib/xlcpp_zos.hpp +61 -0
  184. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/user.hpp +133 -0
  185. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/warning_disable.hpp +47 -0
  186. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config/workaround.hpp +305 -0
  187. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/config.hpp +67 -0
  188. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/cstdint.hpp +556 -0
  189. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/cxx11_char_types.hpp +70 -0
  190. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/detail/workaround.hpp +10 -0
  191. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/limits.hpp +146 -0
  192. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/boolean_op.hpp +442 -0
  193. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/boolean_op_45.hpp +1398 -0
  194. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/iterator_compact_to_points.hpp +74 -0
  195. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/iterator_geometry_to_set.hpp +314 -0
  196. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/iterator_points_to_compact.hpp +60 -0
  197. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/max_cover.hpp +281 -0
  198. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/minkowski.hpp +131 -0
  199. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_45_formation.hpp +2238 -0
  200. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_45_set_view.hpp +380 -0
  201. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_45_touch.hpp +238 -0
  202. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_90_set_view.hpp +490 -0
  203. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_90_touch.hpp +418 -0
  204. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_arbitrary_formation.hpp +2907 -0
  205. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_formation.hpp +2287 -0
  206. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_set_view.hpp +222 -0
  207. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_simplify.hpp +116 -0
  208. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/polygon_sort_adaptor.hpp +67 -0
  209. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/property_merge.hpp +588 -0
  210. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/property_merge_45.hpp +160 -0
  211. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/rectangle_formation.hpp +266 -0
  212. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/scan_arbitrary.hpp +2861 -0
  213. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/voronoi_ctypes.hpp +643 -0
  214. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/voronoi_predicates.hpp +1533 -0
  215. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/voronoi_robust_fpt.hpp +501 -0
  216. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/detail/voronoi_structures.hpp +450 -0
  217. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/gmp_override.hpp +128 -0
  218. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/gtl.hpp +35 -0
  219. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/interval_concept.hpp +934 -0
  220. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/interval_data.hpp +118 -0
  221. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/interval_traits.hpp +47 -0
  222. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/isotropy.hpp +525 -0
  223. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/point_concept.hpp +469 -0
  224. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/point_data.hpp +138 -0
  225. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/point_traits.hpp +48 -0
  226. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon.hpp +92 -0
  227. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_45_data.hpp +72 -0
  228. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_45_set_concept.hpp +441 -0
  229. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_45_set_data.hpp +1880 -0
  230. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_45_set_traits.hpp +149 -0
  231. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_45_with_holes_data.hpp +107 -0
  232. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_90_data.hpp +79 -0
  233. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_90_set_concept.hpp +550 -0
  234. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_90_set_data.hpp +989 -0
  235. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_90_set_traits.hpp +366 -0
  236. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_90_with_holes_data.hpp +115 -0
  237. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_data.hpp +69 -0
  238. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_set_concept.hpp +581 -0
  239. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_set_data.hpp +1006 -0
  240. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_set_traits.hpp +133 -0
  241. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_traits.hpp +1861 -0
  242. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/polygon_with_holes_data.hpp +107 -0
  243. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/rectangle_concept.hpp +1082 -0
  244. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/rectangle_data.hpp +63 -0
  245. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/rectangle_traits.hpp +40 -0
  246. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/segment_concept.hpp +696 -0
  247. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/segment_data.hpp +121 -0
  248. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/segment_traits.hpp +50 -0
  249. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/segment_utils.hpp +164 -0
  250. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/transform.hpp +476 -0
  251. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/voronoi.hpp +157 -0
  252. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/voronoi_diagram.hpp +620 -0
  253. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/polygon/voronoi_geometry_type.hpp +48 -0
  254. compas_nest-0.1.0/external/nest/opennest_cpp/third_party/boost_min/boost/version.hpp +32 -0
  255. compas_nest-0.1.0/external/nest/opennest_cpp/tools/parity_diff.py +99 -0
  256. compas_nest-0.1.0/mkdocs.yml +52 -0
  257. compas_nest-0.1.0/pyproject.toml +101 -0
  258. compas_nest-0.1.0/requirements-dev.txt +9 -0
  259. compas_nest-0.1.0/requirements-docs.txt +6 -0
  260. compas_nest-0.1.0/src/_clipper.cpp +59 -0
  261. compas_nest-0.1.0/src/_nest_physics.cpp +106 -0
  262. compas_nest-0.1.0/src/_nfp_nest.cpp +122 -0
  263. compas_nest-0.1.0/src/compas_nest/__init__.py +43 -0
  264. compas_nest-0.1.0/src/compas_nest/collision.py +217 -0
  265. compas_nest-0.1.0/src/compas_nest/datastructures.py +288 -0
  266. compas_nest-0.1.0/src/compas_nest/nfp.py +253 -0
  267. compas_nest-0.1.0/src/compas_nest/offset.py +122 -0
  268. compas_nest-0.1.0/src/compas_nest/result.py +158 -0
  269. compas_nest-0.1.0/src/compas_nest/types.py +32 -0
  270. compas_nest-0.1.0/src/compas_nest/viewer.py +112 -0
  271. compas_nest-0.1.0/tests/test_nesting.py +125 -0
@@ -0,0 +1,80 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ build_wheels:
11
+ name: Build wheels on ${{ matrix.platform }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ - os: ubuntu-latest
18
+ platform: manylinux
19
+ - os: macos-latest
20
+ platform: mac
21
+ - os: windows-latest
22
+ platform: windows
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+ submodules: recursive
28
+
29
+ - name: Build wheels
30
+ uses: pypa/cibuildwheel@v2.23.1
31
+ with:
32
+ output-dir: wheelhouse
33
+
34
+ - uses: actions/upload-artifact@v4
35
+ with:
36
+ name: wheels-${{ matrix.platform }}
37
+ path: wheelhouse/*.whl
38
+
39
+ build_sdist:
40
+ name: Build source distribution
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ with:
45
+ fetch-depth: 0
46
+ submodules: recursive
47
+
48
+ - name: Build SDist
49
+ run: pipx run build --sdist
50
+
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: sdist
54
+ path: dist/*.tar.gz
55
+
56
+ # Publish to PyPI on every push to main. `skip-existing` makes this a no-op when the version in
57
+ # src/compas_nest/__init__.py is unchanged, so bump it to release a new version.
58
+ publish:
59
+ name: Publish to PyPI
60
+ needs: [build_wheels, build_sdist]
61
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
62
+ runs-on: ubuntu-latest
63
+ environment:
64
+ name: pypi
65
+ url: https://pypi.org/project/compas_nest
66
+ permissions:
67
+ id-token: write # OIDC trusted publishing (no API token needed)
68
+ steps:
69
+ - uses: actions/download-artifact@v4
70
+ with:
71
+ pattern: wheels-*
72
+ path: dist
73
+ merge-multiple: true
74
+ - uses: actions/download-artifact@v4
75
+ with:
76
+ name: sdist
77
+ path: dist
78
+ - uses: pypa/gh-action-pypi-publish@release/v1
79
+ with:
80
+ skip-existing: true
@@ -0,0 +1,31 @@
1
+ name: docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ docs:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ submodules: recursive
18
+
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+
23
+ # mkdocstrings imports compas_nest, so the C++ extension must be built/installed first.
24
+ - name: Build and install compas_nest
25
+ run: pip install .
26
+
27
+ - name: Install docs dependencies
28
+ run: pip install -r requirements-docs.txt
29
+
30
+ - name: Build and deploy to gh-pages
31
+ run: mkdocs gh-deploy --force
@@ -0,0 +1,31 @@
1
+ # Build / packaging
2
+ build/
3
+ dist/
4
+ wheelhouse/
5
+ *.egg-info/
6
+ _skbuild/
7
+ *.pyd
8
+ *.so
9
+ *.dll
10
+ *.lib
11
+ *.exp
12
+ *.obj
13
+
14
+ # Python
15
+ __pycache__/
16
+ *.py[cod]
17
+ .pytest_cache/
18
+ .ruff_cache/
19
+ .venv/
20
+ temp/
21
+
22
+ # Generated example outputs
23
+ data/output/*.json
24
+
25
+ # Docs
26
+ site/
27
+
28
+ # OS / editor
29
+ .DS_Store
30
+ .vscode/
31
+ .idea/
@@ -0,0 +1,3 @@
1
+ [submodule "external/nest"]
2
+ path = external/nest
3
+ url = https://github.com/petrasvestartas/nest.git
File without changes
File without changes
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+
7
+ ## Unreleased
8
+
9
+ ### Added
10
+
11
+ * `nest_geo` and `nest_sheets` COMPAS `Data` containers (replicating the OpenNest C# `nest_geo` / `nest_sheets`).
12
+ * `opennest_collision` wrapper around the physics / overlap-relaxation engine (`np_nest`), with a non-blocking `start()` + `collision_solve` handle for live animation.
13
+ * `opennest` wrapper around the NFP + genetic-algorithm engine (`nfp_nest`).
14
+ * `nest_result` with world-placed geometry grouped per sheet and `to_json()` (placed polylines + transformations) serialization.
15
+ * nanobind C++ bindings `_nest_physics` and `_nfp_nest`.
16
+ * compas_viewer examples (top view, grouped scene, live animation, real 48-element dataset) and pytest smoke tests.
17
+
18
+ ### Changed
19
+
20
+ ### Removed
@@ -0,0 +1,107 @@
1
+ cmake_minimum_required(VERSION 3.15...3.27)
2
+
3
+ project(nest_wrapper LANGUAGES CXX)
4
+
5
+ set(CMAKE_CXX_STANDARD 20)
6
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
+ set(CMAKE_CXX_EXTENSIONS OFF)
8
+ if(NOT CMAKE_BUILD_TYPE)
9
+ set(CMAKE_BUILD_TYPE Release)
10
+ endif()
11
+
12
+ # Static-link the MSVC runtime so the wheels carry no VC++ redistributable dependency.
13
+ if(POLICY CMP0091)
14
+ cmake_policy(SET CMP0091 NEW)
15
+ endif()
16
+ if(MSVC)
17
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
18
+ add_compile_options(/Zm1000)
19
+ endif()
20
+
21
+ # ---------------------------------------------------------------------------
22
+ # Vendored OpenNest C++ engine sources (git submodule -> external/nest).
23
+ # No CGAL / Boost / Eigen download: both engines are self-contained.
24
+ # ---------------------------------------------------------------------------
25
+ set(NEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/nest")
26
+ set(PHYSICS_DIR "${NEST_DIR}/nest_physics_cpp")
27
+ set(NFP_DIR "${NEST_DIR}/opennest_cpp")
28
+
29
+ if(NOT EXISTS "${PHYSICS_DIR}/nest_physics_capi.cpp")
30
+ message(FATAL_ERROR
31
+ "OpenNest C++ sources not found at ${NEST_DIR}. "
32
+ "Initialise the submodule: git submodule update --init --recursive")
33
+ endif()
34
+
35
+ # ---------------------------------------------------------------------------
36
+ # Python + nanobind
37
+ # ---------------------------------------------------------------------------
38
+ if(NOT SKBUILD)
39
+ message(WARNING "This CMake file is meant to be driven by scikit-build-core "
40
+ "(pip install). Running it directly is unlikely to work.")
41
+ endif()
42
+
43
+ find_package(Python 3.9
44
+ REQUIRED COMPONENTS Interpreter Development.Module
45
+ OPTIONAL_COMPONENTS Development.SABIModule)
46
+
47
+ find_package(nanobind CONFIG REQUIRED)
48
+
49
+ # ===========================================================================
50
+ # Module 1: _nest_physics (collision / overlap-relaxation engine)
51
+ # Header-only solver; the C-API translation unit pulls it all in.
52
+ # ===========================================================================
53
+ nanobind_add_module(_nest_physics STABLE_ABI NB_STATIC
54
+ src/_nest_physics.cpp
55
+ "${PHYSICS_DIR}/nest_physics_capi.cpp")
56
+ target_include_directories(_nest_physics PRIVATE "${PHYSICS_DIR}")
57
+ if(NOT MSVC)
58
+ target_compile_options(_nest_physics PRIVATE -O3)
59
+ endif()
60
+ install(TARGETS _nest_physics LIBRARY DESTINATION compas_nest)
61
+
62
+ # ===========================================================================
63
+ # Module 2: _nfp_nest (NFP + genetic-algorithm engine)
64
+ # Needs the vendored Clipper2 + nest_lib sources + the minimal Boost subset.
65
+ # ===========================================================================
66
+ set(NFP_SOURCES
67
+ src/_nfp_nest.cpp
68
+ "${NFP_DIR}/src/capi/nfp_nest_capi.cpp"
69
+ "${NFP_DIR}/src/GeometryUtil.cpp"
70
+ "${NFP_DIR}/src/MinkowskiConvolution.cpp"
71
+ "${NFP_DIR}/src/NfpWorker.cpp"
72
+ "${NFP_DIR}/src/GeneticAlgorithm.cpp"
73
+ "${NFP_DIR}/src/NestingEngine.cpp"
74
+ "${NFP_DIR}/src/NestingContext.cpp"
75
+ "${NFP_DIR}/src/clipper2/clipper.engine.cpp"
76
+ "${NFP_DIR}/src/clipper2/clipper.offset.cpp"
77
+ "${NFP_DIR}/src/clipper2/clipper.rectclip.cpp")
78
+
79
+ nanobind_add_module(_nfp_nest STABLE_ABI NB_STATIC ${NFP_SOURCES})
80
+ target_include_directories(_nfp_nest PRIVATE
81
+ "${NFP_DIR}/src"
82
+ "${NFP_DIR}/third_party/boost_min")
83
+ if(MSVC)
84
+ target_compile_definitions(_nfp_nest PRIVATE _USE_MATH_DEFINES)
85
+ target_compile_options(_nfp_nest PRIVATE /wd4244 /wd4267 /wd4305)
86
+ else()
87
+ target_compile_options(_nfp_nest PRIVATE -O3 -Wno-unused-parameter)
88
+ endif()
89
+ install(TARGETS _nfp_nest LIBRARY DESTINATION compas_nest)
90
+
91
+ # ===========================================================================
92
+ # Module 3: _clipper (Clipper2 polygon offsetting for clearance)
93
+ # Reuses the Clipper2 sources vendored with the NFP engine.
94
+ # ===========================================================================
95
+ nanobind_add_module(_clipper STABLE_ABI NB_STATIC
96
+ src/_clipper.cpp
97
+ "${NFP_DIR}/src/clipper2/clipper.engine.cpp"
98
+ "${NFP_DIR}/src/clipper2/clipper.offset.cpp"
99
+ "${NFP_DIR}/src/clipper2/clipper.rectclip.cpp")
100
+ target_include_directories(_clipper PRIVATE "${NFP_DIR}/src")
101
+ if(MSVC)
102
+ target_compile_definitions(_clipper PRIVATE _USE_MATH_DEFINES)
103
+ target_compile_options(_clipper PRIVATE /wd4244 /wd4267 /wd4305)
104
+ else()
105
+ target_compile_options(_clipper PRIVATE -O3 -Wno-unused-parameter)
106
+ endif()
107
+ install(TARGETS _clipper LIBRARY DESTINATION compas_nest)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Petras Vestartas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.1
2
+ Name: compas_nest
3
+ Version: 0.1.0
4
+ Summary: 2D irregular nesting (OpenNest) for COMPAS.
5
+ Author-Email: Petras Vestartas <petrasvestartas@gmail.com>
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Topic :: Scientific/Engineering
9
+ Project-URL: Homepage, https://github.com/petrasvestartas/compas_nest
10
+ Project-URL: Repository, https://github.com/petrasvestartas/compas_nest
11
+ Requires-Python: >=3.9
12
+ Requires-Dist: numpy>=1.24
13
+ Requires-Dist: compas<3,>=2.15
14
+ Description-Content-Type: text/markdown
15
+
16
+ # compas_nest
17
+
18
+ 2D irregular nesting for the [COMPAS](https://compas.dev) framework — Python bindings for the
19
+ [OpenNest](https://github.com/petrasvestartas/OpenNest) C++ engines, built with
20
+ [nanobind](https://github.com/wjakob/nanobind) (the same toolchain as
21
+ [compas_cgal](https://github.com/compas-dev/compas_cgal)).
22
+
23
+ Nest polylines **with holes** into sheets **with holes**, with live terminal progress and
24
+ [compas_viewer](https://github.com/compas-dev/compas_viewer) visualization.
25
+
26
+ ![compas_nest](docs/images/04_collision_dataset.gif)
27
+
28
+ ## Two engines
29
+
30
+ | Class | Engine | Notes |
31
+ |---|---|---|
32
+ | `opennest_collision` | physics / overlap-relaxation (`np_nest`) | dependency-free; iteration-budget driven; nests parts into holes |
33
+ | `opennest` | NFP + genetic algorithm (`nfp_nest`) | bundled Clipper2; generation/fitness driven; carries part *attributes* through placement |
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pip install compas_nest
39
+ ```
40
+
41
+ ### From source (editable)
42
+
43
+ **One-step (uv, macOS + Windows Git Bash + Linux):** creates a local `.venv`, installs every
44
+ dependency, and builds the package:
45
+
46
+ ```bash
47
+ git clone --recurse-submodules https://github.com/petrasvestartas/compas_nest.git
48
+ cd compas_nest
49
+ bash bash/install.sh
50
+ ```
51
+
52
+ After editing C++ sources, rebuild without recreating the env: `bash bash/build.sh --test`.
53
+
54
+ **conda:**
55
+
56
+ ```bash
57
+ conda env create -f environment.yml
58
+ conda activate compas_nest
59
+ pip install --no-build-isolation -ve .
60
+ ```
61
+
62
+ **plain pip:**
63
+
64
+ ```bash
65
+ pip install nanobind "scikit-build-core[pyproject]"
66
+ pip install --no-build-isolation -ve .
67
+ ```
68
+
69
+ The C++ engine sources live under `external/nest/` (`nest_physics_cpp/` + `opennest_cpp/`, the latter
70
+ bundling Clipper2 and a minimal Boost subset). They are self-contained — no CGAL/Boost/Eigen download
71
+ is needed.
72
+
73
+ ## Quick start
74
+
75
+ ```python
76
+ from compas.geometry import Polyline
77
+ from compas_nest import nest_geo, nest_sheets, opennest_collision
78
+
79
+ def rect(x0, y0, w, h):
80
+ return Polyline([[x0, y0, 0], [x0+w, y0, 0], [x0+w, y0+h, 0], [x0, y0+h, 0], [x0, y0, 0]])
81
+
82
+ geo = nest_geo()
83
+ geo.add_part(rect(0, 0, 20, 10), copies=3)
84
+ geo.add_part(rect(0, 0, 15, 15), holes=[rect(5, 5, 5, 5)], copies=2)
85
+
86
+ sheets = nest_sheets()
87
+ sheets.add_sheet(rect(0, 0, 100, 100), holes=[rect(40, 40, 10, 10)])
88
+
89
+ result = opennest_collision(iterations=2000, num_rotations=64).solve(geo, sheets)
90
+
91
+ for group in result.placed_polylines():
92
+ print("sheet", group["sheet_id"], "->", len(group["parts"]), "parts")
93
+
94
+ # serialize placed polylines (with holes) + transformations to COMPAS JSON
95
+ result.to_json("data/output/quickstart.json")
96
+ ```
97
+
98
+ See the `examples/` folder for the viewer workflows, and the
99
+ [documentation](https://petrasvestartas.github.io/compas_nest/) for examples, API reference and credits.
100
+
101
+ ## Credits
102
+
103
+ `compas_nest` is the COMPAS / Python binding of the [OpenNest](https://github.com/petrasvestartas/OpenNest)
104
+ C++ engines by **Petras Vestartas**, which build on SVGnest/Deepnest (NFP+GA), jagua-rs/sparrow (physics
105
+ strip-packing), Clipper2 and Boost.Polygon. Full attributions: [docs/credits.md](docs/credits.md).
106
+
107
+ ## License
108
+
109
+ MIT
@@ -0,0 +1,94 @@
1
+ # compas_nest
2
+
3
+ 2D irregular nesting for the [COMPAS](https://compas.dev) framework — Python bindings for the
4
+ [OpenNest](https://github.com/petrasvestartas/OpenNest) C++ engines, built with
5
+ [nanobind](https://github.com/wjakob/nanobind) (the same toolchain as
6
+ [compas_cgal](https://github.com/compas-dev/compas_cgal)).
7
+
8
+ Nest polylines **with holes** into sheets **with holes**, with live terminal progress and
9
+ [compas_viewer](https://github.com/compas-dev/compas_viewer) visualization.
10
+
11
+ ![compas_nest](docs/images/04_collision_dataset.gif)
12
+
13
+ ## Two engines
14
+
15
+ | Class | Engine | Notes |
16
+ |---|---|---|
17
+ | `opennest_collision` | physics / overlap-relaxation (`np_nest`) | dependency-free; iteration-budget driven; nests parts into holes |
18
+ | `opennest` | NFP + genetic algorithm (`nfp_nest`) | bundled Clipper2; generation/fitness driven; carries part *attributes* through placement |
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ pip install compas_nest
24
+ ```
25
+
26
+ ### From source (editable)
27
+
28
+ **One-step (uv, macOS + Windows Git Bash + Linux):** creates a local `.venv`, installs every
29
+ dependency, and builds the package:
30
+
31
+ ```bash
32
+ git clone --recurse-submodules https://github.com/petrasvestartas/compas_nest.git
33
+ cd compas_nest
34
+ bash bash/install.sh
35
+ ```
36
+
37
+ After editing C++ sources, rebuild without recreating the env: `bash bash/build.sh --test`.
38
+
39
+ **conda:**
40
+
41
+ ```bash
42
+ conda env create -f environment.yml
43
+ conda activate compas_nest
44
+ pip install --no-build-isolation -ve .
45
+ ```
46
+
47
+ **plain pip:**
48
+
49
+ ```bash
50
+ pip install nanobind "scikit-build-core[pyproject]"
51
+ pip install --no-build-isolation -ve .
52
+ ```
53
+
54
+ The C++ engine sources live under `external/nest/` (`nest_physics_cpp/` + `opennest_cpp/`, the latter
55
+ bundling Clipper2 and a minimal Boost subset). They are self-contained — no CGAL/Boost/Eigen download
56
+ is needed.
57
+
58
+ ## Quick start
59
+
60
+ ```python
61
+ from compas.geometry import Polyline
62
+ from compas_nest import nest_geo, nest_sheets, opennest_collision
63
+
64
+ def rect(x0, y0, w, h):
65
+ return Polyline([[x0, y0, 0], [x0+w, y0, 0], [x0+w, y0+h, 0], [x0, y0+h, 0], [x0, y0, 0]])
66
+
67
+ geo = nest_geo()
68
+ geo.add_part(rect(0, 0, 20, 10), copies=3)
69
+ geo.add_part(rect(0, 0, 15, 15), holes=[rect(5, 5, 5, 5)], copies=2)
70
+
71
+ sheets = nest_sheets()
72
+ sheets.add_sheet(rect(0, 0, 100, 100), holes=[rect(40, 40, 10, 10)])
73
+
74
+ result = opennest_collision(iterations=2000, num_rotations=64).solve(geo, sheets)
75
+
76
+ for group in result.placed_polylines():
77
+ print("sheet", group["sheet_id"], "->", len(group["parts"]), "parts")
78
+
79
+ # serialize placed polylines (with holes) + transformations to COMPAS JSON
80
+ result.to_json("data/output/quickstart.json")
81
+ ```
82
+
83
+ See the `examples/` folder for the viewer workflows, and the
84
+ [documentation](https://petrasvestartas.github.io/compas_nest/) for examples, API reference and credits.
85
+
86
+ ## Credits
87
+
88
+ `compas_nest` is the COMPAS / Python binding of the [OpenNest](https://github.com/petrasvestartas/OpenNest)
89
+ C++ engines by **Petras Vestartas**, which build on SVGnest/Deepnest (NFP+GA), jagua-rs/sparrow (physics
90
+ strip-packing), Clipper2 and Boost.Polygon. Full attributions: [docs/credits.md](docs/credits.md).
91
+
92
+ ## License
93
+
94
+ MIT
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Rebuild compas_nest in the existing .venv after editing C++ sources, without
4
+ # recreating the environment. Works on macOS and Windows (Git Bash).
5
+ #
6
+ # bash bash/build.sh # rebuild only
7
+ # bash bash/build.sh --test # rebuild, then run pytest
8
+ #
9
+ set -euo pipefail
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
13
+ cd "$ROOT"
14
+
15
+ case "$(uname -s)" in
16
+ MINGW*|MSYS*|CYGWIN*) OS=windows ;;
17
+ *) OS=other ;;
18
+ esac
19
+
20
+ if [ "$OS" = "windows" ]; then
21
+ VENV_PY="$ROOT/.venv/Scripts/python.exe"
22
+ else
23
+ VENV_PY="$ROOT/.venv/bin/python"
24
+ fi
25
+
26
+ if [ ! -x "$VENV_PY" ] && [ ! -f "$VENV_PY" ]; then
27
+ echo "ERROR: .venv not found. Run 'bash bash/install.sh' first."
28
+ exit 1
29
+ fi
30
+
31
+ echo ">> Rebuilding compas_nest (editable) ..."
32
+ if [ "$OS" = "windows" ]; then
33
+ VSW="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
34
+ if [ -f "$VSW" ]; then
35
+ VSMAJOR="$("$VSW" -latest -property installationVersion 2>/dev/null | cut -d. -f1)"
36
+ case "$VSMAJOR" in
37
+ 17) export CMAKE_GENERATOR="Visual Studio 17 2022" ;;
38
+ 16) export CMAKE_GENERATOR="Visual Studio 16 2019" ;;
39
+ 15) export CMAKE_GENERATOR="Visual Studio 15 2017" ;;
40
+ esac
41
+ export CMAKE_GENERATOR_PLATFORM=x64
42
+ fi
43
+ fi
44
+ uv pip install --python "$VENV_PY" --no-build-isolation -ve .
45
+
46
+ if [ "${1:-}" = "--test" ]; then
47
+ echo ">> Running tests ..."
48
+ "$VENV_PY" -m pytest tests/ -q
49
+ fi
50
+
51
+ echo ">> Done."
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Create a local uv virtual environment (.venv), install all dependencies, and
4
+ # build compas_nest in editable mode. Works on macOS and on Windows (run from
5
+ # Git Bash). Linux works too.
6
+ #
7
+ # bash bash/install.sh
8
+ #
9
+ # Options (environment variables):
10
+ # PYTHON_VERSION Python to use for the venv (default: 3.12)
11
+ #
12
+ set -euo pipefail
13
+
14
+ # --- locate the repo root (parent of this bash/ folder) ---------------------
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ cd "$ROOT"
18
+
19
+ PYTHON_VERSION="${PYTHON_VERSION:-3.12}"
20
+
21
+ # --- detect OS --------------------------------------------------------------
22
+ case "$(uname -s)" in
23
+ Darwin*) OS=mac ;;
24
+ Linux*) OS=linux ;;
25
+ MINGW*|MSYS*|CYGWIN*) OS=windows ;;
26
+ *) OS=unknown ;;
27
+ esac
28
+ echo ">> Platform: $OS Python: $PYTHON_VERSION"
29
+
30
+ # --- require uv -------------------------------------------------------------
31
+ if ! command -v uv >/dev/null 2>&1; then
32
+ echo "ERROR: 'uv' is not installed or not on PATH."
33
+ if [ "$OS" = "windows" ]; then
34
+ echo " Install it with: powershell -c \"irm https://astral.sh/uv/install.ps1 | iex\""
35
+ else
36
+ echo " Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh"
37
+ fi
38
+ exit 1
39
+ fi
40
+
41
+ # --- make sure the C++ engine submodule is present --------------------------
42
+ if [ -f .gitmodules ]; then
43
+ echo ">> Initialising git submodules (external/nest) ..."
44
+ git submodule update --init --recursive
45
+ fi
46
+ if [ ! -f external/nest/nest_physics_cpp/nest_physics_capi.cpp ]; then
47
+ echo "ERROR: C++ engine sources missing at external/nest. Submodule init failed?"
48
+ exit 1
49
+ fi
50
+
51
+ # --- create the virtual environment -----------------------------------------
52
+ echo ">> Creating uv virtual environment in .venv ..."
53
+ uv venv --python "$PYTHON_VERSION" .venv
54
+
55
+ if [ "$OS" = "windows" ]; then
56
+ VENV_PY="$ROOT/.venv/Scripts/python.exe"
57
+ else
58
+ VENV_PY="$ROOT/.venv/bin/python"
59
+ fi
60
+
61
+ # --- install dependencies (build + runtime + viewer + tests) ----------------
62
+ echo ">> Installing dependencies into .venv ..."
63
+ uv pip install --python "$VENV_PY" \
64
+ nanobind>=2.12 \
65
+ "scikit-build-core[pyproject]>=0.10" \
66
+ cmake>=3.15 \
67
+ ninja \
68
+ "numpy>=1.24" \
69
+ "compas>=2.15,<3" \
70
+ compas_viewer \
71
+ pytest \
72
+ ruff
73
+
74
+ # --- build + install compas_nest (editable) ---------------------------------
75
+ echo ">> Building compas_nest (editable) ..."
76
+ if [ "$OS" = "windows" ]; then
77
+ # Use the Visual Studio CMake generator: MSBuild locates the MSVC toolchain
78
+ # itself, so no vcvars / 'cmd' wrapper is needed (which is fragile from Git Bash).
79
+ VSW="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
80
+ if [ -f "$VSW" ]; then
81
+ VSMAJOR="$("$VSW" -latest -property installationVersion 2>/dev/null | cut -d. -f1)"
82
+ case "$VSMAJOR" in
83
+ 17) export CMAKE_GENERATOR="Visual Studio 17 2022" ;;
84
+ 16) export CMAKE_GENERATOR="Visual Studio 16 2019" ;;
85
+ 15) export CMAKE_GENERATOR="Visual Studio 15 2017" ;;
86
+ esac
87
+ export CMAKE_GENERATOR_PLATFORM=x64
88
+ echo ">> Using CMake generator: ${CMAKE_GENERATOR:-default}"
89
+ fi
90
+ fi
91
+ uv pip install --python "$VENV_PY" --no-build-isolation -ve .
92
+
93
+ # --- verify -----------------------------------------------------------------
94
+ echo ">> Verifying import ..."
95
+ "$VENV_PY" -c "import compas_nest; from compas_nest import OpenNestCollision, OpenNest2; print('compas_nest', compas_nest.__version__, 'OK')"
96
+
97
+ echo ""
98
+ echo "Done. Activate the environment with:"
99
+ if [ "$OS" = "windows" ]; then
100
+ echo " source .venv/Scripts/activate # Git Bash"
101
+ echo " .venv\\Scripts\\activate # PowerShell/cmd"
102
+ else
103
+ echo " source .venv/bin/activate"
104
+ fi
105
+ echo "Run the tests with: bash bash/build.sh --test (or 'pytest tests/' once activated)"
File without changes