Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jayant Khatkar
tempaware
Commits
842b9f7d
Commit
842b9f7d
authored
Oct 10, 2021
by
Jayant Khatkar
Browse files
add animated plot to show progress of contour order
parent
7bed2ab7
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.jl
View file @
842b9f7d
...
@@ -20,7 +20,7 @@ tdfast = tempdecay(215, 25, 0.08)
...
@@ -20,7 +20,7 @@ tdfast = tempdecay(215, 25, 0.08)
### LOAD IN DATA
### LOAD IN DATA
obj
=
"/Users/jayant/phd/tempaware/models/"
*
"M5"
obj
=
"/Users/jayant/phd/tempaware/models/"
*
"M5"
contours
=
clean_contour
.
(
contour
.
(
JSON
.
parse
(
open
(
obj
*
"contours.json"
))))
contours
=
clean_contour
.
(
contour
.
(
JSON
.
parse
(
open
(
obj
*
"contours.json"
))))
cdata
=
contourdata
(
contours
,
2
0
,
5
)
# contour data
cdata
=
contourdata
(
contours
,
4
0
,
5
)
# contour data
@time
vd
=
voxdata
(
obj
*
"_voxels.csv"
,
cdata
)
@time
vd
=
voxdata
(
obj
*
"_voxels.csv"
,
cdata
)
#stress_multiplier!(vd.voxels, 10)
#stress_multiplier!(vd.voxels, 10)
rl
=
random_rollout
(
cdata
)
rl
=
random_rollout
(
cdata
)
...
@@ -100,4 +100,8 @@ histogram!(sort(data, rev=true)[1:4000]) # vast majority of voxels near 0 stress
...
@@ -100,4 +100,8 @@ histogram!(sort(data, rev=true)[1:4000]) # vast majority of voxels near 0 stress
### Visualise voxmap
### Visualise voxmap
plot
(
vd
,
46
,
cdata
)
plot
(
vd
,
46
,
cdata
)
plot
(
Vector
(
1
:
length
(
rl
)),
cdata
)
plot
(
Vector
(
1
:
length
(
rl
)),
cdata
)
plot
(
rl
,
cdata
)
plot
(
rl
,
cdata
)
\ No newline at end of file
rl
=
random_rollout
(
cdata
)
rl
=
Vector
(
1
:
length
(
rl
))
@time
plot_animate
(
rl
,
cdata
)
\ No newline at end of file
utils.jl
View file @
842b9f7d
...
@@ -9,6 +9,7 @@ using LinearAlgebra
...
@@ -9,6 +9,7 @@ using LinearAlgebra
using
PlotlyJS
using
PlotlyJS
import
PlotlyJS
:
plot
import
PlotlyJS
:
plot
using
Colors
using
Colors
using
Plots
struct
material
struct
material
...
@@ -622,4 +623,22 @@ function plot(rl::Vector{Int}, cdata::contourdata)
...
@@ -622,4 +623,22 @@ function plot(rl::Vector{Int}, cdata::contourdata)
))
))
end
end
plot
(
traces
,
layout
)
plot
(
traces
,
layout
)
end
function
plot_animate
(
rl
::
Vector
{
Int
},
cdata
::
contourdata
)
i
=
1
p
=
Plots
.
plot3d
(
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
1
],
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
2
],
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
3
]
)
return
@gif
for
i
in
2
:
length
(
rl
)
plot3d!
(
p
,
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
1
],
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
2
],
cdata
.
contours
[
rl
[
i
]]
.
pos
[
:
,
3
],
legend
=
false
)
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
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