e point in each pair that has the lowest Z value (then later the highest Z)... The problem is the intersections are not returned sorted by Z, sometimes the lower point is first in the list, sometimes last. So I need to sort those pairs of points by Z value.I noticed the sort points component does not have any inputs for sort criteria... RhinoScript SortPoints allows you to sort by:
blnOrder
Optional. Number. The component sort order, where:
Value
Component Sort Order
0 (default)
X, Y, Z
1
X, Z, Y
2
Y, X, Z
3
Y, Z, X
4
Z, X, Y
5
Z, Y, X
Will we get something like this in GH? For now I think I can manage to analyze the Z for each and re-order the points, but a more comprehensive point sorting tool might be nice... no? Or did I miss something obvious? --Thx, --Mitch…
o's command 'InterpCrv' manually(white line).
We had one need to make the rhino-InterpCrv curve in grasshopper.
One thing I've tried is using a python script to emulate the rhino-InterpCrv, but didn't get any results,since I didn't know how to define the arrCV1 and arrCVn1 when using the 'AddInterpCurve (knotstyle=1/2)'
knotstyle from the rhino IronPython help
knotstyle
Optional. Number. The knot style to use, and whether the curve should be periodic. If omitted, uniform knots (0) are created.
Value
Description
0
Uniform knots. Parameter spacing between consecutive knots is 1.0.
1
Chord length spacing. Requires dblDegree = 3 with arrCV1 and arrCVn1 specified.
2
Sqrt (chord length). Requires dblDegree = 3 with arrCV1 and arrCVn1 specified.
3
Periodic with uniform spacing.
4
Periodic with chord length spacing. Requires an odd degree value.
5
Periodic with sqrt (chord length) spacing. Requires an odd degree value.
did anyone tried to create a curve like native Rhino from script? or, is there a another GH component that is suitable for smooth curves?
I guess a alternative way will be using rs.Command('InterpCrv'), but wanted to know if there will be a smarter way...…
deform into rhombic dedocahedrons when they reach equilibrium.
http://mathworld.wolfram.com/CubicClosePacking.html
I was trying to model sphere lattice constrained within a boundary box. When inflated, they would not intersect with each other; they would stay in place; and would be malleable just enough to expand and fill in the gaps in between the spheres.
I started off with the help of this thread here(Thanks for those contributed!). As I understood, there was a bug in Kangaroo2. Solver can't handle more than one item plugged in. So I tried to understand David's Stasiuk's Script and adopted it with a few variations, please see gh file attached.
In the first 5 - I've used David Stasiuk's C# component-variable pressure (posted on June 9, 2015 at 12:25am): 'No. 4.5' being the most successful simulation so far(inflation value is kept very low so that they would not intersect);
although I realised I made some math mistake in setting the close packing grid.(could be checked by plugging voronoi3D to see if the area of the rhombic faces are regular)
No. 6-7 I tried with Kangaroo2 components.
After consulting my tutor(Andrei Jipa)'s help, I realised the following changes could be made:
- The definition posted by David on June 8, 2015 at 4:47pm with constant pressure would've worked better.
- Icosahedrons with WbCatmull(Quad divisions) would result in more even load distribution. With wbloop, vertices more concentrated at poles.
- Load in dir Z could be omitted. Andrei has suggested to use lengths(line) in Kangaroo 2 as 'pressure' instead. And I am trying to improve the grid; and maybe try with David's constant pressure definition. I will keep you guys posted of the progress!
I am new to the parametric world, comments/advice very much appreciated! :) Zhini
…
ges can have much stronger impact on the final design.
The problem is that usually the more "nonlinear" the mapping is the more interesting the result usually are because a definition with a very "linear" mapping doesn't have so much potential for surprise and unforeseen solutions.
It can be a random number as you stated, but also some like for example a slightly different point coordinate leads to different typology in a delaunay triangulation, now the strength of the impact also depends on the total sum of the delaunay points as well on how early the triangulation happens in the definition.
I seen that a shape analysis is a not easy at all not only technical but especially by defining the criteria. Looking forward to see your approach compare genotype and phenotype 'solution' spaces. Maybe an additional approach could be to have something like a gene manager where you can narrow down ranges of certain genes, weight them or freeze them.
to 4) and 5) looking forward to see the history once its ready. I think it could be beneficial to also be able to insert solution "by hand" for further crossbreeding and saving.
What i found myself doing quite often was taking solutions from the biomorpher and then tweaking one or more parameters "by hand" because then you can really see the impact and then you would like to have the possibly to bring that solution back into the biomorpher process.
I will go on testing and get back to you guys in some weeks! I attached you the my definition in case you want to have a look. Its needs kangaroo1, lunchbox, heteroptera and wb. Its more a graphical formal exercise:
best, chris…
ond class to my c# Project to get a second Component, which doesn´t work. when i load the .gha file, only my first component appears.
so i have a C# Project with two classes like this:
namespace myUtilities{ public class My1stComponent : GH_Component { public My1stComponent() : base("My1stComponentName", "MFC", "do something", "myTab", "my1stToolBox") { } protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { //myInputs } protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { //myOutputs } protected override void SolveInstance(IGH_DataAccess DA) { //myAlgorithm }
public override Guid ComponentGuid { get { return new Guid("88e6231b-d998-4de2-85dc-451b0158c599"); } }
namespace myUtilities{ public class My2ndComponent : GH_Component { public My2ndComponent() : base("My2ndComponentName", "MSC", "do something else", "myTab", "my2ndToolBox") { } protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { //myInputs } protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { //myOutputs } protected override void SolveInstance(IGH_DataAccess DA) { //myAlgorithm }
public override Guid ComponentGuid { get { return new Guid("c5aaf8ea-3a02-4d6e-86ee-a8e35ba2b96d"); } }
Can anybody tell what´s wrong about that?
Another Problem i have is to to get my own icon. i added one to my c# Project like this:
protected override Bitmap Icon { get { return myUtilities.Properties.Resource_icon.myFirstComponent; } }
In Rhino 5 my icon appears, but not in rhino 4 :(.
Thanx for your answers.
…
Added by max wittich at 8:00am on September 17, 2012
lacking in the Rhino 5 Grasshopper 0.9.X Python component editor:
The best screen font I've found is called Volter (Goldfish).
It shows up after I type the first (.
I also found BlendContinuity values here:
http://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_...
Position 0
Tangency 1
Curvature 2
However, the command fails with this error unless I use zero, but position is not a blend at all, just a straight loft, though the command with zero gives no output, just an empty brep list.
Runtime error (TypeErrorException): Cannot convert numeric value 1 to BlendContinuity. The value must be zero.
Why do you guys not provide simple examples in the reference? Rhino.Geometry.BlendContinuity has no example of how to use it. If I set b = Rhino.Geometry.BlendContinuity() and print b it says "position." How do I set it to tangency? I have no idea. You can't put a number in the parentheses.
A related command has the same structure:
http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_CreateBlendCurve_2.htm…
of stuff. Then it works either with ExoW (black mesh) or IntraLattice (blue mesh).
That said ExoW is tricky: occasionally reports engulfing issues and stops playing the game. For instance in this (diagonal) anchor mode and with some U/V random values:
Whilst IntraLattice appears rather less temperamental:
The other def is more complex and works using the Proximity approach that makes more sense with regard random 3d line graphs (as an exercise: Add a gate and use IntraLattice as Plan B).
best
…
to Daniel Pikers' Tutorial mesh relaxation tutorials we are already pretty far.
The Idea of our design is a hanging structure suspendend in a gap between buildings, where you can find places to rest, read or even to sleep. You can find privacy in the cocoons, that are connecting the planes with each other.
As structure we have a net in mind, that is tighter in the area of the cocoons and more transparent in the common areas, but we really don't know whats the right way to get to this point.
In the end of the project we need a printable geometry. We start our boxy design in Sketchup, and remesh it in Rhino. After that we feed it in our kangaroo definition.
1. A nurbs surface could give us more freedom (for postprocessing in tsplines) to form meshes with shorter and longer edges, representing our net. But I see now easy way to get a surface out of the relaxed kangaroo mesh.
2. Working with the kangaroo mesh could also work fine, if we'd find a way to control the edge length of the mesh (for example 20 cm in the common area and 5 in the privates) with an attractor point. Remeshing with Daniel's Plankton Plugin sadly doesn't work, I always get the "runaway faces circulator"-error.
3. It woud be great to convert the mesh to a hexagonal mesh, but I don't know any possibility to remesh an existing one...
You see, we're full of questions, but I really hope to get some help here :)
Agostino & Johanna
…
Here it the RhinoScript that I am using:
'Option Explicit
'Rem Script written by Giulio
'Rem Script version lunes, 10 de noviembre de 2008 21:00:00
'Rem This script is licenced to you under the conditions shown at
'Rem http://www.giuliopiacentino.com/this/
Call Main()
Sub Main()'starts command
Dim arrLfStart(),arrRxStart(), arrLfEnd(), arrRxEnd(), arrLinks(), i 'sets intergers
Dim links: links = 36 'number of cylinders (links)
ReDim arrLfStart(links), arrRxStart(links), arrLfEnd(links), arrRxEnd(links), arrLinks(links) 'combines integer with number
Dim angleDist:angleDist = Rhino.PI / 10
For i=0 To links 'sets integer
'The following sets the path
arrLfStart(i) = Array(Cos(i-angleDist)*3 + Cos(i*12)*12, Sin(i-angleDist)*3 + Sin(i*12)*12, i*5)
arrRxStart(i) = Array(Cos(i+angleDist)*3 + Cos(i*12)*12, Sin(i+angleDist)*3 + Sin(i*12)*12, i*5)
arrLfEnd(i) = Array(-Cos(i-angleDist)*3 + Cos(i*12)*12, -Sin(i-angleDist)*3 + Sin(i*12)*12, i*5)
arrRxEnd(i) = Array(-Cos(i+angleDist)*3 + Cos(i*12)*12, -Sin(i+angleDist)*3 + Sin(i*12)*12, i*5)
'The following adds cylindars according to specified points
Call Rhino.AddCylinder(IntraPts(arrLfStart(i), arrRxStart(i), 0.5), IntraPts(arrLfEnd(i), arrRxEnd(i), 0.5), 0.5)
Next
'The following adds surfaces to the path
Call Rhino.AddLoftSrf(Array(Rhino.AddInterpCurve(arrLfStart), Rhino.AddInterpCurve(arrRxStart)))
Call Rhino.AddLoftSrf(Array(Rhino.AddInterpCurve(arrLfEnd), Rhino.AddInterpCurve(arrRxEnd)))
End Sub
Function IntraPts(byRef p1, byRef p2,byRef n)
'Rem This function gives the first point out if you use n=0,
'Rem with n=1 it gives the second point.
IntraPts = Array( p1(0)*(1.0-n)+p2(0)*n, p1(1)*(1.0-n)+p2(1)*n, p1(2)*(1.0-n)+p2(2)*n )
End Function
I know that the script works in RhinoScript. If anyone could help me out I would appreciate it.…
Added by Adam Smith at 1:57pm on September 9, 2010
tives for low-dimensional, or highly continuous problems. Having a somewhat faster way to trigger a galapagos run would also be beneficial."
I found a post on the 'hoopsnake/forum' describing the very same problem I am trying to solve, and looked into using HoopSnake (without satisfaction so far):
Double loop and hydrostatics?
I don't want to wait until G2 so will re-state some of what I posted earlier, then offer a template for an ideal "fast solver" component ('B-Solve') that could be widely useful. I am ready to accept that it might be written in Python, C, or VB - as long as it's open source or built in to standard GH. If there is a GH plugin that will do this, I'd like to know that too, though prefer a lightweight solution rather than a big toolbox.
QUESTION: Is there a FAST (binary search speed) GH way to "solve" toward a goal by "moving" a single slider?
CONTEXT: I have a boat hull of a given displacement at rest. I rotate the hull to an arbitrary angle ("heel" caused by wind in the sails) and want to adjust a 'Z-offset' slider so the displacement is the same as it was at rest.
I can adjust the slider manually, zooming in for better control, and with a dozen tries or so, in a very short time, narrow in with a binary search method and get very close to matching the value.
When I hook up Galapagos, it runs on and on forever, trying values that are "obviously" further away instead of closer to the goal. When I can solve it manually faster than Galapagos, a different solution is needed.
OBJECTIVE:
I want a FAST solution that doesn't need any manual input. Ideally, it would respond like any other component and re-calc whenever its inputs changed. At worst, a 'start/reset' trigger, "soft input" so it can be used inside a cluster.
It doesn't need to control a slider, they just happen to be handy for defining a range and precision of values.
Using Galapagos: HydroSolve_2015_Sep8a.gh (attached)
An extremely stripped down version of the problem using Grasshopper.
NOTE: One obvious problem here is that by using absolute value ('abs()') for the 'difference' here, Galapagos doesn't know whether it's too high or too low!
Instructions:
Start with 'Roll=0', 'Volume=1543.943'
Adjust 'Roll' to ~35 degrees
"Solve" 'Z-offset' value to return to 'target' (original) volume of 1543.943
Using 'B-Solve': HydroSolve_2015_Sep8b.gh (attached)
'B-Solve' is the proposed fast solver component. Its 'solution' output is always in the range of zero to one, which is remapped by the green group as -5 to 5 and used as the 'Z-offset' for 'Pitch-Roll-Z'.
Starting value ('Reset') for 'solution' is 0.5, and 'B-Solve' tries different 'solution' values to make 'result' (the 'Volume') and 'goal' match. An efficient uphill(?) or binary searcher could be very fast.
Does this sound feasible? Can anyone implement 'B-Solve'?
Two at once?
The post noted earlier, Double loop and hydrostatics?, brings up a complication that's worth considering from the start... Depending on hull shape, the center of buoyancy may move fore and aft, away from the center of gravity, as the hull rolls. This induces a change in pitch so a second 'B-Solve' component could be used in the same model to adjust pitch, which of course changes 'Volume' again... Not quite sure how the two would get along?
Thanks.
Note: the hull in these examples is a really poor shape!…
Added by Joseph Oster at 1:30pm on September 9, 2015