mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
more features of DirectionalInterval
This commit is contained in:
parent
2dc506fcfd
commit
bd5699d5f1
@ -33,6 +33,14 @@ public:
|
||||
return i2;
|
||||
}
|
||||
|
||||
|
||||
DirectionalInterval Intersect (const DirectionalInterval & i2)
|
||||
{
|
||||
DirectionalInterval res = *this;
|
||||
res.minval = max(res.minval, i2.minval);
|
||||
res.maxval = min(res.maxval, i2.maxval);
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Contains (gp_Pnt p, double eps = 1e-8)
|
||||
{
|
||||
|
@ -321,6 +321,13 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
|
||||
|
||||
|
||||
py::class_<DirectionalInterval> (m, "DirectionalInterval")
|
||||
.def("__str__", [](DirectionalInterval self)
|
||||
{
|
||||
stringstream str;
|
||||
str << "(" << self.minval << ", " << self.maxval << ")";
|
||||
return str.str();
|
||||
})
|
||||
|
||||
.def("__lt__", [](DirectionalInterval i, double val)
|
||||
{
|
||||
cout << "directionalinterval, lt, imin/max = " << i.minval << " / " << i.maxval << endl;
|
||||
@ -331,6 +338,10 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
|
||||
cout << "directionalinterval, gt, imin/max = " << i.minval << " / " << i.maxval << endl;
|
||||
return i > val;
|
||||
})
|
||||
.def("__and__", [](DirectionalInterval self, DirectionalInterval other) {
|
||||
cout << "and of intervals" << endl;
|
||||
return self.Intersect(other);
|
||||
})
|
||||
;
|
||||
|
||||
py::implicitly_convertible<py::tuple, gp_Pnt>();
|
||||
|
Loading…
Reference in New Issue
Block a user