AddPlanarSrf self-intersecting

Trying to make a plane from a closed curve, the curve have self-intersecting.

In rhinoscriptsyntax I tried

tmp = rs.AddPlanarSrf(curve)
print tmp #None

In the rhino command:

 PlanarSrf

I get

Sefl-intersecting input curves were found. Using curve boolean processing.?

If I press yes I get the correct surfaces.

My question is, which curve boolean processing are used when pressing yes? and what rhinoscriptsyntax is mimic it?
I have attach the curve that I am trying it on, this is just a demo curve. Need a method that work automatic on all sorts of curve, but alwaise in the x,y plane.

curve.3dm (23.7 KB)

AddPlanarSrf seems to work with your example, it will just add the 3 separate surfaces in the same way it would if you answered yes to the question in the Rhino command.

I’m assuming it will use the active CPlane, so make sure you set that before or while running your script.

–Mitch

Thanks you so much, I had a error a other place in my code.
You are completly correct it work

I will remove the hole post in 10 min, no need to have it up

No need to remove the post, no harm done! --Mitch