Comments (2)
If you want to solve this problem, you have to provide more detailed information. Preferably post a complete code and point out where is the problem.
from libccd.
If this is the same segmentation fault I'm running into with my program, it's an address boundary error caused by nextSupport() in ccd.c at line 961. Further up this trace from valgrind we find __ccdGJKEPA() calls nextSupport():
while (1){
// get triangle nearest to origin
*nearest = ccdPtNearest(polytope);
// get next support point
if (nextSupport(obj1, obj2, ccd, *nearest, &supp) != 0)
break;
// expand nearest triangle using new point - supp
if (expandPolytope(polytope, *nearest, &supp) != 0)
return -2;
}
After tossing a printf into _ccdPtNearestRenew() I found nearest doesn't get set and it's left null after the 3 _ccdPtNearestUpdate() calls in _ccdPtNearestRenew(), which ccdPtNearest() calls if nearest is null.
I think it could be a mathematical robustness issue. Tossing a printf into _ccdPtNearestUpdate() shows el->dist == -nan and pt->nearest_dist == some very big number.
_ccd_inline void _ccdPtNearestUpdate(ccd_pt_t *pt, ccd_pt_el_t *el)
{
if (ccdEq(pt->nearest_dist, el->dist)){
if (el->type < pt->nearest_type){
pt->nearest = el;
pt->nearest_dist = el->dist;
pt->nearest_type = el->type;
}
}else if (el->dist < pt->nearest_dist){
pt->nearest = el;
pt->nearest_dist = el->dist;
pt->nearest_type = el->type;
}
// pt->nearest remains null
printf("dists: %f %f\n", pt->nearest_dist, el->dist);
}
static void _ccdPtNearestRenew(ccd_pt_t *pt)
{
ccd_pt_vertex_t *v;
ccd_pt_edge_t *e;
ccd_pt_face_t *f;
pt->nearest_dist = CCD_REAL_MAX;
pt->nearest_type = 3;
pt->nearest = NULL;
ccdListForEachEntry(&pt->vertices, v, ccd_pt_vertex_t, list){
_ccdPtNearestUpdate(pt, (ccd_pt_el_t *)v);
}
ccdListForEachEntry(&pt->edges, e, ccd_pt_edge_t, list){
_ccdPtNearestUpdate(pt, (ccd_pt_el_t *)e);
}
ccdListForEachEntry(&pt->faces, f, ccd_pt_face_t, list){
_ccdPtNearestUpdate(pt, (ccd_pt_el_t *)f);
}
}
ccd_pt_el_t *ccdPtNearest(ccd_pt_t *pt)
{
if (!pt->nearest){
_ccdPtNearestRenew(pt);
}
return pt->nearest;
}
from libccd.
Related Issues (20)
- nextSupport function does not compute the right answer HOT 4
- Edge/Vertex order in ccd_pt_face_t HOT 1
- ccd_pt_vertex_t.edges is incorrectly assigned HOT 1
- Installation Crashing from executing make HOT 7
- findPenetr() can divide by zero.
- ccdVec3PointTriDist2() divides by zero. HOT 3
- Example from the 'GJK - Intersection Test' section fails HOT 1
- 'pkg-config --libs' shouldn't return -lm
- Enable compilation for ICC
- ccdVec3PointTriDist2 computes different distance with / without witness points. HOT 3
- M_PI not defined on test_gjk_libccd-inl_epa.cpp
- Warning C4273"inconsistent dll linkage" when build Static Library
- Fatal error: LNK1120 unresolved externals when libccd maked as static library HOT 1
- Examples in README are difficult to read and don't define all symbols they use HOT 3
- ccdGJKPenetration: Access violation reading location 0x0000000000000000. occurred HOT 7
- MPR - Penetration depth with any vector, not with MDT-vector - it's possible?
- ccdMPRPenetration() bug, wrong dir penetration depth HOT 36
- use CMAKE_INSTALL_DOCDIR insted of ${CMAKE_INSTALL_DATAROOTDIR}/doc/ccd
- Question: EPA Position Computation
- autotools install does not install header files.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libccd.