File: test_615_rytz_axis.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (22 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import pytest
from ezdxf.math import rytz_axis_construction, Vec3


def test_exception():
    with pytest.raises(ArithmeticError):
        # orthogonal axis
        rytz_axis_construction(Vec3(5, 0, 0), Vec3(0, 3, 0))
    with pytest.raises(ArithmeticError):
        # colinear axis
        rytz_axis_construction(Vec3(5, 0, 0), Vec3(4, 0, 0))


def test_simple_case():
    a, b, ratio = rytz_axis_construction(Vec3(3, 0, 0), Vec3(-2, 2, 0))
    assert ratio < 1


if __name__ == "__main__":
    pytest.main([__file__])