extrusion.Create failled

hi, m trying to using ghpython to extrude a curve to a closed brep, using extrusion.Create, but failed. then i use trygetPlane() to check the curve , returned False, while using trygetPlane(0.0001), it returned True.
maybe i dont make myself chear, please have a look at the attached file. :grinning:extrusionFail.3dm (39.9 KB) extrusionFail.gh (7.2 KB)


import rhinoscriptsyntax as rs
if rs.IsCurvePlanar(x):
    normal = rs.CurvePlane(x)[3]
    a = rs.ExtrudeCurve(x, rs.AddLine([0,0,0], 100 * normal))


import Rhino.Geometry as rg
from scriptcontext import doc
isplanar, plane = x.TryGetPlane(doc.ModelAbsoluteTolerance)
if isplanar:
    x = rg.Curve.ProjectToPlane(x, plane)
    a = rg.Extrusion.Create(x, 100, True)

Extrusion.gh (12.8 KB)

thanks man, u r a hero.