Hello,
I’m trying to get intersection point of two segments.
There is:
https://docs.kicad.org/doxygen-python-8.0/classpcbnew_1_1SEG.html#a922a1fc1a5a0258fc0dd80dd30af5f25
def Intersect(self, aSeg, aIgnoreEndpoints=False, aLines=False):
r"""Intersect(SEG self, SEG aSeg, bool aIgnoreEndpoints=False, bool aLines=False) -> OPT_VECTOR2I"""
return _pcbnew.SEG_Intersect(self, aSeg, aIgnoreEndpoints, aLines)
but it returns OPT_VECTOR2I
which I think is missing swig handling and can’t be used from python (or am I missing something?)
Something like this:
seg1 = pcbnew.SEG(pos1, pos2)
seg2 = pcbnew.SEG(pos3, pos4)
result = seg1.Intersect(seg2)
produces following message in terminal:
swig/python detected a memory leak of type 'std::optional< VECTOR2< int > > *', no destructor found.