ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rfluxmtx.c
(Generate patch)

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.51 by greg, Mon Mar 2 22:00:05 2020 UTC vs.
Revision 2.54 by greg, Wed Dec 15 01:38:50 2021 UTC

# Line 720 | Line 720 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
720                                          /* compute projected areas */
721          for (i = 0, sp = p->slist; sp != NULL; i++, sp = sp->next) {
722                  projsa[i] = -DOT(sp->snrm, rdir) * sp->area;
723 <                tarea += projsa[i] *= (double)(projsa[i] > FTINY);
723 >                tarea += projsa[i] *= (double)(projsa[i] > 0);
724          }
725 <        if (tarea < 0) {                /* wrong side of sender? */
725 >        if (tarea < FTINY*FTINY) {      /* wrong side of sender? */
726                  fputs(progname, stderr);
727                  fputs(": internal - sample behind all sender elements!\n",
728                                  stderr);
# Line 740 | Line 740 | sample_uniform(PARAMS *p, int b, FILE *fp)
740   {
741          int     n = sampcnt;
742          double  samp3[3];
743 <        double  duvw[3];
744 <        FVECT   orig_dir[2];
743 >        FVECT   duvw, orig_dir[2];
744          int     i;
745  
746          if (fp == NULL)                 /* just requesting number of bins? */
# Line 749 | Line 748 | sample_uniform(PARAMS *p, int b, FILE *fp)
748  
749          while (n--) {                   /* stratified hemisphere sampling */
750                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
751 <                SDsquare2disk(duvw, samp3[1], samp3[2]);
751 >                square2disk(duvw, samp3[1], samp3[2]);
752                  duvw[2] = -sqrt(1. - duvw[0]*duvw[0] - duvw[1]*duvw[1]);
753                  for (i = 3; i--; )
754                          orig_dir[1][i] = duvw[0]*p->udir[i] +
# Line 769 | Line 768 | sample_shirchiu(PARAMS *p, int b, FILE *fp)
768   {
769          int     n = sampcnt;
770          double  samp3[3];
771 <        double  duvw[3];
773 <        FVECT   orig_dir[2];
771 >        FVECT   duvw, orig_dir[2];
772          int     i;
773  
774          if (fp == NULL)                 /* just requesting number of bins? */
# Line 778 | Line 776 | sample_shirchiu(PARAMS *p, int b, FILE *fp)
776  
777          while (n--) {                   /* stratified sampling */
778                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
779 <                SDsquare2disk(duvw, (b/p->hsiz + samp3[1])/curparams.hsiz,
779 >                square2disk(duvw, (b/p->hsiz + samp3[1])/curparams.hsiz,
780                                  (b%p->hsiz + samp3[2])/curparams.hsiz);
781                  duvw[2] = sqrt(1. - duvw[0]*duvw[0] - duvw[1]*duvw[1]);
782                  for (i = 3; i--; )
# Line 997 | Line 995 | finish_polygon(SURF *p)
995                  VCOPY(e1, e2);
996          }
997          p->area = normalize(p->snrm)*0.5;
998 <        return(p->area > FTINY);
998 >        return(p->area > FTINY*FTINY);
999   }
1000  
1001   /* Add a surface to our current parameters */
# Line 1060 | Line 1058 | add_surface(int st, const char *oname, FILE *fp)
1058                  snew->area *= PI*snew->area;
1059                  break;
1060          }
1061 <        if ((snew->area <= FTINY) & (verbose >= 0)) {
1061 >        if ((snew->area <= FTINY*FTINY) & (verbose >= 0)) {
1062                  fprintf(stderr, "%s: warning - zero area for surface '%s'\n",
1063                                  progname, oname);
1064                  free(snew);
# Line 1308 | Line 1306 | main(int argc, char *argv[])
1306                  case 'n':               /* options with 1 argument */
1307                  case 's':
1308                  case 'o':
1309 +                case 't':
1310                          na = 2;
1311                          break;
1312                  case 'b':               /* special case */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines