imes. Your loop should go to y.Count - 1. Or, you could use a For...Each loop, circumventing the problem altogether:
Dim shortLines As New List(Of Line)
For Each segment As Line in y
If (segment.Length < x) Then
shortLines.Add(segment)
End If
Next
A = shortLines
--------------------------------
Another problem is this line of code:
New_Lines.Add(New_Line)
It is located inside the loop but outside the If statement, meaning it gets run every single iteration. This fills up the short line list with duplicates.
-------------------------------
Here's something else which is redundant:
Dim Input_Line As New Line
Apart from the fact that you don't need a special variable for this at all, you also don't need to add a New keyword. The type Line in RhinoCommon (just like Point3d, Vector3d, Plane, BoundingBox etc. etc.) are Structures, not Classes. Structures always exist when they are defined, whereas Classes can be null ("Nothing" in VB).
-------------------------------
Some more advice:
Dim i As Integer
For i = 0 To y.Count()
You can merge these two lines into one. VB.NET allows you to declare your iteration variable inside the loop:
For i As Integer = 0 To y.Count - 1
--------------------------------
If you don't like the For...Each approach at the top of this answer, here's how to write this using a For...To loop:
Dim shortLines As New List(Of Line)
For i As Integer = 0 To y.Count - 1
If (y(i).Length < x) Then
shortLines.Add(y(i))
End If
Next
A = shortLines
ps. A personal preference of mine is that I always encase the expressions inside If...Then statements in brackets. You technically don't need to do this, but I find it makes the code more readable.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
s para resolver problemas que hoy se presentan en el diseño y fabricación digital de formas complejas, que en conjunto, son las tendencias e instrucciones mas utilizadas por las oficinas de arquitectura del mundo.
Tomando como plataforma Rhinoceros de McNeel Associates, se optimiza el diseño y fabricación usando Grasshopper, RhinoNest y RhinoCAM.
Se realizará en Lima, Perú el 12 y 13 Setiembre, de 8:00 AM a 6:00 PM., con un total de 16 horas.
Cupo máximo: 20 alumnos.
Inversión. (no incluye impuestos)
S/.900.00 Incluye Licencia Rhino
S/.750.00 NO incluye Licencia Rhino
Ambas incluyen certificado de McNeel Miami.
Instructor:
Andres Gonzalez, CEO McNeel Miami, desarrollador desde 1980. www.rhino3d.com
Organización
McNeel Miami, Pablo C. Herrera,
Pedro Arteaga y MGP Nuevas Artes www.mgp-peru.com
Contacto en Lima, Perú
Claudia Aller / contacto@mgp-peru.com
Contacto en Miami, USA
Jackie Nasser / jackie@mcneel.com…
st one bakes each mesh chunk into the document, the middle one calculates the isosurface values and has the following code:
Private Sub RunScript(ByVal x As List(Of Vector3d), ByVal y As Object, ByRef A As Object)
Dim nums As New list(Of Double)
For Each v As point3d In x
nums.add(mandelbulb(v))
Next
a = nums
End Sub
' custom additional code
Dim z As vector3d
Dim Iterations As Integer = 6
Dim Power As Integer = 8
Function mandelbulb(pos As vector3d) As Double
z = pos
Dim dr As Double = 1.0
Dim r As Double = 0.0
Dim int As Integer = 0
For i As Integer = 0 To iterations - 1r = z.Length
Dim theta As Double = Math.acos(z.Z / r)
Dim phi As Double = Math.atan2(z.Y, z.X)
dr = Math.pow(r, Power - 1.0) * Power * dr + 1.0
Dim zr As Double = Math.pow(r, Power)
theta = theta * Power
phi = phi * Power
Dim sintheta As Double = Math.sin(theta)
z.X = sintheta * Math.cos(phi)
z.Y = Math.sin(phi) * sintheta
z.Z = Math.cos(theta)
z = vector3d.Multiply(z, zr)
z = vector3d.Add(z, pos)
If r > 1.5 Then Exit For
Next
Return 0.5 * Math.log(r) * r / dr
End Function
I mainly got it from here: https://github.com/royvanrijn/mandelbulb.js, but I've seen almost the same code on several places.…
Added by Vicente Soler at 9:38am on December 19, 2012
, 2013)
The most popular year was 2008 (5 responses)
Note: According to Wikipedia: "The first version of Grasshopper, called Explicit History at the time, was originally publicly released in September 2007." Interesting coincidence.
The response to question #2 by those that began before 2007 (How long did it take for you to feel comfortable with designing computationally?):
- Years
- Don't remember, but it felt like a natural way to relate to cad.
- After a few projects
- A month.
Compared to some of the responses of those that began since 2007:
- A month
- A few months
- After 6 weeks
- About 8 weeks
- Within my second design project with GH
- five to six months
- after 1 years of self learning + over 2 years of multiple projects and continuous self learning = Computation skill is comfortable but Computational Design can not be comfortable, Crazy learning curve.
There is much diversity, but some patterns begin to emerge.
Looking forward to more responses!…
ten, Graft, Simplify and Flip Matrix. There is also an additional example showing Integer Divide to which there is no existing component.
For those uninitiated in the dark arts of pathmapper the component can be found on the Sets Tab> Tree Section with the icon of a red cube. Section 8: The Garden of the Forking Path of the Grasshopper Primer 2nd Edition is dedicated to the Tree Structure implemented in GH v0.6. There is an extensive Help file accessed from the 'right click' Context Menu.
UPDATED to correct an error in the Flip Matrix demonstration path_count should be item_count. Plus reflecting the change of the Simplify Component and Additional demonstration of grouping without the Path Mapper
Updated: 2011-04-20
Replace Branches
Not sure if it's right to include this here as its actually encouraging you not to use the Path Mapper, but sometimes there are benefits to being able to keep the definition free from restrictions like the Path Mapper. When a data structure changes the Path Mapper is unable to adapt without user intervention. This is demonstrated in the two Grouping examples above. The Path Mapper method would need the user to manually change the Integer 6 if they ever increased the V Divide, where as the Replace Branches Component will simply update based on its inputs.
I hope to follow this up with some more..... …
n en el diseño y fabricación digital de formas complejas y euclidianas.
Tomando como plataforma Grasshopper con RHINO, se explora y optimiza el diseño y fabricación de topologías complejas bajo los entornos de "Grasshopper", "RhinoNest" y "RhinoCAM" así como la parte de renderizado tipo high-end con Brazil.
D-O-F De 8:00 AM a 12:00 PM y de 1:00 PM a 5:00 PM
Contenidos:
1. Modelado Avanzado y sus Tecnicas. Aplanado y Desarrollo de Superficies.Anidado y distribución Nesting.
2. Introducción al Diseño Paramétrico.Definiciones Avanzadas de Grasshopper,posibilidades y limitaciones. Ajustes de escala para impresión y corte.
3. Introducción a la Manufactura en CNC - RhinoCAM 2.0.
4. Guía Paso a Paso para la realización de un Renderizado usando Brazil 2.0. Presentación DIGITAL de proyectos.
Docentes:
Andrés González - CEO McNeel Miami
Ovidio Cardona - Especialista en RhinoCAM y Zebra
Juan David Moreno - Especialista en Rhino y Brazil
Inversión:
$650 000 (Incluye licencia Educativa y Certificación de McNeel)
$550 000 ( Incluye Certificación de McNeel)
Informes:
Bits LTDA Tel: 412 30 15
Laboratorio de Imagen Facultad de Arquitectura Tel: 430 94 32…
I want to use standard components I have to use 2 or 3 to get the result or use a scripting component, but sometimes I fell this could be avoided if we could access geometry properties and methods directly, let's say we want to use the x coordinates of a bunch of points, instead of decomposing the points to get the X input we could directly type X in the expression editor input to do so similarly to what happens with math formulas.
mmmm, I suppose that methods will be a bit trickier if more inputs where necessary.
On the other hand GH is very easy to start doing things with because the interface allows all levels of knowledge as shown on this forum where most of the questions, I'd say, have to do with solving specific geometry problems or asking for people experiences in similar problems and not always, how do I use a component if you know what I mean.
Overall I'm so, so happy GH is out there in the hands of creative people and in the hands of creative developers! Perhaps there is no need for GH to do any task because it certainly does quite a lot and it is so versatile, even better, that the requests of users get implemented as far as possible.
I think it's very difficult to compare two programs unless you are at the same level of proficiency on both, in the future I'm going to pay more attention as to if there would be a simpler way to do things in GH and if it required some implementation.
My two pence, 8)
Evert…
Added by Evert Amador at 4:03am on February 23, 2011
simple, there are many symetries in 3 main planes. So I used arcs rotated 45° from the main planes and I generate a pentagon which was mirrored and rotated many times.
At the end there are 24 pentagons and 8 hexagons so 32 faces, 54 points/vertex and 84 edges.
It could generate some others tessalation styles
…
ifically: I have a 100' vertical plane lofted between curved top and bottom profiles. I contour it every 8' (normal direction is Z, giving me 13 horizontal curves). I use Divide Curve to divide each contour into 10 segments. The "Points" output of Divide Curve now yields 13 branches with 11 items each, corresponding to 13 contours with 11 points from the left end of the curve to its right.
I now want to string "vertical" lines, and connect all the 2nd items in each branch together, all the 3rd items, etc... in order to make a polyline that travels between each 2nd point or 3rd point. i don't want to use Cull Pattern/Nth/Index because the number of subdivisions could change (11 could become 20, etc).
How do I connect the Nth item of each branch in this tree? Moreover, how do I connect all values in a branch with their corresponding values in all other branches?
Thanks for any replies,
Richman Neumann
Solomon Cordwell Buenz Architects
…
ow the steps of the successful run when step 1.2 is bypassed (note that the and OpenFOAM session is open in the background while running the Butterfly demo file):
1. create wind tunnel, and use different parameters of (4,4) for _globalRefLevel_ as suggested by Theodoro in this post
2. run blockMesh:
3. run snappyHexMesh:
4. run checkMesh:
5. connect the case from checkMesh to simpleFOAM and run the simulation:
6. the simulation converged at 1865 iteration, but the results visualization part has some problem:
7. so I revised this part according to suggestions from Hagit:
8. and the results can be visualized for P and U values:
The GH file used for the successful run shown above is attached here.
Now, the following is the error I got when the case from the update fvScheme component is used for simpleFOAM simulation:
the warning message on the simpleFOAM component is:
1. Solution exception: --> OpenFOAM command Failed!#0 Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #2 ? in "/lib64/libc.so.6" #3 double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #4 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #5 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<double>&, Foam::Field<double> const&) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #6 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #7 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so" #8 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so" #9 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #10 Foam::fvMatrix<double>::solve() in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #11 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam" #12 __libc_start_main in "/lib64/libc.so.6" #13 ? in "/opt/OpenFOAM/OpenFOAM-v1606+/platforms/linux64GccDPInt32Opt/bin/simpleFoam"
The error message from the readMe! output node is attached below as a text file.
Hope you can kindly advise what the important steps or parameters I might have missed here. I assume it might be related to OpenFOAM rather than with the Butterfly workflow...
Thank you very much!
- Ji
…