{ "info": { "author": "Mike Malinowski", "author_email": "mike@twisted.space", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# Overview\nSpatial is a module which contains a series of spatially relevent helper\nfunctionality and classes. \n\n## Bounds\nA Bounding Box allows you\nto calculate the overall bounds of a point cloud - but does not store\nthe point cloud itself, it simply expands to match the outer most limits\nof the point cloud data.\n\nThere are three Bounding Box classes:\n\n__Bounds__: This is an N-Dimensional bounding box, allowing your points to\nbe of any dimensional length. This is useful if working in one dimension\nor in a dimensional space greater than three dimensions.\n\n__Bounds2D__: This inherits from Bounds - so gives all the same funcitonaltiy\nexcept it has some convenience functions with an assumption of width\nand height.\n\n__Bounds3D__: Much like Bounds2D, Bounds3D is a Bounds object which exposes\nfunctionality with the assumption of Width, Height and Depth.\n\nIn this example we create two three dimensional bounding boxes\nand test wether they intersect\n\n```python\nimport spatial\n\n# -- Test bound intersections\npoints_a = [\n [0, 0, 0],\n [1, 1, 1],\n]\n\npoints_b = [\n [5, 5, -5],\n [3, 3, 3],\n]\n\nbounds_a = spatial.Bounds3D(points_a)\nbounds_b = spatial.Bounds3D(points_b)\n\nprint('Does bounds A intersect with bounds B : %s' % ('Yes' if bounds_b.intersects(bounds_a) else 'No'))\n```\n\n\nIn the following example we create a bounding box and test whether\nthe given point is inside the bounds:\n\n```python\nimport spatial\n\nbounds = spatial.Bounds2D()\n\n# -- Create a point cloud\npoints = [\n [-2, -2],\n [2, 2],\n]\n\n# -- Add all our points\nbounds.add_points(points)\n\n# -- Test whether a point is inside the bounds\noutside_point = [3, 5]\nprint('Bound contains %s : %s' % (outside_point, bounds.contains(outside_point)))\n\n# -- Same test giving a point inside the bounds\ninside_point = [1, 1]\nprint('Bound contains %s : %s' % (inside_point, bounds.contains(inside_point)))\n```\n\n# Vector\n\nThis class represents a vector which exposes the typically used\nmethods of a 3d vector such as cross and dot products as well as \nlength/magnitude.\n \n```python\nimport spatial\n\n# -- Create two vectors\nv1 = spatial.Vector3(1.0, 0.0, 0.0)\nv2 = spatial.Vector3(0.0, 1.0, 0.0)\n\n# -- Calculate the angle between the two vectors\nv1.angle(v2)\n```\n\nThe Vector supports basic in-place operations such as \nAdd, Subtract, Multiply and Divide.\n \n```python\nimport spatial\n\n# -- Create two vectors\nv1 = spatial.Vector3(1.0, 2.0, 3.0)\nv2 = spatial.Vector3(1.0, 2.0, 3.0)\n\n# -- Add the two vectors\nprint(v1 + v2)\n\n# -- Subtract the two vectors\nprint(v1 - v2)\n\n# -- Multiply the two vectors\nprint(v1 * v2)\n\n# -- Divide the two vectos\nprint(v1 / v2)\n``` \n\nGives:\n \n Vector3(2.0, 4.0, 6.0)\n Vector3(0.0, 0.0, 0.0)\n Vector3(1.0, 4.0, 9.0)\n Vector3(1.0, 1.0, 1.0)\n\n## Credits & Collaboration\n\n\nI am always open to collaboration, so if you spot bugs lets me know, or if\nyou would like to contribute or get involved just shout!\n\n\n## Compatibility\n\nLaunchpad has been tested under Python 2.7 and Python 3.7 on Windows and Ubuntu.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mikemalinowski/spatial", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "spatial", "package_url": "https://pypi.org/project/spatial/", "platform": "", "project_url": "https://pypi.org/project/spatial/", "project_urls": { "Homepage": "https://github.com/mikemalinowski/spatial" }, "release_url": "https://pypi.org/project/spatial/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "A small pure python library for spatial queries, functions and classes", "version": "0.2.0" }, "last_serial": 5110904, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5fe8f2dabe1553c30fea8d7bf13e7d35", "sha256": "d7df481a57dc1a62dbf2da71bc4403cd544e2005943a5a2f008b136af677f4c6" }, "downloads": -1, "filename": "spatial-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5fe8f2dabe1553c30fea8d7bf13e7d35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1020, "upload_time": "2019-04-05T16:28:43", "url": "https://files.pythonhosted.org/packages/c4/80/2e31436414cd61db5fca87648ad4371dc7edc2e4723bf50ce10d0ccf4b04/spatial-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "35752c2cac6b06f7082c33799c784400", "sha256": "16bcebd62d37e2ab046441f1faa46377ed112a24d9592b8afbca8b9fa2ad962e" }, "downloads": -1, "filename": "spatial-0.1.0.tar.gz", "has_sig": false, "md5_digest": "35752c2cac6b06f7082c33799c784400", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4926, "upload_time": "2019-04-05T21:47:23", "url": "https://files.pythonhosted.org/packages/45/38/68aae232868f77d7b4b8ae8b919174c18957d4580dfa5062ef5e31d9ca4d/spatial-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "cd9d131963bb3270237b6c6433542d71", "sha256": "003ae30a82d2d6792be3e9c438cf7bd04589bfa891db0f52197b89565bb604d0" }, "downloads": -1, "filename": "spatial-0.2.0.tar.gz", "has_sig": false, "md5_digest": "cd9d131963bb3270237b6c6433542d71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7891, "upload_time": "2019-04-07T20:27:18", "url": "https://files.pythonhosted.org/packages/61/bf/dc03c27e88fa6ad3f6726914ac749ef5516d29adee6adfcc94cf5c07db14/spatial-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cd9d131963bb3270237b6c6433542d71", "sha256": "003ae30a82d2d6792be3e9c438cf7bd04589bfa891db0f52197b89565bb604d0" }, "downloads": -1, "filename": "spatial-0.2.0.tar.gz", "has_sig": false, "md5_digest": "cd9d131963bb3270237b6c6433542d71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7891, "upload_time": "2019-04-07T20:27:18", "url": "https://files.pythonhosted.org/packages/61/bf/dc03c27e88fa6ad3f6726914ac749ef5516d29adee6adfcc94cf5c07db14/spatial-0.2.0.tar.gz" } ] }