@@ -59,6 +59,7 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
59
59
const mask_t &mask, const transform3_type &trf,
60
60
const std::array<scalar_type, 2u > mask_tolerance =
61
61
{0 .f , 100 .f * unit<scalar_type>::um},
62
+ const scalar_type mask_tol_scalor = 0 .f,
62
63
const scalar_type overstep_tol = 0 .f) const {
63
64
64
65
// One or both of these solutions might be invalid
@@ -68,15 +69,17 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
68
69
switch (qe.solutions ()) {
69
70
case 2 :
70
71
ret[1 ] = build_candidate<surface_descr_t >(
71
- ray, mask, trf, qe.larger (), mask_tolerance, overstep_tol);
72
+ ray, mask, trf, qe.larger (), mask_tolerance,
73
+ mask_tol_scalor, overstep_tol);
72
74
ret[1 ].sf_desc = sf;
73
75
// If there are two solutions, reuse the case for a single
74
76
// solution to setup the intersection with the smaller path
75
77
// in ret[0]
76
78
[[fallthrough]];
77
79
case 1 :
78
80
ret[0 ] = build_candidate<surface_descr_t >(
79
- ray, mask, trf, qe.smaller (), mask_tolerance, overstep_tol);
81
+ ray, mask, trf, qe.smaller (), mask_tolerance,
82
+ mask_tol_scalor, overstep_tol);
80
83
ret[0 ].sf_desc = sf;
81
84
break ;
82
85
case 0 :
@@ -97,7 +100,7 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
97
100
const mask_t &mask, const transform3_type &trf,
98
101
const scalar_type mask_tolerance,
99
102
const scalar_type overstep_tol = 0 .f) const {
100
- return this ->operator ()(ray, sf, mask, trf, {mask_tolerance, 0 .f },
103
+ return this ->operator ()(ray, sf, mask, trf, {mask_tolerance, 0 .f }, 0 . f ,
101
104
overstep_tol);
102
105
}
103
106
@@ -117,6 +120,7 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
117
120
const mask_t &mask, const transform3_type &trf,
118
121
const std::array<scalar_type, 2u > mask_tolerance =
119
122
{0 .f , 1 .f * unit<scalar_type>::mm},
123
+ const scalar_type mask_tol_scalor = 0 .f,
120
124
const scalar_type overstep_tol = 0 .f) const {
121
125
122
126
// One or both of these solutions might be invalid
@@ -125,7 +129,8 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
125
129
switch (qe.solutions ()) {
126
130
case 1 :
127
131
sfi = build_candidate<surface_descr_t >(
128
- ray, mask, trf, qe.smaller (), mask_tolerance, overstep_tol);
132
+ ray, mask, trf, qe.smaller (), mask_tolerance,
133
+ mask_tol_scalor, overstep_tol);
129
134
break ;
130
135
case 0 :
131
136
sfi.status = false ;
@@ -169,6 +174,7 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
169
174
build_candidate (const ray_type &ray, mask_t &mask,
170
175
const transform3_type &trf, const scalar_type path,
171
176
const std::array<scalar_type, 2u > mask_tolerance,
177
+ const scalar_type mask_tol_scalor,
172
178
const scalar_type overstep_tol) const {
173
179
174
180
assert ((mask_tolerance[0 ] <= mask_tolerance[1 ]) &&
@@ -189,9 +195,10 @@ struct ray_intersector_impl<cylindrical2D<algebra_t>, algebra_t, false> {
189
195
is.local = mask.to_local_frame (trf, p3);
190
196
// Tolerance: per mille of the distance
191
197
is.status = mask.is_inside (
192
- is.local , math::max (mask_tolerance[0 ],
193
- math::min (mask_tolerance[1 ],
194
- 1e-3f * math::fabs (is.path ))));
198
+ is.local ,
199
+ math::max (mask_tolerance[0 ],
200
+ math::min (mask_tolerance[1 ],
201
+ mask_tol_scalor * math::fabs (is.path ))));
195
202
196
203
// prepare some additional information in case the intersection
197
204
// is valid
0 commit comments