jmlien / acd2d Goto Github PK
View Code? Open in Web Editor NEWApproximate Convex Decomposition of Polygons
License: MIT License
Approximate Convex Decomposition of Polygons
License: MIT License
Got two kinds of "segmentation fault" when running the code. Here are the procedures for reproducing the errors:
My environment: Ubuntu 16.04 x86-64
Repo head: b32d695 (current master)
Compile:
$ git clone https://github.com/jmlien/acd2d.git
$ cd acd2d
$ make
Run for segmentation fault 1:
$ ./acd2d_gui ./test_env/hole2.poly
Console output:
- Input: ./test_env/hole2.poly
concavity tolerance=0
concavity weight (alpha)=0
distance weight (beta)=1
GUI Usage:
d: decompose once
D: decompose all
n: show/hide normal direction
h: show/hide convex hulls
r: reset camera
space bar: reload polygon
s: save decomposition
p: save rendering to PS file
+/-: zoom in/out
arrow keys: translate
Gdb output:
0x00000000000001a1 in ?? ()
(gdb) bt
#0 0x00000000000001a1 in ?? ()
#1 0x000000000040cdde in acd2d::cd_2d::decompose_OUT(double, acd2d::cd_polygon&, cd2d::cd_poly&)
()
#2 0x000000000040f1df in acd2d::cd_2d::decompose(double, acd2d::IConcavityMeasure*) ()
#3 0x000000000040f4c1 in acd2d::cd_2d::decomposeAll(double, acd2d::IConcavityMeasure*) ()
#4 0x0000000000419874 in decomposeAll () at gui/acd2d_main_gui.cpp:186
#5 0x0000000000419fa9 in Keyboard (key=68 'D', x=169, y=282) at gui/acd2d_main_gui.cpp:294
#6 0x00007fb4f12d7d1f in glutMainLoopEvent () from /usr/lib/x86_64-linux-gnu/libglut.so.3
#7 0x00007fb4f12d8145 in glutMainLoop () from /usr/lib/x86_64-linux-gnu/libglut.so.3
#8 0x000000000041aa19 in gli::gliMainLoop () at gui/GL/gli.h:39
#9 0x000000000041926a in main (argc=2, argv=0x7ffda5663ff8) at gui/acd2d_main_gui.cpp:106
Run for segmentation fault 2:
$ ./acd2d_gui ./test_env/my_test.poly
Console output:
- Input: ./test_env/ocsc.poly
concavity tolerance=0
concavity weight (alpha)=0
distance weight (beta)=1
GUI Usage:
d: decompose once
D: decompose all
n: show/hide normal direction
h: show/hide convex hulls
r: reset camera
space bar: reload polygon
s: save decomposition
p: save rendering to PS file
+/-: zoom in/out
arrow keys: translate
! ERROR: FindCut_Out Error
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: U=-nan
! ERROR Info: Cut line O=(0.975589,-0.430997)
! ERROR Info: Cut line V=(-nan,-nan)
! ERROR Info: Polygon=
8 out
0.981055 -0.241068
0.975589 -0.430997
0.981055 -0.241068
0.674894 -0.147007
0.390904 -0.149679
0.388231 -0.111591
0.674894 -0.120278
0.674894 -0.147007
1 2 3 4 5 6 7 8
Gdb output:
0x0000000000000080 in ?? ()
(gdb) bt
#0 0x0000000000000080 in ?? ()
#1 0x000000000044a5ce in acd2d::setBridge (e=0xa84970, s=<optimized out>, b=0x0)
#2 acd2d::removeBridge (v=0xa84af0)
#3 acd2d::cd_vertex::~cd_vertex (this=0xa84af0, __in_chrg=<optimized out>)
#4 acd2d::cd_poly::destroy (this=0xa84b80)
#5 acd2d::cd_polygon::destroy (this=this@entry=0xa85350)
#6 0x000000000044cfd9 in acd2d::cd_2d::destroy (this=this@entry=0x7ffff76ed628)
Please check the attachment "my_test.txt" for "my_test.poly".
Thank you!
Luke
Attachments:
my_test.txt
While trying to make the repo, I get the following error with the FIST library.
g++ -std=c++11 -MMD -W -O3 -Wno-deprecated -Wno-unused-parameter -I. -Isrc -Isrc/mathtool -Isrc/hull -Isrc/edge_visibility -Igui -Igui/GL -I./libs/FIST -fPIC -o acd2d_gui src/acd2d_data.o src/acd2d_concavity.o src/acd2d_core.o src/mathtool/acd2d_Basic.o src/hull/acd2d_hull_use_qhull.o src/hull/acd2d_hull.o src/edge_visibility/acd2d_edge_visibility.o src/edge_visibility/acd2d_ev_function.o gui/acd2d_drawPS.o gui/acd2d_main_gui.o gui/acd2d_stat.o gui/GL/gliTexture.o gui/GL/gliFont.o gui/GL/gli.o gui/GL/gliDump.o gui/GL/gl2ps.o -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/local/lib -lXext -lX11 -lXt -lglut -lGLU -lGL -lm -L./libs/FIST -lFIST.linux64
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(api_functions.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(compute.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(data.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(desperate.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(ear_clip.o): relocation R_X86_64_32 against symbol `numerics_h_p' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(elapsed.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(grid.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(heap.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(io.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(list.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(misc.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(numerics.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(orientation.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(quads.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(sgo.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(simple.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(statistics.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(triangulate.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(vertex.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(write_ipe.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(bottleneck.o): relocation R_X86_64_32 against symbol `numerics_h_p' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(bridge.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(clean_data.o): relocation R_X86_64_32 against symbol `_Z6p_compPKvS0_' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(degenerate.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(ipe_io.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(project.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:90: recipe for target 'acd2d_gui' failed
make: *** [acd2d_gui] Error 1
From what I understand, the compilation requires the shared object for the FIST library. How can I generate the shared object for FIST?
I tried running approximate convex decomposition algorithm on my input dataset with 1 out polygonal chain and 1 in polygonal chain(hole) , but the output doesn't respects the holes and also partitions inside the holes.
sample output:
I have checked the order of all polygonal chains to be counterclockwise.I have also tried experimenting with all the command line options (-t, -m, -a, -b). What can be the possible reason for this??
I am using Ubuntu 16.04LTS 64 bit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.