. The code I wrote up til now is this:
Private Sub RunScript(ByVal x As Double, ByVal y As Double, ByVal z As Double, ByRef A As Object)
Dim pt (2)
pt(0) = x pt(1) = y pt(2) = z
A = pt
End SubDoes anyone know what statement I need to write to make this code work? Kind regardsJasper…
ls plugin installer for Rhino 5.0 (32 or 64 depending on your system).
3- Download PT-GH Add-on
Enjoy!
Rajaa Issa
Robert McNeel & Associates
-------------------
New in this release:
-------------------
- rhi Installer is more robust.
- Fixed ptConvertToDiamond component bug.
- Added new component for variable 3d paneling using a list of modules.
- Few other minor bug fixes.…
he start point.
Generation (2) i have 4 points + (3*3points) = 13 points.
Generation (3) i have 13 points + (9*3points) = 50 points.
But when i bake the python component i have 157 points ? Why ?
What's the logic behind this ?
Also how can i have in a, lists of points according to generations and for exemple in b lines according to generations too ??
Here's the code:
import rhinoscriptsyntax as rsimport random as rr.seed(seed)
def Main():....allGenerations = []....allGenerations.append(startPt)....curGeneration = []....curGeneration.append(startPt)....for i in range(gens):........newGeneration = []........for pt in curGeneration:............ang1 = r.randint(-30,30) ............ang2 = r.randint(90,150) ............ang3 = r.randint(210,270) ............dist1 = r.randint(10,40) ............dist2 = r.randint(10,40) ............dist3 = r.randint(10,40) ............zV = -1 ............newPoints = branch(pt, ang1, ang2, ang3, dist1/(i+1), dist2/(i+1), dist3/(i+1), zV) ............newGeneration.extend(newPoints) ............curGeneration = newGeneration ............allGenerations.extend(newGeneration)....return allGenerations
def branch(pt, ang1, ang2, ang3, dist1, dist2, dist3, zV):....ptP1 = rs.Polar(pt, ang1, dist1)....ptP2 = rs.Polar(pt, ang2, dist2) ....ptP3 = rs.Polar(pt, ang3, dist3) ....ptA1 = rs.AddPoint(ptP1)....ptA2 = rs.AddPoint(ptP2)....ptA3 = rs.AddPoint(ptP3) ....pt1 = rs.MoveObject(ptA1, [0,0,zV])....pt2 = rs.MoveObject(ptA2, [0,0,zV])....pt3 = rs.MoveObject(ptA3, [0,0,zV]) ....ln1 = rs.AddLine(pt, pt1)....ln2 = rs.AddLine(pt, pt2)....ln3 = rs.AddLine(pt, pt3) ....return [pt1, pt2, pt3]
a = Main()
Thanks for you replies and sorry for my noob questions...
…
f that brep. So:
2- closest_pt is the point that is on the brep and happens to be closest to your test point (pt).
3- Component index is the index of the face or edge of that brep that the test point happens to be closest to.
4- s and t are the u and v coordinate of the surface that the test point is on.
6- A normal to a surface is a vector. I always initialize my values before passing them to a function.
This function takes few parameters. It uses some of them as input and assign new values to output parameters.
The input is the test point (pt), and the rest are outputs. That means if you check closest_pt, ci, s, t and normal after the function is executed, you'll see all of them have new values calculated inside the "brep.ClosestPoint(...)" including the "normal" which is what you need in this case.
Hope this is helpful.…
Added by Rajaa Issa at 12:05pm on October 30, 2012
ts located at 0 weighting factor=0.5555, +/- 0.77 weighting factor=0.8888
This requires the integration limits to be between -1 to +1.
If your limits are different, you will need to substitute a new variable to normalise the limits.…
64 depending on your system).
3- Download PT-GH Add-on
4- Get the latest PT-GH_Examples file with updated components.
Look forward to your feedback
Enjoy!
Rajaa Issa
Robert McNeel & Associates
-------------------
New in this release:
-------------------
- Fixed divide surface by distance to output cleaned grid. - Added CleanGrid component to delete null rows and columns in a grid. - Added SquareGrid component to make all rows in a grid have equal number of elements. - Added two Coordinate components that extracts x, y and z directions for one grid and 2 grids. - Added a component to create a grid from intersecting curves in 2 directions. - Added Cellulate3D component to extract cells between 2 bounding grids. - Added Managed3D paneling component to define custom 3D patterns. - Added Morpg3D component to morph 3D curves and polysurfaces between 2 bounding grids with the ability for smooth morphing if surfaces are defined. - Changed surface domain grid components. Now we have 3 components: - Grid from domain by number. - Grid from domain by length on surface with option to select reference point on surface. - Grid from domain by chord distance with option to select reference point on surface. - Added new divide curve components to divide by length and chord distance that accept reference point on curve.…
Rhino session and see if PanelingTools drop-down menu is there. Now close Rhino.Next, make sure you have the matching PT-GH (May 3rd):http://download.rhino3d.com/Rhino/5.0/PT_GH/Unzip and save to (%appdata%\Grasshopper\Libraries) Next, open Rhino, then GH and see if you can use PT components.Let me know how that goes. …
u are wellcome!
P.S.: in Construction planes, I just created 3 reference Plane.All those have the same (Origin Pt) == the centroid of the base of the Geometry(TUBE).
i am happy to be helpful.:)