Name | cwmath JSON |
Version |
0.0.9
JSON |
| download |
home_page | |
Summary | Cadwork Math Utilities |
upload_time | 2024-03-13 18:07:14 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2024 Cadwork Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
cadwork
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Cadwork Math Utilities

[](https://pypi.python.org/pypi/cwmath/)
[](https://pypi.python.org/pypi/cwmath/)
[](https://docs.cadwork.com/projects/cwmath/en/latest/)
[](https://github.com/cwapi3d/cwmath/issues)
[](https://github.com/cwapi3d/cwmath/pulls)
[](https://choosealicense.com/licenses/mit/)
This is the Cadwork Math Utilities library in Python.
## Installation
Install with pip:
```bash
pip install cwmath
```
## Contributing
Contributions are always welcome!
Before contributing, please check our [contributing agreement](CONTRIBUTING.md).
## Roadmap
- Guides
- Examples
- API Documentation
## Authors
- [@jspaquet](https://github.com/jspaquet)
- [@Brunner246](https://github.com/Brunner246)
## License
[MIT](https://choosealicense.com/licenses/mit/)
# Style Guide
Please follow the style guide below when adding functions.
[Guidelines](GUIDELINES.md)
```python
# imports:
import math
import sys
from myclass import MyClass
# example function
def add_one(number: int) -> int:
"""Increase number by one.
Function written by John Doe.
Args:
number: a number
Returns:
number increased by one
"""
return number + 1
# Aligned with opening delimiter.
foo = long_function_name(var_one, var_two,
var_three, var_four)
if foo == 'blah':
do_blah_thing()
do_one()
do_two()
do_three()
```
# Examples
```python
import cadwork
import element_controller as ec
import geometry_controller as gc
import sys
sys.path.append("...\\...\cwmath\\src")
from cwmath import cwplane3d
from cwmath import cwvector3d
element_ids = ec.get_active_identifiable_element_ids()
if len(element_ids) > 0:
point1 = gc.get_p1(*element_ids)
point2 = gc.get_p2(*element_ids)
yl = gc.get_yl(*element_ids)
plane = cwplane3d.CwPlane3d(point1,yl)
print(point1)
print(yl)
print(plane)
distance = plane.distance_to_point(cadwork.point_3d(0.,0.,0.))
print(distance)
vector1 = cwvector3d.CwVector3d.from_point_3d(point1)
vector2 = cwvector3d.CwVector3d.from_point_3d(point2)
norm =(vector2 - vector1).normalize()
print(norm)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "cwmath",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "cadwork",
"author": "",
"author_email": "Cadwork <it@cadwork.ca>",
"download_url": "https://files.pythonhosted.org/packages/33/93/a7bef5fcf47ccb76a3e96de5f0b17652e6ee2612b64d51f4dfb631d5888a/cwmath-0.0.9.tar.gz",
"platform": null,
"description": "# Cadwork Math Utilities\n\n\n\n[](https://pypi.python.org/pypi/cwmath/)\n[](https://pypi.python.org/pypi/cwmath/)\n[](https://docs.cadwork.com/projects/cwmath/en/latest/)\n[](https://github.com/cwapi3d/cwmath/issues)\n[](https://github.com/cwapi3d/cwmath/pulls)\n[](https://choosealicense.com/licenses/mit/)\n\nThis is the Cadwork Math Utilities library in Python.\n\n## Installation\n\nInstall with pip:\n\n```bash\n pip install cwmath\n```\n \n## Contributing\n\nContributions are always welcome!\nBefore contributing, please check our [contributing agreement](CONTRIBUTING.md).\n \n## Roadmap\n\n- Guides\n- Examples\n- API Documentation\n \n## Authors\n\n- [@jspaquet](https://github.com/jspaquet)\n- [@Brunner246](https://github.com/Brunner246)\n \n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n# Style Guide\n\nPlease follow the style guide below when adding functions.\n[Guidelines](GUIDELINES.md)\n\n```python\n\n# imports:\nimport math\nimport sys\nfrom myclass import MyClass\n\n\n# example function\ndef add_one(number: int) -> int:\n \"\"\"Increase number by one.\n \n Function written by John Doe.\n\n Args:\n number: a number\n\n Returns:\n number increased by one\n \"\"\"\n return number + 1\n\n\n# Aligned with opening delimiter.\nfoo = long_function_name(var_one, var_two,\n var_three, var_four)\n\nif foo == 'blah':\n do_blah_thing()\ndo_one()\ndo_two()\ndo_three()\n\n```\n\n# Examples\n```python\nimport cadwork\nimport element_controller as ec\nimport geometry_controller as gc\n\nimport sys\n\nsys.path.append(\"...\\\\...\\cwmath\\\\src\")\n\nfrom cwmath import cwplane3d\nfrom cwmath import cwvector3d\n\nelement_ids = ec.get_active_identifiable_element_ids()\nif len(element_ids) > 0:\n point1 = gc.get_p1(*element_ids)\n point2 = gc.get_p2(*element_ids)\n yl = gc.get_yl(*element_ids)\n plane = cwplane3d.CwPlane3d(point1,yl)\n print(point1)\n print(yl)\n print(plane)\n\n distance = plane.distance_to_point(cadwork.point_3d(0.,0.,0.))\n print(distance)\n\n vector1 = cwvector3d.CwVector3d.from_point_3d(point1)\n vector2 = cwvector3d.CwVector3d.from_point_3d(point2)\n norm =(vector2 - vector1).normalize()\n print(norm)\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Cadwork Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Cadwork Math Utilities",
"version": "0.0.9",
"project_urls": {
"Homepage": "https://github.com/cwapi3d/cwmath"
},
"split_keywords": [
"cadwork"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3babd36a3232391d324bfe4ce72c1463867851be95c177e3989d89574c6f95e0",
"md5": "0313d32b40d2eb93e55179ece4b44bad",
"sha256": "214bc57c87d08e3e8ddc1f575d9f260fc3bad388d69c737320021f003054b776"
},
"downloads": -1,
"filename": "cwmath-0.0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0313d32b40d2eb93e55179ece4b44bad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6667,
"upload_time": "2024-03-13T18:07:13",
"upload_time_iso_8601": "2024-03-13T18:07:13.018648Z",
"url": "https://files.pythonhosted.org/packages/3b/ab/d36a3232391d324bfe4ce72c1463867851be95c177e3989d89574c6f95e0/cwmath-0.0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3393a7bef5fcf47ccb76a3e96de5f0b17652e6ee2612b64d51f4dfb631d5888a",
"md5": "458eaacb845fa69719072f8ba0a7f232",
"sha256": "a442621ae284343ea25cfeff06dd25efcc155bc17ffbc73da8064661b33ec840"
},
"downloads": -1,
"filename": "cwmath-0.0.9.tar.gz",
"has_sig": false,
"md5_digest": "458eaacb845fa69719072f8ba0a7f232",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 6934,
"upload_time": "2024-03-13T18:07:14",
"upload_time_iso_8601": "2024-03-13T18:07:14.619321Z",
"url": "https://files.pythonhosted.org/packages/33/93/a7bef5fcf47ccb76a3e96de5f0b17652e6ee2612b64d51f4dfb631d5888a/cwmath-0.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-13 18:07:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cwapi3d",
"github_project": "cwmath",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "cwmath"
}