How to build a freeform surface with single curved or flat panels using rhinoscript+

How to build a freeform surface with single curved or flat panels using rhinoscript