Skip to content

Commit d1dfad1

Browse files
authored
Merge pull request #78 from KVSlab/hotfix-prepare-output-surface
Hotfix for prepare_output_surface
2 parents def4a82 + 48bae90 commit d1dfad1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.circleci/config.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ workflows:
77
jobs:
88
install-and-test:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.10.6
1111
working_directory: ~/repo
1212
steps:
1313
- checkout
@@ -23,14 +23,15 @@ jobs:
2323
# Export path
2424
export PATH="$HOME/miniconda/bin:$PATH"
2525
hash -r
26-
26+
2727
# Set conda parameters
2828
conda config --set always_yes yes --set changeps1 no
2929
conda config --add channels conda-forge
3030
conda config --set channel_priority strict
31-
31+
3232
# Set up environment
33-
conda create -n morphman morphman
33+
conda install mamba
34+
mamba create -n morphman morphman
3435
3536
# Activate environment
3637
source activate morphman

morphman/common/surface_operations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ def prepare_output_surface(surface, original_surface, new_centerline, output_fil
503503
# Get relevant points
504504
tmp_points = points[region_id == i]
505505

506-
# Get normal
506+
# Get slightly downscaled normal
507507
tmp_normal = np.cross(tmp_points[0] - tmp_points[-1],
508508
tmp_points[0] - tmp_points[tmp_points.shape[0] // 2])
509-
normal = tmp_normal / np.sqrt(np.sum(tmp_normal ** 2))
509+
normal = tmp_normal / np.sqrt(np.sum(tmp_normal ** 2) * 1.02)
510510

511511
# Get Center
512512
center = np.mean(tmp_points, axis=0)
@@ -532,7 +532,7 @@ def prepare_output_surface(surface, original_surface, new_centerline, output_fil
532532
in_dir = np.array(line.GetPoint(line.GetNumberOfPoints() - 5)) - \
533533
np.array(line.GetPoint(line.GetNumberOfPoints() - 1))
534534

535-
in_dir = in_dir / np.sqrt(np.sum(in_dir ** 2))
535+
in_dir = in_dir / np.sqrt(np.sum(in_dir ** 2) * 1.02)
536536
angle = np.arccos(np.dot(in_dir, normal)) * 180 / np.pi
537537
normal = -normal if 90 < angle < 270 else normal
538538

0 commit comments

Comments
 (0)