• S sverchok
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 148
    • Задачи 148
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 21
    • Запросы на слияние 21
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • nikitronn
  • sverchok
  • Запросы на слияние
  • !3332

"Track normal" mode for "Extrude curve along curve" node.

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты nikitronn запросил слияние normal_track в master Июн 08, 2020
  • Обзор 1
  • Коммиты 2
  • Конвейеры 0
  • Изменения 4

Created by: portnov

From #3306 (closed).

To "rotate matrix according to curve's tangent", we have the following approaches:

a) historically (in Sverchok) the first: use Householder, Tracking or Rotation Difference algorithm. These algorithms take two vectors: initial tangent direction and tangent direction you want, and return a rotation matrix that converts the source tangent direction to the target. Note: these algorithms do not know at all what the "curve" is. They depend on tangent direction only.

b) Frenet and "zero-twist" algorithms. Frenet algorithm takes Frenet matrix of the curve, made from tangent direction, normal and binormal directions of the curve. "Zero-twist" is similar, it takes Frenet matrices first, and then it "substracts" rotation around the tangent, which is calculated by integrating curve torsion. These algorithms are not "curve-agnostic", they are based on differential geometry, so for "good" curves they give better results. "Good" means curve with non-zero curvature, i.e. curve which has non-zero second derivative in all points. If the curve has points with zero curvature, or, even worse, it has straight segments, then everything is suddenly very bad.

c) New algorithm. First, let's split curve in N pieces and calculate tangent vectors at these points ("knots"). Then we take curve's normal vector at curve's starting point (let's assume that at least at this point the curve has non-zero curvature). Then we iterate through all knots. At each knot, we build a plane through the knot point, orthogonal to curve's tangent vector at this knot point; and we project normal vector from previous point to this plane. So we have N normal vectors. Then for any value of T in curve's domain, we can calculate normal vector by interpolating normals between knot points somehow. In the following script, quaternions linear interpolation is used.

For compassion, "Tracking" algorithm, which for this particular curve gives the best result among all implemented algorithms:

Screenshot_20200608_012849

Note the twisting at the left side.

New algorithm: Screenshot_20200608_010829

Another example:

Screenshot_20200608_222636

Preflight checklist

Put an x letter in each brackets when you're done this item:

  • Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • Manual testing done.
  • Unit-tests implemented.
  • Ready for merge.
Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: normal_track