ndingBox bbox = msh.GetBoundingBox(True) Dim fp As New point3d fp = bbox.FurthestPoint(pt) Dim vec As New vector3d(fp.X - pt.X, fp.Y - pt.Y, fp.Z - pt.Z) Dim dist As Double = fp.DistanceTo(pt) Dim xLine As New Line(pt, vec, dist * 10) Dim xCrv As New rhino.Geometry.PolylineCurve xCrv.SetStartPoint(xLine.From) xCrv.SetEndPoint(xLine.To)
Dim interPt() As point3d = rhino.Geometry.Intersect.Intersection.MeshPolyline(msh, xCrv, fIdx)
If interPt.length mod 2 = 0 then
isIn = false
else
isIn = true
end if
Return isIn
End Function
This returns an error "Object reference not set to an instance of an object" (I guess that its related to interPt array)
I have to add 2 values (0,0) to fIdx array, otherwise I get a warning that it has no values and it may return a null.
+ you said "Using a line-mesh intersector" ... I cant find it (rhino 4), so I create a polylineCurve to use polyline-mesh intersector. (cant cast line to polyline).. is that how you do it ?…
w with the smallest circles and the higher part with the biggest circles.
Details :
----- top -----
Part 6 : Radius 6 and circle of lower radius with the space left (but less)
Part 5 : Radius 5 and circle of lower radius with the space left (but less)
Part 4 : Radius 4 and circle of lower radius with the space left (but less)
Part 3 : Radius 3 and circle of lower radius with the space left (but less)
Part 2 : Radius 2 and circle of lower radius with the space left (but less)
Part 1 : Radius 1
----bottom----
2. The circle have, surrounding them, a space witch should not intersect with any other circle. For example a circle of radius 5 has a circle of radius 10 from the same center and no other circle should intersect this last one.
Now i have no problem putting points randomly on a surface and then dividing the primary surface in 6 sub-surfaces in order to make the gradiant... My problem start when i try to find the distance beetween the points and dispatch lists according to the distance beetwen them. I really don't know how to proceed i spend so far 5 hours per evening for 2 weeks now... So i won't detail what i've done in order to have new ideas and freshs starts of logics :)
Thx all in advance
ps : i'm aware it might not be clear, so questions are welcome :)
…
End Sub
'<Custom additional code>
Dim BB As BlABLA
Public Class BLABLA Public Curva As curve
Sub New(ids As list(Of guid)) Dim points As New list(Of point3d) For Each id As guid In ids Dim rh As rhinoobject = rhinodoc.ActiveDoc.Objects.Find(id) Dim pt As Rhino.Geometry.Point = DirectCast(rh.Geometry, rhino.Geometry.Point) If pt is Nothing Then Continue For points.add(pt.Location) Next curva = curve.CreateInterpolatedCurve(points, 3) End Sub
End Class…
.
1. How do I refer to the points in the for loop?
I have a list of points in grasshopper (not rhino objects) and I plugged them into python and named the input 'points'.
Then I had something like this:
for pt in points: ptCoord = rs.PointCoordinates(pt) x = ptCoord[0] y = ptCoord[1] z = ptCoord[2]
But I got error report in the bolded line saying
Parameter must be a Guid or string representing a Guid
2. How do I match multiple data to one
I know it's weird since the script can't read the points.. but sometimes the 'Distance' rhinoscript does work... however, it's giving me a single distance while I need a list of distances from multiple points to a target point
for pt in points: distance = rs.Distance(targetpoint,pt)
print distance
I don't know why it worked (it gave me a number so it seems to be reading the points).. However, it's giving me one single value. Is there anyway I cold make it a list?
3. This is extra.. but the ghpython doesn't fully work on my computer and it's weird..
It's ok if you guys completely ignore this question..
I just can't add new ghpython component to my computer.. Every time I tried to duplicate existing components, it gives me an error report saying it's missing the plug-in "python interpreter".. Also, even though grasshopper can successfully open this particular file that I'm working on, it gives me an error report and quit loading ghpython component every time I try to open another file containing ghpython..
I downloaded my ghpython from food4rhino, which works fine in my classmates' computers... I 'installed' (drag the ghpython into grasshopper) multiple times but it still doesn't seem to be working
Then I downloaded IronPython because some say it might work? But it didn't..
Thank you guys so much for this!…
de curve option could provide better "resolution").
3. If C1 yields 1 point > a C2 "scan" is attempted.
Added a mixed grill test case where copies of your latest test curve coexist with polylines.
…
you have the latest Rhino 5 beta.http://v5.rhino3d.com/page/download-1
Look forward to your feedback.-Rajaa IssaRobert McNeel & AssociatesWhat's new in PT for Rhino.- Update ptUnrollSurfaces command to work better with tags.- Updated toolbar.What's new in PT for GH:- Update to GH 0.9*.- Bake multiple grids without concatenate them.- Changed output structure from ptMorph2D so that it is easier to separate morpged modules into groups.- Added 4 new components: - ptFlatten - flatten 2D grid into a tree of unit grids or cells. - ptFlatten3D - flatten 2 input grids into a tree of unit grids or cells. - ptMorph2DMap - Map a list of 2D modules to 2D grid cells. - ptMorph3DMap - Map a list of 3D modules to 3D grid cells. - Update example to include new functionality. - Update tags and comments. - Fixed crash bug when managed paneling produce no meshes.…
rm, object y, ref object A) {
Rhino.DocObjects.LightObject light = doc.Lights[0];
light.LightGeometry.Transform(xForm); light.CommitChanges();
}
Allowing you to pass into xForm the transform output of a rotation component. (or any other transform for that matter.)
Note that both of these will apply the same rotation over and over and over again, so it behaves unlike a typical grasshopper rotation in that adjustments are cumulative rather than re-applied from scratch each time. For finer control over the light's rotation, you might want to specify its position rather than apply a transformation. This would look something like this:
Option 3:
private void RunScript(Point3d Pt, Vector3d Dir, ref object A) {
Rhino.DocObjects.LightObject light = doc.Lights[0];
light.LightGeometry.Location = Pt; light.LightGeometry.Direction = Dir; light.CommitChanges();
}
Dir is only necessary if you're operating on a directional light.
Also all of the above assume that there is exactly 1 light in the document - if you're dealing with more you'll have to be cleverer about how you access the light in question.…
ntainer, but have them each in their own 'grouped' branches. Putting them together just flattens them, while grafting before putting them together groups one point from each group. The ideal syntax I'd be looking for is:
(0) N = ['n' value for NT_100]
(1) N = ['n' value for JL_200]
(2) N = ['n' value for CB_300]
So that there is Data with 3 branches, one for each set of points. However, Im unclear as to how best to achieve this. Help is always appreciated!
…
list of just group of points only. His file finds the n-closest points to a point on a curve, but I want to find the n-closest points for each point in the group. I would use the Proximity3d component but it will only take points from the rhino model, baked and brought in, not points from grasshopper algorithm.
I started a VB node to try and do this but I am not getting very far. I can find the closest pt, but not the 4, 5, or 6 closest points with my method.
I am using version 0.6.0043.
thanks,
Guy
any help? any ideas?…
"sheet" body Breps (i.e trimmed stuff == BrepFaces) divide them proportionally to the u/v domains using DeDom2Num: get Lists of U1/V1 values, say a uList and a vList. In order to do that:
3. Find the min of each List, say uMin, vMin.
4. Your U/V division integer values (per surface) are:
(int) (U * uList[i] / uMin)); (int) (V * vList[i] / vMin));
5. Using the pts and vectors trees from the divide surface component ... add to each div pt the corresponding normal vector multiplied by some min/max random value.
6. Create a Nurbs Surface using the newly created "distorted" pts (control points or trough points).
7. Trim the surfaces against the potential Inner/Outer loops (per brep). Trim requires solid cutters mind.
…