Skip to content

Commit 5fe142b

Browse files
committed
[geogram] Update to 1.7.2
1 parent dd43bd5 commit 5fe142b

File tree

147 files changed

+10690
-4119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+10690
-4119
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ include(cmake/geogram.cmake)
4848

4949
set(VORPALINE_VERSION_MAJOR 1)
5050
set(VORPALINE_VERSION_MINOR 7)
51-
set(VORPALINE_VERSION_PATCH 1)
51+
set(VORPALINE_VERSION_PATCH 2)
5252
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
5353

5454
set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})

cmake/platforms/Emscripten-clang.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set(CMAKE_CXX_COMPILER "em++")
1919
set(CMAKE_AR "emar")
2020
set(CMAKE_RANLIB "emranlib")
2121
set(CMAKE_LINKER "emld")
22+
set(CMAKE_SKIP_RPATH TRUE)
2223

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

@@ -56,11 +57,20 @@ endif()
5657
# way add_flags() works may remove the second "-s" argument.
5758
# Note: TOTAL_MEMORY needs to be a multiple of 16M
5859
set(EM_COMMON_FLAGS
59-
-s WASM=0
60+
-s WASM=0
6061
-s USE_GLFW=3
62+
# -s USE_WEBGL2=1 -DGEO_WEBGL2
6163
-s TOTAL_MEMORY=268435456
6264
-s EXPORTED_FUNCTIONS='["_main","_file_system_changed_callback"]'
6365
-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall"]'
66+
-s FORCE_FILESYSTEM=1
67+
# For now, multithreading is deactivated, because it seems that
68+
# browser support is not there yet !!
69+
# -s USE_PTHREADS=1
70+
# -s PTHREAD_POOL_SIZE=4
71+
# -s PTHREAD_HINT_NUM_CORES=1
72+
# -s ASSERTIONS=1
73+
# -s DEMANGLE_SUPPORT=1
6474
)
6575
set(EM_FLAGS_RELEASE -O3 ${EM_COMMON_FLAGS})
6676
set(EM_FLAGS_DEBUG -O2 -s ASSERTIONS=2 -s SAFE_HEAP=1 -g ${EM_COMMON_FLAGS})

src/bin/geobox/main.cpp

Lines changed: 91 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
#include <geogram/basic/command_line.h>
6565
#include <geogram/basic/command_line_args.h>
66+
#include <geogram/basic/file_system.h>
6667

6768
namespace {
6869
using namespace GEO;
@@ -93,7 +94,7 @@ namespace {
9394

9495
void draw_about() override {
9596
ImGui::Separator();
96-
if(ImGui::BeginMenu("About...")) {
97+
if(ImGui::BeginMenu(icon_UTF8("info") + " About...")) {
9798
ImGui::Text(
9899
" GEObox\n"
99100
" The geometry processing toolbox\n"
@@ -162,7 +163,7 @@ namespace {
162163
GEO::Command::set_current(
163164
"void reconstruct( "
164165
" double radius=5.0 [search radius (in % bbox. diag.)],"
165-
" index_t nb_iterations=0 [number of smoothing iterations], "
166+
" index_t nb_smth_iter=2 [number of smoothing iterations], "
166167
" index_t nb_neighbors=30 [number of nearest neighbors] "
167168
") [reconstructs a surface from a pointset]",
168169
this, &GeoBoxApplication::reconstruct
@@ -173,9 +174,10 @@ namespace {
173174

174175

175176
if(ImGui::BeginMenu("Surface")) {
176-
if(ImGui::BeginMenu("Repair")) {
177-
if(ImGui::MenuItem("repair surface")) {
178-
GEO::Command::set_current(
177+
ImGui::MenuItem(" Repair", nullptr, false, false);
178+
179+
if(ImGui::MenuItem("repair surface")) {
180+
GEO::Command::set_current(
179181
" void repair( "
180182
" double epsilon = 1e-6 [point merging tol. (% bbox. diag.)],"
181183
" double min_comp_area = 0.03 "
@@ -191,23 +193,23 @@ namespace {
191193
" ) [repairs a surfacic mesh]",
192194
this, &GeoBoxApplication::repair_surface
193195
);
194-
}
196+
}
195197

196-
if(ImGui::MenuItem("merge vertices")) {
197-
GEO::Command::set_current(
198+
if(ImGui::MenuItem("merge vertices")) {
199+
GEO::Command::set_current(
198200
"void merge_vertices( "
199201
" double epsilon=1e-6 "
200202
" [tolerance for merging vertices (in % bbox diagonal)],"
201203
") [merges the vertices that are within tolerance] ",
202204
this, &GeoBoxApplication::merge_vertices
203-
);
204-
}
205-
ImGui::EndMenu();
206-
}
207-
208-
if(ImGui::BeginMenu("Remesh")) {
209-
if(ImGui::MenuItem("remesh smooth")) {
210-
GEO::Command::set_current(
205+
);
206+
}
207+
208+
ImGui::Separator();
209+
ImGui::MenuItem(" Remesh", nullptr, false, false);
210+
211+
if(ImGui::MenuItem("remesh smooth")) {
212+
GEO::Command::set_current(
211213
"void remesh_smooth( "
212214
#ifdef GEO_OS_EMSCRIPTEN
213215
" index_t nb_points = 5000 [number of points in remesh],"
@@ -226,40 +228,38 @@ namespace {
226228
" [nb samples (used if size adapt != 0)] "
227229
")",
228230
this, &GeoBoxApplication::remesh_smooth
229-
);
230-
}
231+
);
232+
}
231233

232-
if(ImGui::MenuItem("decimate")) {
233-
GEO::Command::set_current(
234+
if(ImGui::MenuItem("decimate")) {
235+
GEO::Command::set_current(
234236
"void decimate( "
235237
" index_t nb_bins = 100 [the higher-the more precise], "
236238
" bool remove_deg3_vrtx = true [remove degree3 vertices],"
237239
" bool keep_borders = true, "
238240
" bool repair = true "
239241
") [quick and dirty mesh decimator (vertex clustering)]",
240242
this, &GeoBoxApplication::decimate
241-
);
242-
}
243-
ImGui::EndMenu();
244-
}
245-
246-
if(ImGui::BeginMenu("Shapes")) {
247-
if(ImGui::MenuItem("create cube")) {
248-
GEO::Command::set_current(
249-
"void create_cube("
250-
" double x1=0, double y1=0, double z1=0,"
251-
" double x2=1, double y2=1, double z2=1"
252-
")",
253-
this, &GeoBoxApplication::create_cube
254-
);
255-
}
256-
if(ImGui::MenuItem("create icosahedron")) {
257-
create_icosahedron();
258-
}
259-
ImGui::EndMenu();
260-
}
261-
ImGui::EndMenu();
262-
}
243+
);
244+
}
245+
246+
ImGui::Separator();
247+
ImGui::MenuItem(" Create...", nullptr, false, false);
248+
249+
if(ImGui::MenuItem("create cube")) {
250+
GEO::Command::set_current(
251+
"void create_cube("
252+
" double x1=0, double y1=0, double z1=0,"
253+
" double x2=1, double y2=1, double z2=1"
254+
")",
255+
this, &GeoBoxApplication::create_cube
256+
);
257+
}
258+
if(ImGui::MenuItem("create icosahedron")) {
259+
create_icosahedron();
260+
}
261+
ImGui::EndMenu();
262+
}
263263

264264
if(ImGui::BeginMenu("Volume")) {
265265
if(ImGui::MenuItem("tet meshing")) {
@@ -277,15 +277,19 @@ namespace {
277277
}
278278

279279
if(ImGui::BeginMenu("Mesh")) {
280-
if(ImGui::BeginMenu("Stats")) {
281-
if(ImGui::MenuItem("show mesh statistics")) {
282-
show_statistics();
283-
}
284-
if(ImGui::MenuItem("show mesh topology")) {
285-
show_topology();
286-
}
287-
ImGui::EndMenu();
288-
}
280+
281+
ImGui::MenuItem(" Stats", nullptr, false, false);
282+
283+
if(ImGui::MenuItem("show mesh stats")) {
284+
show_statistics();
285+
}
286+
if(ImGui::MenuItem("show mesh topo")) {
287+
show_topology();
288+
}
289+
290+
ImGui::Separator();
291+
ImGui::MenuItem(" Edit", nullptr, false, false);
292+
289293
if(ImGui::MenuItem("clear")) {
290294
Command::set_current(
291295
"void clear(bool yes_I_am_sure=false) "
@@ -307,50 +311,48 @@ namespace {
307311
);
308312
}
309313

310-
if(ImGui::MenuItem("remove isolated vertices")) {
314+
if(ImGui::MenuItem("remove isolated vrtx")) {
311315
Command::set_current(
312316
"void remove_isolated_vertices(bool yes_I_am_sure=false) "
313317
"[removes vertices that are not connected to any element]",
314318
this, &GeoBoxApplication::remove_isolated_vertices
315319
);
316320
}
317321

318-
if(ImGui::BeginMenu("Selection")) {
319-
if(ImGui::BeginMenu("vertices")) {
320-
if(ImGui::MenuItem("select all vertices")) {
321-
select_all_vertices();
322-
}
323-
if(ImGui::MenuItem("unselect all vertices")) {
324-
unselect_all_vertices();
325-
}
326-
if(ImGui::MenuItem("invert vertices selection")) {
327-
invert_vertices_selection();
328-
}
329-
if(ImGui::MenuItem("select vertices on surface border")) {
330-
select_vertices_on_surface_border();
331-
}
332-
if(ImGui::MenuItem("unselect vertices on surface border")) {
333-
unselect_vertices_on_surface_border();
334-
}
335-
if(ImGui::MenuItem("delete selected vertices")) {
336-
delete_selected_vertices();
337-
}
338-
ImGui::EndMenu();
339-
}
340-
ImGui::EndMenu();
341-
}
342-
322+
ImGui::Separator();
323+
ImGui::MenuItem(" Selection", nullptr, false, false);
324+
325+
if(ImGui::MenuItem("select all vrtx")) {
326+
select_all_vertices();
327+
}
328+
if(ImGui::MenuItem("unselect all vrtx")) {
329+
unselect_all_vertices();
330+
}
331+
if(ImGui::MenuItem("invert vrtx sel")) {
332+
invert_vertices_selection();
333+
}
334+
if(ImGui::MenuItem(
335+
"sel vrtx on surf brdr")
336+
) {
337+
select_vertices_on_surface_border();
338+
}
339+
if(ImGui::MenuItem("unsel vrtx on surf brdr")) {
340+
unselect_vertices_on_surface_border();
341+
}
342+
if(ImGui::MenuItem("delete sel vrtx")) {
343+
delete_selected_vertices();
344+
}
343345
ImGui::EndMenu();
344346
}
345347

346348
if(ImGui::BeginMenu("Attributes")) {
347-
if(ImGui::MenuItem("compute local feature size")) {
349+
if(ImGui::MenuItem("compute LFS")) {
348350
Command::set_current(
349351
"compute_local_feature_size(std::string attribute_name=\"LFS\")",
350352
this, &GeoBoxApplication::compute_local_feature_size
351353
);
352354
}
353-
if(ImGui::MenuItem("compute distance to border")) {
355+
if(ImGui::MenuItem("compute dist. to brdr")) {
354356
Command::set_current(
355357
"compute_distance_to_border(std::string attribute_name=\"distance\")",
356358
this, &GeoBoxApplication::compute_distance_to_border
@@ -368,7 +370,16 @@ namespace {
368370
}
369371
}
370372

371-
373+
bool load(const std::string& filename) override {
374+
bool result = SimpleMeshApplication::load(filename);
375+
if(result && FileSystem::extension(filename) == "stl") {
376+
mesh_.vertices.set_double_precision();
377+
mesh_repair(mesh_);
378+
mesh_.vertices.set_single_precision();
379+
}
380+
return result;
381+
}
382+
372383
void remove_elements(
373384
bool vertices=false,
374385
bool edges=false,

src/bin/geocod/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ namespace {
169169
embedded_files_menu("games/");
170170
ImGui::EndMenu();
171171
}
172+
/*
172173
if(ImGui::BeginMenu("Load Shift and Tab\'s adventure...")) {
173174
embedded_files_menu("book/");
174175
ImGui::EndMenu();
175176
}
177+
*/
176178
if(ImGui::BeginMenu("Load internal lib...")) {
177179
ImGui::MenuItem("These files are those", nullptr, false, false);
178180
ImGui::MenuItem(
@@ -187,7 +189,10 @@ namespace {
187189
embedded_files_menu("lib/");
188190
ImGui::EndMenu();
189191
}
190-
if(ImGui::MenuItem("Run program [F5]")) {
192+
if(ImGui::MenuItem(
193+
"Run program",
194+
phone_screen_ ? nullptr : "[F5]"
195+
)) {
191196
run_program();
192197
}
193198
}

src/bin/geoshade/glsl/ShaderToy/AlloyPlatedVoronoi.glsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/XdfyWM
2+
13
/*
24
35
Alloy Plated Voronoi

src/bin/geoshade/glsl/ShaderToy/AndromedaJewel.glsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/4sVfWR
2+
13
#define pi 3.14159265359
24
//this noise stuff is from iq thanks
35
float hash (vec2 v) {

src/bin/geoshade/glsl/ShaderToy/Circuits.glsl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/XlX3Rj
2+
13
#define time iTime*.02
24

35

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

3032

src/bin/geoshade/glsl/ShaderToy/ContouredLayers.glsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/3lj3zt
2+
13
/*
24
35
Contoured Layers
@@ -264,7 +266,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord){
264266
float flNum = 5.;
265267

266268

267-
for(int i = 0; i<lNum; i++){
269+
for(int i = 0; i<5; i++){
268270

269271

270272
float fi = float(i);

src/bin/geoshade/glsl/ShaderToy/FractalLand.glsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/XsBXWt
2+
13
// "Fractal Cartoon" - former "DE edge detection" by Kali
24

35
// There are no lights and no AO, only color by normals and dark edges.

src/bin/geoshade/glsl/ShaderToy/GeodesicTiling.glsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/llVXRd
2+
13
#define MODEL_ROTATION vec2(.3, .25)
24
#define CAMERA_ROTATION vec2(.5, .5)
35

src/bin/geoshade/glsl/ShaderToy/Geomechanical.glsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// https://www.shadertoy.com/view/MdcXzn
2+
13
// Author : Sebastien Berube
24
// Created : March 2015
35
// Modified : Jan 2016

0 commit comments

Comments
 (0)