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

project point to line

Created by: Durman

We have a line that consists with many edges and we have one or several points. The goal is to find find closest to given point (or points) point lying on the line. I made small algorithm that can reach this goal.

The algorithm can be divided on two parts. First part consist from finding closest point of the line to given point. I used KDTree from mathutils but faced with next problem.

problem1

Unexpected solution of this problem was to subdivide the line to smaller edges. I expect that this approach can gives wrong result time to times but it should work in most cases.

problem2

By default subdivision is equal to smallest edge in the line but also I made parameter that don't let to default subdivision have too small value.

Second part of the algorithm to find projection given point to edges that coinciding with found point on the line. For this task there are all that we need in mathutils. Product vector to vector and scalar multiplication of vectors. The scalar multiplication gives as a sign that says projected vector has same direction or not with another vector.

projection_vector

And final result.

final

Ответственный
Назначить
Оценка трудозатрат