Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonathan Lambrechts
seamsh
Commits
5609c3d0
Commit
5609c3d0
authored
Oct 21, 2021
by
Jonathan Lambrechts
Browse files
fix unique points connecting several lines
parent
e154363c
Pipeline
#9880
failed with stages
in 4 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
seamsh/field.py
View file @
5609c3d0
...
...
@@ -116,4 +116,6 @@ class Raster:
det
=
gm
[
5
]
*
gm
[
1
]
-
gm
[
2
]
*
gm
[
4
]
pixx
=
((
lon
-
gm
[
0
])
*
gm
[
5
]
-
(
lat
-
gm
[
3
])
*
gm
[
2
])
/
det
pixy
=
((
lat
-
gm
[
3
])
*
gm
[
1
]
-
(
lon
-
gm
[
0
])
*
gm
[
4
])
/
det
return
self
.
_data
[
pixy
.
astype
(
int
),
pixx
.
astype
(
int
)]
pixy
=
_tools
.
np
.
clip
(
pixy
.
astype
(
int
),
0
,
self
.
_data
.
shape
[
0
]
-
1
)
pixx
=
_tools
.
np
.
clip
(
pixx
.
astype
(
int
),
0
,
self
.
_data
.
shape
[
1
]
-
1
)
return
self
.
_data
[
pixy
,
pixx
]
seamsh/geometry.py
View file @
5609c3d0
...
...
@@ -47,7 +47,12 @@ def _generate_unique_points(x):
eps
=
_tools
.
np
.
linalg
.
norm
(
bbmax
-
bbmin
)
*
1e-12
eps
=
1e-12
cid
=
0
for
p0
,
p1
in
tree
.
query_pairs
(
eps
):
pairs
=
_tools
.
np
.
array
(
list
(
tree
.
query_pairs
(
eps
)))
#sorting the pairs is necessary to handle points connecting more than 2 lines
pairs
.
sort
(
axis
=
1
)
pairsint64
=
pairs
[:,
0
].
astype
(
_tools
.
np
.
int64
)
*
2
**
32
+
pairs
[:,
1
].
astype
(
_tools
.
np
.
int64
)
pairs
=
pairs
[
pairsint64
.
argsort
(),:]
for
p0
,
p1
in
pairs
:
uid
=
max
(
unique_id
[
p0
],
unique_id
[
p1
])
if
uid
==
-
1
:
uid
=
cid
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment