Коммит c19385d4 создал по автору Ilya Portnov's avatar Ilya Portnov
Просмотр файлов

Add testcases for geometry utilities.

владелец 1068425a
import unittest
from mathutils import Vector
from sverchok.utils.logging import error
from sverchok.utils.testing import *
from sverchok.utils.geom import *
class GeometryTests(SverchokTestCase):
def test_center_trivial(self):
input = [(0, 0, 0)]
output = center(input)
expected_output = input[0]
self.assertEquals(output, expected_output)
def test_center_quad(self):
inputs = [(-1, 0, 0), (0, -1, 0), (0, 1, 0), (1, 0, 0)]
output = center(inputs)
expected_output = (0, 0, 0)
self.assertEquals(output, expected_output)
def test_normal_quad(self):
inputs = [(-1, 0, 0), (0, -1, 0), (1, 0, 0), (0, 1, 0)]
output = calc_normal(inputs)
expected_output = Vector((0, 0, 1))
self.assertEquals(output, expected_output)
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать