> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/geometry-1/nurbs-surface-irregular.md).

# Nurbs Surface Irregular

![](/files/-MZM93KfDr856OmmlZ46)

```d
//Base Profile
ln1 = Line.ByStartPointEndPoint(Point.ByCoordinates(-50,0),Point.ByCoordinates(0,-50));
pt1 = ln1.PointAtParameter(0..1..#9).Translate(Vector.ByCoordinates(-1,-1,0),[0,5,0,0,5,0,0,5,0]);
pg1 = Polygon.ByPoints(List.Flatten(List.RestOfItems(pt1).Rotate(Point.Origin(),Vector.ZAxis(),(90..#4..90)<1>),-1));

//Nurbs Surface
pt2 = Point.ByCoordinates((-60..60..15)<1>,(-60..60..15)<2>);
bl1 = pt2.DoesIntersect(pg1.Patch());
ds1 = bl1? pt2.DistanceTo(pg1) : 0;
pt3 = pt2.Translate(Vector.ZAxis(),ds1/2);
ns1 = NurbsSurface.ByPoints(pt3,3,3);

nc2 = PolyCurve.ByJoinedCurves(pg1.PullOntoSurface(ns1));
ns2 = ns1.TrimWithEdgeLoops(nc2);
ns3 = GeometryColor.ByGeometryColor(ns2,Color.ByARGB(250,220,120,20));
```

![](/files/-MZM9A8njyXz_1ZIgkby)

```d
//Base Profile
ln1 = Line.ByStartPointEndPoint(Point.ByCoordinates(-50,0),Point.ByCoordinates(0,-50));
pt1 = ln1.PointAtParameter(0..1..#9).Translate(Vector.ByCoordinates(-1,-1,0),[0,5,0,0,5,0,0,5,0]);
pg1 = Polygon.ByPoints(List.Flatten(List.RestOfItems(pt1).Rotate(Point.Origin(),Vector.ZAxis(),(90..#4..90)<1>),-1));

//Nurbs Surface
pt2 = Point.ByCoordinates((-60..60..15)<1>,(-60..60..15)<2>);
bl1 = pt2.DoesIntersect(pg1.Patch());
ds1 = bl1? pt2.DistanceTo(pg1) : 0;
pt3 = pt2.Translate(Vector.ZAxis(),ds1/2);
ns1 = NurbsSurface.ByPoints(pt3,3,3);

nc2 = PolyCurve.ByJoinedCurves(pg1.PullOntoSurface(ns1));
ns2 = ns1.TrimWithEdgeLoops(nc2);
ns3 = GeometryColor.ByGeometryColor(ns2,Color.ByARGB(250,220,120,20));
```
