dartpy 7.0.0.dev0__cp312-cp312-manylinux_2_39_x86_64.whl

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.

Potentially problematic release.


This version of dartpy might be problematic. Click here for more details.

Files changed (994) hide show
  1. dartpy-7.0.0.dev0.dist-info/METADATA +86 -0
  2. dartpy-7.0.0.dev0.dist-info/RECORD +994 -0
  3. dartpy-7.0.0.dev0.dist-info/WHEEL +5 -0
  4. dartpy-7.0.0.dev0.dist-info/licenses/LICENSE +31 -0
  5. dartpy.cpython-312-x86_64-linux-gnu.so +0 -0
  6. dartpy.libs/libBulletCollision-f96eb02c.so.3.25 +0 -0
  7. dartpy.libs/libBulletDynamics-3cff1f18.so.3.25 +0 -0
  8. dartpy.libs/libBulletSoftBody-220f01bd.so.3.25 +0 -0
  9. dartpy.libs/libLinearMath-71568d02.so.3.25 +0 -0
  10. dartpy.libs/libOpenThreads-8bc434db.so.3.3.1 +0 -0
  11. dartpy.libs/libSDL2-2-3db87ac0.0.so.0.3200.56 +0 -0
  12. dartpy.libs/libassimp-44cf3e77.so.5.4.3 +0 -0
  13. dartpy.libs/libccd-4f119cf4.so.2.0 +0 -0
  14. dartpy.libs/libconsole_bridge-f26e11cc.so.1.0 +0 -0
  15. dartpy.libs/libfcl-2607815a.so.0.7.0 +0 -0
  16. dartpy.libs/libfmt-277170bf.so.11.2.0 +0 -0
  17. dartpy.libs/libfontconfig-559ff509.so.1.14.0 +0 -0
  18. dartpy.libs/libfreetype-64806fc6.so.6.20.4 +0 -0
  19. dartpy.libs/libglfw-6f066845.so.3.4 +0 -0
  20. dartpy.libs/libimgui-ab87b07d.so +0 -0
  21. dartpy.libs/libnlopt-78f9bc34.so.1.0.0 +0 -0
  22. dartpy.libs/liboctomap-38e56f99.so.1.10.0 +0 -0
  23. dartpy.libs/liboctomath-bff26442.so.1.10.0 +0 -0
  24. dartpy.libs/libode-caca20fc.so.8.2.0 +0 -0
  25. dartpy.libs/libosg-e67375e5.so.3.6.5 +0 -0
  26. dartpy.libs/libosgDB-22ae780f.so.3.6.5 +0 -0
  27. dartpy.libs/libosgGA-6af4078b.so.3.6.5 +0 -0
  28. dartpy.libs/libosgManipulator-3270f659.so.3.6.5 +0 -0
  29. dartpy.libs/libosgShadow-127a8d77.so.3.6.5 +0 -0
  30. dartpy.libs/libosgText-87d82d87.so.3.6.5 +0 -0
  31. dartpy.libs/libosgUtil-55896958.so.3.6.5 +0 -0
  32. dartpy.libs/libosgViewer-76d832e3.so.3.6.5 +0 -0
  33. dartpy.libs/libpng16-bd65464e.so.16.50.0 +0 -0
  34. dartpy.libs/libtinyxml2-8d10763c.so.11.0.0 +0 -0
  35. dartpy.libs/liburdfdom_model-7b26ae88.so.4.0 +0 -0
  36. dartpy.libs/liburdfdom_model_state-95a5ad6e.so.4.0 +0 -0
  37. dartpy.libs/liburdfdom_sensor-55a145ea.so.4.0 +0 -0
  38. dartpy.libs/liburdfdom_world-a32c7194.so.4.0 +0 -0
  39. dartpy.libs/libvulkan-8caf1954.so.1.4.328 +0 -0
  40. include/dart/collision/CollisionDetector.hpp +305 -0
  41. include/dart/collision/CollisionFilter.hpp +126 -0
  42. include/dart/collision/CollisionGroup.hpp +546 -0
  43. include/dart/collision/CollisionObject.hpp +90 -0
  44. include/dart/collision/CollisionOption.hpp +71 -0
  45. include/dart/collision/CollisionResult.hpp +109 -0
  46. include/dart/collision/Contact.hpp +103 -0
  47. include/dart/collision/DistanceFilter.hpp +66 -0
  48. include/dart/collision/DistanceOption.hpp +80 -0
  49. include/dart/collision/DistanceResult.hpp +123 -0
  50. include/dart/collision/Option.hpp +42 -0
  51. include/dart/collision/RaycastOption.hpp +58 -0
  52. include/dart/collision/RaycastResult.hpp +80 -0
  53. include/dart/collision/Result.hpp +42 -0
  54. include/dart/collision/SmartPointer.hpp +51 -0
  55. include/dart/collision/all.hpp +17 -0
  56. include/dart/collision/bullet/BulletCollisionDetector.hpp +168 -0
  57. include/dart/collision/bullet/BulletCollisionGroup.hpp +98 -0
  58. include/dart/collision/bullet/BulletCollisionObject.hpp +75 -0
  59. include/dart/collision/bullet/BulletCollisionShape.hpp +62 -0
  60. include/dart/collision/bullet/BulletInclude.hpp +47 -0
  61. include/dart/collision/bullet/BulletTypes.hpp +57 -0
  62. include/dart/collision/bullet/all.hpp +8 -0
  63. include/dart/collision/bullet/bullet.hpp +14 -0
  64. include/dart/collision/bullet/detail/BulletCollisionDispatcher.hpp +70 -0
  65. include/dart/collision/bullet/detail/BulletOverlapFilterCallback.hpp +72 -0
  66. include/dart/collision/collision.hpp +14 -0
  67. include/dart/collision/dart/DARTCollide.hpp +106 -0
  68. include/dart/collision/dart/DARTCollisionDetector.hpp +109 -0
  69. include/dart/collision/dart/DARTCollisionGroup.hpp +82 -0
  70. include/dart/collision/dart/DARTCollisionObject.hpp +63 -0
  71. include/dart/collision/dart/all.hpp +6 -0
  72. include/dart/collision/dart/dart.hpp +14 -0
  73. include/dart/collision/detail/CollisionDetector.hpp +66 -0
  74. include/dart/collision/detail/CollisionGroup.hpp +287 -0
  75. include/dart/collision/detail/Contact-impl.hpp +56 -0
  76. include/dart/collision/detail/UnorderedPairs.hpp +153 -0
  77. include/dart/collision/fcl/BackwardCompatibility.hpp +145 -0
  78. include/dart/collision/fcl/CollisionShapes.hpp +374 -0
  79. include/dart/collision/fcl/FCLCollisionDetector.hpp +204 -0
  80. include/dart/collision/fcl/FCLCollisionGroup.hpp +95 -0
  81. include/dart/collision/fcl/FCLCollisionObject.hpp +72 -0
  82. include/dart/collision/fcl/FCLTypes.hpp +62 -0
  83. include/dart/collision/fcl/TriTriIntersectionTest.hpp +17 -0
  84. include/dart/collision/fcl/all.hpp +9 -0
  85. include/dart/collision/fcl/fcl.hpp +14 -0
  86. include/dart/collision/fcl/tri_tri_intersection_test.hpp +332 -0
  87. include/dart/collision/ode/OdeCollisionDetector.hpp +131 -0
  88. include/dart/collision/ode/OdeCollisionGroup.hpp +87 -0
  89. include/dart/collision/ode/OdeCollisionObject.hpp +89 -0
  90. include/dart/collision/ode/OdeTypes.hpp +51 -0
  91. include/dart/collision/ode/all.hpp +6 -0
  92. include/dart/collision/ode/detail/OdeBox.hpp +58 -0
  93. include/dart/collision/ode/detail/OdeCapsule.hpp +58 -0
  94. include/dart/collision/ode/detail/OdeCylinder.hpp +58 -0
  95. include/dart/collision/ode/detail/OdeGeom.hpp +83 -0
  96. include/dart/collision/ode/detail/OdeHeightmap-impl.hpp +170 -0
  97. include/dart/collision/ode/detail/OdeHeightmap.hpp +70 -0
  98. include/dart/collision/ode/detail/OdeMesh.hpp +83 -0
  99. include/dart/collision/ode/detail/OdePlane.hpp +67 -0
  100. include/dart/collision/ode/detail/OdeSphere.hpp +58 -0
  101. include/dart/collision/ode/ode.hpp +14 -0
  102. include/dart/common/Aspect.hpp +215 -0
  103. include/dart/common/AspectWithVersion.hpp +180 -0
  104. include/dart/common/CAllocator.hpp +65 -0
  105. include/dart/common/Castable.hpp +102 -0
  106. include/dart/common/ClassWithVirtualBase.hpp +47 -0
  107. include/dart/common/Cloneable.hpp +327 -0
  108. include/dart/common/Composite.hpp +205 -0
  109. include/dart/common/CompositeJoiner.hpp +160 -0
  110. include/dart/common/Console.hpp +75 -0
  111. include/dart/common/Deprecated.hpp +126 -0
  112. include/dart/common/EmbeddedAspect.hpp +466 -0
  113. include/dart/common/Empty.hpp +55 -0
  114. include/dart/common/Factory.hpp +146 -0
  115. include/dart/common/Filesystem.hpp +112 -0
  116. include/dart/common/FreeListAllocator.hpp +162 -0
  117. include/dart/common/IncludeWindows.hpp +50 -0
  118. include/dart/common/LocalResource.hpp +76 -0
  119. include/dart/common/LocalResourceRetriever.hpp +63 -0
  120. include/dart/common/LockableReference.hpp +166 -0
  121. include/dart/common/Logging.hpp +146 -0
  122. include/dart/common/Macros.hpp +78 -0
  123. include/dart/common/Memory.hpp +215 -0
  124. include/dart/common/MemoryAllocator.hpp +120 -0
  125. include/dart/common/MemoryAllocatorDebugger.hpp +98 -0
  126. include/dart/common/MemoryManager.hpp +189 -0
  127. include/dart/common/Metaprogramming.hpp +68 -0
  128. include/dart/common/NameManager.hpp +184 -0
  129. include/dart/common/Observer.hpp +85 -0
  130. include/dart/common/Optional.hpp +48 -0
  131. include/dart/common/Platform.hpp +92 -0
  132. include/dart/common/PoolAllocator.hpp +141 -0
  133. include/dart/common/Profile.hpp +56 -0
  134. include/dart/common/ProxyAspect.hpp +93 -0
  135. include/dart/common/RequiresAspect.hpp +79 -0
  136. include/dart/common/Resource.hpp +96 -0
  137. include/dart/common/ResourceRetriever.hpp +82 -0
  138. include/dart/common/SharedLibrary.hpp +201 -0
  139. include/dart/common/Signal.hpp +250 -0
  140. include/dart/common/Singleton.hpp +85 -0
  141. include/dart/common/SmartPointer.hpp +63 -0
  142. include/dart/common/SpecializedForAspect.hpp +207 -0
  143. include/dart/common/StlAllocator.hpp +111 -0
  144. include/dart/common/StlHelpers.hpp +61 -0
  145. include/dart/common/Stopwatch.hpp +143 -0
  146. include/dart/common/String.hpp +71 -0
  147. include/dart/common/SubPtr.hpp +17 -0
  148. include/dart/common/Subject.hpp +84 -0
  149. include/dart/common/Timer.hpp +119 -0
  150. include/dart/common/Uri.hpp +229 -0
  151. include/dart/common/VersionCounter.hpp +68 -0
  152. include/dart/common/Virtual.hpp +51 -0
  153. include/dart/common/all.hpp +53 -0
  154. include/dart/common/common.hpp +14 -0
  155. include/dart/common/detail/Aspect.hpp +102 -0
  156. include/dart/common/detail/AspectWithVersion.hpp +455 -0
  157. include/dart/common/detail/Castable-impl.hpp +109 -0
  158. include/dart/common/detail/Cloneable.hpp +638 -0
  159. include/dart/common/detail/Composite.hpp +241 -0
  160. include/dart/common/detail/CompositeData.hpp +393 -0
  161. include/dart/common/detail/CompositeJoiner.hpp +128 -0
  162. include/dart/common/detail/ConnectionBody.hpp +157 -0
  163. include/dart/common/detail/EmbeddedAspect.hpp +487 -0
  164. include/dart/common/detail/Factory-impl.hpp +200 -0
  165. include/dart/common/detail/LockableReference-impl.hpp +156 -0
  166. include/dart/common/detail/Logging-impl.hpp +162 -0
  167. include/dart/common/detail/Memory-impl.hpp +66 -0
  168. include/dart/common/detail/MemoryAllocator-impl.hpp +97 -0
  169. include/dart/common/detail/MemoryAllocatorDebugger-impl.hpp +201 -0
  170. include/dart/common/detail/MemoryManager-impl.hpp +102 -0
  171. include/dart/common/detail/Metaprogramming-impl.hpp +89 -0
  172. include/dart/common/detail/NameManager.hpp +301 -0
  173. include/dart/common/detail/NoOp.hpp +57 -0
  174. include/dart/common/detail/ProxyAspect.hpp +172 -0
  175. include/dart/common/detail/RequiresAspect.hpp +51 -0
  176. include/dart/common/detail/SharedLibraryManager.hpp +106 -0
  177. include/dart/common/detail/Signal.hpp +242 -0
  178. include/dart/common/detail/Singleton-impl.hpp +74 -0
  179. include/dart/common/detail/SpecializedForAspect.hpp +331 -0
  180. include/dart/common/detail/StlAllocator-impl.hpp +108 -0
  181. include/dart/common/detail/Stopwatch-impl.hpp +242 -0
  182. include/dart/common/detail/SubPtr.hpp +17 -0
  183. include/dart/common/detail/TemplateJoinerDispatchMacro.hpp +59 -0
  184. include/dart/common/detail/sub_ptr.hpp +139 -0
  185. include/dart/common/sub_ptr.hpp +103 -0
  186. include/dart/config.hpp +100 -0
  187. include/dart/constraint/BalanceConstraint.hpp +202 -0
  188. include/dart/constraint/BallJointConstraint.hpp +142 -0
  189. include/dart/constraint/BoxedLcpConstraintSolver.hpp +182 -0
  190. include/dart/constraint/BoxedLcpSolver.hpp +101 -0
  191. include/dart/constraint/ConstrainedGroup.hpp +120 -0
  192. include/dart/constraint/ConstraintBase.hpp +141 -0
  193. include/dart/constraint/ConstraintSolver.hpp +325 -0
  194. include/dart/constraint/ContactConstraint.hpp +286 -0
  195. include/dart/constraint/ContactSurface.hpp +191 -0
  196. include/dart/constraint/DantzigBoxedLcpSolver.hpp +71 -0
  197. include/dart/constraint/DantzigLCPSolver.hpp +87 -0
  198. include/dart/constraint/DynamicJointConstraint.hpp +120 -0
  199. include/dart/constraint/JointConstraint.hpp +182 -0
  200. include/dart/constraint/JointCoulombFrictionConstraint.hpp +149 -0
  201. include/dart/constraint/JointLimitConstraint.hpp +185 -0
  202. include/dart/constraint/LCPSolver.hpp +71 -0
  203. include/dart/constraint/MimicMotorConstraint.hpp +164 -0
  204. include/dart/constraint/PGSLCPSolver.hpp +109 -0
  205. include/dart/constraint/PgsBoxedLcpSolver.hpp +106 -0
  206. include/dart/constraint/ServoMotorConstraint.hpp +151 -0
  207. include/dart/constraint/SmartPointer.hpp +69 -0
  208. include/dart/constraint/SoftContactConstraint.hpp +262 -0
  209. include/dart/constraint/WeldJointConstraint.hpp +133 -0
  210. include/dart/constraint/all.hpp +25 -0
  211. include/dart/constraint/constraint.hpp +14 -0
  212. include/dart/constraint/detail/ConstraintSolver-impl.hpp +78 -0
  213. include/dart/dart.hpp +44 -0
  214. include/dart/dynamics/ArrowShape.hpp +121 -0
  215. include/dart/dynamics/AssimpInputResourceAdaptor.hpp +129 -0
  216. include/dart/dynamics/BallJoint.hpp +143 -0
  217. include/dart/dynamics/BodyNode.hpp +1279 -0
  218. include/dart/dynamics/BoxShape.hpp +90 -0
  219. include/dart/dynamics/Branch.hpp +107 -0
  220. include/dart/dynamics/CapsuleShape.hpp +105 -0
  221. include/dart/dynamics/Chain.hpp +142 -0
  222. include/dart/dynamics/CompositeNode.hpp +114 -0
  223. include/dart/dynamics/ConeShape.hpp +107 -0
  224. include/dart/dynamics/CylinderShape.hpp +96 -0
  225. include/dart/dynamics/DegreeOfFreedom.hpp +415 -0
  226. include/dart/dynamics/EllipsoidShape.hpp +115 -0
  227. include/dart/dynamics/EndEffector.hpp +158 -0
  228. include/dart/dynamics/Entity.hpp +258 -0
  229. include/dart/dynamics/EntityNode.hpp +77 -0
  230. include/dart/dynamics/EulerJoint.hpp +174 -0
  231. include/dart/dynamics/FixedFrame.hpp +105 -0
  232. include/dart/dynamics/FixedJacobianNode.hpp +168 -0
  233. include/dart/dynamics/Frame.hpp +388 -0
  234. include/dart/dynamics/FreeJoint.hpp +369 -0
  235. include/dart/dynamics/GenericJoint.hpp +825 -0
  236. include/dart/dynamics/Group.hpp +270 -0
  237. include/dart/dynamics/HeightmapShape.hpp +195 -0
  238. include/dart/dynamics/HierarchicalIK.hpp +419 -0
  239. include/dart/dynamics/IkFast.hpp +277 -0
  240. include/dart/dynamics/Inertia.hpp +176 -0
  241. include/dart/dynamics/InvalidIndex.hpp +46 -0
  242. include/dart/dynamics/InverseKinematics.hpp +1401 -0
  243. include/dart/dynamics/JacobianNode.hpp +312 -0
  244. include/dart/dynamics/Joint.hpp +1128 -0
  245. include/dart/dynamics/LineSegmentShape.hpp +140 -0
  246. include/dart/dynamics/Linkage.hpp +246 -0
  247. include/dart/dynamics/Marker.hpp +126 -0
  248. include/dart/dynamics/MeshShape.hpp +225 -0
  249. include/dart/dynamics/MetaSkeleton.hpp +1034 -0
  250. include/dart/dynamics/MimicDofProperties.hpp +62 -0
  251. include/dart/dynamics/MultiSphereConvexHullShape.hpp +111 -0
  252. include/dart/dynamics/MultiSphereShape.hpp +42 -0
  253. include/dart/dynamics/Node.hpp +273 -0
  254. include/dart/dynamics/NodeManagerJoiner.hpp +190 -0
  255. include/dart/dynamics/PlanarJoint.hpp +161 -0
  256. include/dart/dynamics/PlaneShape.hpp +105 -0
  257. include/dart/dynamics/PointCloudShape.hpp +186 -0
  258. include/dart/dynamics/PointMass.hpp +709 -0
  259. include/dart/dynamics/PrismaticJoint.hpp +120 -0
  260. include/dart/dynamics/PyramidShape.hpp +122 -0
  261. include/dart/dynamics/ReferentialSkeleton.hpp +550 -0
  262. include/dart/dynamics/RevoluteJoint.hpp +120 -0
  263. include/dart/dynamics/ScrewJoint.hpp +126 -0
  264. include/dart/dynamics/Shape.hpp +231 -0
  265. include/dart/dynamics/ShapeFrame.hpp +291 -0
  266. include/dart/dynamics/ShapeNode.hpp +134 -0
  267. include/dart/dynamics/SharedLibraryIkFast.hpp +147 -0
  268. include/dart/dynamics/SimpleFrame.hpp +247 -0
  269. include/dart/dynamics/Skeleton.hpp +1350 -0
  270. include/dart/dynamics/SmartPointer.hpp +185 -0
  271. include/dart/dynamics/SoftBodyNode.hpp +472 -0
  272. include/dart/dynamics/SoftMeshShape.hpp +100 -0
  273. include/dart/dynamics/SpecializedNodeManager.hpp +230 -0
  274. include/dart/dynamics/SphereShape.hpp +89 -0
  275. include/dart/dynamics/TemplatedJacobianNode.hpp +128 -0
  276. include/dart/dynamics/TranslationalJoint.hpp +105 -0
  277. include/dart/dynamics/TranslationalJoint2D.hpp +156 -0
  278. include/dart/dynamics/UniversalJoint.hpp +128 -0
  279. include/dart/dynamics/VoxelGridShape.hpp +171 -0
  280. include/dart/dynamics/WeldJoint.hpp +116 -0
  281. include/dart/dynamics/ZeroDofJoint.hpp +562 -0
  282. include/dart/dynamics/all.hpp +69 -0
  283. include/dart/dynamics/detail/BasicNodeManager.hpp +539 -0
  284. include/dart/dynamics/detail/BodyNode.hpp +344 -0
  285. include/dart/dynamics/detail/BodyNodeAspect.hpp +177 -0
  286. include/dart/dynamics/detail/BodyNodePtr.hpp +351 -0
  287. include/dart/dynamics/detail/CompositeNode.hpp +93 -0
  288. include/dart/dynamics/detail/DegreeOfFreedomPtr.hpp +338 -0
  289. include/dart/dynamics/detail/EndEffectorAspect.hpp +106 -0
  290. include/dart/dynamics/detail/EntityNode.hpp +81 -0
  291. include/dart/dynamics/detail/EntityNodeAspect.hpp +101 -0
  292. include/dart/dynamics/detail/EulerJointAspect.hpp +93 -0
  293. include/dart/dynamics/detail/FixedFrameAspect.hpp +58 -0
  294. include/dart/dynamics/detail/FixedJacobianNode.hpp +55 -0
  295. include/dart/dynamics/detail/GenericJoint.hpp +2471 -0
  296. include/dart/dynamics/detail/GenericJointAspect.hpp +353 -0
  297. include/dart/dynamics/detail/HeightmapShape-impl.hpp +243 -0
  298. include/dart/dynamics/detail/InverseKinematics.hpp +83 -0
  299. include/dart/dynamics/detail/InverseKinematicsPtr.hpp +341 -0
  300. include/dart/dynamics/detail/JointAspect.hpp +161 -0
  301. include/dart/dynamics/detail/JointPtr.hpp +293 -0
  302. include/dart/dynamics/detail/MarkerAspect.hpp +68 -0
  303. include/dart/dynamics/detail/MetaSkeleton-impl.hpp +151 -0
  304. include/dart/dynamics/detail/Node.hpp +532 -0
  305. include/dart/dynamics/detail/NodeManagerJoiner.hpp +184 -0
  306. include/dart/dynamics/detail/NodePtr.hpp +259 -0
  307. include/dart/dynamics/detail/PlanarJointAspect.hpp +136 -0
  308. include/dart/dynamics/detail/PrismaticJointAspect.hpp +85 -0
  309. include/dart/dynamics/detail/RevoluteJointAspect.hpp +86 -0
  310. include/dart/dynamics/detail/ScrewJointAspect.hpp +90 -0
  311. include/dart/dynamics/detail/ShapeFrameAspect.hpp +169 -0
  312. include/dart/dynamics/detail/ShapeNode.hpp +51 -0
  313. include/dart/dynamics/detail/Skeleton.hpp +92 -0
  314. include/dart/dynamics/detail/SkeletonAspect.hpp +181 -0
  315. include/dart/dynamics/detail/SoftBodyNodeAspect.hpp +132 -0
  316. include/dart/dynamics/detail/SpecializedNodeManager.hpp +324 -0
  317. include/dart/dynamics/detail/TemplatedJacobianNode.hpp +294 -0
  318. include/dart/dynamics/detail/TranslationalJoint2DAspect.hpp +140 -0
  319. include/dart/dynamics/detail/UniversalJointAspect.hpp +86 -0
  320. include/dart/dynamics/dynamics.hpp +14 -0
  321. include/dart/dynamics/ikfast.h +345 -0
  322. include/dart/external/convhull_3d/convhull_3d.h +1878 -0
  323. include/dart/external/convhull_3d/safe_convhull_3d.h +53 -0
  324. include/dart/external/odelcpsolver/common.h +418 -0
  325. include/dart/external/odelcpsolver/error.h +62 -0
  326. include/dart/external/odelcpsolver/lcp.h +75 -0
  327. include/dart/external/odelcpsolver/matrix.h +277 -0
  328. include/dart/external/odelcpsolver/misc.h +82 -0
  329. include/dart/external/odelcpsolver/odeconfig.h +110 -0
  330. include/dart/gui/osg/DefaultEventHandler.hpp +237 -0
  331. include/dart/gui/osg/DragAndDrop.hpp +360 -0
  332. include/dart/gui/osg/GridVisual.hpp +218 -0
  333. include/dart/gui/osg/ImGuiHandler.hpp +113 -0
  334. include/dart/gui/osg/ImGuiViewer.hpp +83 -0
  335. include/dart/gui/osg/ImGuiWidget.hpp +91 -0
  336. include/dart/gui/osg/IncludeImGui.hpp +75 -0
  337. include/dart/gui/osg/InteractiveFrame.hpp +170 -0
  338. include/dart/gui/osg/MouseEventHandler.hpp +76 -0
  339. include/dart/gui/osg/RealTimeWorldNode.hpp +126 -0
  340. include/dart/gui/osg/ShapeFrameNode.hpp +117 -0
  341. include/dart/gui/osg/SupportPolygonVisual.hpp +202 -0
  342. include/dart/gui/osg/TrackballManipulator.hpp +97 -0
  343. include/dart/gui/osg/Utils.hpp +120 -0
  344. include/dart/gui/osg/Viewer.hpp +427 -0
  345. include/dart/gui/osg/WorldNode.hpp +211 -0
  346. include/dart/gui/osg/all.hpp +19 -0
  347. include/dart/gui/osg/detail/CameraModeCallback.hpp +82 -0
  348. include/dart/gui/osg/detail/Utils-impl.hpp +160 -0
  349. include/dart/gui/osg/osg.hpp +14 -0
  350. include/dart/gui/osg/render/BoxShapeNode.hpp +74 -0
  351. include/dart/gui/osg/render/CapsuleShapeNode.hpp +75 -0
  352. include/dart/gui/osg/render/ConeShapeNode.hpp +74 -0
  353. include/dart/gui/osg/render/CylinderShapeNode.hpp +75 -0
  354. include/dart/gui/osg/render/EllipsoidShapeNode.hpp +76 -0
  355. include/dart/gui/osg/render/HeightmapShapeNode.hpp +485 -0
  356. include/dart/gui/osg/render/LineSegmentShapeNode.hpp +75 -0
  357. include/dart/gui/osg/render/MeshShapeNode.hpp +86 -0
  358. include/dart/gui/osg/render/MultiSphereShapeNode.hpp +76 -0
  359. include/dart/gui/osg/render/PlaneShapeNode.hpp +75 -0
  360. include/dart/gui/osg/render/PointCloudShapeNode.hpp +85 -0
  361. include/dart/gui/osg/render/PyramidShapeNode.hpp +75 -0
  362. include/dart/gui/osg/render/ShapeNode.hpp +126 -0
  363. include/dart/gui/osg/render/SoftMeshShapeNode.hpp +75 -0
  364. include/dart/gui/osg/render/SphereShapeNode.hpp +76 -0
  365. include/dart/gui/osg/render/VoxelGridShapeNode.hpp +83 -0
  366. include/dart/gui/osg/render/WarningShapeNode.hpp +64 -0
  367. include/dart/gui/osg/render/all.hpp +19 -0
  368. include/dart/gui/osg/render/render.hpp +14 -0
  369. include/dart/integration/EulerIntegrator.hpp +64 -0
  370. include/dart/integration/Integrator.hpp +104 -0
  371. include/dart/integration/RK4Integrator.hpp +68 -0
  372. include/dart/integration/SemiImplicitEulerIntegrator.hpp +64 -0
  373. include/dart/integration/all.hpp +6 -0
  374. include/dart/integration/integration.hpp +14 -0
  375. include/dart/lcpsolver/Lemke.hpp +54 -0
  376. include/dart/lcpsolver/ODELCPSolver.hpp +88 -0
  377. include/dart/lcpsolver/all.hpp +4 -0
  378. include/dart/lcpsolver/lcpsolver.hpp +14 -0
  379. include/dart/math/ConfigurationSpace.hpp +144 -0
  380. include/dart/math/Constants.hpp +79 -0
  381. include/dart/math/Geometry.hpp +659 -0
  382. include/dart/math/Helpers.hpp +481 -0
  383. include/dart/math/Icosphere.hpp +106 -0
  384. include/dart/math/MathTypes.hpp +100 -0
  385. include/dart/math/Mesh.hpp +108 -0
  386. include/dart/math/Random.hpp +225 -0
  387. include/dart/math/TriMesh.hpp +121 -0
  388. include/dart/math/all.hpp +11 -0
  389. include/dart/math/detail/ConfigurationSpace.hpp +235 -0
  390. include/dart/math/detail/Geometry-impl.hpp +126 -0
  391. include/dart/math/detail/Icosphere-impl.hpp +214 -0
  392. include/dart/math/detail/Mesh-impl.hpp +151 -0
  393. include/dart/math/detail/Random-impl.hpp +353 -0
  394. include/dart/math/detail/TriMesh-impl.hpp +202 -0
  395. include/dart/math/math.hpp +14 -0
  396. include/dart/optimizer/Function.hpp +203 -0
  397. include/dart/optimizer/GenericMultiObjectiveProblem.hpp +174 -0
  398. include/dart/optimizer/GradientDescentSolver.hpp +240 -0
  399. include/dart/optimizer/MultiObjectiveProblem.hpp +168 -0
  400. include/dart/optimizer/MultiObjectiveSolver.hpp +168 -0
  401. include/dart/optimizer/Population.hpp +108 -0
  402. include/dart/optimizer/Problem.hpp +191 -0
  403. include/dart/optimizer/Solver.hpp +182 -0
  404. include/dart/optimizer/all.hpp +10 -0
  405. include/dart/optimizer/ipopt/BackwardCompatibility.hpp +43 -0
  406. include/dart/optimizer/ipopt/IpoptSolver.hpp +223 -0
  407. include/dart/optimizer/ipopt/all.hpp +4 -0
  408. include/dart/optimizer/ipopt/ipopt.hpp +14 -0
  409. include/dart/optimizer/nlopt/NloptSolver.hpp +212 -0
  410. include/dart/optimizer/nlopt/all.hpp +3 -0
  411. include/dart/optimizer/nlopt/nlopt.hpp +14 -0
  412. include/dart/optimizer/optimizer.hpp +14 -0
  413. include/dart/simulation/Recording.hpp +118 -0
  414. include/dart/simulation/SmartPointer.hpp +46 -0
  415. include/dart/simulation/World.hpp +405 -0
  416. include/dart/simulation/all.hpp +5 -0
  417. include/dart/simulation/detail/World-impl.hpp +129 -0
  418. include/dart/simulation/simulation.hpp +14 -0
  419. include/dart/utils/C3D.hpp +107 -0
  420. include/dart/utils/CompositeResourceRetriever.hpp +97 -0
  421. include/dart/utils/DartResourceRetriever.hpp +104 -0
  422. include/dart/utils/FileInfoC3D.hpp +91 -0
  423. include/dart/utils/FileInfoDof.hpp +109 -0
  424. include/dart/utils/FileInfoWorld.hpp +75 -0
  425. include/dart/utils/PackageResourceRetriever.hpp +118 -0
  426. include/dart/utils/SkelParser.hpp +70 -0
  427. include/dart/utils/VskParser.hpp +108 -0
  428. include/dart/utils/XmlHelpers.hpp +243 -0
  429. include/dart/utils/all.hpp +14 -0
  430. include/dart/utils/detail/XmlHelpers-impl.hpp +213 -0
  431. include/dart/utils/mjcf/MjcfParser.hpp +80 -0
  432. include/dart/utils/mjcf/all.hpp +3 -0
  433. include/dart/utils/mjcf/mjcf.hpp +14 -0
  434. include/dart/utils/sdf/SdfParser.hpp +98 -0
  435. include/dart/utils/sdf/all.hpp +3 -0
  436. include/dart/utils/sdf/sdf.hpp +14 -0
  437. include/dart/utils/urdf/BackwardCompatibility.hpp +52 -0
  438. include/dart/utils/urdf/DartLoader.hpp +277 -0
  439. include/dart/utils/urdf/IncludeUrdf.hpp +47 -0
  440. include/dart/utils/urdf/URDFTypes.hpp +42 -0
  441. include/dart/utils/urdf/all.hpp +5 -0
  442. include/dart/utils/urdf/urdf.hpp +14 -0
  443. include/dart/utils/urdf/urdf_world_parser.hpp +83 -0
  444. include/dart/utils/utils.hpp +14 -0
  445. lib64/libdart-collision-bullet.a +0 -0
  446. lib64/libdart-collision-ode.a +0 -0
  447. lib64/libdart-external-odelcpsolver.a +0 -0
  448. lib64/libdart-gui-osg.a +0 -0
  449. lib64/libdart-optimizer-ipopt.a +0 -0
  450. lib64/libdart-optimizer-nlopt.a +0 -0
  451. lib64/libdart-utils-urdf.a +0 -0
  452. lib64/libdart-utils.a +0 -0
  453. lib64/libdart.a +0 -0
  454. lib64/pkgconfig/dart.pc +12 -0
  455. share/dart/cmake/DARTConfig.cmake +194 -0
  456. share/dart/cmake/DARTConfigVersion.cmake +65 -0
  457. share/dart/cmake/DARTFindBullet.cmake +96 -0
  458. share/dart/cmake/DARTFindEigen3.cmake +9 -0
  459. share/dart/cmake/DARTFindIPOPT.cmake +20 -0
  460. share/dart/cmake/DARTFindNLOPT.cmake +17 -0
  461. share/dart/cmake/DARTFindODE.cmake +23 -0
  462. share/dart/cmake/DARTFindOpenSceneGraph.cmake +69 -0
  463. share/dart/cmake/DARTFindassimp.cmake +18 -0
  464. share/dart/cmake/DARTFindfcl.cmake +23 -0
  465. share/dart/cmake/DARTFindfmt.cmake +9 -0
  466. share/dart/cmake/DARTFindimgui.cmake +21 -0
  467. share/dart/cmake/DARTFindoctomap.cmake +17 -0
  468. share/dart/cmake/DARTFindspdlog.cmake +9 -0
  469. share/dart/cmake/DARTFindtinyxml2.cmake +27 -0
  470. share/dart/cmake/DARTFindurdfdom.cmake +29 -0
  471. share/dart/cmake/FindIPOPT.cmake +54 -0
  472. share/dart/cmake/FindNLOPT.cmake +54 -0
  473. share/dart/cmake/FindODE.cmake +54 -0
  474. share/dart/cmake/Findassimp.cmake +56 -0
  475. share/dart/cmake/Findfcl.cmake +67 -0
  476. share/dart/cmake/Findimgui.cmake +70 -0
  477. share/dart/cmake/Findtinyxml2.cmake +54 -0
  478. share/dart/cmake/dart_collision-bulletComponent.cmake +19 -0
  479. share/dart/cmake/dart_collision-bulletTargets-release.cmake +19 -0
  480. share/dart/cmake/dart_collision-bulletTargets.cmake +122 -0
  481. share/dart/cmake/dart_collision-odeComponent.cmake +19 -0
  482. share/dart/cmake/dart_collision-odeTargets-release.cmake +19 -0
  483. share/dart/cmake/dart_collision-odeTargets.cmake +122 -0
  484. share/dart/cmake/dart_dartComponent.cmake +19 -0
  485. share/dart/cmake/dart_dartTargets-release.cmake +19 -0
  486. share/dart/cmake/dart_dartTargets.cmake +125 -0
  487. share/dart/cmake/dart_external-odelcpsolverComponent.cmake +19 -0
  488. share/dart/cmake/dart_external-odelcpsolverTargets-release.cmake +19 -0
  489. share/dart/cmake/dart_external-odelcpsolverTargets.cmake +106 -0
  490. share/dart/cmake/dart_gui-osgComponent.cmake +19 -0
  491. share/dart/cmake/dart_gui-osgTargets-release.cmake +19 -0
  492. share/dart/cmake/dart_gui-osgTargets.cmake +122 -0
  493. share/dart/cmake/dart_optimizer-ipoptComponent.cmake +19 -0
  494. share/dart/cmake/dart_optimizer-ipoptTargets-release.cmake +19 -0
  495. share/dart/cmake/dart_optimizer-ipoptTargets.cmake +123 -0
  496. share/dart/cmake/dart_optimizer-nloptComponent.cmake +19 -0
  497. share/dart/cmake/dart_optimizer-nloptTargets-release.cmake +19 -0
  498. share/dart/cmake/dart_optimizer-nloptTargets.cmake +123 -0
  499. share/dart/cmake/dart_utils-urdfComponent.cmake +19 -0
  500. share/dart/cmake/dart_utils-urdfTargets-release.cmake +19 -0
  501. share/dart/cmake/dart_utils-urdfTargets.cmake +122 -0
  502. share/dart/cmake/dart_utilsComponent.cmake +19 -0
  503. share/dart/cmake/dart_utilsTargets-release.cmake +19 -0
  504. share/dart/cmake/dart_utilsTargets.cmake +122 -0
  505. share/dart/package.xml +42 -0
  506. share/doc/dart/data/c3d/nick_freeform_001.c3d +0 -0
  507. share/doc/dart/data/c3d/squat.c3d +0 -0
  508. share/doc/dart/data/dof/RHand.dof +205 -0
  509. share/doc/dart/data/dof/fixedHand.dof +205 -0
  510. share/doc/dart/data/dof/init_Tpose.dof +240 -0
  511. share/doc/dart/data/dof/same.dof +1003 -0
  512. share/doc/dart/data/dof/simMotion.dof +1817 -0
  513. share/doc/dart/data/dof/simMotion1.dof +1355 -0
  514. share/doc/dart/data/etc/fort.4 +43 -0
  515. share/doc/dart/data/humanJointLimits/neuralnets/net-larm +0 -0
  516. share/doc/dart/data/humanJointLimits/neuralnets/net-lleg +0 -0
  517. share/doc/dart/data/mjcf/openai/LICENSE.md +36 -0
  518. share/doc/dart/data/mjcf/openai/ant.xml +81 -0
  519. share/doc/dart/data/mjcf/openai/half_cheetah.xml +96 -0
  520. share/doc/dart/data/mjcf/openai/hopper.xml +50 -0
  521. share/doc/dart/data/mjcf/openai/humanoid.xml +121 -0
  522. share/doc/dart/data/mjcf/openai/humanoidstandup.xml +121 -0
  523. share/doc/dart/data/mjcf/openai/inverted_double_pendulum.xml +47 -0
  524. share/doc/dart/data/mjcf/openai/inverted_pendulum.xml +27 -0
  525. share/doc/dart/data/mjcf/openai/point.xml +31 -0
  526. share/doc/dart/data/mjcf/openai/pusher.xml +91 -0
  527. share/doc/dart/data/mjcf/openai/reacher.xml +39 -0
  528. share/doc/dart/data/mjcf/openai/robotics/fetch/pick_and_place.xml +35 -0
  529. share/doc/dart/data/mjcf/openai/robotics/fetch/push.xml +32 -0
  530. share/doc/dart/data/mjcf/openai/robotics/fetch/reach.xml +26 -0
  531. share/doc/dart/data/mjcf/openai/robotics/fetch/robot.xml +123 -0
  532. share/doc/dart/data/mjcf/openai/robotics/fetch/shared.xml +66 -0
  533. share/doc/dart/data/mjcf/openai/robotics/fetch/slide.xml +32 -0
  534. share/doc/dart/data/mjcf/openai/robotics/stls/.get +0 -0
  535. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/base_link_collision.stl +0 -0
  536. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/bellows_link_collision.stl +0 -0
  537. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/elbow_flex_link_collision.stl +0 -0
  538. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/estop_link.stl +0 -0
  539. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/forearm_roll_link_collision.stl +0 -0
  540. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/gripper_link.stl +0 -0
  541. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/head_pan_link_collision.stl +0 -0
  542. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/head_tilt_link_collision.stl +0 -0
  543. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/l_wheel_link_collision.stl +0 -0
  544. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/laser_link.stl +0 -0
  545. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/r_wheel_link_collision.stl +0 -0
  546. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/shoulder_lift_link_collision.stl +0 -0
  547. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/shoulder_pan_link_collision.stl +0 -0
  548. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/torso_fixed_link.stl +0 -0
  549. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/torso_lift_link_collision.stl +0 -0
  550. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/upperarm_roll_link_collision.stl +0 -0
  551. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/wrist_flex_link_collision.stl +0 -0
  552. share/doc/dart/data/mjcf/openai/robotics/stls/fetch/wrist_roll_link_collision.stl +0 -0
  553. share/doc/dart/data/mjcf/openai/robotics/textures/block.png +0 -0
  554. share/doc/dart/data/mjcf/openai/robotics/textures/block_hidden.png +0 -0
  555. share/doc/dart/data/mjcf/openai/striker.xml +101 -0
  556. share/doc/dart/data/mjcf/openai/swimmer.xml +39 -0
  557. share/doc/dart/data/mjcf/openai/thrower.xml +127 -0
  558. share/doc/dart/data/mjcf/openai/walker2d.xml +62 -0
  559. share/doc/dart/data/mjcf/test/default.xml +17 -0
  560. share/doc/dart/data/mjcf/test/include_default.xml +8 -0
  561. share/doc/dart/data/mjcf/test/include_main.xml +12 -0
  562. share/doc/dart/data/obj/Body_Hip.obj +22830 -0
  563. share/doc/dart/data/obj/BoxSmall.obj +23 -0
  564. share/doc/dart/data/obj/foot.obj +10970 -0
  565. share/doc/dart/data/other/torus1.path +11991 -0
  566. share/doc/dart/data/other/torus1.tris +5329 -0
  567. share/doc/dart/data/other/torus2.path +11991 -0
  568. share/doc/dart/data/other/torus2.tris +12961 -0
  569. share/doc/dart/data/screencap/.KEEP +0 -0
  570. share/doc/dart/data/sdf/atlas/atlas_v3.urdf +914 -0
  571. share/doc/dart/data/sdf/atlas/atlas_v3_no_head.sdf +1541 -0
  572. share/doc/dart/data/sdf/atlas/atlas_v3_no_head.urdf +914 -0
  573. share/doc/dart/data/sdf/atlas/atlas_v3_no_head_soft_feet.sdf +1567 -0
  574. share/doc/dart/data/sdf/atlas/ground.urdf +28 -0
  575. share/doc/dart/data/sdf/atlas/head.dae +8607 -0
  576. share/doc/dart/data/sdf/atlas/head.stl +0 -0
  577. share/doc/dart/data/sdf/atlas/head_camera.dae +2326 -0
  578. share/doc/dart/data/sdf/atlas/head_camera.stl +0 -0
  579. share/doc/dart/data/sdf/atlas/l_clav.dae +1278 -0
  580. share/doc/dart/data/sdf/atlas/l_clav.stl +0 -0
  581. share/doc/dart/data/sdf/atlas/l_farm.dae +1204 -0
  582. share/doc/dart/data/sdf/atlas/l_farm.stl +0 -0
  583. share/doc/dart/data/sdf/atlas/l_foot.dae +1330 -0
  584. share/doc/dart/data/sdf/atlas/l_foot.stl +0 -0
  585. share/doc/dart/data/sdf/atlas/l_hand.dae +964 -0
  586. share/doc/dart/data/sdf/atlas/l_hand.stl +0 -0
  587. share/doc/dart/data/sdf/atlas/l_larm.dae +1378 -0
  588. share/doc/dart/data/sdf/atlas/l_larm.stl +0 -0
  589. share/doc/dart/data/sdf/atlas/l_lglut.dae +897 -0
  590. share/doc/dart/data/sdf/atlas/l_lglut.stl +0 -0
  591. share/doc/dart/data/sdf/atlas/l_lleg.dae +6660 -0
  592. share/doc/dart/data/sdf/atlas/l_lleg.stl +0 -0
  593. share/doc/dart/data/sdf/atlas/l_scap.dae +1531 -0
  594. share/doc/dart/data/sdf/atlas/l_scap.stl +0 -0
  595. share/doc/dart/data/sdf/atlas/l_talus.dae +374 -0
  596. share/doc/dart/data/sdf/atlas/l_talus.stl +0 -0
  597. share/doc/dart/data/sdf/atlas/l_uarm.dae +1204 -0
  598. share/doc/dart/data/sdf/atlas/l_uarm.stl +0 -0
  599. share/doc/dart/data/sdf/atlas/l_uglut.dae +398 -0
  600. share/doc/dart/data/sdf/atlas/l_uglut.stl +0 -0
  601. share/doc/dart/data/sdf/atlas/l_uleg.dae +9087 -0
  602. share/doc/dart/data/sdf/atlas/l_uleg.stl +0 -0
  603. share/doc/dart/data/sdf/atlas/ltorso.dae +614 -0
  604. share/doc/dart/data/sdf/atlas/ltorso.stl +0 -0
  605. share/doc/dart/data/sdf/atlas/mtorso.dae +266 -0
  606. share/doc/dart/data/sdf/atlas/mtorso.stl +0 -0
  607. share/doc/dart/data/sdf/atlas/pelvis.dae +8727 -0
  608. share/doc/dart/data/sdf/atlas/pelvis.stl +0 -0
  609. share/doc/dart/data/sdf/atlas/r_clav.dae +1278 -0
  610. share/doc/dart/data/sdf/atlas/r_clav.stl +0 -0
  611. share/doc/dart/data/sdf/atlas/r_farm.dae +1204 -0
  612. share/doc/dart/data/sdf/atlas/r_farm.stl +0 -0
  613. share/doc/dart/data/sdf/atlas/r_foot.dae +1330 -0
  614. share/doc/dart/data/sdf/atlas/r_foot.stl +0 -0
  615. share/doc/dart/data/sdf/atlas/r_hand.dae +904 -0
  616. share/doc/dart/data/sdf/atlas/r_hand.stl +0 -0
  617. share/doc/dart/data/sdf/atlas/r_larm.dae +1378 -0
  618. share/doc/dart/data/sdf/atlas/r_larm.stl +0 -0
  619. share/doc/dart/data/sdf/atlas/r_lglut.dae +897 -0
  620. share/doc/dart/data/sdf/atlas/r_lglut.stl +0 -0
  621. share/doc/dart/data/sdf/atlas/r_lleg.dae +6661 -0
  622. share/doc/dart/data/sdf/atlas/r_lleg.stl +0 -0
  623. share/doc/dart/data/sdf/atlas/r_scap.dae +1531 -0
  624. share/doc/dart/data/sdf/atlas/r_scap.stl +0 -0
  625. share/doc/dart/data/sdf/atlas/r_talus.dae +374 -0
  626. share/doc/dart/data/sdf/atlas/r_talus.stl +0 -0
  627. share/doc/dart/data/sdf/atlas/r_uarm.dae +1144 -0
  628. share/doc/dart/data/sdf/atlas/r_uarm.stl +0 -0
  629. share/doc/dart/data/sdf/atlas/r_uglut.dae +398 -0
  630. share/doc/dart/data/sdf/atlas/r_uglut.stl +0 -0
  631. share/doc/dart/data/sdf/atlas/r_uleg.dae +9087 -0
  632. share/doc/dart/data/sdf/atlas/r_uleg.stl +0 -0
  633. share/doc/dart/data/sdf/atlas/utorso.dae +28342 -0
  634. share/doc/dart/data/sdf/atlas/utorso.stl +0 -0
  635. share/doc/dart/data/sdf/atlas/utorso_mod.dae +16508 -0
  636. share/doc/dart/data/sdf/atlas/utorso_mod.stl +0 -0
  637. share/doc/dart/data/sdf/atlas/utorso_pack.dae +8521 -0
  638. share/doc/dart/data/sdf/atlas/utorso_pack.stl +0 -0
  639. share/doc/dart/data/sdf/benchmark.world +2510 -0
  640. share/doc/dart/data/sdf/double_pendulum.world +168 -0
  641. share/doc/dart/data/sdf/double_pendulum_with_base.world +263 -0
  642. share/doc/dart/data/sdf/empty.world +13 -0
  643. share/doc/dart/data/sdf/ground.world +48 -0
  644. share/doc/dart/data/sdf/materials/textures/atlas_cage_and_camera_diffuse_flat.jpg +0 -0
  645. share/doc/dart/data/sdf/materials/textures/drc_extremities_diffuse.jpg +0 -0
  646. share/doc/dart/data/sdf/materials/textures/drc_labels_1.jpg +0 -0
  647. share/doc/dart/data/sdf/materials/textures/drc_torso_head_diffuse.jpg +0 -0
  648. share/doc/dart/data/sdf/materials/textures/extremities_diffuse_unplugged.jpg +0 -0
  649. share/doc/dart/data/sdf/materials/textures/right_leg_diffuse_unplugged.jpg +0 -0
  650. share/doc/dart/data/sdf/materials/textures/torso_diffuse_unplugged.jpg +0 -0
  651. share/doc/dart/data/sdf/quad.sdf +867 -0
  652. share/doc/dart/data/sdf/test/force_torque_test.world +173 -0
  653. share/doc/dart/data/sdf/test/force_torque_test2.world +214 -0
  654. share/doc/dart/data/sdf/test/issue1193_revolute_test.sdf +70 -0
  655. share/doc/dart/data/sdf/test/issue1193_revolute_with_offset_test.sdf +70 -0
  656. share/doc/dart/data/sdf/test/issue1624_cubes.sdf +5037 -0
  657. share/doc/dart/data/sdf/test/single_bodynode_skeleton.world +55 -0
  658. share/doc/dart/data/sdf/test/test_issue1583.model +45 -0
  659. share/doc/dart/data/sdf/test/test_issue1596.model +182 -0
  660. share/doc/dart/data/sdf/test/test_skeleton_joint.world +278 -0
  661. share/doc/dart/data/skel/biped.skel +850 -0
  662. share/doc/dart/data/skel/bullet_collision.skel +174 -0
  663. share/doc/dart/data/skel/chain.skel +212 -0
  664. share/doc/dart/data/skel/cube.skel +71 -0
  665. share/doc/dart/data/skel/cubes.skel +137 -0
  666. share/doc/dart/data/skel/empty.skel +10 -0
  667. share/doc/dart/data/skel/freeChain.skel +212 -0
  668. share/doc/dart/data/skel/fullbody1.skel +1177 -0
  669. share/doc/dart/data/skel/ground.skel +31 -0
  670. share/doc/dart/data/skel/joint_limit.skel +123 -0
  671. share/doc/dart/data/skel/kima/abdomen.dae +18933 -0
  672. share/doc/dart/data/skel/kima/head.dae +34634 -0
  673. share/doc/dart/data/skel/kima/kima_human_edited.skel +933 -0
  674. share/doc/dart/data/skel/kima/kima_human_left_arm.skel +323 -0
  675. share/doc/dart/data/skel/kima/kima_human_left_leg.skel +327 -0
  676. share/doc/dart/data/skel/kima/l-clavicle.dae +20111 -0
  677. share/doc/dart/data/skel/kima/l-foot.dae +28208 -0
  678. share/doc/dart/data/skel/kima/pelvis.dae +35919 -0
  679. share/doc/dart/data/skel/kima/r-clavicle.dae +20090 -0
  680. share/doc/dart/data/skel/kima/thorax.dae +47337 -0
  681. share/doc/dart/data/skel/mesh_collision.skel +137 -0
  682. share/doc/dart/data/skel/shapes.skel +378 -0
  683. share/doc/dart/data/skel/skateboard.skel +222 -0
  684. share/doc/dart/data/skel/softBodies.skel +284 -0
  685. share/doc/dart/data/skel/soft_cubes.skel +134 -0
  686. share/doc/dart/data/skel/soft_open_chain.skel +241 -0
  687. share/doc/dart/data/skel/sphere.skel +74 -0
  688. share/doc/dart/data/skel/spheres.skel +118 -0
  689. share/doc/dart/data/skel/test/SimplePendulum.skel +141 -0
  690. share/doc/dart/data/skel/test/ball_joints.skel +49 -0
  691. share/doc/dart/data/skel/test/box_stacking.skel +346 -0
  692. share/doc/dart/data/skel/test/boxes.skel +52 -0
  693. share/doc/dart/data/skel/test/chainwhipa.skel +193 -0
  694. share/doc/dart/data/skel/test/collision_of_prescribed_joints_test.skel +249 -0
  695. share/doc/dart/data/skel/test/dof_attribute_test.skel +206 -0
  696. share/doc/dart/data/skel/test/double_pendulum.skel +76 -0
  697. share/doc/dart/data/skel/test/double_pendulum_ball_joint.skel +76 -0
  698. share/doc/dart/data/skel/test/double_pendulum_euler_joint.skel +78 -0
  699. share/doc/dart/data/skel/test/double_pendulum_with_base.skel +1390 -0
  700. share/doc/dart/data/skel/test/drop.skel +116 -0
  701. share/doc/dart/data/skel/test/drop_BENCHMARK.skel +10 -0
  702. share/doc/dart/data/skel/test/drop_unrotated_box.skel +156 -0
  703. share/doc/dart/data/skel/test/empty.skel +10 -0
  704. share/doc/dart/data/skel/test/file_info_world_test.skel +1177 -0
  705. share/doc/dart/data/skel/test/free_joints.skel +49 -0
  706. share/doc/dart/data/skel/test/gazebo/drop_test.skel +161 -0
  707. share/doc/dart/data/skel/test/gazebo/force_torque_test.skel +138 -0
  708. share/doc/dart/data/skel/test/gazebo/force_torque_test2.skel +171 -0
  709. share/doc/dart/data/skel/test/hybrid_dynamics_test.skel +172 -0
  710. share/doc/dart/data/skel/test/joint_actuator_type_test.skel +185 -0
  711. share/doc/dart/data/skel/test/joint_dynamics_elements_test.skel +103 -0
  712. share/doc/dart/data/skel/test/joint_friction_test.skel +80 -0
  713. share/doc/dart/data/skel/test/joint_limit_test.skel +80 -0
  714. share/doc/dart/data/skel/test/planar_joint.skel +167 -0
  715. share/doc/dart/data/skel/test/serial_chain_BENCHMARK.skel +10 -0
  716. share/doc/dart/data/skel/test/serial_chain_ball_joint.skel +212 -0
  717. share/doc/dart/data/skel/test/serial_chain_ball_joint_20.skel +412 -0
  718. share/doc/dart/data/skel/test/serial_chain_ball_joint_40.skel +812 -0
  719. share/doc/dart/data/skel/test/serial_chain_eulerxyz_joint.skel +224 -0
  720. share/doc/dart/data/skel/test/serial_chain_revolute_joint.skel +244 -0
  721. share/doc/dart/data/skel/test/simple_tree_structure.skel +108 -0
  722. share/doc/dart/data/skel/test/simple_tree_structure_ball_joint.skel +108 -0
  723. share/doc/dart/data/skel/test/simple_tree_structure_euler_joint.skel +111 -0
  724. share/doc/dart/data/skel/test/single_pendulum.skel +55 -0
  725. share/doc/dart/data/skel/test/single_pendulum_ball_joint.skel +55 -0
  726. share/doc/dart/data/skel/test/single_pendulum_euler_joint.skel +56 -0
  727. share/doc/dart/data/skel/test/spheres.skel +118 -0
  728. share/doc/dart/data/skel/test/test_adaptive_deformable.skel +88 -0
  729. share/doc/dart/data/skel/test/test_articulated_bodies.skel +112 -0
  730. share/doc/dart/data/skel/test/test_articulated_bodies_10bodies.skel +401 -0
  731. share/doc/dart/data/skel/test/test_double_pendulum.skel +105 -0
  732. share/doc/dart/data/skel/test/test_drop_box.skel +87 -0
  733. share/doc/dart/data/skel/test/test_drop_box_offset.skel +87 -0
  734. share/doc/dart/data/skel/test/test_drop_low_stiffness.skel +86 -0
  735. share/doc/dart/data/skel/test/test_drop_sphere.skel +86 -0
  736. share/doc/dart/data/skel/test/test_shapes.skel +324 -0
  737. share/doc/dart/data/skel/test/test_single_body.skel +55 -0
  738. share/doc/dart/data/skel/test/test_single_pendulum.skel +55 -0
  739. share/doc/dart/data/skel/test/translational_joints.skel +49 -0
  740. share/doc/dart/data/skel/test/tree_structure.skel +428 -0
  741. share/doc/dart/data/skel/test/tree_structure_ball_joint.skel +441 -0
  742. share/doc/dart/data/skel/test/tree_structure_euler_joint.skel +441 -0
  743. share/doc/dart/data/skel/two_cubes.skel +118 -0
  744. share/doc/dart/data/skel/vehicle.skel +322 -0
  745. share/doc/dart/data/test/hello_world.txt +1 -0
  746. share/doc/dart/data/urdf/KR5/KR5 sixx R650.urdf +397 -0
  747. share/doc/dart/data/urdf/KR5/ground.urdf +28 -0
  748. share/doc/dart/data/urdf/KR5/meshes/base_link.STL +0 -0
  749. share/doc/dart/data/urdf/KR5/meshes/bicep.STL +0 -0
  750. share/doc/dart/data/urdf/KR5/meshes/elbow.STL +0 -0
  751. share/doc/dart/data/urdf/KR5/meshes/forearm.STL +0 -0
  752. share/doc/dart/data/urdf/KR5/meshes/palm.STL +0 -0
  753. share/doc/dart/data/urdf/KR5/meshes/shoulder.STL +0 -0
  754. share/doc/dart/data/urdf/KR5/meshes/wrist.STL +0 -0
  755. share/doc/dart/data/urdf/drchubo/CMakeLists.txt +5 -0
  756. share/doc/dart/data/urdf/drchubo/drchubo.urdf +1508 -0
  757. share/doc/dart/data/urdf/drchubo/meshes/convhull_LAP_merged.stl +0 -0
  758. share/doc/dart/data/urdf/drchubo/meshes/convhull_LAR_merged.stl +0 -0
  759. share/doc/dart/data/urdf/drchubo/meshes/convhull_LEP_merged.stl +0 -0
  760. share/doc/dart/data/urdf/drchubo/meshes/convhull_LF1.stl +0 -0
  761. share/doc/dart/data/urdf/drchubo/meshes/convhull_LF2.stl +0 -0
  762. share/doc/dart/data/urdf/drchubo/meshes/convhull_LF3.stl +0 -0
  763. share/doc/dart/data/urdf/drchubo/meshes/convhull_LHP_merged.stl +0 -0
  764. share/doc/dart/data/urdf/drchubo/meshes/convhull_LHR_merged.stl +0 -0
  765. share/doc/dart/data/urdf/drchubo/meshes/convhull_LHY_merged.stl +0 -0
  766. share/doc/dart/data/urdf/drchubo/meshes/convhull_LKP_merged.stl +0 -0
  767. share/doc/dart/data/urdf/drchubo/meshes/convhull_LSP_merged.stl +0 -0
  768. share/doc/dart/data/urdf/drchubo/meshes/convhull_LSR_merged.stl +0 -0
  769. share/doc/dart/data/urdf/drchubo/meshes/convhull_LSY_merged.stl +0 -0
  770. share/doc/dart/data/urdf/drchubo/meshes/convhull_LWP_merged.stl +0 -0
  771. share/doc/dart/data/urdf/drchubo/meshes/convhull_LWR_merged.stl +0 -0
  772. share/doc/dart/data/urdf/drchubo/meshes/convhull_LWY_merged.stl +0 -0
  773. share/doc/dart/data/urdf/drchubo/meshes/convhull_NK1_merged.stl +0 -0
  774. share/doc/dart/data/urdf/drchubo/meshes/convhull_NK2.stl +0 -0
  775. share/doc/dart/data/urdf/drchubo/meshes/convhull_NKY_merged.stl +0 -0
  776. share/doc/dart/data/urdf/drchubo/meshes/convhull_RAP_merged.stl +0 -0
  777. share/doc/dart/data/urdf/drchubo/meshes/convhull_RAR_merged.stl +0 -0
  778. share/doc/dart/data/urdf/drchubo/meshes/convhull_REP_merged.stl +0 -0
  779. share/doc/dart/data/urdf/drchubo/meshes/convhull_RF1.stl +0 -0
  780. share/doc/dart/data/urdf/drchubo/meshes/convhull_RF2.stl +0 -0
  781. share/doc/dart/data/urdf/drchubo/meshes/convhull_RF3.stl +0 -0
  782. share/doc/dart/data/urdf/drchubo/meshes/convhull_RHP_merged.stl +0 -0
  783. share/doc/dart/data/urdf/drchubo/meshes/convhull_RHR_merged.stl +0 -0
  784. share/doc/dart/data/urdf/drchubo/meshes/convhull_RHY_merged.stl +0 -0
  785. share/doc/dart/data/urdf/drchubo/meshes/convhull_RKP_merged.stl +0 -0
  786. share/doc/dart/data/urdf/drchubo/meshes/convhull_RSP_merged.stl +0 -0
  787. share/doc/dart/data/urdf/drchubo/meshes/convhull_RSR_merged.stl +0 -0
  788. share/doc/dart/data/urdf/drchubo/meshes/convhull_RSY_merged.stl +0 -0
  789. share/doc/dart/data/urdf/drchubo/meshes/convhull_RWP_merged.stl +0 -0
  790. share/doc/dart/data/urdf/drchubo/meshes/convhull_RWR_merged.stl +0 -0
  791. share/doc/dart/data/urdf/drchubo/meshes/convhull_RWY_merged.stl +0 -0
  792. share/doc/dart/data/urdf/drchubo/meshes/convhull_TSY_merged.stl +0 -0
  793. share/doc/dart/data/urdf/drchubo/meshes/convhull_Torso_merged.stl +0 -0
  794. share/doc/dart/data/urdf/drchubo/package.xml +11 -0
  795. share/doc/dart/data/urdf/test/invalid.urdf +1 -0
  796. share/doc/dart/data/urdf/test/invalid_mesh.stl +1 -0
  797. share/doc/dart/data/urdf/test/invalid_mesh.urdf +10 -0
  798. share/doc/dart/data/urdf/test/issue838.urdf +86 -0
  799. share/doc/dart/data/urdf/test/joint_properties.urdf +60 -0
  800. share/doc/dart/data/urdf/test/missing_mesh.urdf +10 -0
  801. share/doc/dart/data/urdf/test/missing_package.urdf +10 -0
  802. share/doc/dart/data/urdf/test/primitive_geometry.urdf +12 -0
  803. share/doc/dart/data/urdf/test/testWorld.urdf +9 -0
  804. share/doc/dart/data/urdf/wam/meshes/images/base_gray_128x.jpg +0 -0
  805. share/doc/dart/data/urdf/wam/meshes/images/forearm_256x.jpg +0 -0
  806. share/doc/dart/data/urdf/wam/meshes/images/lpu_128x.jpg +0 -0
  807. share/doc/dart/data/urdf/wam/meshes/images/shoulder_256x.jpg +0 -0
  808. share/doc/dart/data/urdf/wam/meshes/images/upperarm_128x.jpg +0 -0
  809. share/doc/dart/data/urdf/wam/meshes/images/wrist_yaw_128x.jpg +0 -0
  810. share/doc/dart/data/urdf/wam/meshes/wam/wam1.STL +0 -0
  811. share/doc/dart/data/urdf/wam/meshes/wam/wam1.dae +187 -0
  812. share/doc/dart/data/urdf/wam/meshes/wam/wam1_collision.STL +0 -0
  813. share/doc/dart/data/urdf/wam/meshes/wam/wam2.STL +0 -0
  814. share/doc/dart/data/urdf/wam/meshes/wam/wam2.dae +187 -0
  815. share/doc/dart/data/urdf/wam/meshes/wam/wam2_collision.STL +0 -0
  816. share/doc/dart/data/urdf/wam/meshes/wam/wam3.STL +0 -0
  817. share/doc/dart/data/urdf/wam/meshes/wam/wam3.dae +187 -0
  818. share/doc/dart/data/urdf/wam/meshes/wam/wam3_collision.STL +0 -0
  819. share/doc/dart/data/urdf/wam/meshes/wam/wam4.STL +0 -0
  820. share/doc/dart/data/urdf/wam/meshes/wam/wam4.dae +187 -0
  821. share/doc/dart/data/urdf/wam/meshes/wam/wam4_collision.STL +0 -0
  822. share/doc/dart/data/urdf/wam/meshes/wam/wam5.STL +0 -0
  823. share/doc/dart/data/urdf/wam/meshes/wam/wam5.dae +187 -0
  824. share/doc/dart/data/urdf/wam/meshes/wam/wam5_collision.STL +0 -0
  825. share/doc/dart/data/urdf/wam/meshes/wam/wam6.STL +0 -0
  826. share/doc/dart/data/urdf/wam/meshes/wam/wam6.dae +187 -0
  827. share/doc/dart/data/urdf/wam/meshes/wam/wam6_collision.STL +0 -0
  828. share/doc/dart/data/urdf/wam/meshes/wam/wam7.STL +0 -0
  829. share/doc/dart/data/urdf/wam/meshes/wam/wam7.dae +137 -0
  830. share/doc/dart/data/urdf/wam/meshes/wam/wam7_collision.STL +0 -0
  831. share/doc/dart/data/urdf/wam/meshes/wam/wam_base.STL +0 -0
  832. share/doc/dart/data/urdf/wam/meshes/wam/wam_base.dae +103 -0
  833. share/doc/dart/data/urdf/wam/meshes/wam/wam_base_collision.STL +0 -0
  834. share/doc/dart/data/urdf/wam/wam.urdf +230 -0
  835. share/doc/dart/data/vsk/Nick01.vsk +398 -0
  836. share/doc/dart/data/vsk/SehoonVSK3.vsk +398 -0
  837. share/doc/dart/data/vsk/Yuting.vsk +398 -0
  838. share/doc/dart/data/vsk/test/empty.vsk +3 -0
  839. share/doc/dart/examples/CMakeLists.txt +44 -0
  840. share/doc/dart/examples/README.md +33 -0
  841. share/doc/dart/examples/add_delete_skels/CMakeLists.txt +19 -0
  842. share/doc/dart/examples/add_delete_skels/main.cpp +165 -0
  843. share/doc/dart/examples/atlas_puppet/CMakeLists.txt +19 -0
  844. share/doc/dart/examples/atlas_puppet/README.md +20 -0
  845. share/doc/dart/examples/atlas_puppet/main.cpp +930 -0
  846. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconEventHandler.cpp +71 -0
  847. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconEventHandler.hpp +56 -0
  848. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconWidget.cpp +187 -0
  849. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconWidget.hpp +85 -0
  850. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconWorldNode.cpp +134 -0
  851. share/doc/dart/examples/atlas_simbicon/AtlasSimbiconWorldNode.hpp +75 -0
  852. share/doc/dart/examples/atlas_simbicon/CMakeLists.txt +19 -0
  853. share/doc/dart/examples/atlas_simbicon/Controller.cpp +996 -0
  854. share/doc/dart/examples/atlas_simbicon/Controller.hpp +203 -0
  855. share/doc/dart/examples/atlas_simbicon/README.md +20 -0
  856. share/doc/dart/examples/atlas_simbicon/State.cpp +674 -0
  857. share/doc/dart/examples/atlas_simbicon/State.hpp +336 -0
  858. share/doc/dart/examples/atlas_simbicon/StateMachine.cpp +222 -0
  859. share/doc/dart/examples/atlas_simbicon/StateMachine.hpp +134 -0
  860. share/doc/dart/examples/atlas_simbicon/TerminalCondition.cpp +111 -0
  861. share/doc/dart/examples/atlas_simbicon/TerminalCondition.hpp +102 -0
  862. share/doc/dart/examples/atlas_simbicon/main.cpp +102 -0
  863. share/doc/dart/examples/biped_stand/CMakeLists.txt +19 -0
  864. share/doc/dart/examples/biped_stand/README.md +20 -0
  865. share/doc/dart/examples/biped_stand/main.cpp +287 -0
  866. share/doc/dart/examples/box_stacking/CMakeLists.txt +19 -0
  867. share/doc/dart/examples/box_stacking/README.md +20 -0
  868. share/doc/dart/examples/box_stacking/main.cpp +417 -0
  869. share/doc/dart/examples/boxes/CMakeLists.txt +19 -0
  870. share/doc/dart/examples/boxes/README.md +20 -0
  871. share/doc/dart/examples/boxes/main.cpp +157 -0
  872. share/doc/dart/examples/drag_and_drop/CMakeLists.txt +19 -0
  873. share/doc/dart/examples/drag_and_drop/README.md +20 -0
  874. share/doc/dart/examples/drag_and_drop/main.cpp +101 -0
  875. share/doc/dart/examples/empty/CMakeLists.txt +19 -0
  876. share/doc/dart/examples/empty/README.md +20 -0
  877. share/doc/dart/examples/empty/main.cpp +164 -0
  878. share/doc/dart/examples/fetch/CMakeLists.txt +19 -0
  879. share/doc/dart/examples/fetch/README.md +20 -0
  880. share/doc/dart/examples/fetch/main.cpp +246 -0
  881. share/doc/dart/examples/hardcoded_design/CMakeLists.txt +19 -0
  882. share/doc/dart/examples/hardcoded_design/HardcodedEventHandler.cpp +71 -0
  883. share/doc/dart/examples/hardcoded_design/HardcodedEventHandler.hpp +56 -0
  884. share/doc/dart/examples/hardcoded_design/README.md +27 -0
  885. share/doc/dart/examples/hardcoded_design/main.cpp +186 -0
  886. share/doc/dart/examples/heightmap/CMakeLists.txt +19 -0
  887. share/doc/dart/examples/heightmap/README.md +20 -0
  888. share/doc/dart/examples/heightmap/main.cpp +460 -0
  889. share/doc/dart/examples/hello_world/CMakeLists.txt +19 -0
  890. share/doc/dart/examples/hello_world/README.md +20 -0
  891. share/doc/dart/examples/hello_world/main.cpp +114 -0
  892. share/doc/dart/examples/hubo_puppet/CMakeLists.txt +19 -0
  893. share/doc/dart/examples/hubo_puppet/README.md +20 -0
  894. share/doc/dart/examples/hubo_puppet/main.cpp +1464 -0
  895. share/doc/dart/examples/human_joint_limits/CMakeLists.txt +49 -0
  896. share/doc/dart/examples/human_joint_limits/HumanArmJointLimitConstraint.cpp +411 -0
  897. share/doc/dart/examples/human_joint_limits/HumanArmJointLimitConstraint.hpp +182 -0
  898. share/doc/dart/examples/human_joint_limits/HumanLegJointLimitConstraint.cpp +432 -0
  899. share/doc/dart/examples/human_joint_limits/HumanLegJointLimitConstraint.hpp +179 -0
  900. share/doc/dart/examples/human_joint_limits/main.cpp +157 -0
  901. share/doc/dart/examples/hybrid_dynamics/CMakeLists.txt +19 -0
  902. share/doc/dart/examples/hybrid_dynamics/README.md +17 -0
  903. share/doc/dart/examples/hybrid_dynamics/main.cpp +187 -0
  904. share/doc/dart/examples/imgui/CMakeLists.txt +19 -0
  905. share/doc/dart/examples/imgui/README.md +20 -0
  906. share/doc/dart/examples/imgui/main.cpp +289 -0
  907. share/doc/dart/examples/joint_constraints/CMakeLists.txt +19 -0
  908. share/doc/dart/examples/joint_constraints/Controller.cpp +110 -0
  909. share/doc/dart/examples/joint_constraints/Controller.hpp +105 -0
  910. share/doc/dart/examples/joint_constraints/README.md +22 -0
  911. share/doc/dart/examples/joint_constraints/main.cpp +242 -0
  912. share/doc/dart/examples/mixed_chain/CMakeLists.txt +19 -0
  913. share/doc/dart/examples/mixed_chain/README.md +35 -0
  914. share/doc/dart/examples/mixed_chain/main.cpp +188 -0
  915. share/doc/dart/examples/operational_space_control/CMakeLists.txt +19 -0
  916. share/doc/dart/examples/operational_space_control/README.md +20 -0
  917. share/doc/dart/examples/operational_space_control/main.cpp +338 -0
  918. share/doc/dart/examples/point_cloud/CMakeLists.txt +19 -0
  919. share/doc/dart/examples/point_cloud/README.md +20 -0
  920. share/doc/dart/examples/point_cloud/main.cpp +740 -0
  921. share/doc/dart/examples/rerun/CMakeLists.txt +19 -0
  922. share/doc/dart/examples/rigid_chain/CMakeLists.txt +19 -0
  923. share/doc/dart/examples/rigid_chain/README.md +19 -0
  924. share/doc/dart/examples/rigid_chain/main.cpp +110 -0
  925. share/doc/dart/examples/rigid_cubes/CMakeLists.txt +19 -0
  926. share/doc/dart/examples/rigid_cubes/README.md +91 -0
  927. share/doc/dart/examples/rigid_cubes/main.cpp +201 -0
  928. share/doc/dart/examples/rigid_loop/CMakeLists.txt +19 -0
  929. share/doc/dart/examples/rigid_loop/README.md +34 -0
  930. share/doc/dart/examples/rigid_loop/main.cpp +127 -0
  931. share/doc/dart/examples/rigid_shapes/CMakeLists.txt +19 -0
  932. share/doc/dart/examples/rigid_shapes/README.md +19 -0
  933. share/doc/dart/examples/rigid_shapes/main.cpp +250 -0
  934. share/doc/dart/examples/simple_frames/CMakeLists.txt +19 -0
  935. share/doc/dart/examples/simple_frames/README.md +27 -0
  936. share/doc/dart/examples/simple_frames/main.cpp +124 -0
  937. share/doc/dart/examples/simulation_event_handler/CMakeLists.txt +19 -0
  938. share/doc/dart/examples/simulation_event_handler/README.md +189 -0
  939. share/doc/dart/examples/simulation_event_handler/SimulationEventHandler.cpp +572 -0
  940. share/doc/dart/examples/simulation_event_handler/SimulationEventHandler.hpp +211 -0
  941. share/doc/dart/examples/simulation_event_handler/main.cpp +277 -0
  942. share/doc/dart/examples/soft_bodies/CMakeLists.txt +19 -0
  943. share/doc/dart/examples/soft_bodies/README.md +20 -0
  944. share/doc/dart/examples/soft_bodies/main.cpp +219 -0
  945. share/doc/dart/examples/speed_test/CMakeLists.txt +19 -0
  946. share/doc/dart/examples/speed_test/README.md +20 -0
  947. share/doc/dart/examples/speed_test/main.cpp +250 -0
  948. share/doc/dart/examples/tinkertoy/CMakeLists.txt +19 -0
  949. share/doc/dart/examples/tinkertoy/README.md +20 -0
  950. share/doc/dart/examples/tinkertoy/TinkertoyWidget.cpp +208 -0
  951. share/doc/dart/examples/tinkertoy/TinkertoyWidget.hpp +70 -0
  952. share/doc/dart/examples/tinkertoy/TinkertoyWorldNode.cpp +35 -0
  953. share/doc/dart/examples/tinkertoy/TinkertoyWorldNode.hpp +470 -0
  954. share/doc/dart/examples/tinkertoy/main.cpp +186 -0
  955. share/doc/dart/examples/vehicle/CMakeLists.txt +19 -0
  956. share/doc/dart/examples/vehicle/README.md +22 -0
  957. share/doc/dart/examples/vehicle/main.cpp +195 -0
  958. share/doc/dart/examples/wam_ikfast/CMakeLists.txt +22 -0
  959. share/doc/dart/examples/wam_ikfast/Helpers.cpp +148 -0
  960. share/doc/dart/examples/wam_ikfast/Helpers.hpp +46 -0
  961. share/doc/dart/examples/wam_ikfast/InputHandler.cpp +110 -0
  962. share/doc/dart/examples/wam_ikfast/InputHandler.hpp +73 -0
  963. share/doc/dart/examples/wam_ikfast/README.md +20 -0
  964. share/doc/dart/examples/wam_ikfast/WamWorld.cpp +46 -0
  965. share/doc/dart/examples/wam_ikfast/WamWorld.hpp +53 -0
  966. share/doc/dart/examples/wam_ikfast/ikfast/CMakeLists.txt +11 -0
  967. share/doc/dart/examples/wam_ikfast/ikfast/ikfast71.Transform6D.4_6_9_10_11_12_f8.cpp +14930 -0
  968. share/doc/dart/examples/wam_ikfast/osgWamIkFast.cpp +96 -0
  969. share/doc/dart/tutorials/CMakeLists.txt +12 -0
  970. share/doc/dart/tutorials/README.md +45 -0
  971. share/doc/dart/tutorials/tutorial_biped/CMakeLists.txt +19 -0
  972. share/doc/dart/tutorials/tutorial_biped/README +18 -0
  973. share/doc/dart/tutorials/tutorial_biped/main.cpp +374 -0
  974. share/doc/dart/tutorials/tutorial_biped_finished/CMakeLists.txt +19 -0
  975. share/doc/dart/tutorials/tutorial_biped_finished/README +18 -0
  976. share/doc/dart/tutorials/tutorial_biped_finished/main.cpp +532 -0
  977. share/doc/dart/tutorials/tutorial_collisions/CMakeLists.txt +19 -0
  978. share/doc/dart/tutorials/tutorial_collisions/README +18 -0
  979. share/doc/dart/tutorials/tutorial_collisions/main.cpp +506 -0
  980. share/doc/dart/tutorials/tutorial_collisions_finished/CMakeLists.txt +19 -0
  981. share/doc/dart/tutorials/tutorial_collisions_finished/README +18 -0
  982. share/doc/dart/tutorials/tutorial_collisions_finished/main.cpp +679 -0
  983. share/doc/dart/tutorials/tutorial_dominoes/CMakeLists.txt +19 -0
  984. share/doc/dart/tutorials/tutorial_dominoes/README +18 -0
  985. share/doc/dart/tutorials/tutorial_dominoes/main.cpp +394 -0
  986. share/doc/dart/tutorials/tutorial_dominoes_finished/CMakeLists.txt +19 -0
  987. share/doc/dart/tutorials/tutorial_dominoes_finished/README +18 -0
  988. share/doc/dart/tutorials/tutorial_dominoes_finished/main.cpp +559 -0
  989. share/doc/dart/tutorials/tutorial_multi_pendulum/CMakeLists.txt +19 -0
  990. share/doc/dart/tutorials/tutorial_multi_pendulum/README +18 -0
  991. share/doc/dart/tutorials/tutorial_multi_pendulum/main.cpp +443 -0
  992. share/doc/dart/tutorials/tutorial_multi_pendulum_finished/CMakeLists.txt +19 -0
  993. share/doc/dart/tutorials/tutorial_multi_pendulum_finished/README +18 -0
  994. share/doc/dart/tutorials/tutorial_multi_pendulum_finished/main.cpp +512 -0
@@ -0,0 +1,1878 @@
1
+ /*
2
+ Copyright (c) 2017-2021 Leo McCormack
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+ */
22
+ /*
23
+ * Filename:
24
+ * convhull_3d.h
25
+ * Description:
26
+ * A header only C implementation of the 3-D quickhull algorithm.
27
+ * The code is largely derived from the "computational-geometry-toolbox"
28
+ * by George Papazafeiropoulos (c) 2014, originally distributed under
29
+ * the BSD (2-clause) license.
30
+ * To include this implementation in a project, simply add this:
31
+ * #define CONVHULL_3D_ENABLE
32
+ * #include "convhull_3d.h"
33
+ * By default, the algorithm uses double floating point precision. To
34
+ * use single precision (less accurate but quicker), also add this:
35
+ * #define CONVHULL_3D_USE_SINGLE_PRECISION
36
+ * If your project has CBLAS linked, then you can also speed things up
37
+ * a tad by adding this:
38
+ * #define CONVHULL_3D_USE_CBLAS
39
+ * The code is C++ compiler safe.
40
+ * Reference: "The Quickhull Algorithm for Convex Hull, C. Bradford
41
+ * Barber, David P. Dobkin and Hannu Huhdanpaa, Geometry
42
+ * Center Technical Report GCG53, July 30, 1993"
43
+ * Dependencies:
44
+ * cblas (optional for speed ups, especially for very large meshes)
45
+ * (Available in e.g. Apple Accelerate Framework, or Intel MKL)
46
+ * Author, date created:
47
+ * Leo McCormack, 02.10.2017
48
+ */
49
+
50
+ /**********
51
+ * PUBLIC:
52
+ *********/
53
+
54
+ #ifndef CONVHULL_3D_INCLUDED
55
+ #define CONVHULL_3D_INCLUDED
56
+
57
+ #ifdef __cplusplus
58
+ extern "C" {
59
+ #endif
60
+
61
+ #ifdef CONVHULL_3D_USE_SINGLE_PRECISION
62
+ typedef float CH_FLOAT;
63
+ #else
64
+ typedef double CH_FLOAT;
65
+ #endif
66
+ typedef struct _ch_vertex {
67
+ union {
68
+ CH_FLOAT v[3];
69
+ struct{
70
+ CH_FLOAT x, y, z;
71
+ };
72
+ };
73
+ } ch_vertex;
74
+ typedef ch_vertex ch_vec3;
75
+
76
+ /* builds the 3-D convexhull */
77
+ void convhull_3d_build(/* input arguments */
78
+ ch_vertex* const in_vertices, /* vector of input vertices; nVert x 1 */
79
+ const int nVert, /* number of vertices */
80
+ /* output arguments */
81
+ int** out_faces, /* & of empty int*, output face indices; flat: nOut_faces x 3 */
82
+ int* nOut_faces); /* & of int, number of output face indices */
83
+
84
+ /* exports the vertices, face indices, and face normals, as an 'obj' file, ready for GPU (for 3d convexhulls only) */
85
+ void convhull_3d_export_obj(/* input arguments */
86
+ ch_vertex* const vertices, /* vector of input vertices; nVert x 1 */
87
+ const int nVert, /* number of vertices */
88
+ int* const faces, /* face indices; flat: nFaces x 3 */
89
+ const int nFaces, /* number of faces in hull */
90
+ const int keepOnlyUsedVerticesFLAG, /* 0: exports in_vertices, 1: exports only used vertices */
91
+ char* const obj_filename); /* obj filename, WITHOUT extension */
92
+
93
+ /* exports the vertices, face indices, and face normals, as an 'm' file, for MatLab verification (for 3d convexhulls only) */
94
+ void convhull_3d_export_m(/* input arguments */
95
+ ch_vertex* const vertices, /* vector of input vertices; nVert x 1 */
96
+ const int nVert, /* number of vertices */
97
+ int* const faces, /* face indices; flat: nFaces x 3 */
98
+ const int nFaces, /* number of faces in hull */
99
+ char* const m_filename); /* m filename, WITHOUT extension */
100
+
101
+ /* reads an 'obj' file and extracts only the vertices (for 3d convexhulls only) */
102
+ void extract_vertices_from_obj_file(/* input arguments */
103
+ char* const obj_filename, /* obj filename, WITHOUT extension */
104
+ /* output arguments */
105
+ ch_vertex** out_vertices, /* & of empty ch_vertex*, output vertices; out_nVert x 1 */
106
+ int* out_nVert); /* & of int, number of vertices */
107
+
108
+ /**** NEW! ****/
109
+
110
+ /* builds the N-Dimensional convexhull of a grid of points */
111
+ void convhull_nd_build(/* input arguments */
112
+ CH_FLOAT* const in_points, /* Matrix of points in 'd' dimensions; FLAT: nPoints x d */
113
+ const int nPoints, /* number of points */
114
+ const int d, /* Number of dimensions */
115
+ /* output arguments */
116
+ int** out_faces, /* (&) output face indices; FLAT: nOut_faces x d */
117
+ CH_FLOAT** out_cf, /* (&) contains the coefficients of the planes (set to NULL if not wanted); FLAT: nOut_faces x d */
118
+ CH_FLOAT** out_df, /* (&) contains the constant terms of the planes (set to NULL if not wanted); nOut_faces x 1 */
119
+ int* nOut_faces); /* (&) number of output face indices */
120
+
121
+ /* Computes the Delaunay triangulation (mesh) of an arrangement of points in N-dimensional space */
122
+ void delaunay_nd_mesh(/* input Arguments */
123
+ const float* points, /* The input points; FLAT: nPoints x nd */
124
+ const int nPoints, /* Number of points */
125
+ const int nd, /* The number of dimensions */
126
+ /* output Arguments */
127
+ int** Mesh, /* (&) the indices defining the Delaunay triangulation of the points; FLAT: nMesh x (nd+1) */
128
+ int* nMesh); /* (&) Number of triangulations */
129
+
130
+ /**** CUSTOM ALLOCATOR VERSIONS ****/
131
+
132
+ /* builds the 3-D convexhull */
133
+ void convhull_3d_build_alloc(/* input arguments */
134
+ ch_vertex* const in_vertices, /* vector of input vertices; nVert x 1 */
135
+ const int nVert, /* number of vertices */
136
+ /* output arguments */
137
+ int** out_faces, /* & of empty int*, output face indices; flat: nOut_faces x 3 */
138
+ int* nOut_faces, /* & of int, number of output face indices */
139
+ void* allocator); /* & of an allocator */
140
+
141
+ /* builds the N-Dimensional convexhull of a grid of points */
142
+ void convhull_nd_build_alloc(/* input arguments */
143
+ CH_FLOAT* const in_points, /* Matrix of points in 'd' dimensions; FLAT: nPoints x d */
144
+ const int nPoints, /* number of points */
145
+ const int d, /* Number of dimensions */
146
+ /* output arguments */
147
+ int** out_faces, /* (&) output face indices; FLAT: nOut_faces x d */
148
+ CH_FLOAT** out_cf, /* (&) contains the coefficients of the planes (set to NULL if not wanted); FLAT: nOut_faces x d */
149
+ CH_FLOAT** out_df, /* (&) contains the constant terms of the planes (set to NULL if not wanted); nOut_faces x 1 */
150
+ int* nOut_faces, /* (&) number of output face indices */
151
+ void* allocator); /* & of an allocator */
152
+
153
+ /* Computes the Delaunay triangulation (mesh) of an arrangement of points in N-dimensional space */
154
+ void delaunay_nd_mesh_alloc(/* input Arguments */
155
+ const float* points, /* The input points; FLAT: nPoints x nd */
156
+ const int nPoints, /* Number of points */
157
+ const int nd, /* The number of dimensions */
158
+ /* output Arguments */
159
+ int** Mesh, /* (&) the indices defining the Delaunay triangulation of the points; FLAT: nMesh x (nd+1) */
160
+ int* nMesh, /* (&) Number of triangulations */
161
+ void* allocator); /* & of an allocator */
162
+
163
+ /* reads an 'obj' file and extracts only the vertices (for 3d convexhulls only) */
164
+ void extract_vertices_from_obj_file_alloc(/* input arguments */
165
+ char* const obj_filename, /* obj filename, WITHOUT extension */
166
+ /* output arguments */
167
+ ch_vertex** out_vertices, /* & of empty ch_vertex*, output vertices; out_nVert x 1 */
168
+ int* out_nVert, /* & of int, number of vertices */
169
+ void* allocator); /* & of an allocator */
170
+
171
+ #ifdef __cplusplus
172
+ } /*extern "C"*/
173
+ #endif
174
+
175
+ #endif /* CONVHULL_3D_INCLUDED */
176
+
177
+
178
+ /************
179
+ * INTERNAL:
180
+ ***********/
181
+
182
+ #ifdef CONVHULL_3D_ENABLE
183
+
184
+ #include <stdlib.h>
185
+ #include <stdio.h>
186
+ #include <math.h>
187
+ #include <string.h>
188
+ #include <float.h>
189
+ #include <ctype.h>
190
+ #include <string.h>
191
+ #include <errno.h>
192
+ #include <assert.h>
193
+ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
194
+ #define CV_STRNCPY(a,b,c) strncpy_s(a,c+1,b,c);
195
+ #define CV_STRCAT(a,b) strcat_s(a,sizeof(b),b);
196
+ #else
197
+ #define CV_STRNCPY(a,b,c) strncpy(a,b,c);
198
+ #define CV_STRCAT(a,b) strcat(a,b);
199
+ #endif
200
+ #ifdef CONVHULL_3D_USE_SINGLE_PRECISION
201
+ #define CH_FLT_MIN FLT_MIN
202
+ #define CH_FLT_MAX FLT_MAX
203
+ #define CH_NOISE_VAL 0.00001f
204
+ #define ch_pow powf
205
+ #define ch_sqrt sqrtf
206
+ #else
207
+ #define CH_FLT_MIN DBL_MIN
208
+ #define CH_FLT_MAX DBL_MAX
209
+ #define CH_NOISE_VAL 0.0000001
210
+ #define ch_pow pow
211
+ #define ch_sqrt sqrt
212
+ #endif
213
+ #ifndef MIN
214
+ #define MIN(a,b) (( (a) < (b) ) ? (a) : (b) )
215
+ #endif
216
+ #ifndef MAX
217
+ #define MAX(a,b) (( (a) > (b) ) ? (a) : (b) )
218
+ #endif
219
+ #ifndef ch_malloc
220
+ #define ch_malloc malloc
221
+ #endif
222
+ #ifndef ch_calloc
223
+ #define ch_calloc calloc
224
+ #endif
225
+ #ifndef ch_realloc
226
+ #define ch_realloc realloc
227
+ #endif
228
+ #ifndef ch_free
229
+ #define ch_free free
230
+ #endif
231
+ #ifndef ch_stateful_malloc
232
+ #define ch_stateful_malloc(allocator, size) ch_malloc(size)
233
+ #endif
234
+ #ifndef ch_stateful_calloc
235
+ #define ch_stateful_calloc(allocator, num, size) ch_calloc(num, size)
236
+ #endif
237
+ #ifndef ch_stateful_realloc
238
+ #define ch_stateful_realloc(allocator, ptr, size) ch_realloc(ptr, size)
239
+ #endif
240
+ #ifndef ch_stateful_free
241
+ #define ch_stateful_free(allocator, ptr) ch_free(ptr)
242
+ #endif
243
+ #ifndef ch_stateful_resize
244
+ #define ch_stateful_resize(allocator, ptr, size) default_memory_resize(allocator, ptr, size)
245
+ #define CONVHULL_CREATE_DEFAULT_RESIZE 1
246
+ #endif
247
+
248
+ #define CH_MAX_NUM_FACES 50000
249
+ #define CONVHULL_3D_MAX_DIMENSIONS 3
250
+ #define CONVHULL_ND_MAX_DIMENSIONS 5
251
+
252
+ /* structs for qsort */
253
+ typedef struct float_w_idx {
254
+ CH_FLOAT val;
255
+ int idx;
256
+ }float_w_idx;
257
+
258
+ /* internal functions prototypes: */
259
+ static int cmp_asc_float(const void*, const void*);
260
+ static int cmp_desc_float(const void*, const void*);
261
+ static int cmp_asc_int(const void*, const void*);
262
+ static void sort_float(CH_FLOAT*, CH_FLOAT*, int*, int, int, void*);
263
+ static void sort_int(int*, int);
264
+ static ch_vec3 cross(ch_vec3*, ch_vec3*);
265
+ static CH_FLOAT det_4x4(CH_FLOAT*);
266
+ static void plane_3d(CH_FLOAT*, CH_FLOAT*, CH_FLOAT*);
267
+ static void ismember(int*, int*, int*, int, int);
268
+
269
+ /* internal functions definitions: */
270
+ #ifdef CONVHULL_CREATE_DEFAULT_RESIZE
271
+ static void* default_memory_resize(void* allocator, void* ptr, size_t size)
272
+ {
273
+ if (ptr)
274
+ ch_stateful_free(allocator, ptr);
275
+ return ch_stateful_malloc(allocator, size);
276
+ }
277
+ #endif
278
+
279
+ static int cmp_asc_float(const void *a,const void *b) {
280
+ struct float_w_idx *a1 = (struct float_w_idx*)a;
281
+ struct float_w_idx *a2 = (struct float_w_idx*)b;
282
+ if((*a1).val<(*a2).val)return -1;
283
+ else if((*a1).val>(*a2).val)return 1;
284
+ else return 0;
285
+ }
286
+
287
+ static int cmp_desc_float(const void *a,const void *b) {
288
+ struct float_w_idx *a1 = (struct float_w_idx*)a;
289
+ struct float_w_idx *a2 = (struct float_w_idx*)b;
290
+ if((*a1).val>(*a2).val)return -1;
291
+ else if((*a1).val<(*a2).val)return 1;
292
+ else return 0;
293
+ }
294
+
295
+ static int cmp_asc_int(const void *a,const void *b) {
296
+ int *a1 = (int*)a;
297
+ int *a2 = (int*)b;
298
+ if((*a1)<(*a2))return -1;
299
+ else if((*a1)>(*a2))return 1;
300
+ else return 0;
301
+ }
302
+
303
+ static void sort_float
304
+ (
305
+ CH_FLOAT* in_vec, /* vector[len] to be sorted */
306
+ CH_FLOAT* out_vec, /* if NULL, then in_vec is sorted "in-place" */
307
+ int* new_idices, /* set to NULL if you don't need them */
308
+ int len, /* number of elements in vectors, must be consistent with the input data */
309
+ int descendFLAG, /* !1:ascending, 1:descending */
310
+ void* allocator /* (stateful) allocator */
311
+ )
312
+ {
313
+ int i;
314
+ struct float_w_idx *data;
315
+
316
+ data = (float_w_idx*)ch_stateful_malloc(allocator, len*sizeof(float_w_idx));
317
+ for(i=0;i<len;i++) {
318
+ data[i].val=in_vec[i];
319
+ data[i].idx=i;
320
+ }
321
+ if(descendFLAG)
322
+ qsort(data,len,sizeof(data[0]),cmp_desc_float);
323
+ else
324
+ qsort(data,len,sizeof(data[0]),cmp_asc_float);
325
+ for(i=0;i<len;i++){
326
+ if (out_vec!=NULL)
327
+ out_vec[i] = data[i].val;
328
+ else
329
+ in_vec[i] = data[i].val; /* overwrite input vector */
330
+ if(new_idices!=NULL)
331
+ new_idices[i] = data[i].idx;
332
+ }
333
+ ch_stateful_free(allocator, data);
334
+ }
335
+
336
+ static void sort_int
337
+ (
338
+ int* io_vec, /* vector[len] to be sorted */
339
+ int len /* number of elements in vectors, must be consistent with the input data */
340
+ )
341
+ {
342
+ qsort(io_vec,len,sizeof(io_vec[0]),cmp_asc_int);
343
+ }
344
+
345
+ static ch_vec3 cross(ch_vec3* v1, ch_vec3* v2)
346
+ {
347
+ ch_vec3 cross;
348
+ cross.x = v1->y * v2->z - v1->z * v2->y;
349
+ cross.y = v1->z * v2->x - v1->x * v2->z;
350
+ cross.z = v1->x * v2->y - v1->y * v2->x;
351
+ return cross;
352
+ }
353
+
354
+ /* calculates the determinent of a 4x4 matrix */
355
+ static CH_FLOAT det_4x4(CH_FLOAT* m) {
356
+ return
357
+ m[3] * m[6] * m[9] * m[12] - m[2] * m[7] * m[9] * m[12] -
358
+ m[3] * m[5] * m[10] * m[12] + m[1] * m[7] * m[10] * m[12] +
359
+ m[2] * m[5] * m[11] * m[12] - m[1] * m[6] * m[11] * m[12] -
360
+ m[3] * m[6] * m[8] * m[13] + m[2] * m[7] * m[8] * m[13] +
361
+ m[3] * m[4] * m[10] * m[13] - m[0] * m[7] * m[10] * m[13] -
362
+ m[2] * m[4] * m[11] * m[13] + m[0] * m[6] * m[11] * m[13] +
363
+ m[3] * m[5] * m[8] * m[14] - m[1] * m[7] * m[8] * m[14] -
364
+ m[3] * m[4] * m[9] * m[14] + m[0] * m[7] * m[9] * m[14] +
365
+ m[1] * m[4] * m[11] * m[14] - m[0] * m[5] * m[11] * m[14] -
366
+ m[2] * m[5] * m[8] * m[15] + m[1] * m[6] * m[8] * m[15] +
367
+ m[2] * m[4] * m[9] * m[15] - m[0] * m[6] * m[9] * m[15] -
368
+ m[1] * m[4] * m[10] * m[15] + m[0] * m[5] * m[10] * m[15];
369
+ }
370
+
371
+ /* Helper function for det_NxN() */
372
+ static void createSubMatrix
373
+ (
374
+ CH_FLOAT* m,
375
+ int N,
376
+ int i,
377
+ CH_FLOAT* sub_m
378
+ )
379
+ {
380
+ int j, k;
381
+ for(j = N, k=0; j < N * N; j++){
382
+ if(j % N != i){ /* i is the index to remove */
383
+ sub_m[k] = m[j];
384
+ k++;
385
+ }
386
+ }
387
+ }
388
+
389
+ static CH_FLOAT det_NxN
390
+ (
391
+ CH_FLOAT* m,
392
+ int d
393
+ )
394
+ {
395
+ CH_FLOAT sum;
396
+ CH_FLOAT sub_m[CONVHULL_ND_MAX_DIMENSIONS*CONVHULL_ND_MAX_DIMENSIONS];
397
+ int sign;
398
+
399
+ if (d == 0)
400
+ return 1.0;
401
+ sum = 0.0;
402
+ sign = 1;
403
+ for (int i = 0; i < d; i++) {
404
+ createSubMatrix(m, d, i, sub_m);
405
+ sum += sign * m[i] * det_NxN(sub_m, d - 1);
406
+ sign *= -1;
407
+ }
408
+ return sum;
409
+ }
410
+
411
+ /* Calculates the coefficients of the equation of a PLANE in 3D.
412
+ * Original Copyright (c) 2014, George Papazafeiropoulos
413
+ * Distributed under the BSD (2-clause) license
414
+ */
415
+ static void plane_3d
416
+ (
417
+ CH_FLOAT* p,
418
+ CH_FLOAT* c,
419
+ CH_FLOAT* d
420
+ )
421
+ {
422
+ int i, j, k, l;
423
+ int r[3];
424
+ CH_FLOAT sign, det, norm_c;
425
+ CH_FLOAT pdiff[2][3], pdiff_s[2][2];
426
+
427
+ for(i=0; i<2; i++)
428
+ for(j=0; j<3; j++)
429
+ pdiff[i][j] = p[(i+1)*3+j] - p[i*3+j];
430
+ memset(c, 0, 3*sizeof(CH_FLOAT));
431
+ sign = 1.0;
432
+ for(i=0; i<3; i++)
433
+ r[i] = i;
434
+ for(i=0; i<3; i++){
435
+ for(j=0; j<2; j++){
436
+ for(k=0, l=0; k<3; k++){
437
+ if(r[k]!=i){
438
+ pdiff_s[j][l] = pdiff[j][k];
439
+ l++;
440
+ }
441
+ }
442
+ }
443
+ det = pdiff_s[0][0]*pdiff_s[1][1] - pdiff_s[1][0]*pdiff_s[0][1];
444
+ c[i] = sign * det;
445
+ sign *= -1.0;
446
+ }
447
+ norm_c = (CH_FLOAT)0.0;
448
+ for(i=0; i<3; i++)
449
+ norm_c += (ch_pow(c[i], (CH_FLOAT)2.0));
450
+ norm_c = ch_sqrt(norm_c);
451
+ for(i=0; i<3; i++)
452
+ c[i] /= norm_c;
453
+ (*d) = (CH_FLOAT)0.0;
454
+ for(i=0; i<3; i++)
455
+ (*d) += -p[i] * c[i];
456
+ }
457
+
458
+ /* Calculates the coefficients of the equation of a PLANE in ND.
459
+ * Original Copyright (c) 2014, George Papazafeiropoulos
460
+ * Distributed under the BSD (2-clause) license
461
+ */
462
+ static void plane_nd
463
+ (
464
+ const int Nd,
465
+ CH_FLOAT* p,
466
+ CH_FLOAT* c,
467
+ CH_FLOAT* d
468
+ )
469
+ {
470
+ int i, j, k, l;
471
+ int r[CONVHULL_ND_MAX_DIMENSIONS];
472
+ CH_FLOAT sign, det, norm_c;
473
+ CH_FLOAT pdiff[CONVHULL_ND_MAX_DIMENSIONS-1][CONVHULL_ND_MAX_DIMENSIONS], pdiff_s[(CONVHULL_ND_MAX_DIMENSIONS-1)*(CONVHULL_ND_MAX_DIMENSIONS-1)];
474
+
475
+ if(Nd==3){
476
+ plane_3d(p,c,d);
477
+ return;
478
+ }
479
+
480
+ for(i=0; i<Nd-1; i++)
481
+ for(j=0; j<Nd; j++)
482
+ pdiff[i][j] = p[(i+1)*Nd+j] - p[i*Nd+j];
483
+ memset(c, 0, Nd*sizeof(CH_FLOAT));
484
+ sign = 1.0;
485
+ for(i=0; i<Nd; i++)
486
+ r[i] = i;
487
+ for(i=0; i<Nd; i++){
488
+ for(j=0; j<Nd-1; j++){
489
+ for(k=0, l=0; k<Nd; k++){
490
+ if(r[k]!=i){
491
+ pdiff_s[j*(Nd-1)+l] = pdiff[j][k];
492
+ l++;
493
+ }
494
+ }
495
+ }
496
+ /* Determinant 1 dimension lower */
497
+ if(Nd==3)
498
+ det = pdiff_s[0*(Nd-1)+0]*pdiff_s[1*(Nd-1)+1] - pdiff_s[1*(Nd-1)+0]*pdiff_s[0*(Nd-1)+1];
499
+ else if(Nd==5)
500
+ det = det_4x4((CH_FLOAT*)pdiff_s);
501
+ else{
502
+ det = det_NxN((CH_FLOAT*)pdiff_s, Nd-1);
503
+ }
504
+ c[i] = sign * det;
505
+ sign *= -1.0;
506
+ }
507
+ norm_c = (CH_FLOAT)0.0;
508
+ for(i=0; i<Nd; i++)
509
+ norm_c += (ch_pow(c[i], (CH_FLOAT)2.0));
510
+ norm_c = ch_sqrt(norm_c);
511
+ for(i=0; i<Nd; i++)
512
+ c[i] /= norm_c;
513
+ (*d) = (CH_FLOAT)0.0;
514
+ for(i=0; i<Nd; i++)
515
+ (*d) += -p[i] * c[i];
516
+ }
517
+
518
+ static void ismember
519
+ (
520
+ int* pLeft, /* left vector; nLeftElements x 1 */
521
+ int* pRight, /* right vector; nRightElements x 1 */
522
+ int* pOut, /* 0, unless pRight elements are present in pLeft then 1; nLeftElements x 1 */
523
+ int nLeftElements, /* number of elements in pLeft */
524
+ int nRightElements /* number of elements in pRight */
525
+ )
526
+ {
527
+ int i, j;
528
+ memset(pOut, 0, nLeftElements*sizeof(int));
529
+ for(i=0; i< nLeftElements; i++)
530
+ for(j=0; j< nRightElements; j++)
531
+ if(pLeft[i] == pRight[j] )
532
+ pOut[i] = 1;
533
+ }
534
+
535
+ static CH_FLOAT rnd(int x, int y)
536
+ {
537
+ // Reference(s):
538
+ //
539
+ // - Improvements to the canonical one-liner GLSL rand() for OpenGL ES 2.0
540
+ // http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
541
+ //
542
+ CH_FLOAT a = (CH_FLOAT) 12.9898;
543
+ CH_FLOAT b = (CH_FLOAT) 78.233;
544
+ CH_FLOAT c = (CH_FLOAT) 43758.5453;
545
+ CH_FLOAT dt = x*a + y*b;
546
+ #ifdef CONVHULL_3D_USE_SINGLE_PRECISION
547
+ float sn = fmodf(dt, 3.14f);
548
+ float intpart;
549
+ return modff(sinf(sn) * c, &intpart);
550
+ #else
551
+ double sn = fmod(dt, 3.14);
552
+ double intpart;
553
+ return modf(sin(sn) * c, &intpart);
554
+ #endif // CONVHULL_3D_USE_SINGLE_PRECISION
555
+ }
556
+
557
+ /* A C version of the 3D quickhull matlab implementation from here:
558
+ * https://www.mathworks.com/matlabcentral/fileexchange/48509-computational-geometry-toolbox?focused=3851550&tab=example
559
+ * (*out_faces) is returned as NULL, if triangulation fails *
560
+ * Original Copyright (c) 2014, George Papazafeiropoulos
561
+ * Distributed under the BSD (2-clause) license
562
+ * Reference: "The Quickhull Algorithm for Convex Hull, C. Bradford Barber, David P. Dobkin
563
+ * and Hannu Huhdanpaa, Geometry Center Technical Report GCG53, July 30, 1993"
564
+ */
565
+ inline void convhull_3d_build
566
+ (
567
+ ch_vertex* const in_vertices,
568
+ const int nVert,
569
+ int** out_faces,
570
+ int* nOut_faces
571
+ )
572
+ {
573
+ convhull_3d_build_alloc(in_vertices, nVert, out_faces, nOut_faces, NULL);
574
+ }
575
+
576
+ inline void convhull_3d_build_alloc
577
+ (
578
+ ch_vertex* const in_vertices,
579
+ const int nVert,
580
+ int** out_faces,
581
+ int* nOut_faces,
582
+ void* allocator
583
+ )
584
+ {
585
+ int i, j, k, l, h;
586
+ int nFaces, p, d;
587
+ int* aVec, *faces;
588
+ CH_FLOAT dfi, v, max_p, min_p;
589
+ CH_FLOAT span[CONVHULL_3D_MAX_DIMENSIONS];
590
+ CH_FLOAT cfi[CONVHULL_3D_MAX_DIMENSIONS];
591
+ CH_FLOAT p_s[CONVHULL_3D_MAX_DIMENSIONS*CONVHULL_3D_MAX_DIMENSIONS];
592
+ CH_FLOAT* points, *cf, *df;
593
+
594
+ if(nVert<=3 || in_vertices==NULL){
595
+ (*out_faces) = NULL;
596
+ (*nOut_faces) = 0;
597
+ return;
598
+ }
599
+
600
+ /* 3 dimensions. The code should theoretically work for >=2 dimensions, but "plane_3d" and "det_4x4" are hardcoded for 3,
601
+ * so would need to be rewritten */
602
+ d = 3;
603
+
604
+ /* Add noise to the points */
605
+ points = (CH_FLOAT*)ch_stateful_malloc(allocator, nVert*(d+1)*sizeof(CH_FLOAT));
606
+ for(i=0; i<nVert; i++){
607
+ for(j=0; j<d; j++)
608
+ points[i*(d+1)+j] = in_vertices[i].v[j] + CH_NOISE_VAL*rnd(i, j); /* noise mitigates duplicates */
609
+ points[i*(d+1)+d] = 1.0f; /* add a last column of ones. Used only for determinant calculation */
610
+ }
611
+
612
+ /* Find the span */
613
+ for(j=0; j<d; j++){
614
+ max_p = (CH_FLOAT)-2.23e+13; min_p = (CH_FLOAT)2.23e+13;
615
+ for(i=0; i<nVert; i++){
616
+ max_p = MAX(max_p, points[i*(d+1)+j]);
617
+ min_p = MIN(min_p, points[i*(d+1)+j]);
618
+ }
619
+ span[j] = max_p - min_p;
620
+ #ifndef CONVHULL_ALLOW_BUILD_IN_HIGHER_DIM
621
+ /* If you hit this assertion error, then the input vertices do not span all 3 dimensions. Therefore the convex hull could be built in less dimensions.
622
+ * In these cases, consider reducing the dimensionality of the points and calling convhull_nd_build() instead with d<3
623
+ * You can turn this assert off using CONVHULL_ALLOW_BUILD_IN_HIGHER_DIM if you still wish to build in a higher number of dimensions. */
624
+ assert(span[j]>0.000000001);
625
+ #endif
626
+ }
627
+
628
+ /* The initial convex hull is a simplex with (d+1) facets, where d is the number of dimensions */
629
+ nFaces = (d+1);
630
+ faces = (int*)ch_stateful_calloc(allocator, nFaces*d, sizeof(int));
631
+ aVec = (int*)ch_stateful_malloc(allocator, nFaces*sizeof(int));
632
+ for(i=0; i<nFaces; i++)
633
+ aVec[i] = i;
634
+
635
+ /* Each column of cf contains the coefficients of a plane */
636
+ cf = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*d*sizeof(CH_FLOAT));
637
+ df = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*sizeof(CH_FLOAT));
638
+ for(i=0; i<nFaces; i++){
639
+ /* Set the indices of the points defining the face */
640
+ for(j=0, k=0; j<(d+1); j++){
641
+ if(aVec[j]!=i){
642
+ faces[i*d+k] = aVec[j];
643
+ k++;
644
+ }
645
+ }
646
+
647
+ /* Calculate and store the plane coefficients of the face */
648
+ for(j=0; j<d; j++)
649
+ for(k=0; k<d; k++)
650
+ p_s[j*d+k] = points[(faces[i*d+j])*(d+1) + k];
651
+
652
+ /* Calculate and store the plane coefficients of the face */
653
+ plane_3d(p_s, cfi, &dfi);
654
+ for(j=0; j<d; j++)
655
+ cf[i*d+j] = cfi[j];
656
+ df[i] = dfi;
657
+ }
658
+ CH_FLOAT A[(CONVHULL_3D_MAX_DIMENSIONS+1)*(CONVHULL_3D_MAX_DIMENSIONS+1)];
659
+ int fVec[CONVHULL_3D_MAX_DIMENSIONS+1];
660
+ int face_tmp[2];
661
+
662
+ /* Check to make sure that faces are correctly oriented */
663
+ int bVec[CONVHULL_3D_MAX_DIMENSIONS+1];
664
+ for(i=0; i<d+1; i++)
665
+ bVec[i] = i;
666
+
667
+ /* A contains the coordinates of the points forming a simplex */
668
+ memset(A, 0, sizeof(A));
669
+ for(k=0; k<(d+1); k++){
670
+ /* Get the point that is not on the current face (point p) */
671
+ for(i=0; i<d; i++)
672
+ fVec[i] = faces[k*d+i];
673
+ sort_int(fVec, d); /* sort ascending */
674
+ p=k;
675
+ for(i=0; i<d; i++)
676
+ for(j=0; j<(d+1); j++)
677
+ A[i*(d+1)+j] = points[(faces[k*d+i])*(d+1) + j];
678
+ for(; i<(d+1); i++)
679
+ for(j=0; j<(d+1); j++)
680
+ A[i*(d+1)+j] = points[p*(d+1)+j];
681
+
682
+ /* det(A) determines the orientation of the face */
683
+ v = det_4x4(A);
684
+
685
+ /* Orient so that each point on the original simplex can't see the opposite face */
686
+ if(v<0){
687
+ /* Reverse the order of the last two vertices to change the volume */
688
+ for(j=0; j<2; j++)
689
+ face_tmp[j] = faces[k*d+d-j-1];
690
+ for(j=0; j<2; j++)
691
+ faces[k*d+d-j-1] = face_tmp[1-j];
692
+
693
+ /* Modify the plane coefficients of the properly oriented faces */
694
+ for(j=0; j<d; j++)
695
+ cf[k*d+j] = -cf[k*d+j];
696
+ df[k] = -df[k];
697
+ for(i=0; i<d; i++)
698
+ for(j=0; j<(d+1); j++)
699
+ A[i*(d+1)+j] = points[(faces[k*d+i])*(d+1) + j];
700
+ for(; i<(d+1); i++)
701
+ for(j=0; j<(d+1); j++)
702
+ A[i*(d+1)+j] = points[p*(d+1)+j];
703
+ }
704
+ }
705
+
706
+ /* Coordinates of the center of the point set */
707
+ CH_FLOAT meanp[CONVHULL_3D_MAX_DIMENSIONS];
708
+ CH_FLOAT* absdist, *reldist, *desReldist;
709
+ memset(meanp, 0, sizeof(meanp));
710
+ for(i=d+1; i<nVert; i++)
711
+ for(j=0; j<d; j++)
712
+ meanp[j] += points[i*(d+1)+j];
713
+ for(j=0; j<d; j++)
714
+ meanp[j] = meanp[j]/(CH_FLOAT)(nVert-d-1);
715
+
716
+ /* Absolute distance of points from the center */
717
+ absdist = (CH_FLOAT*)ch_stateful_malloc(allocator, (nVert-d-1)*d * sizeof(CH_FLOAT));
718
+ for(i=d+1, k=0; i<nVert; i++, k++)
719
+ for(j=0; j<d; j++)
720
+ absdist[k*d+j] = (points[i*(d+1)+j] - meanp[j])/span[j];
721
+
722
+ /* Relative distance of points from the center */
723
+ reldist = (CH_FLOAT*)ch_stateful_calloc(allocator, (nVert-d-1), sizeof(CH_FLOAT));
724
+ desReldist = (CH_FLOAT*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(CH_FLOAT));
725
+ for(i=0; i<(nVert-d-1); i++)
726
+ for(j=0; j<d; j++)
727
+ reldist[i] += ch_pow(absdist[i*d+j], (CH_FLOAT)2.0);
728
+
729
+ /* Sort from maximum to minimum relative distance */
730
+ int num_pleft, cnt;
731
+ int* ind, *pleft;
732
+ ind = (int*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(int));
733
+ pleft = (int*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(int));
734
+ sort_float(reldist, desReldist, ind, (nVert-d-1), 1, allocator);
735
+
736
+ /* Initialize the vector of points left. The points with the larger relative
737
+ distance from the center are scanned first. */
738
+ num_pleft = (nVert-d-1);
739
+ for(i=0; i<num_pleft; i++)
740
+ pleft[i] = ind[i]+d+1;
741
+
742
+ /* Loop over all remaining points that are not deleted. Deletion of points
743
+ occurs every #iter2del# iterations of this while loop */
744
+ memset(A, 0, sizeof(A));
745
+
746
+ /* cnt is equal to the points having been selected without deletion of
747
+ nonvisible points (i.e. points inside the current convex hull) */
748
+ cnt=0;
749
+
750
+ /* The main loop for the quickhull algorithm */
751
+ CH_FLOAT detA;
752
+ CH_FLOAT* points_cf;
753
+ CH_FLOAT points_s[CONVHULL_3D_MAX_DIMENSIONS];
754
+ int face_s[CONVHULL_3D_MAX_DIMENSIONS];
755
+ int gVec[CONVHULL_3D_MAX_DIMENSIONS];
756
+ int* visible_ind, *visible, *nonvisible_faces, *f0, *u, *horizon, *hVec, *pp, *hVec_mem_face;
757
+ int num_visible_ind, num_nonvisible_faces, n_newfaces, n_realloc_faces, count, vis;
758
+ int f0_sum, u_len, start, num_p, index, horizon_size1;
759
+ int FUCKED;
760
+ FUCKED = 0;
761
+ /* These pointers need to be assigned NULL as they only use realloc/resize (which act like malloc on a NULL pointer */
762
+ visible = nonvisible_faces = f0 = u = horizon = hVec = pp = hVec_mem_face = NULL;
763
+ nFaces = d+1;
764
+ visible_ind = (int*)ch_stateful_malloc(allocator, nFaces*sizeof(int));
765
+ points_cf = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*sizeof(CH_FLOAT));
766
+ while( (num_pleft>0) ){
767
+ /* i is the first point of the points left */
768
+ i = pleft[0];
769
+
770
+ /* Delete the point selected */
771
+ for(j=0; j<num_pleft-1; j++)
772
+ pleft[j] = pleft[j+1];
773
+ num_pleft--;
774
+ if(num_pleft == 0)
775
+ ch_stateful_free(allocator, pleft);
776
+ else
777
+ pleft = (int*)ch_stateful_realloc(allocator, pleft, num_pleft*sizeof(int));
778
+
779
+ /* Update point selection counter */
780
+ cnt++;
781
+
782
+ /* find visible faces */
783
+ for(j=0; j<d; j++)
784
+ points_s[j] = points[i*(d+1)+j];
785
+ points_cf = (CH_FLOAT*)ch_stateful_realloc(allocator, points_cf, nFaces*sizeof(CH_FLOAT));
786
+ visible_ind = (int*)ch_stateful_realloc(allocator, visible_ind, nFaces*sizeof(int));
787
+ #ifdef CONVHULL_3D_USE_CBLAS
788
+ #ifdef CONVHULL_3D_USE_SINGLE_PRECISION
789
+ cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasTrans, 1, nFaces, d, 1.0f,
790
+ points_s, d,
791
+ cf, d, 0.0f,
792
+ points_cf, nFaces);
793
+ #else
794
+ cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasTrans, 1, nFaces, d, 1.0,
795
+ points_s, d,
796
+ cf, d, 0.0,
797
+ points_cf, nFaces);
798
+ #endif
799
+ #else
800
+ for (j = 0; j < nFaces; j++) {
801
+ points_cf[j] = 0;
802
+ for (k = 0; k < d; k++)
803
+ points_cf[j] += points_s[k]*cf[j*d+k];
804
+ }
805
+ #endif
806
+ num_visible_ind = 0;
807
+ for(j=0; j<nFaces; j++){
808
+ if(points_cf[j] + df[j] > 0.0){
809
+ num_visible_ind++; /* will sum to 0 if none are visible */
810
+ visible_ind[j] = 1;
811
+ }
812
+ else
813
+ visible_ind[j] = 0;
814
+ }
815
+ num_nonvisible_faces = nFaces - num_visible_ind;
816
+
817
+ /* proceed if there are any visible faces */
818
+ if(num_visible_ind!=0){
819
+ /* Find visible face indices */
820
+ visible = (int*)ch_stateful_resize(allocator, visible, num_visible_ind*sizeof(int));
821
+ for(j=0, k=0; j<nFaces; j++){
822
+ if(visible_ind[j]==1){
823
+ visible[k]=j;
824
+ k++;
825
+ }
826
+ }
827
+
828
+ /* Find nonvisible faces */
829
+ nonvisible_faces = (int*)ch_stateful_resize(allocator, nonvisible_faces, num_nonvisible_faces*d*sizeof(int));
830
+ f0 = (int*)ch_stateful_resize(allocator, f0, num_nonvisible_faces*d*sizeof(int));
831
+ for(j=0, k=0; j<nFaces; j++){
832
+ if(visible_ind[j]==0){
833
+ for(l=0; l<d; l++)
834
+ nonvisible_faces[k*d+l]= faces[j*d+l];
835
+ k++;
836
+ }
837
+ }
838
+
839
+ /* Create horizon (count is the number of the edges of the horizon) */
840
+ count=0;
841
+ for(j=0; j<num_visible_ind; j++){
842
+ /* visible face */
843
+ vis = visible[j];
844
+ for(k=0; k<d; k++)
845
+ face_s[k] = faces[vis*d+k];
846
+ sort_int(face_s, d);
847
+ ismember(nonvisible_faces, face_s, f0, num_nonvisible_faces*d, d);
848
+ u_len = 0;
849
+
850
+ /* u are the nonvisible faces connected to the face v, if any */
851
+ for(k=0; k<num_nonvisible_faces; k++){
852
+ f0_sum = 0;
853
+ for(l=0; l<d; l++)
854
+ f0_sum += f0[k*d + l];
855
+ if(f0_sum == d-1){
856
+ u_len++;
857
+ if(u_len==1)
858
+ u = (int*)ch_stateful_resize(allocator, u, u_len*sizeof(int));
859
+ else
860
+ u = (int*)ch_stateful_realloc(allocator, u, u_len*sizeof(int));
861
+ u[u_len-1] = k;
862
+ }
863
+ }
864
+ for(k=0; k<u_len; k++){
865
+ /* The boundary between the visible face v and the k(th) nonvisible face connected to the face v forms part of the horizon */
866
+ count++;
867
+ if(count==1)
868
+ horizon = (int*)ch_stateful_resize(allocator, horizon, count*(d-1)*sizeof(int));
869
+ else
870
+ horizon = (int*)ch_stateful_realloc(allocator, horizon, count*(d-1)*sizeof(int));
871
+ for(l=0; l<d; l++)
872
+ gVec[l] = nonvisible_faces[u[k]*d+l];
873
+ for(l=0, h=0; l<d; l++){
874
+ if(f0[u[k]*d+l]){
875
+ horizon[(count-1)*(d-1)+h] = gVec[l];
876
+ h++;
877
+ }
878
+ }
879
+ }
880
+ }
881
+ horizon_size1 = count;
882
+ for(j=0, l=0; j<nFaces; j++){
883
+ if(!visible_ind[j]){
884
+ /* Delete visible faces */
885
+ for(k=0; k<d; k++)
886
+ faces[l*d+k] = faces[j*d+k];
887
+
888
+ /* Delete the corresponding plane coefficients of the faces */
889
+ for(k=0; k<d; k++)
890
+ cf[l*d+k] = cf[j*d+k];
891
+ df[l] = df[j];
892
+ l++;
893
+ }
894
+ }
895
+
896
+ /* Update the number of faces */
897
+ nFaces = nFaces-num_visible_ind;
898
+
899
+ /* start is the first row of the new faces */
900
+ start=nFaces;
901
+
902
+ /* Add faces connecting horizon to the new point */
903
+ n_newfaces = horizon_size1;
904
+ n_realloc_faces = nFaces + n_newfaces;
905
+ if (n_realloc_faces > CH_MAX_NUM_FACES)
906
+ n_realloc_faces = CH_MAX_NUM_FACES+1;
907
+ faces = (int*)ch_stateful_realloc(allocator, faces, n_realloc_faces*d*sizeof(int));
908
+ cf = (CH_FLOAT*)ch_stateful_realloc(allocator, cf, n_realloc_faces*d*sizeof(CH_FLOAT));
909
+ df = (CH_FLOAT*)ch_stateful_realloc(allocator, df, n_realloc_faces*sizeof(CH_FLOAT));
910
+
911
+ for(j=0; j<n_newfaces; j++){
912
+ nFaces++;
913
+ for(k=0; k<d-1; k++)
914
+ faces[(nFaces-1)*d+k] = horizon[j*(d-1)+k];
915
+ faces[(nFaces-1)*d+(d-1)] = i;
916
+
917
+ /* Calculate and store appropriately the plane coefficients of the faces */
918
+ for(k=0; k<d; k++)
919
+ for(l=0; l<d; l++)
920
+ p_s[k*d+l] = points[(faces[(nFaces-1)*d+k])*(d+1) + l];
921
+ plane_3d(p_s, cfi, &dfi);
922
+ for(k=0; k<d; k++)
923
+ cf[(nFaces-1)*d+k] = cfi[k];
924
+ df[(nFaces-1)] = dfi;
925
+ if(nFaces > CH_MAX_NUM_FACES){
926
+ FUCKED = 1;
927
+ nFaces = 0;
928
+ break;
929
+ }
930
+ }
931
+
932
+ /* Orient each new face properly */
933
+ hVec = (int*)ch_stateful_resize(allocator, hVec, nFaces*sizeof(int));
934
+ hVec_mem_face = (int*)ch_stateful_resize(allocator, hVec_mem_face, nFaces*sizeof(int));
935
+ for(j=0; j<nFaces; j++)
936
+ hVec[j] = j;
937
+ for(k=start; k<nFaces; k++){
938
+ for(j=0; j<d; j++)
939
+ face_s[j] = faces[k*d+j];
940
+ sort_int(face_s, d);
941
+ ismember(hVec, face_s, hVec_mem_face, nFaces, d);
942
+ num_p = 0;
943
+ for(j=0; j<nFaces; j++)
944
+ if(!hVec_mem_face[j])
945
+ num_p++;
946
+ pp = (int*)ch_stateful_resize(allocator, pp, num_p*sizeof(int));
947
+ for(j=0, l=0; j<nFaces; j++){
948
+ if(!hVec_mem_face[j]){
949
+ pp[l] = hVec[j];
950
+ l++;
951
+ }
952
+ }
953
+ index = 0;
954
+ detA = 0.0;
955
+
956
+ /* While new point is coplanar, choose another point */
957
+ while(detA==0.0){
958
+ for(j=0;j<d; j++)
959
+ for(l=0; l<d+1; l++)
960
+ A[j*(d+1)+l] = points[(faces[k*d+j])*(d+1) + l];
961
+ for(; j<d+1; j++)
962
+ for(l=0; l<d+1; l++)
963
+ A[j*(d+1)+l] = points[pp[index]*(d+1)+l];
964
+ index++;
965
+ detA = det_4x4(A);
966
+ }
967
+
968
+ /* Orient faces so that each point on the original simplex can't see the opposite face */
969
+ if (detA<0.0){
970
+ /* If orientation is improper, reverse the order to change the volume sign */
971
+ for(j=0; j<2; j++)
972
+ face_tmp[j] = faces[k*d+d-j-1];
973
+ for(j=0; j<2; j++)
974
+ faces[k*d+d-j-1] = face_tmp[1-j];
975
+
976
+ /* Modify the plane coefficients of the properly oriented faces */
977
+ for(j=0; j<d; j++)
978
+ cf[k*d+j] = -cf[k*d+j];
979
+ df[k] = -df[k];
980
+ for(l=0; l<d; l++)
981
+ for(j=0; j<d+1; j++)
982
+ A[l*(d+1)+j] = points[(faces[k*d+l])*(d+1) + j];
983
+ for(; l<d+1; l++)
984
+ for(j=0; j<d+1; j++)
985
+ A[l*(d+1)+j] = points[pp[index]*(d+1)+j];
986
+ #ifndef NDEBUG
987
+ /* Check */
988
+ detA = det_4x4(A);
989
+ /* If you hit this assertion error, then the face cannot be properly orientated */
990
+ assert(detA>0.0);
991
+ #endif
992
+ }
993
+ }
994
+ }
995
+ if(FUCKED){
996
+ break;
997
+ }
998
+ }
999
+
1000
+ /* output */
1001
+ if(FUCKED){
1002
+ (*out_faces) = NULL;
1003
+ (*nOut_faces) = 0;
1004
+ }
1005
+ else{
1006
+ (*out_faces) = (int*)ch_stateful_malloc(allocator, nFaces*d*sizeof(int));
1007
+ memcpy((*out_faces),faces, nFaces*d*sizeof(int));
1008
+ (*nOut_faces) = nFaces;
1009
+ }
1010
+
1011
+ /* clean-up */
1012
+ ch_stateful_free(allocator, u);
1013
+ ch_stateful_free(allocator, pp);
1014
+ ch_stateful_free(allocator, horizon);
1015
+ ch_stateful_free(allocator, f0);
1016
+ ch_stateful_free(allocator, nonvisible_faces);
1017
+ ch_stateful_free(allocator, visible);
1018
+ ch_stateful_free(allocator, hVec);
1019
+ ch_stateful_free(allocator, hVec_mem_face);
1020
+ ch_stateful_free(allocator, visible_ind);
1021
+ ch_stateful_free(allocator, points_cf);
1022
+ ch_stateful_free(allocator, absdist);
1023
+ ch_stateful_free(allocator, reldist);
1024
+ ch_stateful_free(allocator, desReldist);
1025
+ ch_stateful_free(allocator, ind);
1026
+ ch_stateful_free(allocator, points);
1027
+ ch_stateful_free(allocator, faces);
1028
+ ch_stateful_free(allocator, aVec);
1029
+ ch_stateful_free(allocator, cf);
1030
+ ch_stateful_free(allocator, df);
1031
+ }
1032
+
1033
+ inline void convhull_3d_export_obj
1034
+ (
1035
+ ch_vertex* const vertices,
1036
+ const int nVert,
1037
+ int* const faces,
1038
+ const int nFaces,
1039
+ const int keepOnlyUsedVerticesFLAG,
1040
+ char* const obj_filename
1041
+ )
1042
+ {
1043
+ int i, j;
1044
+ char path[256] = "\0";
1045
+ CV_STRNCPY(path, obj_filename, strlen(obj_filename));
1046
+ FILE* obj_file;
1047
+ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
1048
+ CV_STRCAT(path, ".obj");
1049
+ fopen_s(&obj_file, path, "wt");
1050
+ #else
1051
+ errno = 0;
1052
+ obj_file = fopen(strcat(path, ".obj"), "wt");
1053
+ #endif
1054
+ if (obj_file==NULL) {
1055
+ printf("Error %d \n", errno);
1056
+ printf("It's null");
1057
+ }
1058
+ fprintf(obj_file, "o\n");
1059
+ CH_FLOAT scale;
1060
+ ch_vec3 v1, v2, normal;
1061
+
1062
+ /* export vertices */
1063
+ if(keepOnlyUsedVerticesFLAG){
1064
+ for (i = 0; i < nFaces; i++)
1065
+ for(j=0; j<3; j++)
1066
+ fprintf(obj_file, "v %f %f %f\n", vertices[faces[i*3+j]].x,
1067
+ vertices[faces[i*3+j]].y, vertices[faces[i*3+j]].z);
1068
+ }
1069
+ else {
1070
+ for (i = 0; i < nVert; i++)
1071
+ fprintf(obj_file, "v %f %f %f\n", vertices[i].x,
1072
+ vertices[i].y, vertices[i].z);
1073
+ }
1074
+
1075
+ /* export the face normals */
1076
+ for (i = 0; i < nFaces; i++){
1077
+ /* calculate cross product between v1-v0 and v2-v0 */
1078
+ v1 = vertices[faces[i*3+1]];
1079
+ v2 = vertices[faces[i*3+2]];
1080
+ v1.x -= vertices[faces[i*3]].x;
1081
+ v1.y -= vertices[faces[i*3]].y;
1082
+ v1.z -= vertices[faces[i*3]].z;
1083
+ v2.x -= vertices[faces[i*3]].x;
1084
+ v2.y -= vertices[faces[i*3]].y;
1085
+ v2.z -= vertices[faces[i*3]].z;
1086
+ normal = cross(&v1, &v2);
1087
+
1088
+ /* normalise to unit length */
1089
+ scale = ((CH_FLOAT)1.0)/(ch_sqrt(ch_pow(normal.x, (CH_FLOAT)2.0)+ch_pow(normal.y, (CH_FLOAT)2.0)+ch_pow(normal.z, (CH_FLOAT)2.0))+(CH_FLOAT)2.23e-9);
1090
+ normal.x *= scale;
1091
+ normal.y *= scale;
1092
+ normal.z *= scale;
1093
+ fprintf(obj_file, "vn %f %f %f\n", normal.x, normal.y, normal.z);
1094
+ }
1095
+
1096
+ /* export the face indices */
1097
+ if(keepOnlyUsedVerticesFLAG){
1098
+ for (i = 0; i < nFaces; i++){
1099
+ /* vertices are in same order as the faces, and normals are in order */
1100
+ fprintf(obj_file, "f %u//%u %u//%u %u//%u\n",
1101
+ i*3 + 1, i + 1,
1102
+ i*3+1 + 1, i + 1,
1103
+ i*3+2 + 1, i + 1);
1104
+ }
1105
+ }
1106
+ else {
1107
+ /* just normals are in order */
1108
+ for (i = 0; i < nFaces; i++){
1109
+ fprintf(obj_file, "f %u//%u %u//%u %u//%u\n",
1110
+ faces[i*3] + 1, i + 1,
1111
+ faces[i*3+1] + 1, i + 1,
1112
+ faces[i*3+2] + 1, i + 1);
1113
+ }
1114
+ }
1115
+ fclose(obj_file);
1116
+ }
1117
+
1118
+ inline void convhull_3d_export_m
1119
+ (
1120
+ ch_vertex* const vertices,
1121
+ const int nVert,
1122
+ int* const faces,
1123
+ const int nFaces,
1124
+ char* const m_filename
1125
+ )
1126
+ {
1127
+ int i;
1128
+ char path[256] = { "\0" };
1129
+ memcpy(path, m_filename, strlen(m_filename));
1130
+ FILE* m_file;
1131
+ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
1132
+ CV_STRCAT(path, ".m");
1133
+ fopen_s(&m_file, path, "wt");
1134
+ #else
1135
+ m_file = fopen(strcat(path, ".m"), "wt");
1136
+ #endif
1137
+
1138
+ /* save face indices and vertices for verification in matlab: */
1139
+ fprintf(m_file, "vertices = [\n");
1140
+ for (i = 0; i < nVert; i++)
1141
+ fprintf(m_file, "%f, %f, %f;\n", vertices[i].x, vertices[i].y, vertices[i].z);
1142
+ fprintf(m_file, "];\n\n\n");
1143
+ fprintf(m_file, "faces = [\n");
1144
+ for (i = 0; i < nFaces; i++) {
1145
+ fprintf(m_file, " %u, %u, %u;\n",
1146
+ faces[3*i+0]+1,
1147
+ faces[3*i+1]+1,
1148
+ faces[3*i+2]+1);
1149
+ }
1150
+ fprintf(m_file, "];\n\n\n");
1151
+ fclose(m_file);
1152
+ }
1153
+
1154
+ inline void extract_vertices_from_obj_file
1155
+ (
1156
+ char* const obj_filename,
1157
+ ch_vertex** out_vertices,
1158
+ int* out_nVert)
1159
+ {
1160
+ extract_vertices_from_obj_file_alloc(obj_filename, out_vertices, out_nVert, NULL);
1161
+ }
1162
+
1163
+ inline void extract_vertices_from_obj_file_alloc
1164
+ (
1165
+ char* const obj_filename,
1166
+ ch_vertex** out_vertices,
1167
+ int* out_nVert,
1168
+ void* allocator
1169
+ )
1170
+ {
1171
+ FILE* obj_file;
1172
+ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
1173
+ CV_STRCAT(obj_filename, ".obj");
1174
+ fopen_s(&obj_file, obj_filename, "r");
1175
+ #else
1176
+ obj_file = fopen(strcat(obj_filename, ".obj"), "r");
1177
+ #endif
1178
+
1179
+ /* determine number of vertices */
1180
+ unsigned int nVert = 0;
1181
+ char line[256];
1182
+ while (fgets(line, sizeof(line), obj_file)) {
1183
+ char* vexists = strstr(line, "v ");
1184
+ if(vexists!=NULL)
1185
+ nVert++;
1186
+ }
1187
+ (*out_nVert) = nVert;
1188
+ (*out_vertices) = (ch_vertex*)ch_stateful_malloc(allocator, nVert*sizeof(ch_vertex));
1189
+
1190
+ /* extract the vertices */
1191
+ rewind(obj_file);
1192
+ int i=0;
1193
+ int vertID, prev_char_isDigit, current_char_isDigit;
1194
+ char vert_char[256] = { 0 };
1195
+ while (fgets(line, sizeof(line), obj_file)) {
1196
+ char* vexists = strstr(line, "v ");
1197
+ if(vexists!=NULL){
1198
+ prev_char_isDigit = 0;
1199
+ vertID = -1;
1200
+ for(size_t j=0; j<strlen(line)-1; j++){
1201
+ if(isdigit(line[j])||line[j]=='.'||line[j]=='-'||line[j]=='+'||line[j]=='E'||line[j]=='e'){
1202
+ vert_char[strlen(vert_char)] = line[j];
1203
+ current_char_isDigit = 1;
1204
+ }
1205
+ else
1206
+ current_char_isDigit = 0;
1207
+ if((prev_char_isDigit && !current_char_isDigit) || j ==strlen(line)-2 ){
1208
+ vertID++;
1209
+ if(vertID>4){
1210
+ /* not a valid file */
1211
+ ch_stateful_free(allocator, (*out_vertices));
1212
+ (*out_vertices) = NULL;
1213
+ (*out_nVert) = 0;
1214
+ return;
1215
+ }
1216
+ (*out_vertices)[i].v[vertID] = (CH_FLOAT)atof(vert_char);
1217
+ memset(vert_char, 0, 256 * sizeof(char));
1218
+ }
1219
+ prev_char_isDigit = current_char_isDigit;
1220
+ }
1221
+ i++;
1222
+ }
1223
+ }
1224
+ }
1225
+
1226
+
1227
+
1228
+ /**** NEW! ****/
1229
+
1230
+ /* A C version of the ND quickhull matlab implementation from here:
1231
+ * https://www.mathworks.com/matlabcentral/fileexchange/48509-computational-geometry-toolbox?focused=3851550&tab=example
1232
+ * (*out_faces) is returned as NULL, if triangulation fails *
1233
+ * Original Copyright (c) 2014, George Papazafeiropoulos
1234
+ * Distributed under the BSD (2-clause) license
1235
+ * Reference: "The Quickhull Algorithm for Convex Hull, C. Bradford Barber, David P. Dobkin
1236
+ * and Hannu Huhdanpaa, Geometry Center Technical Report GCG53, July 30, 1993"
1237
+ */
1238
+ inline void convhull_nd_build
1239
+ (
1240
+ CH_FLOAT* const in_vertices,
1241
+ const int nVert,
1242
+ const int d,
1243
+ int** out_faces,
1244
+ CH_FLOAT** out_cf,
1245
+ CH_FLOAT** out_df,
1246
+ int* nOut_faces
1247
+ )
1248
+ {
1249
+ convhull_nd_build_alloc(in_vertices, nVert, d, out_faces, out_cf, out_df, nOut_faces, NULL);
1250
+ }
1251
+
1252
+ inline void convhull_nd_build_alloc
1253
+ (
1254
+ CH_FLOAT* const in_vertices,
1255
+ const int nVert,
1256
+ const int d,
1257
+ int** out_faces,
1258
+ CH_FLOAT** out_cf,
1259
+ CH_FLOAT** out_df,
1260
+ int* nOut_faces,
1261
+ void* allocator
1262
+ )
1263
+ {
1264
+ int i, j, k, l, h;
1265
+ int nFaces, p;
1266
+ int* aVec, *faces;
1267
+ CH_FLOAT dfi, v, max_p, min_p;
1268
+ CH_FLOAT span[CONVHULL_ND_MAX_DIMENSIONS];
1269
+ CH_FLOAT cfi[CONVHULL_ND_MAX_DIMENSIONS];
1270
+ CH_FLOAT p_s[CONVHULL_ND_MAX_DIMENSIONS*CONVHULL_ND_MAX_DIMENSIONS];
1271
+ CH_FLOAT* points, *cf, *df;
1272
+
1273
+ assert(d<=CONVHULL_ND_MAX_DIMENSIONS);
1274
+
1275
+ /* Solution not possible... */
1276
+ if(d>CONVHULL_ND_MAX_DIMENSIONS || nVert<=d || in_vertices==NULL){
1277
+ (*out_faces) = NULL;
1278
+ (*nOut_faces) = 0;
1279
+ if(out_cf!=NULL)
1280
+ (*out_cf) = NULL;
1281
+ if(out_df!=NULL)
1282
+ (*out_df) = NULL;
1283
+ return;
1284
+ }
1285
+
1286
+ /* Add noise to the points */
1287
+ points = (CH_FLOAT*)ch_stateful_malloc(allocator, nVert*(d+1)*sizeof(CH_FLOAT));
1288
+ for(i=0; i<nVert; i++){
1289
+ for(j=0; j<d; j++)
1290
+ points[i*(d+1)+j] = in_vertices[i*d+j] + CH_NOISE_VAL*rnd(i, j);
1291
+ points[i*(d+1)+d] = 1.0; /* add a last column of ones. Used only for determinant calculation */
1292
+ }
1293
+
1294
+ /* Find the span */
1295
+ for(j=0; j<d; j++){
1296
+ max_p = (CH_FLOAT)-2.23e+13; min_p = (CH_FLOAT)2.23e+13;
1297
+ for(i=0; i<nVert; i++){
1298
+ max_p = MAX(max_p, points[i*(d+1)+j]);
1299
+ min_p = MIN(min_p, points[i*(d+1)+j]);
1300
+ }
1301
+ span[j] = max_p - min_p;
1302
+ #ifndef CONVHULL_ALLOW_BUILD_IN_HIGHER_DIM
1303
+ /* If you hit this assertion error, then the input vertices do not span all 'd' dimensions. Therefore the convex hull could be built in less dimensions.
1304
+ * In these cases, consider reducing the dimensionality of the points and calling convhull_nd_build() with a smaller d
1305
+ * You can turn this assert off using CONVHULL_ALLOW_BUILD_IN_HIGHER_DIM if you still wish to build in a higher number of dimensions. */
1306
+ assert(span[j]>0.000000001);
1307
+ #endif
1308
+ }
1309
+
1310
+ /* The initial convex hull is a simplex with (d+1) facets, where d is the number of dimensions */
1311
+ nFaces = (d+1);
1312
+ faces = (int*)ch_stateful_calloc(allocator, nFaces*d, sizeof(int));
1313
+ aVec = (int*)ch_stateful_malloc(allocator, nFaces*sizeof(int));
1314
+ for(i=0; i<nFaces; i++)
1315
+ aVec[i] = i;
1316
+
1317
+ /* Each column of cf contains the coefficients of a plane */
1318
+ cf = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*d*sizeof(CH_FLOAT));
1319
+ df = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*sizeof(CH_FLOAT));
1320
+ for(i=0; i<nFaces; i++){
1321
+ /* Set the indices of the points defining the face */
1322
+ for(j=0, k=0; j<(d+1); j++){
1323
+ if(aVec[j]!=i){
1324
+ faces[i*d+k] = aVec[j];
1325
+ k++;
1326
+ }
1327
+ }
1328
+
1329
+ /* Calculate and store the plane coefficients of the face */
1330
+ for(j=0; j<d; j++)
1331
+ for(k=0; k<d; k++)
1332
+ p_s[j*d+k] = points[(faces[i*d+j])*(d+1) + k];
1333
+
1334
+ /* Calculate and store the plane coefficients of the face */
1335
+ plane_nd(d, p_s, cfi, &dfi);
1336
+ for(j=0; j<d; j++)
1337
+ cf[i*d+j] = cfi[j];
1338
+ df[i] = dfi;
1339
+ }
1340
+ CH_FLOAT A[(CONVHULL_ND_MAX_DIMENSIONS+1)*(CONVHULL_ND_MAX_DIMENSIONS+1)];
1341
+ int fVec[CONVHULL_ND_MAX_DIMENSIONS+1];
1342
+ int face_tmp[2];
1343
+
1344
+ /* Check to make sure that faces are correctly oriented */
1345
+ int bVec[CONVHULL_ND_MAX_DIMENSIONS+1];
1346
+ for(i=0; i<d+1; i++)
1347
+ bVec[i] = i;
1348
+
1349
+ /* A contains the coordinates of the points forming a simplex */
1350
+ memset(A, 0, sizeof(A));
1351
+ for(k=0; k<(d+1); k++){
1352
+ /* Get the point that is not on the current face (point p) */
1353
+ for(i=0; i<d; i++)
1354
+ fVec[i] = faces[k*d+i];
1355
+ sort_int(fVec, d); /* sort ascending */
1356
+ p=k;
1357
+ for(i=0; i<d; i++)
1358
+ for(j=0; j<(d+1); j++)
1359
+ A[i*(d+1)+j] = points[(faces[k*d+i])*(d+1) + j];
1360
+ for(; i<(d+1); i++)
1361
+ for(j=0; j<(d+1); j++)
1362
+ A[i*(d+1)+j] = points[p*(d+1)+j];
1363
+
1364
+ /* det(A) determines the orientation of the face */
1365
+ if(d==3)
1366
+ v = det_4x4(A);
1367
+ else
1368
+ v = det_NxN(A, d+1);
1369
+
1370
+ /* Orient so that each point on the original simplex can't see the opposite face */
1371
+ if(v<0){
1372
+ /* Reverse the order of the last two vertices to change the volume */
1373
+ for(j=0; j<2; j++)
1374
+ face_tmp[j] = faces[k*d+d-j-1];
1375
+ for(j=0; j<2; j++)
1376
+ faces[k*d+d-j-1] = face_tmp[1-j];
1377
+
1378
+ /* Modify the plane coefficients of the properly oriented faces */
1379
+ for(j=0; j<d; j++)
1380
+ cf[k*d+j] = -cf[k*d+j];
1381
+ df[k] = -df[k];
1382
+ for(i=0; i<d; i++)
1383
+ for(j=0; j<(d+1); j++)
1384
+ A[i*(d+1)+j] = points[(faces[k*d+i])*(d+1) + j];
1385
+ for(; i<(d+1); i++)
1386
+ for(j=0; j<(d+1); j++)
1387
+ A[i*(d+1)+j] = points[p*(d+1)+j];
1388
+ }
1389
+ }
1390
+
1391
+ /* Coordinates of the center of the point set */
1392
+ CH_FLOAT meanp[CONVHULL_ND_MAX_DIMENSIONS];
1393
+ CH_FLOAT* reldist, *desReldist, *absdist;
1394
+ memset(meanp, 0, sizeof(meanp));
1395
+ for(i=d+1; i<nVert; i++)
1396
+ for(j=0; j<d; j++)
1397
+ meanp[j] += points[i*(d+1)+j];
1398
+ for(j=0; j<d; j++)
1399
+ meanp[j] = meanp[j]/(CH_FLOAT)(nVert-d-1);
1400
+
1401
+ /* Absolute distance of points from the center */
1402
+ absdist = (CH_FLOAT*)ch_stateful_malloc(allocator, (nVert-d-1)*d * sizeof(CH_FLOAT));
1403
+ for(i=d+1, k=0; i<nVert; i++, k++)
1404
+ for(j=0; j<d; j++)
1405
+ absdist[k*d+j] = (points[i*(d+1)+j] - meanp[j])/span[j];
1406
+
1407
+ /* Relative distance of points from the center */
1408
+ reldist = (CH_FLOAT*)ch_stateful_calloc(allocator, (nVert-d-1), sizeof(CH_FLOAT));
1409
+ desReldist = (CH_FLOAT*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(CH_FLOAT));
1410
+ for(i=0; i<(nVert-d-1); i++)
1411
+ for(j=0; j<d; j++)
1412
+ reldist[i] += ch_pow(absdist[i*d+j], (CH_FLOAT)2.0);
1413
+
1414
+ /* Sort from maximum to minimum relative distance */
1415
+ int num_pleft, cnt;
1416
+ int* ind, *pleft;
1417
+ ind = (int*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(int));
1418
+ pleft = (int*)ch_stateful_malloc(allocator, (nVert-d-1) * sizeof(int));
1419
+ sort_float(reldist, desReldist, ind, (nVert-d-1), 1, allocator);
1420
+
1421
+ /* Initialize the vector of points left. The points with the larger relative
1422
+ distance from the center are scanned first. */
1423
+ num_pleft = (nVert-d-1);
1424
+ for(i=0; i<num_pleft; i++)
1425
+ pleft[i] = ind[i]+d+1;
1426
+
1427
+ /* Loop over all remaining points that are not deleted. Deletion of points
1428
+ occurs every #iter2del# iterations of this while loop */
1429
+ memset(A, 0, sizeof(A));
1430
+
1431
+ /* cnt is equal to the points having been selected without deletion of
1432
+ nonvisible points (i.e. points inside the current convex hull) */
1433
+ cnt=0;
1434
+
1435
+ /* The main loop for the quickhull algorithm */
1436
+ CH_FLOAT detA;
1437
+ CH_FLOAT* points_cf;
1438
+ CH_FLOAT points_s[CONVHULL_ND_MAX_DIMENSIONS];
1439
+ int face_s[CONVHULL_ND_MAX_DIMENSIONS];
1440
+ int gVec[CONVHULL_ND_MAX_DIMENSIONS];
1441
+ int* visible_ind, *visible, *nonvisible_faces, *f0, *u, *horizon, *hVec, *pp, *hVec_mem_face;
1442
+ int num_visible_ind, num_nonvisible_faces, n_newfaces, n_realloc_faces, count, vis;
1443
+ int f0_sum, u_len, start, num_p, index, horizon_size1;
1444
+ int FUCKED;
1445
+ FUCKED = 0;
1446
+ /* These pointers need to be assigned NULL as they only use realloc/resize (which act like malloc on a NULL pointer */
1447
+ visible = nonvisible_faces = f0 = u = horizon = hVec = pp = hVec_mem_face = NULL;
1448
+ nFaces = d+1;
1449
+ visible_ind = (int*)ch_stateful_malloc(allocator, nFaces*sizeof(int));
1450
+ points_cf = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*sizeof(CH_FLOAT));
1451
+ while( (num_pleft>0) ){
1452
+ /* i is the first point of the points left */
1453
+ i = pleft[0];
1454
+
1455
+ /* Delete the point selected */
1456
+ for(j=0; j<num_pleft-1; j++)
1457
+ pleft[j] = pleft[j+1];
1458
+ num_pleft--;
1459
+ if(num_pleft == 0)
1460
+ ch_stateful_free(allocator, pleft);
1461
+ else
1462
+ pleft = (int*)ch_stateful_realloc(allocator, pleft, num_pleft*sizeof(int));
1463
+
1464
+ /* Update point selection counter */
1465
+ cnt++;
1466
+
1467
+ /* find visible faces */
1468
+ for(j=0; j<d; j++)
1469
+ points_s[j] = points[i*(d+1)+j];
1470
+ points_cf = (CH_FLOAT*)ch_stateful_realloc(allocator, points_cf,nFaces*sizeof(CH_FLOAT));
1471
+ visible_ind = (int*)ch_stateful_realloc(allocator, visible_ind, nFaces*sizeof(int));
1472
+ #ifdef CONVHULL_3D_USE_CBLAS
1473
+ #ifdef CONVHULL_3D_USE_SINGLE_PRECISION
1474
+ cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasTrans, 1, nFaces, d, 1.0f,
1475
+ points_s, d,
1476
+ cf, d, 0.0f,
1477
+ points_cf, nFaces);
1478
+ #else
1479
+ cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasTrans, 1, nFaces, d, 1.0,
1480
+ points_s, d,
1481
+ cf, d, 0.0,
1482
+ points_cf, nFaces);
1483
+ #endif
1484
+ #else
1485
+ for (j = 0; j < nFaces; j++) {
1486
+ points_cf[j] = 0;
1487
+ for (k = 0; k < d; k++)
1488
+ points_cf[j] += points_s[k]*cf[j*d+k];
1489
+ }
1490
+ #endif
1491
+ num_visible_ind = 0;
1492
+ for(j=0; j<nFaces; j++){
1493
+ if(points_cf[j] + df[j] > 0.0){
1494
+ num_visible_ind++; /* will sum to 0 if none are visible */
1495
+ visible_ind[j] = 1;
1496
+ }
1497
+ else
1498
+ visible_ind[j] = 0;
1499
+ }
1500
+ num_nonvisible_faces = nFaces - num_visible_ind;
1501
+
1502
+ /* proceed if there are any visible faces */
1503
+ if(num_visible_ind!=0){
1504
+ /* Find visible face indices */
1505
+ visible = (int*)ch_stateful_resize(allocator, visible, num_visible_ind*sizeof(int));
1506
+ for(j=0, k=0; j<nFaces; j++){
1507
+ if(visible_ind[j]==1){
1508
+ visible[k]=j;
1509
+ k++;
1510
+ }
1511
+ }
1512
+
1513
+ /* Find nonvisible faces */
1514
+ nonvisible_faces = (int*)ch_stateful_resize(allocator, nonvisible_faces, num_nonvisible_faces*d*sizeof(int));
1515
+ f0 = (int*)ch_stateful_resize(allocator, f0, num_nonvisible_faces*d*sizeof(int));
1516
+ for(j=0, k=0; j<nFaces; j++){
1517
+ if(visible_ind[j]==0){
1518
+ for(l=0; l<d; l++)
1519
+ nonvisible_faces[k*d+l] = faces[j*d+l];
1520
+ k++;
1521
+ }
1522
+ }
1523
+
1524
+ /* Create horizon (count is the number of the edges of the horizon) */
1525
+ count=0;
1526
+ for(j=0; j<num_visible_ind; j++){
1527
+ /* visible face */
1528
+ vis = visible[j];
1529
+ for(k=0; k<d; k++)
1530
+ face_s[k] = faces[vis*d+k];
1531
+ sort_int(face_s, d);
1532
+ ismember(nonvisible_faces, face_s, f0, num_nonvisible_faces*d, d);
1533
+ u_len = 0;
1534
+
1535
+ /* u are the nonvisible faces connected to the face v, if any */
1536
+ for(k=0; k<num_nonvisible_faces; k++){
1537
+ f0_sum = 0;
1538
+ for(l=0; l<d; l++)
1539
+ f0_sum += f0[k*d + l];
1540
+ if(f0_sum == d-1){
1541
+ u_len++;
1542
+ if(u_len==1)
1543
+ u = (int*)ch_stateful_resize(allocator, u, u_len*sizeof(int));
1544
+ else
1545
+ u = (int*)ch_stateful_realloc(allocator, u, u_len*sizeof(int));
1546
+ u[u_len-1] = k;
1547
+ }
1548
+ }
1549
+ for(k=0; k<u_len; k++){
1550
+ /* The boundary between the visible face v and the k(th) nonvisible face connected to the face v forms part of the horizon */
1551
+ count++;
1552
+ if(count==1)
1553
+ horizon = (int*)ch_stateful_resize(allocator, horizon, count*(d-1)*sizeof(int));
1554
+ else
1555
+ horizon = (int*)ch_stateful_realloc(allocator, horizon, count*(d-1)*sizeof(int));
1556
+ for(l=0; l<d; l++)
1557
+ gVec[l] = nonvisible_faces[u[k]*d+l];
1558
+ for(l=0, h=0; l<d; l++){
1559
+ if(f0[u[k]*d+l]){
1560
+ horizon[(count-1)*(d-1)+h] = gVec[l];
1561
+ h++;
1562
+ }
1563
+ }
1564
+ }
1565
+ }
1566
+ horizon_size1 = count;
1567
+ for(j=0, l=0; j<nFaces; j++){
1568
+ if(!visible_ind[j]){
1569
+ /* Delete visible faces */
1570
+ for(k=0; k<d; k++)
1571
+ faces[l*d+k] = faces[j*d+k];
1572
+
1573
+ /* Delete the corresponding plane coefficients of the faces */
1574
+ for(k=0; k<d; k++)
1575
+ cf[l*d+k] = cf[j*d+k];
1576
+ df[l] = df[j];
1577
+ l++;
1578
+ }
1579
+ }
1580
+
1581
+ /* Update the number of faces */
1582
+ nFaces = nFaces-num_visible_ind;
1583
+
1584
+ /* start is the first row of the new faces */
1585
+ start=nFaces;
1586
+
1587
+ /* Add faces connecting horizon to the new point */
1588
+ n_newfaces = horizon_size1;
1589
+ n_realloc_faces = nFaces + n_newfaces;
1590
+ if (n_realloc_faces > CH_MAX_NUM_FACES)
1591
+ n_realloc_faces = CH_MAX_NUM_FACES+1;
1592
+ faces = (int*)ch_stateful_realloc(allocator, faces, (nFaces+n_newfaces)*d*sizeof(int));
1593
+ cf = (CH_FLOAT*)ch_stateful_realloc(allocator, cf, (nFaces+n_newfaces)*d*sizeof(CH_FLOAT));
1594
+ df = (CH_FLOAT*)ch_stateful_realloc(allocator, df, (nFaces+n_newfaces)*sizeof(CH_FLOAT));
1595
+
1596
+ for(j=0; j<n_newfaces; j++){
1597
+ nFaces++;
1598
+ for(k=0; k<d-1; k++)
1599
+ faces[(nFaces-1)*d+k] = horizon[j*(d-1)+k];
1600
+ faces[(nFaces-1)*d+(d-1)] = i;
1601
+
1602
+ /* Calculate and store appropriately the plane coefficients of the faces */
1603
+ for(k=0; k<d; k++)
1604
+ for(l=0; l<d; l++)
1605
+ p_s[k*d+l] = points[(faces[(nFaces-1)*d+k])*(d+1) + l];
1606
+ plane_nd(d, p_s, cfi, &dfi);
1607
+ for(k=0; k<d; k++)
1608
+ cf[(nFaces-1)*d+k] = cfi[k];
1609
+ df[(nFaces-1)] = dfi;
1610
+ if(nFaces > CH_MAX_NUM_FACES){
1611
+ FUCKED = 1;
1612
+ nFaces = 0;
1613
+ break;
1614
+ }
1615
+ }
1616
+
1617
+ /* Orient each new face properly */
1618
+ hVec = (int*)ch_stateful_resize(allocator, hVec, nFaces*sizeof(int));
1619
+ hVec_mem_face = (int*)ch_stateful_resize(allocator, hVec_mem_face, nFaces*sizeof(int));
1620
+ for(j=0; j<nFaces; j++)
1621
+ hVec[j] = j;
1622
+ for(k=start; k<nFaces; k++){
1623
+ for(j=0; j<d; j++)
1624
+ face_s[j] = faces[k*d+j];
1625
+ sort_int(face_s, d);
1626
+ ismember(hVec, face_s, hVec_mem_face, nFaces, d);
1627
+ num_p = 0;
1628
+ for(j=0; j<nFaces; j++)
1629
+ if(!hVec_mem_face[j])
1630
+ num_p++;
1631
+ pp = (int*)ch_stateful_resize(allocator, pp, num_p*sizeof(int));
1632
+ for(j=0, l=0; j<nFaces; j++){
1633
+ if(!hVec_mem_face[j]){
1634
+ pp[l] = hVec[j];
1635
+ l++;
1636
+ }
1637
+ }
1638
+ index = 0;
1639
+ detA = 0.0;
1640
+
1641
+ /* While new point is coplanar, choose another point */
1642
+ while(detA==0.0){
1643
+ for(j=0;j<d; j++)
1644
+ for(l=0; l<d+1; l++)
1645
+ A[j*(d+1)+l] = points[(faces[k*d+j])*(d+1) + l];
1646
+ for(; j<d+1; j++)
1647
+ for(l=0; l<d+1; l++)
1648
+ A[j*(d+1)+l] = points[pp[index]*(d+1)+l];
1649
+ index++;
1650
+ if(d==3)
1651
+ detA = det_4x4(A);
1652
+ else
1653
+ detA = det_NxN((CH_FLOAT*)A, d+1);
1654
+ }
1655
+
1656
+ /* Orient faces so that each point on the original simplex can't see the opposite face */
1657
+ if (detA<0.0){
1658
+ /* If orientation is improper, reverse the order to change the volume sign */
1659
+ for(j=0; j<2; j++)
1660
+ face_tmp[j] = faces[k*d+d-j-1];
1661
+ for(j=0; j<2; j++)
1662
+ faces[k*d+d-j-1] = face_tmp[1-j];
1663
+
1664
+ /* Modify the plane coefficients of the properly oriented faces */
1665
+ for(j=0; j<d; j++)
1666
+ cf[k*d+j] = -cf[k*d+j];
1667
+ df[k] = -df[k];
1668
+ for(l=0; l<d; l++)
1669
+ for(j=0; j<d+1; j++)
1670
+ A[l*(d+1)+j] = points[(faces[k*d+l])*(d+1) + j];
1671
+ for(; l<d+1; l++)
1672
+ for(j=0; j<d+1; j++)
1673
+ A[l*(d+1)+j] = points[pp[index]*(d+1)+j];
1674
+ #ifndef NDEBUG
1675
+ /* Check */
1676
+ if(d==3)
1677
+ detA = det_4x4(A);
1678
+ else
1679
+ detA = det_NxN((CH_FLOAT*)A, d+1);
1680
+ /* If you hit this assertion error, then the face cannot be properly orientated and building the convex hull is likely impossible */
1681
+ assert(detA>0.0);
1682
+ #endif
1683
+ }
1684
+ }
1685
+ }
1686
+ if(FUCKED){
1687
+ break;
1688
+ }
1689
+ }
1690
+
1691
+ /* output */
1692
+ if(FUCKED){
1693
+ (*out_faces) = NULL;
1694
+ if(out_cf!=NULL)
1695
+ (*out_cf) = NULL;
1696
+ if(out_df!=NULL)
1697
+ (*out_df) = NULL;
1698
+ (*nOut_faces) = 0;
1699
+ }
1700
+ else{
1701
+ (*out_faces) = (int*)ch_stateful_malloc(allocator, nFaces*d*sizeof(int));
1702
+ memcpy((*out_faces),faces, nFaces*d*sizeof(int));
1703
+ (*nOut_faces) = nFaces;
1704
+ if(out_cf!=NULL){
1705
+ (*out_cf) = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*d*sizeof(CH_FLOAT));
1706
+ memcpy((*out_cf), cf, nFaces*d*sizeof(CH_FLOAT));
1707
+ }
1708
+ if(out_df!=NULL){
1709
+ (*out_df) = (CH_FLOAT*)ch_stateful_malloc(allocator, nFaces*sizeof(CH_FLOAT));
1710
+ memcpy((*out_df), df, nFaces*sizeof(CH_FLOAT));
1711
+ }
1712
+ }
1713
+
1714
+ /* clean-up */
1715
+ ch_stateful_free(allocator, u);
1716
+ ch_stateful_free(allocator, pp);
1717
+ ch_stateful_free(allocator, horizon);
1718
+ ch_stateful_free(allocator, f0);
1719
+ ch_stateful_free(allocator, nonvisible_faces);
1720
+ ch_stateful_free(allocator, visible);
1721
+ ch_stateful_free(allocator, hVec);
1722
+ ch_stateful_free(allocator, hVec_mem_face);
1723
+ ch_stateful_free(allocator, visible_ind);
1724
+ ch_stateful_free(allocator, points_cf);
1725
+ ch_stateful_free(allocator, absdist);
1726
+ ch_stateful_free(allocator, reldist);
1727
+ ch_stateful_free(allocator, desReldist);
1728
+ ch_stateful_free(allocator, ind);
1729
+ ch_stateful_free(allocator, points);
1730
+ ch_stateful_free(allocator, faces);
1731
+ ch_stateful_free(allocator, aVec);
1732
+ ch_stateful_free(allocator, cf);
1733
+ ch_stateful_free(allocator, df);
1734
+ }
1735
+
1736
+ inline void delaunay_nd_mesh
1737
+ (
1738
+ const float* points,
1739
+ const int nPoints,
1740
+ const int nd,
1741
+ int** Mesh,
1742
+ int* nMesh
1743
+ )
1744
+ {
1745
+ delaunay_nd_mesh_alloc(points, nPoints, nd, Mesh, nMesh, NULL);
1746
+ }
1747
+
1748
+ inline void delaunay_nd_mesh_alloc
1749
+ (
1750
+ const float* points,
1751
+ const int nPoints,
1752
+ const int nd,
1753
+ int** Mesh,
1754
+ int* nMesh,
1755
+ void* allocator
1756
+ )
1757
+ {
1758
+ int i, j, k, nHullFaces, maxW_idx, nVisible;
1759
+ int* hullfaces;
1760
+ CH_FLOAT w0, w_optimal, w_optimal2;
1761
+ CH_FLOAT* projpoints, *cf, *df, *p0, *p, *visible;
1762
+
1763
+ /* Project the N-dimensional points onto a N+1-dimensional paraboloid */
1764
+ projpoints = (CH_FLOAT*)ch_stateful_malloc(allocator, nPoints*(nd+1)*sizeof(CH_FLOAT));
1765
+ for(i = 0; i < nPoints; i++) {
1766
+ projpoints[i*(nd+1)+nd] = 0.0;
1767
+ for(j=0; j<nd; j++){
1768
+ projpoints[i*(nd+1)+j] = (CH_FLOAT)(points[i*nd+j] + 0.0000001*rnd(i, j));
1769
+ projpoints[i*(nd+1)+nd] += (projpoints[i*(nd+1)+j]*projpoints[i*(nd+1)+j]); /* w vector */
1770
+ }
1771
+ }
1772
+
1773
+ /* The N-dimensional delaunay triangulation requires first computing the convex hull of this N+1-dimensional paraboloid */
1774
+ hullfaces = NULL;
1775
+ cf = df = NULL;
1776
+ convhull_nd_build(projpoints, nPoints, nd+1, &hullfaces, &cf, &df, &nHullFaces);
1777
+
1778
+ /* Solution not possible... */
1779
+ if(nd>CONVHULL_ND_MAX_DIMENSIONS || !hullfaces || !nHullFaces){
1780
+ (*Mesh) = NULL;
1781
+ (*nMesh) = 0;
1782
+ ch_stateful_free(allocator, projpoints);
1783
+ return;
1784
+ }
1785
+
1786
+ /* Find the coordinates of the point with the maximum (N+1 dimension) coordinate (i.e. the w vector) */
1787
+ #ifdef CONVHULL_3D_USE_CBLAS
1788
+ if(sizeof(CH_FLOAT)==sizeof(double))
1789
+ maxW_idx = (int)cblas_idamax(nPoints, (double*)&projpoints[nd], nd+1);
1790
+ else
1791
+ maxW_idx = (int)cblas_isamax(nPoints, (float*)&projpoints[nd], nd+1);
1792
+ #else
1793
+ CH_FLOAT maxVal;
1794
+ maxVal = (CH_FLOAT)-2.23e13;
1795
+ maxW_idx = -1;
1796
+ for(i=0; i<nPoints; i++){
1797
+ if(projpoints[i*(nd+1)+nd]>maxVal){
1798
+ maxVal = projpoints[i*(nd+1)+nd];
1799
+ maxW_idx = i;
1800
+ }
1801
+ }
1802
+ assert(maxW_idx!=-1);
1803
+ #endif
1804
+ w0 = projpoints[maxW_idx*(nd+1)+nd];
1805
+ p0 = (CH_FLOAT*)ch_stateful_malloc(allocator, nd*sizeof(CH_FLOAT));
1806
+ for(j=0; j<nd; j++)
1807
+ p0[j] = projpoints[maxW_idx*(nd+1)+j];
1808
+
1809
+ /* Find the point where the plane tangent to the point (p0,w0) on the paraboloid crosses the w axis.
1810
+ * This is the point that can see the entire lower hull. */
1811
+ w_optimal = 0.0;
1812
+ for(j=0; j<nd; j++)
1813
+ w_optimal += ((CH_FLOAT)2.0*ch_pow(p0[j], (CH_FLOAT)2.0));
1814
+ w_optimal = w0-w_optimal;
1815
+
1816
+ /* Subtract 1000 times the absolute value of w_optimal to ensure that the point where the tangent plane
1817
+ * crosses the w axis will see all points on the lower hull. This avoids numerical roundoff errors. */
1818
+ w_optimal2= (CH_FLOAT)(w_optimal-1000.0*fabs(w_optimal));
1819
+
1820
+ /* Set the point where the tangent plane crosses the w axis */
1821
+ p = (CH_FLOAT*)ch_stateful_calloc(allocator, (nd+1),sizeof(CH_FLOAT));
1822
+ p[nd] = w_optimal2;
1823
+
1824
+ /* Find all faces that are visible from this point */
1825
+ visible = (CH_FLOAT*)ch_stateful_malloc(allocator, nHullFaces*sizeof(CH_FLOAT));
1826
+ #ifdef CONVHULL_3D_USE_CBLAS
1827
+ if(sizeof(CH_FLOAT)==sizeof(double)){
1828
+ cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, nHullFaces, 1, nd+1, 1.0,
1829
+ (double*)cf, nd+1,
1830
+ (double*)p, 1, 0.0,
1831
+ (double*)visible, 1);
1832
+ }
1833
+ else{
1834
+ cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, nHullFaces, 1, nd+1, 1.0f,
1835
+ (float*)cf, nd+1,
1836
+ (float*)p, 1, 0.0f,
1837
+ (float*)visible, 1);
1838
+ }
1839
+ #else
1840
+ for(i=0; i<nHullFaces; i++){
1841
+ visible[i] = 0.0;
1842
+ for(j=0; j<nd+1; j++)
1843
+ visible[i] += cf[i*(nd+1)+j] * p[j];
1844
+ }
1845
+ #endif
1846
+ nVisible = 0;
1847
+ for(j=0; j<nHullFaces; j++){
1848
+ visible[j] += df[j];
1849
+ if(visible[j]>0.0)
1850
+ nVisible++;
1851
+ }
1852
+
1853
+ /* Output */
1854
+ (*nMesh) = nVisible;
1855
+ if(nVisible>0){
1856
+ (*Mesh) = (int*)ch_stateful_malloc(allocator, nVisible*(nd+1)*sizeof(int));
1857
+ for(i=0, j=0; i<nHullFaces; i++){
1858
+ if(visible[i]>0.0){
1859
+ for(k=0; k<nd+1; k++)
1860
+ (*Mesh)[j*(nd+1)+k] = hullfaces[i*(nd+1)+k];
1861
+ j++;
1862
+ }
1863
+ }
1864
+ assert(j==nVisible);
1865
+ }
1866
+
1867
+ /* clean up */
1868
+ ch_stateful_free(allocator, projpoints);
1869
+ ch_stateful_free(allocator, hullfaces);
1870
+ ch_stateful_free(allocator, cf);
1871
+ ch_stateful_free(allocator, df);
1872
+ ch_stateful_free(allocator, p0);
1873
+ ch_stateful_free(allocator, p);
1874
+ ch_stateful_free(allocator, visible);
1875
+ }
1876
+
1877
+
1878
+ #endif /* CONVHULL_3D_ENABLE */