Quantcast
Channel: Grasshopper Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 3657

C#_weave component

$
0
0

@obhagwat29 wrote:

I am trying to make star shape polyline using the points shown in the picture in c#.
Any help would be great!

attached image and script.

List<Point3d> Tpts = new List<Point3d>();
List<Point3d> midPts = new List<Point3d>();
List<Point3d> endPts = new List<Point3d>();
List<Point3d> strPts = new List<Point3d>();
List<Curve> star = new List<Curve>();

List<Curve> crvs = Polygon(2, 8, 22);
Curve cr = crvs[0];
List<Curve> cC = cr.DuplicateSegments().ToList();
Rhino.Geometry.AreaMassProperties cA = Rhino.Geometry.AreaMassProperties.Compute(cr);
Point3d centro = cA.Centroid;

foreach (Curve c in cC)
{
  Point3d p = c.PointAtNormalizedLength(0.5);
  Point3d p1 = c.PointAtEnd;
  Tpts.Add(p);
  endPts.Add(p1);
}

foreach(Point3d pt in endPts)
{
  Curve lines = new Line(centro, pt).ToNurbsCurve();
  Point3d mP = lines.PointAt(t);
  midPts.Add(mP);
}

//////////////////////////////////////////////////////
/* /???
for (int i = 0; i < Tpts.Count;i++)
{
strPts.Add(Tpts[i]);
strPts.Insert(i+2, midPts[i]);
}

Polyline allPls = new Polyline(strPts);

*/

weave%20pattern

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 3657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>