Nurbs Surface Irregular
Non Rectangular footprint
//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));
//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));
Copy link