GithubHelp home page GithubHelp logo

cwmath's Introduction

Cadwork Math Utilities

Logo

PyPI PyPI - Python Version RTD Issues Pulls GitHub

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

MIT

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)

cwmath's People

Contributors

brunner246 avatar jspaquet avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.