Nurbs Surface Irregular
Non Rectangular footprint
1
//Base Profile
2
ln1 = Line.ByStartPointEndPoint(Point.ByCoordinates(-50,0),Point.ByCoordinates(0,-50));
3
pt1 = ln1.PointAtParameter(0..1..#9).Translate(Vector.ByCoordinates(-1,-1,0),[0,5,0,0,5,0,0,5,0]);
4
pg1 = Polygon.ByPoints(List.Flatten(List.RestOfItems(pt1).Rotate(Point.Origin(),Vector.ZAxis(),(90..#4..90)<1>),-1));
5
6
//Nurbs Surface
7
pt2 = Point.ByCoordinates((-60..60..15)<1>,(-60..60..15)<2>);
8
bl1 = pt2.DoesIntersect(pg1.Patch());
9
ds1 = bl1? pt2.DistanceTo(pg1) : 0;
10
pt3 = pt2.Translate(Vector.ZAxis(),ds1/2);
11
ns1 = NurbsSurface.ByPoints(pt3,3,3);
12
13
nc2 = PolyCurve.ByJoinedCurves(pg1.PullOntoSurface(ns1));
14
ns2 = ns1.TrimWithEdgeLoops(nc2);
15
ns3 = GeometryColor.ByGeometryColor(ns2,Color.ByARGB(250,220,120,20));
Copied!
1
//Base Profile
2
ln1 = Line.ByStartPointEndPoint(Point.ByCoordinates(-50,0),Point.ByCoordinates(0,-50));
3
pt1 = ln1.PointAtParameter(0..1..#9).Translate(Vector.ByCoordinates(-1,-1,0),[0,5,0,0,5,0,0,5,0]);
4
pg1 = Polygon.ByPoints(List.Flatten(List.RestOfItems(pt1).Rotate(Point.Origin(),Vector.ZAxis(),(90..#4..90)<1>),-1));
5
6
//Nurbs Surface
7
pt2 = Point.ByCoordinates((-60..60..15)<1>,(-60..60..15)<2>);
8
bl1 = pt2.DoesIntersect(pg1.Patch());
9
ds1 = bl1? pt2.DistanceTo(pg1) : 0;
10
pt3 = pt2.Translate(Vector.ZAxis(),ds1/2);
11
ns1 = NurbsSurface.ByPoints(pt3,3,3);
12
13
nc2 = PolyCurve.ByJoinedCurves(pg1.PullOntoSurface(ns1));
14
ns2 = ns1.TrimWithEdgeLoops(nc2);
15
ns3 = GeometryColor.ByGeometryColor(ns2,Color.ByARGB(250,220,120,20));
Copied!
Last modified 6mo ago
Copy link