Skip to content

Commit c994703

Browse files
committed
fix inconsistency in threshold calc
parallel and angle calculations are only comparable at small angles, ignore possible symmetric polyhedron issues, these will be caught later
1 parent 5e34168 commit c994703

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/symmetry.c

+2-10
Original file line numberDiff line numberDiff line change
@@ -414,21 +414,13 @@ msym_error_t findSymmetrySymmetricPolyhedron(msym_equivalence_set_t *es, double
414414
vsub(v0,vi, v0i);
415415
vnorm(v0i);
416416

417-
double tangle = fabs((fabs(dot0)-fabs(doti))/(fabs(dot0)+fabs(doti)));
418-
419-
if(!(tangle <= thresholds->angle)){
420-
msymSetErrorDetails("Elements in symmetric polyhedron do not lie on two parallel circles %e > %e (angle threshold)",tangle,thresholds->angle);
421-
ret = MSYM_SYMMETRY_ERROR;
422-
goto err;
423-
}
417+
theta = vangle(v0_proj, vi_proj);
424418

425-
if(vparallel(v0i,ev[prim],thresholds->angle)){
419+
if(theta < asin(thresholds->angle)){
426420
sigma_h = 1;
427421
staggered = 0;
428422
}
429423

430-
theta = vangle(v0_proj, vi_proj);
431-
432424
if(dot0*doti > 0.0){
433425
theta_sigma = theta/2;
434426
if(LT(theta, 4*M_PI/es->length, asin(thresholds->angle)) && es->length % 4 == 0){

0 commit comments

Comments
 (0)