52 <<
"Span should have two positive and one zero entry. Now:"
55 else if (span[dir] < VSMALL)
73 <<
"Span should have one and only zero entry. Now:" << span
85 const scalar nearestDistSqr
98 info.rawPoint()[normalDir_] = origin_[normalDir_];
103 if (dir != normalDir_)
105 if (info.rawPoint()[dir] < origin_[dir])
107 info.rawPoint()[dir] = origin_[dir];
109 else if (info.rawPoint()[dir] > origin_[dir]+span_[dir])
111 info.rawPoint()[dir] = origin_[dir]+span_[dir];
118 if (
magSqr(info.rawPoint() - sample) > nearestDistSqr)
141 const vector dir(end-start);
143 if (
mag(dir[normalDir_]) < VSMALL)
150 scalar t = (origin_[normalDir_]-start[normalDir_]) / dir[normalDir_];
159 info.rawPoint() = start+t*dir;
160 info.rawPoint()[normalDir_] = origin_[normalDir_];
165 if (dir != normalDir_)
167 if (info.rawPoint()[dir] < origin_[dir])
173 else if (info.rawPoint()[dir] > origin_[dir]+span_[dir])
187 treeBoundBox bb(origin_, origin_+span_);
188 bb.min()[normalDir_] -= 1
E-6;
189 bb.max()[normalDir_] += 1
E-6;
191 if (!bb.contains(info.hitPoint()))
194 <<
"bb:" << bb <<
endl
195 <<
"origin_:" << origin_ <<
endl
196 <<
"span_:" << span_ <<
endl
197 <<
"normalDir_:" << normalDir_ <<
endl
198 <<
"hitPoint:" << info.hitPoint()
209 Foam::searchablePlate::searchablePlate
216 searchableSurface(io),
219 normalDir_(calcNormal(span_))
223 Info<<
"searchablePlate::searchablePlate :"
224 <<
" origin:" << origin_
225 <<
" origin+span:" << origin_+span_
232 Foam::searchablePlate::searchablePlate
239 origin_(dict.
lookup(
"origin")),
240 span_(dict.
lookup(
"span")),
241 normalDir_(calcNormal(span_))
245 Info<<
"searchablePlate::searchablePlate :"
246 <<
" origin:" << origin_
247 <<
" origin+span:" << origin_+span_
264 if (regions_.empty())
267 regions_[0] =
"region0";
273 void Foam::searchablePlate::findNearest
284 info[i] = findNearest(samples[i], nearestDistSqr[i]);
289 void Foam::searchablePlate::findLine
300 info[i] = findLine(start[i], end[i]);
312 findLine(start, end, info);
324 findLine(start, end, nearestInfo);
329 if (nearestInfo[pointI].hit())
332 info[pointI][0] = nearestInfo[pointI];
336 info[pointI].
clear();
363 normal[i][normalDir_] = 1.0;
376 "searchableCollection::getVolumeType(const pointField&"
377 ", List<volumeType>&) const"
378 ) <<
"Volume type not supported for plate."