Skip to content

Commit

Permalink
[geogram] Update to 1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
simogasp committed Nov 10, 2019
1 parent dd43bd5 commit 5fe142b
Show file tree
Hide file tree
Showing 147 changed files with 10,690 additions and 4,119 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ include(cmake/geogram.cmake)

set(VORPALINE_VERSION_MAJOR 1)
set(VORPALINE_VERSION_MINOR 7)
set(VORPALINE_VERSION_PATCH 1)
set(VORPALINE_VERSION_PATCH 2)
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})

set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
Expand Down
12 changes: 11 additions & 1 deletion cmake/platforms/Emscripten-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(CMAKE_CXX_COMPILER "em++")
set(CMAKE_AR "emar")
set(CMAKE_RANLIB "emranlib")
set(CMAKE_LINKER "emld")
set(CMAKE_SKIP_RPATH TRUE)

include(${EMSCRIPTEN_DIR}/cmake/Modules/Platform/Emscripten.cmake)

Expand Down Expand Up @@ -56,11 +57,20 @@ endif()
# way add_flags() works may remove the second "-s" argument.
# Note: TOTAL_MEMORY needs to be a multiple of 16M
set(EM_COMMON_FLAGS
-s WASM=0
-s WASM=0
-s USE_GLFW=3
# -s USE_WEBGL2=1 -DGEO_WEBGL2
-s TOTAL_MEMORY=268435456
-s EXPORTED_FUNCTIONS='["_main","_file_system_changed_callback"]'
-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall"]'
-s FORCE_FILESYSTEM=1
# For now, multithreading is deactivated, because it seems that
# browser support is not there yet !!
# -s USE_PTHREADS=1
# -s PTHREAD_POOL_SIZE=4
# -s PTHREAD_HINT_NUM_CORES=1
# -s ASSERTIONS=1
# -s DEMANGLE_SUPPORT=1
)
set(EM_FLAGS_RELEASE -O3 ${EM_COMMON_FLAGS})
set(EM_FLAGS_DEBUG -O2 -s ASSERTIONS=2 -s SAFE_HEAP=1 -g ${EM_COMMON_FLAGS})
Expand Down
171 changes: 91 additions & 80 deletions src/bin/geobox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

#include <geogram/basic/command_line.h>
#include <geogram/basic/command_line_args.h>
#include <geogram/basic/file_system.h>

namespace {
using namespace GEO;
Expand Down Expand Up @@ -93,7 +94,7 @@ namespace {

void draw_about() override {
ImGui::Separator();
if(ImGui::BeginMenu("About...")) {
if(ImGui::BeginMenu(icon_UTF8("info") + " About...")) {
ImGui::Text(
" GEObox\n"
" The geometry processing toolbox\n"
Expand Down Expand Up @@ -162,7 +163,7 @@ namespace {
GEO::Command::set_current(
"void reconstruct( "
" double radius=5.0 [search radius (in % bbox. diag.)],"
" index_t nb_iterations=0 [number of smoothing iterations], "
" index_t nb_smth_iter=2 [number of smoothing iterations], "
" index_t nb_neighbors=30 [number of nearest neighbors] "
") [reconstructs a surface from a pointset]",
this, &GeoBoxApplication::reconstruct
Expand All @@ -173,9 +174,10 @@ namespace {


if(ImGui::BeginMenu("Surface")) {
if(ImGui::BeginMenu("Repair")) {
if(ImGui::MenuItem("repair surface")) {
GEO::Command::set_current(
ImGui::MenuItem(" Repair", nullptr, false, false);

if(ImGui::MenuItem("repair surface")) {
GEO::Command::set_current(
" void repair( "
" double epsilon = 1e-6 [point merging tol. (% bbox. diag.)],"
" double min_comp_area = 0.03 "
Expand All @@ -191,23 +193,23 @@ namespace {
" ) [repairs a surfacic mesh]",
this, &GeoBoxApplication::repair_surface
);
}
}

if(ImGui::MenuItem("merge vertices")) {
GEO::Command::set_current(
if(ImGui::MenuItem("merge vertices")) {
GEO::Command::set_current(
"void merge_vertices( "
" double epsilon=1e-6 "
" [tolerance for merging vertices (in % bbox diagonal)],"
") [merges the vertices that are within tolerance] ",
this, &GeoBoxApplication::merge_vertices
);
}
ImGui::EndMenu();
}

if(ImGui::BeginMenu("Remesh")) {
if(ImGui::MenuItem("remesh smooth")) {
GEO::Command::set_current(
);
}
ImGui::Separator();
ImGui::MenuItem(" Remesh", nullptr, false, false);
if(ImGui::MenuItem("remesh smooth")) {
GEO::Command::set_current(
"void remesh_smooth( "
#ifdef GEO_OS_EMSCRIPTEN
" index_t nb_points = 5000 [number of points in remesh],"
Expand All @@ -226,40 +228,38 @@ namespace {
" [nb samples (used if size adapt != 0)] "
")",
this, &GeoBoxApplication::remesh_smooth
);
}
);
}

if(ImGui::MenuItem("decimate")) {
GEO::Command::set_current(
if(ImGui::MenuItem("decimate")) {
GEO::Command::set_current(
"void decimate( "
" index_t nb_bins = 100 [the higher-the more precise], "
" bool remove_deg3_vrtx = true [remove degree3 vertices],"
" bool keep_borders = true, "
" bool repair = true "
") [quick and dirty mesh decimator (vertex clustering)]",
this, &GeoBoxApplication::decimate
);
}
ImGui::EndMenu();
}

if(ImGui::BeginMenu("Shapes")) {
if(ImGui::MenuItem("create cube")) {
GEO::Command::set_current(
"void create_cube("
" double x1=0, double y1=0, double z1=0,"
" double x2=1, double y2=1, double z2=1"
")",
this, &GeoBoxApplication::create_cube
);
}
if(ImGui::MenuItem("create icosahedron")) {
create_icosahedron();
}
ImGui::EndMenu();
}
ImGui::EndMenu();
}
);
}

ImGui::Separator();
ImGui::MenuItem(" Create...", nullptr, false, false);

if(ImGui::MenuItem("create cube")) {
GEO::Command::set_current(
"void create_cube("
" double x1=0, double y1=0, double z1=0,"
" double x2=1, double y2=1, double z2=1"
")",
this, &GeoBoxApplication::create_cube
);
}
if(ImGui::MenuItem("create icosahedron")) {
create_icosahedron();
}
ImGui::EndMenu();
}

if(ImGui::BeginMenu("Volume")) {
if(ImGui::MenuItem("tet meshing")) {
Expand All @@ -277,15 +277,19 @@ namespace {
}

if(ImGui::BeginMenu("Mesh")) {
if(ImGui::BeginMenu("Stats")) {
if(ImGui::MenuItem("show mesh statistics")) {
show_statistics();
}
if(ImGui::MenuItem("show mesh topology")) {
show_topology();
}
ImGui::EndMenu();
}

ImGui::MenuItem(" Stats", nullptr, false, false);

if(ImGui::MenuItem("show mesh stats")) {
show_statistics();
}
if(ImGui::MenuItem("show mesh topo")) {
show_topology();
}

ImGui::Separator();
ImGui::MenuItem(" Edit", nullptr, false, false);

if(ImGui::MenuItem("clear")) {
Command::set_current(
"void clear(bool yes_I_am_sure=false) "
Expand All @@ -307,50 +311,48 @@ namespace {
);
}

if(ImGui::MenuItem("remove isolated vertices")) {
if(ImGui::MenuItem("remove isolated vrtx")) {
Command::set_current(
"void remove_isolated_vertices(bool yes_I_am_sure=false) "
"[removes vertices that are not connected to any element]",
this, &GeoBoxApplication::remove_isolated_vertices
);
}

if(ImGui::BeginMenu("Selection")) {
if(ImGui::BeginMenu("vertices")) {
if(ImGui::MenuItem("select all vertices")) {
select_all_vertices();
}
if(ImGui::MenuItem("unselect all vertices")) {
unselect_all_vertices();
}
if(ImGui::MenuItem("invert vertices selection")) {
invert_vertices_selection();
}
if(ImGui::MenuItem("select vertices on surface border")) {
select_vertices_on_surface_border();
}
if(ImGui::MenuItem("unselect vertices on surface border")) {
unselect_vertices_on_surface_border();
}
if(ImGui::MenuItem("delete selected vertices")) {
delete_selected_vertices();
}
ImGui::EndMenu();
}
ImGui::EndMenu();
}

ImGui::Separator();
ImGui::MenuItem(" Selection", nullptr, false, false);

if(ImGui::MenuItem("select all vrtx")) {
select_all_vertices();
}
if(ImGui::MenuItem("unselect all vrtx")) {
unselect_all_vertices();
}
if(ImGui::MenuItem("invert vrtx sel")) {
invert_vertices_selection();
}
if(ImGui::MenuItem(
"sel vrtx on surf brdr")
) {
select_vertices_on_surface_border();
}
if(ImGui::MenuItem("unsel vrtx on surf brdr")) {
unselect_vertices_on_surface_border();
}
if(ImGui::MenuItem("delete sel vrtx")) {
delete_selected_vertices();
}
ImGui::EndMenu();
}

if(ImGui::BeginMenu("Attributes")) {
if(ImGui::MenuItem("compute local feature size")) {
if(ImGui::MenuItem("compute LFS")) {
Command::set_current(
"compute_local_feature_size(std::string attribute_name=\"LFS\")",
this, &GeoBoxApplication::compute_local_feature_size
);
}
if(ImGui::MenuItem("compute distance to border")) {
if(ImGui::MenuItem("compute dist. to brdr")) {
Command::set_current(
"compute_distance_to_border(std::string attribute_name=\"distance\")",
this, &GeoBoxApplication::compute_distance_to_border
Expand All @@ -368,7 +370,16 @@ namespace {
}
}


bool load(const std::string& filename) override {
bool result = SimpleMeshApplication::load(filename);
if(result && FileSystem::extension(filename) == "stl") {
mesh_.vertices.set_double_precision();
mesh_repair(mesh_);
mesh_.vertices.set_single_precision();
}
return result;
}

void remove_elements(
bool vertices=false,
bool edges=false,
Expand Down
7 changes: 6 additions & 1 deletion src/bin/geocod/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ namespace {
embedded_files_menu("games/");
ImGui::EndMenu();
}
/*
if(ImGui::BeginMenu("Load Shift and Tab\'s adventure...")) {
embedded_files_menu("book/");
ImGui::EndMenu();
}
*/
if(ImGui::BeginMenu("Load internal lib...")) {
ImGui::MenuItem("These files are those", nullptr, false, false);
ImGui::MenuItem(
Expand All @@ -187,7 +189,10 @@ namespace {
embedded_files_menu("lib/");
ImGui::EndMenu();
}
if(ImGui::MenuItem("Run program [F5]")) {
if(ImGui::MenuItem(
"Run program",
phone_screen_ ? nullptr : "[F5]"
)) {
run_program();
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/bin/geoshade/glsl/ShaderToy/AlloyPlatedVoronoi.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/XdfyWM

/*
Alloy Plated Voronoi
Expand Down
2 changes: 2 additions & 0 deletions src/bin/geoshade/glsl/ShaderToy/AndromedaJewel.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/4sVfWR

#define pi 3.14159265359
//this noise stuff is from iq thanks
float hash (vec2 v) {
Expand Down
6 changes: 4 additions & 2 deletions src/bin/geoshade/glsl/ShaderToy/Circuits.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/XlX3Rj

#define time iTime*.02


Expand All @@ -22,9 +24,9 @@ void formula(vec2 z, float c) {
float w=width*minit*2.;
float circ=pow(max(0.,w-ot2)/w,6.);
shape+=max(pow(max(0.,w-ot)/w,.25),circ);
vec3 col=normalize(.3+texture(iChannel1,vec2(minit*.1)).rgb);
vec3 col=normalize(vec3(0.3,0.3,0.3));
color+=col*(.4+mod(minit/9.-time*10.+ot2*2.,1.)*1.6);
color+=vec3(1.,.7,.3)*circ*(10.-minit)*3.*smoothstep(0.,.5,.15+texture(iChannel0,vec2(.0,1.)).x-.5);
color+=vec3(1.,.7,.3)*circ*(10.-minit)*3.*smoothstep(0.,.5,.15-.5);
}


Expand Down
4 changes: 3 additions & 1 deletion src/bin/geoshade/glsl/ShaderToy/ContouredLayers.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/3lj3zt

/*
Contoured Layers
Expand Down Expand Up @@ -264,7 +266,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord){
float flNum = 5.;


for(int i = 0; i<lNum; i++){
for(int i = 0; i<5; i++){


float fi = float(i);
Expand Down
2 changes: 2 additions & 0 deletions src/bin/geoshade/glsl/ShaderToy/FractalLand.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/XsBXWt

// "Fractal Cartoon" - former "DE edge detection" by Kali

// There are no lights and no AO, only color by normals and dark edges.
Expand Down
2 changes: 2 additions & 0 deletions src/bin/geoshade/glsl/ShaderToy/GeodesicTiling.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/llVXRd

#define MODEL_ROTATION vec2(.3, .25)
#define CAMERA_ROTATION vec2(.5, .5)

Expand Down
2 changes: 2 additions & 0 deletions src/bin/geoshade/glsl/ShaderToy/Geomechanical.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://www.shadertoy.com/view/MdcXzn

// Author : Sebastien Berube
// Created : March 2015
// Modified : Jan 2016
Expand Down
Loading

0 comments on commit 5fe142b

Please sign in to comment.