olyline p = New OnPolyline() Dim arrpts(0) As Double Dim k, l As Int32 k = 0 l = -1 For k = 0 To pts.count - 1 l = l + 3 ReDim Preserve arrpts(l) arrpts(l - 2) = pts.item(k).x arrpts(l - 1) = pts.item(k).y arrpts(l - 0) = pts.item(k).z Next l = l + 3 ReDim Preserve arrpts(l) arrpts(l - 2) = pts.item(0).x arrpts(l - 1) = pts.item(0).y arrpts(l - 0) = pts.item(0).z p.Create(3, False, 3, arrpts) ???
Return p End Function
How should I proceed with Rhinocommon right in this example?
(Of course we need to change Polyline instead of OnPolyline, Point3d instead of On3dPoint etc)
Thanks in advance, and keep up the good work!…
console app into "Rhino\System\" directory the program runs fine. I've searched for days regarding the loading of dll's but to no avail. Could it be that the Rhino dll's are protected in the program files directory? The code is very simple, please take a look.
using Rhino.Geometry;using System;using System.Collections.Generic;using System.Text;namespace Rhino{ class Program { static void Main(string[] args) { Point3d j = new Point3d(1, 1, 1); Point3d k = new Point3d(2, 2, 2); List<Point3d> list = new List<Point3d>(); list.Add(j); list.Add(k); Console.WriteLine(new List<Point3d>{j,k}); Point3d p = Point3d.Add(j, k); Console.WriteLine(Point3d.ArePointsCoplanar(list, 1.0)); Console.Read(); } }}
…
as follows.
We have a grid which consists of a collection of columns, where each column consists of a list of points. You said flattening is out of the question, so we need to cull items from each list individually.
Let's say our culling pattern is KDDDKDD (repeat as needed). K = Keep, D = Ditch. If a column contains 18 points, the pattern needs to be repeated until it is 18 items long. In this case:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
K D D D K D D K D D D K D D K D D D
We can now cull each column, but they will all be culled in the same way. By shifting the pattern one more index for each column, we can cycle the culling.
The fix incidentally is to Shift the pattern PRIOR to repeating it. Then it works as expected:
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 2:49pm on October 2, 2013