Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Holger_Tower_POV
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Cattaneo
Holger_Tower_POV
Commits
5de80af8
Commit
5de80af8
authored
1 year ago
by
Nicolas Cattaneo
Browse files
Options
Downloads
Patches
Plain Diff
update repo
parent
5fd3436d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
CodeR/01_test_data_structure.r
+96
-0
96 additions, 0 deletions
CodeR/01_test_data_structure.r
CodeR/01_test_data_structure.r~
+55
-0
55 additions, 0 deletions
CodeR/01_test_data_structure.r~
with
152 additions
and
0 deletions
.gitignore
0 → 100755
+
1
−
0
View file @
5de80af8
/DataR/
This diff is collapsed.
Click to expand it.
CodeR/01_test_data_structure.r
0 → 100644
+
96
−
0
View file @
5de80af8
rm
(
list
=
ls
())
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
library
(
"rlas"
)
library
(
"rgl"
)
library
(
"stringr"
)
library
(
"VoxR"
)
library
(
"data.table"
)
## function to scale X, Y and Z
getwd
()
load
(
"/home/nica/Documents/Helge_Tower_POV/DataR/pan3d.RData"
)
objects
()
## this function scale points coordinate
## between 0 and (max-min) values
Scale
<-
function
(
Vector
){
((
Vector
-
min
(
Vector
))
/
(
max
(
Vector
)
-
min
(
Vector
)))
*
(
max
(
Vector
)
-
min
(
Vector
))}
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## plot data - full path
DataPaths
<-
list.files
(
"/home/nica/Documents/Helge_Tower_POV/DataR"
,
pattern
=
"plot_"
,
full.names
=
T
)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Scale the data to imrpove visualization
Data
<-
read.las
(
DataPaths
)
gc
()
Data
[,
X
:=
Scale
(
Data
$
X
)]
Data
[,
Y
:=
Scale
(
Data
$
Y
)]
Data
[,
Z
:=
Scale
(
Data
$
Z
)]
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## center the data around 0
Data
[,
X
:=
X
-
mean
(
X
)]
Data
[,
Y
:=
Y
-
mean
(
Y
)]
plot3d
(
Data
,
aspect
=
"iso"
,
size
=
0.2
)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Create an satificial tower. Just the corners
CornA
<-
data.table
(
X
=
1
,
Y
=
1
,
Z
=
40
)
CornB
<-
data.table
(
X
=
1
,
Y
=
-1
,
Z
=
40
)
CornC
<-
data.table
(
X
=
-1
,
Y
=
1
,
Z
=
40
)
CornD
<-
data.table
(
X
=
-1
,
Y
=
-1
,
Z
=
40
)
spheres3d
(
CornA
,
radius
=
0.3
,
col
=
"yellow"
)
spheres3d
(
CornB
,
radius
=
0.3
,
col
=
"blue"
)
spheres3d
(
CornC
,
radius
=
0.3
,
col
=
"red"
)
spheres3d
(
CornD
,
radius
=
0.3
,
col
=
"green"
)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## center the data around cornerX
Data2
<-
copy
(
Data
)
Data2
[,
X
:=
X
-
CornA
$
X
]
Data2
[,
Y
:=
Y
-
CornA
$
Y
]
CornA2
<-
copy
(
CornA
)
CornA2
[,
X
:=
X
-
CornA
$
X
]
CornA2
[,
Y
:=
Y
-
CornA
$
Y
]
plot3d
(
Data2
,
aspect
=
"iso"
,
size
=
0.2
,
col
=
"red"
)
spheres3d
(
c
(
0
,
0
,
40
),
radius
=
0.3
,
col
=
"yellow"
)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## compute angles on the plane.
## It should be from >180 dgrees to <90 dgrees.
## you must voxelize the point cloud first.
Data2
<-
vox
(
Data2
,
0.02
)
plot3d
(
Data2
,
aspect
=
"iso"
,
size
=
0.2
,
col
=
"red"
)
spheres3d
(
c
(
0
,
0
,
40
),
radius
=
0.3
,
col
=
"yellow"
)
## Data2[, npts := NULL]
## Data2[, angle_x := VoxR::axis_angle(Data2, axis = "X",
## project = "xy")]
plot3d
(
Data2
[
angle_x
%inrange%
list
(
0
,
180
),
],
aspect
=
"iso"
,
size
=
0.7
,
col
=
"black"
,
add
=
T
)
plot3d
(
Data2
[
angle_x
%inrange%
list
(
270.1
,
359.9
),
],
aspect
=
"iso"
,
size
=
0.7
,
col
=
"black"
,
add
=
T
)
spheres3d
(
c
(
0
,
0
,
40
),
radius
=
0.3
,
col
=
"yellow"
)
summary
(
Data2
$
angle_x
)
spheres3d
(
c
(
0
,
0
,
40
),
radius
=
0.3
,
col
=
"yellow"
)
This diff is collapsed.
Click to expand it.
CodeR/01_test_data_structure.r~
0 → 100644
+
55
−
0
View file @
5de80af8
rm(list=ls())
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
library("rlas")
library("rgl")
library("stringr")
library("VoxR")
library("data.table")
## function to scale X, Y and Z
getwd()
load("/home/nica/Documents/Helge_Tower_POV/DataR/pan3d.RData")
objects()
## this function scale points coordinate
## between 0 and (max-min) values
Scale <- function(Vector){
((Vector - min(Vector))/
(max(Vector)-min(Vector)))*
(max(Vector)-min(Vector))}
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## plot data - full path
DataPaths <- list.files("/home/nica/Documents/Helge_Tower_POV/DataR",
pattern = "plot_",
full.names = T)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Scale the data to imrpove visualization
Data <- read.las(DataPaths)
gc()
Data[, X := Scale(Data$X)]
Data[, Y := Scale(Data$Y)]
Data[, Z := Scale(Data$Z)]
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## center the data around 0
Data[, X := X-mean(X)]
Data[, Y := Y-mean(Y)]
## plot3d(Data, aspect = "iso", size = 0.2)
## @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Create an satificial tower. Just the corners
CornA <- data.table(X = 2, Y = 2, Z = 40)
CornB <- data.table(X = 2, Y = -2, Z = 40)
CornC <- data.table(X = -2, Y = 2, Z = 40)
CornD <- data.table(X = -2, Y = -2, Z = 40)
spheres3d(CornA, radius = 0.3, col = "yellow")
spheres3d(CornB, radius = 0.3, col = "yellow")
spheres3d(CornC, radius = 0.3, col = "yellow")
spheres3d(CornD, radius = 0.3, col = "yellow")
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment