The places where the corner points should be found is marked in red color. Is there any function in Python that can find the corner or if not, what approach can we take to find corners especially in the curve places like shown below
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
crvID=rs.GetObject("Select a polycurve",4,True)
if crvID:
pc=rs.coercecurve(crvID)
#find discontinuities
dom=pc.Domain
cornerParams=[]
t=dom[0]
cont=Rhino.Geometry.Continuity.C2_locus_continuous
while True:
rc,t=pc.GetNextDiscontinuity(cont,t,dom[1])
if not rc: break
cornerParams.append(t)
#add points to see
for t in cornerParams:
sc.doc.Objects.AddPoint(pc.PointAt(t))
sc.doc.Views.Redraw()