Skip to content

Commit

Permalink
source code
Browse files Browse the repository at this point in the history
  • Loading branch information
heike committed May 21, 2024
1 parent 11bef1b commit 23a04e4
Show file tree
Hide file tree
Showing 17 changed files with 2,070 additions and 8 deletions.
24 changes: 20 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ are publicly available 3d scans of the Hamby-Brundage bullet set #44 provided by
Download:

- [Known Bullets 1 and 2 from Barrel 1](examples/Hamby-44/barrel 1.zip)
- Questioned bullets: Bullet [E](examples/Hamby-44/Questioned/Bullet E.zip), [F](examples/Hamby-44/Questioned/Bullet F.zip),
[G](examples/Hamby-44/Questioned/Bullet G.zip),


- Questioned bullets: [E](examples/Hamby-44/Questioned//Bullet E.zip),
[F](examples/Hamby-44/Questioned//Bullet F.zip),
[G](examples/Hamby-44/Questioned//Bullet G.zip),
[H](examples/Hamby-44/Questioned//Bullet H.zip),
[I](examples/Hamby-44/Questioned//Bullet I.zip),
[J](examples/Hamby-44/Questioned//Bullet J.zip),
[K](examples/Hamby-44/Questioned//Bullet K.zip),
[L](examples/Hamby-44/Questioned//Bullet L.zip),
[O](examples/Hamby-44/Questioned//Bullet O.zip),
[P](examples/Hamby-44/Questioned//Bullet P.zip),
[S](examples/Hamby-44/Questioned//Bullet S.zip),
[T](examples/Hamby-44/Questioned//Bullet T.zip),
[U](examples/Hamby-44/Questioned//Bullet U.zip),
[X](examples/Hamby-44/Questioned//Bullet X.zip),
[Y](examples/Hamby-44/Questioned//Bullet Y.zip)


## Start the Analyzr

Click on the link to start the app: [BulletAnalyzr](https://labs.omnianalytics.org/bullet-analyzer/)
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ Download:

- [Known Bullets 1 and 2 from Barrel
1](examples/Hamby-44/barrel%201.zip)
- Questioned bullets: Bullet
[E](examples/Hamby-44/Questioned/Bullet%20E.zip),
[F](examples/Hamby-44/Questioned/Bullet%20F.zip),
[G](examples/Hamby-44/Questioned/Bullet%20G.zip),
- Questioned bullets: [E](examples/Hamby-44/Questioned//Bullet%20E.zip),
[F](examples/Hamby-44/Questioned//Bullet%20F.zip),
[G](examples/Hamby-44/Questioned//Bullet%20G.zip),
[H](examples/Hamby-44/Questioned//Bullet%20H.zip),
[I](examples/Hamby-44/Questioned//Bullet%20I.zip),
[J](examples/Hamby-44/Questioned//Bullet%20J.zip),
[K](examples/Hamby-44/Questioned//Bullet%20K.zip),
[L](examples/Hamby-44/Questioned//Bullet%20L.zip),
[O](examples/Hamby-44/Questioned//Bullet%20O.zip),
[P](examples/Hamby-44/Questioned//Bullet%20P.zip),
[S](examples/Hamby-44/Questioned//Bullet%20S.zip),
[T](examples/Hamby-44/Questioned//Bullet%20T.zip),
[U](examples/Hamby-44/Questioned//Bullet%20U.zip),
[X](examples/Hamby-44/Questioned//Bullet%20X.zip),
[Y](examples/Hamby-44/Questioned//Bullet%20Y.zip)

2 changes: 2 additions & 0 deletions app/.Rapp.history
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setwd("~/Desktop/csafe/bullet/bulletanalyzer")
shiny::runApp()
894 changes: 894 additions & 0 deletions app/Dump/appold.R

Large diffs are not rendered by default.

Binary file added app/Dump/bull/PGPD Barrel 9-1 Ld1.x3p
Binary file not shown.
72 changes: 72 additions & 0 deletions app/Dump/dump.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
library(shiny)
library(bslib)
options(rgl.useNULL = TRUE)
options(shiny.port = 4569)
options(shiny.host= "0.0.0.0")
library(rgl)
library(x3ptools)
library(bulletxtrctr)
library(shinyscreenshot)

ui <- bootstrapPage(
screenshotButton(label = "Download Report", id = "allplot",filename="Bullet Comparison Report",scale=1),
uiOutput("allplot")

)

server <- function(input, output)
{

bull <- read_bullet("~/Desktop/csafe/bullet/bulletanalyzer/dump/bull")
# bull <- read_bullet("~/Desktop/bull")
bull$x3p <- lapply(bull$x3p,x3p_m_to_mum)
bull$x3p <- lapply(bull$x3p,function(x) y_flip_x3p(rotate_x3p(x,angle = -90)))
x3p_scaled <- x3p_interpolate(bull$x3p[[1]],resx=20)
output$plot1 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot2 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot3 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot4 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot5 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot6 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot7 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot8 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot9 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot10 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot11 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot12 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot13 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot14 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot15 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot16 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot17 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot18 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot19 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})
output$plot20 <- renderRglwidget({image_x3p(x3p_scaled,zoom=1);rglwidget()})

output$allplot <- renderUI({layout_column_wrap(
width = 1/5,
rglwidgetOutput('plot1'),
rglwidgetOutput('plot2'),
rglwidgetOutput('plot3'),
rglwidgetOutput('plot4'),
rglwidgetOutput('plot5'),
rglwidgetOutput('plot6'),
rglwidgetOutput('plot7'),
rglwidgetOutput('plot8'),
rglwidgetOutput('plot9'),
rglwidgetOutput('plot10'),
rglwidgetOutput('plot11'),
rglwidgetOutput('plot12'),
rglwidgetOutput('plot13'),
rglwidgetOutput('plot14'),
rglwidgetOutput('plot15'),
rglwidgetOutput('plot16'),
rglwidgetOutput('plot17'),
rglwidgetOutput('plot18'),
rglwidgetOutput('plot19'),
rglwidgetOutput('plot20')
)})
}


shinyApp(ui = ui, server = server)
46 changes: 46 additions & 0 deletions app/Dump/dump2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

# options(rgl.useNULL = TRUE)
library(rgl)
library(x3ptools)
library(bulletxtrctr)
# bull <- read_bullet("~/Desktop/bull")

bull <- read_bullet("~/Desktop/csafe/bullet/bulletanalyzer/dump/bull")
bull$x3p <- lapply(bull$x3p,x3p_m_to_mum)
bull$x3p <- lapply(bull$x3p,function(x) y_flip_x3p(rotate_x3p(x,angle = -90)))
bull$x3p <- lapply(bull$x3p,function(x) x3p_add_hline(x,yintercept = 375, size = 10, color = "#e6bf98"))
x3p_scaled <- x3p_interpolate(bull$x3p[[1]],resx=8)
image_x3p(x3p_scaled,zoom=.75)


# snapshot3d("~/Downloads/test.png")













options(rgl.useNULL = TRUE)
library(rgl)
library(x3ptools)
library(bulletxtrctr)
bull <- read_bullet("Dump/bull")
# bull <- read_bullet("~/Desktop/csafe/bullet/bulletanalyzer/dump/bull")
bull$x3p <- lapply(bull$x3p,x3p_m_to_mum)
bull$x3p <- lapply(bull$x3p,function(x) y_flip_x3p(rotate_x3p(x,angle = -90)))
bull$crosscut <- sapply(bull$x3p,x3p_crosscut_optimize)
bull$x3p <- lapply(bull$x3p,function(x) x3p_add_hline(x,yintercept = 51.5625, size = 20, color = "#ea2b1f"))
# x3p_scaled <- x3p_interpolate(bull$x3p[[1]],resx=8)
x3p_sampled <- x3p_sample(bull$x3p[[1]],m=5)
image_x3p(x3p_sampled,zoom=.75)


# snapshot3d("~/Downloads/test.png")

18 changes: 18 additions & 0 deletions app/Dump/installation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Ubuntu packages install
sudo apt install build-essential libz-dev gfortran libpng-dev libblas-dev liblapack-dev libjpeg-dev libxml2-dev libtiff5-dev libx11-dev libcurl4-openssl-dev libssl-dev libgl1-mesa-dev libglu1-mesa-dev

## Install Google Chrome Command Line
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
sudo dpkg -i google-chrome-stable_current_amd64.deb

## Install R

## Install R Packages
install.packages(c("shiny","shinyjs","shinyBS","shinycssloaders","shinyscreenshot","bslib","bsicons","ggplot2","randomForest","dplyr","DT","remotes","webshot2"))

remotes::install_github("dmurdoch/rgl")
remotes::install_github("heike/x3ptools")
remotes::install_github("heike/bulletxtrctr")

203 changes: 203 additions & 0 deletions app/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
h4 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
/* color: #003A70;*/
}

h3 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
color: #003A70;
}

h2 {
font-family: 'Montserrat', sans-serif;
font-weight: 500;
}

h1 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
font-size: 36px;
}

body {
font-family: 'Montserrat', sans-serif;
font-weight: 500;
font-size: 16px;
color: #545859;
}

html, body {
height: 100%;
}

.well {
background-color: #003A70;
color: white;
border: 0px;
margin-left: 14px;
}

.help-block {
color: white;
}

#app-container {
height: 100%;
display: flex;
flex-direction: column;
}

#global-navbar {
background-color: #FFFFFF;
overflow: hidden;
height: 120px;
}

.container-fluid {
padding-left: 0px;
padding-right: 0px;
}

.tab-content {
padding-left: 10px;
padding-right: 10px;
padding-top: 15px;
}

.navbar-default {
background-color: #003A70;
padding-left: 10px;
margin-bottom: 20px;
}

/* Targeting inactive tabs */
.navbar-nav > li:not(.active) > a {
color: white; /* Sets the text color to white for inactive tabs */
}

/* Changing text color on hover for inactive tabs */
.navbar-nav > li:not(.active) > a:hover {
color: white; /* Sets the hover text color to light grey */
}

#global-footer {
background-color: #003A70;
overflow: hidden;
height: 60px;
}

#global-navbar a, #global-navbar img, #global-footer a #global-footer p {
float: left;
display: block;
text-align: center;
text-decoration: none;
line-height: 80px;
padding-left: 10px;
}

#global-navbar img {
height: 70px;
margin-top: 5px;
margin-bottom: 5px;
vertical-align: middle;
}

#global-footer img {
height: 60px;
margin-top: 00px;
margin-bottom: 10px;
margin-left: 20px;
vertical-align: middle;
}

#global-footer a, #global-footer p {
color: white;
margin-top: 20px;
}

#global-navbar a {
color: white;
}

#global-navbar a:hover, #global-footer a:hover {
background-color: #ddd;
color: black;
}

#global-navbar a.right-float, #global-footer a.right-float, #global-navbar p.right-float, #global-footer p.right-float {
float: right;
margin-right: 20px;
}

#header-image img {
max-width: 100%;
width: 100%;
max-height: 80px;
height: 80px;
vertical-align: middle;
margin-top: 20px;
}

#main-content {
flex: 1;
}

#global-footer {
margin-top: auto;
}

#customPopover {
position: fixed;
top: 50px;
left: 50%;
transform: translateX(-50%);
background-color: #f9f9f9;
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1050;
display: none;
}

.btn-default {
color: #003A70;
background-color: white;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
}

.modal-content {
background-color: rgba(0, 58, 111, 0.8); /* Blue with 80% transparency */
color: white;
}

.modal-dialog {
position: fixed; /* Or 'absolute' depending on your layout */
top: 30%;
left: 45%;
transform: translate(-45%, -30%);
}

.responsive-text {
font-size: 2vw;
}
@media (max-width: 600px) {
.responsive-text {
font-size: 3vw; /* Larger on small screens */
}
}

.rounded-box {
border: 2px solid #ddd;
border-radius: 15px;
padding: 10px;
margin-bottom: 10px;
display: inline-block;
}

.center-container {
text-align: center;
}
Binary file added app/images/BulletAnalyzr-Design-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/BulletAnalzr-Mark-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 23a04e4

Please sign in to comment.