qh_fprintf(qh,qh->ferr,8092,"\n%d points were well inside the hull. If the hull contains\n\
a lens-shaped component, these points were not verified. Use\n\
options 'Qci Tv' to verify all points.\n",notverified);
if(maxdist>qh->outside_err){
qh_fprintf(qh,qh->ferr,6110,"qhull precision error (qh_check_bestdist): a coplanar point is %6.2g from convex hull. The maximum value(qh.outside_err) is %6.2g\n",
maxdist,qh->outside_err);
qh_errexit2(qh,qh_ERRprec,errfacet1,errfacet2);
}elseif(waserror&&qh->outside_err>REALmax/2)
qh_errexit2(qh,qh_ERRprec,errfacet1,errfacet2);
/* else if waserror, the error was logged to qh.ferr but does not effect the output */
trace0((qh,qh->ferr,20,"qh_check_bestdist: max distance outside %2.2g\n",maxdist));
trace0((qh,qh->ferr,16,"qh_check_dupridge: duplicate ridge between f%d and f%d due to nearly-coincident vertices (%2.2g), dist %2.2g, reverse dist %2.2g, ratio %2.2g while processing p%d\n",
qh_fprintf(qh,qh->ferr,6271,"qhull precision error (qh_check_dupridge): wide merge (%.0f times wider) due to duplicate ridge with nearly coincident points (%2.2g) between f%d and f%d, merge dist %2.2g, while processing p%d\n- Ignore error with option 'Q12'\n- To be fixed in a later version of Qhull\n",
qh_fprintf(qh,qh->ferr,8145,"- A bounding box for the input sites may alleviate this error.\n");
if(minvertex>qh_WIDEduplicate*prevdist)
qh_fprintf(qh,qh->ferr,8146,"- Vertex distance %2.2g is greater than %d times maximum distance %2.2g\n Please report to bradb@shore.net with steps to reproduce and all output\n",
qh_fprintf(qh,qh->ferr,6112,"qhull precision error (qh_check_points): a coplanar point is %6.2g from convex hull. The maximum value(qh.outside_err) is %6.2g\n",
maxdist,qh->outside_err);
qh_errexit2(qh,qh_ERRprec,errfacet1,errfacet2);
}elseif(errfacet1&&qh->outside_err>REALmax/2)
qh_errexit2(qh,qh_ERRprec,errfacet1,errfacet2);
/* else if errfacet1, the error was logged to qh.ferr but does not effect the output */
trace0((qh,qh->ferr,21,"qh_check_points: max distance outside %2.2g\n",maxdist));
qh_fprintf(qh,qh->ferr,6138,"qhull internal error (qh_checkpolygon): visible list f%d no longer on facet list\n",qh->visible_list->id);
qh_printlists(qh);
qh_errexit(qh,qh_ERRqhull,qh->visible_list,NULL);
}
if(facetlist==qh->facet_list)
vertexlist=qh->vertex_list;
elseif(facetlist==qh->newfacet_list)
vertexlist=qh->newvertex_list;
else
vertexlist=NULL;
FORALLvertex_(vertexlist){
vertex->seen=False;
vertex->visitid=0;
}
FORALLfacet_(facetlist){
if(facet->visible)
continue;
if(facet->simplicial)
numridges+=qh->hull_dim;
else
numridges+=qh_setsize(qh,facet->ridges);
FOREACHvertex_(facet->vertices){
vertex->visitid++;
if(!vertex->seen){
vertex->seen=True;
numvertices++;
if(qh_pointid(qh,vertex->point)==qh_IDunknown){
qh_fprintf(qh,qh->ferr,6139,"qhull internal error (qh_checkpolygon): unknown point %p for vertex v%d first_point %p\n",
vertex->point,vertex->id,qh->first_point);
waserror=True;
}
}
}
}
qh->vertex_visit+=(unsignedint)numfacets;
if(facetlist==qh->facet_list){
if(numfacets!=qh->num_facets-qh->num_visible){
qh_fprintf(qh,qh->ferr,6140,"qhull internal error (qh_checkpolygon): actual number of facets is %d, cumulative facet count is %d - %d visible facets\n",
numfacets,qh->num_facets,qh->num_visible);
waserror=True;
}
qh->vertex_visit++;
if(qh->VERTEXneighbors){
FORALLvertices{
qh_setcheck(qh,vertex->neighbors,"neighbors for v",vertex->id);
qh_fprintf(qh,qh->ferr,6151,"qhull input error: 'Qg QVn' (only good vertex) does not work with merging.\nUse 'QJ' to joggle the input or 'Q0' to turn off merging.\n");
if(!qh_checkflipped(qh,facet,NULL,qh_ALL)){/* due to axis-parallel facet */
trace1((qh,qh->ferr,1031,"qh_initialhull: initial orientation incorrect. Correct all facets\n"));
facet->flipped=False;
FORALLfacets{
facet->toporient^=(unsignedchar)True;
qh_orientoutside(qh,facet);
}
break;
}
}
FORALLfacets{
if(!qh_checkflipped(qh,facet,NULL,!qh_ALL)){/* can happen with 'R0.1' */
if(qh->DELAUNAY&&!qh->ATinfinity){
if(qh->UPPERdelaunay)
qh_fprintf(qh,qh->ferr,6240,"Qhull precision error: Initial simplex is cocircular or cospherical. Option 'Qs' searches all points. Can not compute the upper Delaunay triangulation or upper Voronoi diagram of cocircular/cospherical points.\n");
else
qh_fprintf(qh,qh->ferr,6239,"Qhull precision error: Initial simplex is cocircular or cospherical. Use option 'Qz' for the Delaunay triangulation or Voronoi diagram of cocircular/cospherical points. Option 'Qz' adds a point \"at infinity\". Use option 'Qs' to search all points for the initial simplex.\n");
qh_errexit(qh,qh_ERRinput,NULL,NULL);
}
qh_precision(qh,"initial simplex is flat");
qh_fprintf(qh,qh->ferr,6154,"Qhull precision error: Initial simplex is flat (facet %d is coplanar with the interior point)\n",
returns size of qh.hash_table of at least newsize slots
notes:
assumes qh.hash_table is NULL
qh_HASHfactor determines the number of extra slots
size is not divisible by 2, 3, or 5
*/
intqh_newhashtable(qhT*qh,intnewsize){
intsize;
size=((newsize+1)*qh_HASHfactor)|0x1;/* odd number */
while(True){
if(newsize<0||size<0){
qh_fprintf(qh,qh->qhmem.ferr,6236,"qhull error (qh_newhashtable): negative request (%d) or size (%d). Did int overflow due to high-D?\n",newsize,size);/* WARN64 */
qh_errexit(qh,qhmem_ERRmem,NULL,NULL);
}
if((size%3)&&(size%5))
break;
size+=2;
/* loop terminates because there is an infinite number of primes */
trace2((qh,qh->ferr,2049,"qh_triangulate: update neighbor lists for vertices from v%d\n",getid_(new_vertex_list)));
qh->newvertex_list=new_vertex_list;/* all vertices of new facets */
qh->visible_list=NULL;
qh_updatevertices(qh/*qh.newvertex_list, empty newfacet_list and visible_list*/);
qh_resetlists(qh,False,!qh_RESETvisible/*qh.newvertex_list, empty newfacet_list and visible_list*/);
trace2((qh,qh->ferr,2050,"qh_triangulate: identify degenerate tricoplanar facets from f%d\n",getid_(new_facet_list)));
trace2((qh,qh->ferr,2051,"qh_triangulate: and replace facet->f.triowner with tricoplanar facets that own center, normal, etc.\n"));
FORALLfacet_(new_facet_list){
if(facet->tricoplanar&&!facet->visible){
FOREACHneighbor_i_(qh,facet){
if(neighbor_i==0){/* first iteration */
if(neighbor->tricoplanar)
orig_neighbor=neighbor->f.triowner;
else
orig_neighbor=neighbor;
}else{
if(neighbor->tricoplanar)
otherfacet=neighbor->f.triowner;
else
otherfacet=neighbor;
if(orig_neighbor==otherfacet){
zinc_(Ztridegen);
facet->degenerate=True;
break;
}
}
}
}
}
trace2((qh,qh->ferr,2052,"qh_triangulate: delete visible facets -- non-simplicial, null, and mirrored facets\n"));
owner=NULL;
visible=NULL;
for(facet=new_facet_list;facet&&facet->next;facet=nextfacet){/* may delete facet */
nextfacet=facet->next;
if(facet->visible){
if(facet->tricoplanar){/* a null or mirrored facet */
qh_delfacet(qh,facet);
qh->num_visible--;
}else{/* a non-simplicial facet followed by its tricoplanars */
if(visible&&!owner){
/* RBOX 200 s D5 t1001471447 | QHULL Qt C-0.01 Qx Qc Tv Qt -- f4483 had 6 vertices/neighbors and 8 ridges */
trace2((qh,qh->ferr,2053,"qh_triangulate: all tricoplanar facets degenerate for non-simplicial facet f%d\n",
visible->id));
qh_delfacet(qh,visible);
qh->num_visible--;
}
visible=facet;
owner=NULL;
}
}elseif(facet->tricoplanar){
if(facet->f.triowner!=visible||visible==NULL){
qh_fprintf(qh,qh->ferr,6162,"qhull error (qh_triangulate): tricoplanar facet f%d not owned by its visible, non-simplicial facet f%d\n",facet->id,getid_(visible));
qh_errexit2(qh,qh_ERRqhull,facet,visible);
}
if(owner)
facet->f.triowner=owner;
elseif(!facet->degenerate){
owner=facet;
nextfacet=visible->next;/* rescan tricoplanar facets with owner, visible!=0 by QH6162 */
facet->keepcentrum=True;/* one facet owns ->normal, etc. */
facet->coplanarset=visible->coplanarset;
facet->outsideset=visible->outsideset;
visible->coplanarset=NULL;
visible->outsideset=NULL;
if(!qh->TRInormals){/* center and normal copied to tricoplanar facets */
visible->center=NULL;
visible->normal=NULL;
}
qh_delfacet(qh,visible);
qh->num_visible--;
}
}
}
if(visible&&!owner){
trace2((qh,qh->ferr,2054,"qh_triangulate: all tricoplanar facets degenerate for last non-simplicial facet f%d\n",