Cadwork Math Utilities
Project description
Cadwork Math Utilities
This is the Cadwork Math Utilities library in Python.
Installation
Install with pip:
pip install cwmath
Contributing
Contributions are always welcome! Before contributing, please check our contributing agreement.
Roadmap
- Guides
- Examples
- API Documentation
Authors
License
Style Guide
Please follow the style guide below when adding functions. Guidelines
# 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
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cwmath-0.0.8.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file cwmath-0.0.8.tar.gz
.
File metadata
- Download URL: cwmath-0.0.8.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96c3633efaf478f578569b2992aca9b5295d38f428126e061fcfdd0f7838a583 |
|
MD5 | 8e0d8490a71ebd0adf7e4426846eea8a |
|
BLAKE2b-256 | fe1f33e64352e54a05f86243ba57f6dc3b2a1b5c14c91755e8d4cde21eeec993 |
File details
Details for the file cwmath-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: cwmath-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 113300ef5cd65597daafe66ad0900e85dea6cc989b57258e40db0c913e2ee071 |
|
MD5 | 1a51a9988d2d9701f130d22227b193ec |
|
BLAKE2b-256 | dd268a8410315a0b0f7c0669e4057b7dfb3c9a5d061863ad0e6be3203d4e6bee |