x geometry which will be the basis in plan for a building facade. The problem is as follows:
I am generating a series of arcs using 3 different ranges for radii. Each segment of the geometry is assigned one of the radii. The length of each arc segment is controlled by a specific number, also within a range -- the end goal is to divide this geometry into perfectly equal segments.
(Parameter Ranges)
I am building these arcs in such a way that they are tied to the arc drawn before it - meaning that as the length of the previous arc is adjusted, the arc in question will still begin where the previous arc ends, and be tangent from said previous arc.
This approach works well until I get to the final segment of the form. I want to be able to close the form in a way that the final arc both meets the first arc at its tangent point and is a length divisible by the desired segment length.
Through a series of trial and error by means of adjusting the radii, panel size, and arc lengths, I have been able to get the geometry to being very close to closed, but there is always some sort of remainder, or the last arc is not tangent to the first arc.
My thought is that this would be a perfect scenario to use Galapagos, but my attempts to do so have resulted in an almost immediate crash of rhino. I'm not sure if I'm feeding too many inputs into galapagos (the radii ranges and segment length ranges), or that the number I'm telling it to minimize is incorrect (distance between the end of the final segment and the start of the first segment), or if there is a larger issue with the definition I've written, but I haven't been able to figure out the issue.
Are there any thoughts out there on how I might be able to reach a possible solution? Or at the very least is there any precedent for a geometric shape similar to what I am trying to create which follows the same number of parameters I'm using?
I've attached the GH definition as well as a rhino model for your visual reference. To preview the GH form in rhino, simply assign the only curve in the attached rhino model to the crv node in grasshopper:
This simply locates everything that's being generated in grasshopper in space in rhino.
Thanks in advance for any thoughts, and also apologies for a somewhat potentially messy definition.
…
Added by Ray LeChase at 11:12am on August 31, 2016
d simulate the bending process of a flat stell sheet in order to get the same shape. This can be really interesting so we can evaluate the material beheaviour, the deformation on the cross section a
nd explore big deformations in mecanics analysis of materials.
I am not a mecanical engineer nor a civil engineer, I´m an Architect and my interest is the construcction method and extracting the necesary information to consider fabricating the project.
I´m having conceptual challengings on the methodology for this simulation, so I will post a small overview of what I`ve done.
1.- Understanding the Geometry.
This is a sclupture by the Venezuelan/Hungarian/German artist Zoltan Kunckel (KuZo).
The shape is achieved bending a pre water cut square sheet of stainless steel. After bended manually, the different lashes are pulled on the opposite direction. New curvatures are produced after all is deployed.
2.- Reproducing the Shape digitally.
Using Karamba I built a definition to reproduce the produced by physical stress. This model served to find deformations that occur when a set of loads are applied to a mesh. Following this process will allow us to find a coherent and more natural cross section so then we could re-shape simulating the bending process of a piece of ductile material.
3.- Discretizing curve
Reducing the model to its simplest element is a key aspect of finite nonlinear analysis. Once our shape is already defined we can divide its principal characteristic of its principal given curve.
At this point I have already found the desired curve.
I Think the better strategy to simulate bending the steel sheet into this shape, is rationalize the curve and divide it finding the tangents one of the curve that compose this sort of parabola. bur i don`t know how to parametrize that in GH.
Please. If someone have a better Idea about this process I`ll glad to read sugestions.
Tomás Mena
…
rrect, the heat balance of a zone is always 0 = Qcool/heat + Qinf + Qvent + Qtrans + Qinternalgains + Qsol. These parameters also correspond with the readEPresult element. However, if i sum up these values there is a slight deviation.
The deviation is greater during daytimes and in winter, suggesting it has something to do with the heating values.
Attached you'll find an image of the energy plus outputs that I use and the resulting -.CSV file that I constructed. In this you'll see that the balance does not add up.
Am i missing some energy flows?
Thanks for the help.
Hour[H]
Qbal{kWh]
Qint[kWh]
Qsol[kWh]
Qinf[kWh]
Qvent[kWh]
Qtrans[kWh]
Tair[°C]
Tdrybulb[°C]
DIFFERENCE
1
3,039357
0,137702
0
-0,253218
-0,321929
-2,000028
20
5,1
0,601884
2
3,107099
0,125462
0
-0,247457
-0,315484
-1,881276
20
4,6
0,788344
3
3,181073
0,119342
0
-0,261765
-0,334485
-2,473788
20
4,3
0,230377
…
to enter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net
• The Grasshopper scripting components. Choosing a .Net language. Language developments
• Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls
• Classes: declaration and instancing. Constructors. Importing a namespace. Point3d, Lines
• Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities.
Afternoon: patterns
• About OOP (object oriented programming) as opposed to procedural programming. Discussion
• Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes
• Lists as input parameters. Trees as input parameters. Usage and limitations
• Finding resources: on the net with website that can help getting started and troubleshoot. And books
Day 2 Morning: extending Grasshopper functionality with our definitions
• Store data between updates. The use of fields [globals, or static locals]
• Examples on how to use stored data between updates: a simple agents simulation
• Baking geometry with scripting directly into the Rhino document. Baking with names
• Passing custom types from a scripted component to another one. Our own code reusability
• Rendering an animation from Grasshopper. How to get started and final results
Afternoon: customizing our tools
• Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher
• Writing a custom Grasshopper component: hacking an exporter for our data to Excel
Day 3 All day: personal project
• Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing
MINIMUM REQUIREMENTS
A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
So it's not true that Bounds.X is only a getter. However it does behave as though it is. This is because RectangleF is a Value Type instead of a Reference Type. When you assign a variable of one value type to another variable of the same type, you always assign a copy of the first value. So when you request the Bounds from an attributes class, what you get is a copy of the actual bounds. Changing the X on this copy would be a useless operation which is why Visual Studio catches this mistake.
Let's assume that Dog is a class (a reference type) and it has a get/set property for fur type. Then, if I type:
Dog A = new Dog();
A.Coat = Long;
Dog B = A;
B.Coat = Short;
At the end of these lines, both A and B have a short coat, because the act of assigning A to B (line 3) means that both A and B now point to the same instance of Dog in memory. In effect, A and B are the same. If Dog were a struct (a value type), then at the end of this code A and B would have different coats, because assigning A to B means creating a copy of A. Any changes made to B will not affect A.
The one place where this causes annoying situations is exactly where you ran into it. If a property returns a value type then it's typically not useful to call properties and methods on that returned data, as it would only affect the copy of the actual data instead of the original data. That's why, if you want to change the Bounds of an attribute, you need code like this:
RectangleF box = Bounds;
box.X +=10;
Bounds = box;
On to the second problem, which is that doing it this way won't help you one bit. Laying out a component is a difficult job and the size of the Bounds depends on many things:
The display mode of the component (icon or text).
The size of the text (depending on which Font to use).
The maximum number of input and output parameters.
The maximum width of the longest input/output parameter name.
The maximum number of state icons to draw on the input/output parameters.
Changing the Bounds after the layout has occurred will basically just invalidate the parameter layout, resulting in parameter names and grips being drawn in the wrong places.
If you want to affect the size of the Bounds for a GH_Component class, you're going to have to dive in and do the laying out yourself. As mentioned before, this is not trivial.
There are static methods on GH_ComponentAttributes which are helpful when doing this, have a look at:
LayoutComponentBox()
LayoutInputParams()
LayoutOutputParams()
LayoutBounds()
Unfortunately they are undocumented.
--
David Rutten
david@mcneel.com…
Added by David Rutten at 1:39pm on January 31, 2014
rameters, which forces the user to connect all three curve input parameters (even if only 2 are required) to avoid the message 'Input parameter ... failed to collect data'. How can I set up the curve inputs so that null values are valid? I'm currently registering these as curve parameters as below, and suspect the answer lies in using a different method for parameter registration.
protected override void RegisterInputParams(GH_Component.GH_InputParamManagerpManager)
{
pManager.Register_SurfaceParam(
"Reference Surface", "S", "Surface on which laths are to be generated", GH_ParamAccess.item);
pManager.Register_CurveParam(
"Surface curves 1", "Curves 1", "Set of curves across surface in first direction", GH_ParamAccess.list);
pManager.Register_CurveParam(
"Surface curves 2", "Curves 2", "Set of curves across surface in second direction", GH_ParamAccess.list);
pManager.Register_CurveParam(
"Surface Curves 3", "Curves 3", "Set of curves across surface in third direction", GH_ParamAccess.list);
pManager.Register_DoubleParam(
"Lath Offsets 1", "LO1", "Offset from surface to centreline of first layer", 0.0, GH_ParamAccess.item);
pManager.Register_DoubleParam(
"Lath Offsets 2", "LO2", "Offset from surface to centreline of second layer", 0.0, GH_ParamAccess.item);
pManager.Register_DoubleParam(
"Lath Offsets 3", "LO3", "Offset from surface to centreline of third layer", 0.0, GH_ParamAccess.item);
pManager.Register_IntegerParam(
"Seed Value (0, 1, 2)", "Seed", "Seed value for weave offsets (0 for no weave, 1 or 2 for weave)",0, GH_ParamAccess.item);
}
Thanks!
Alex
…
Added by Alex Baalham at 9:48am on October 1, 2012
3. receiver gets data from sender via input (0) < the data here may be changed in the meantime, for instance if its a double then I would like to add 1 to it.
4. receiver sends data to sender's input(2)
5. go to 1.
VS 2013 studio project folder
SENDER
Public Class loopStart Inherits GH_Component
Dim cnt As Integer
Friend Property counter() As Integer Get Return cnt End Get Set(value As Integer) cnt = value End Set End Property
Dim iData As New GH_Structure(Of IGH_Goo)
Friend Property startData() As GH_Structure(Of IGH_Goo) Get Return iData End Get Set(value As GH_Structure(Of IGH_Goo)) iData = value End Set End Property
Public Sub New() MyBase.New("loopStart", "loopStart", "Start the loop with this one.", "Extra", "Extra") End Sub
Public Overrides ReadOnly Property ComponentGuid() As System.Guid Get Return New Guid("bdf1b60d-6757-422b-9d2d-08257996a88c") End Get End Property
Protected Overrides Sub RegisterInputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager) pManager.AddGenericParameter("Data", "dIn", "Data to loop", GH_ParamAccess.tree) pManager.AddIntegerParameter("Steps", "S", "Number of loops", GH_ParamAccess.item) pManager.AddGenericParameter("<X>", "<X>", "Please leave this one alone, don't input anything.", GH_ParamAccess.tree) pManager.Param(2).Optional = True End Sub
Protected Overrides Sub RegisterOutputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_OutputParamManager) pManager.AddGenericParameter("Data", "dOut", "Data to loop", GH_ParamAccess.tree) End Sub
Public Overrides Sub CreateAttributes() m_attributes = New loopStartAttributes(Me) End Sub
Protected Overrides Sub SolveInstance(ByVal DA As Grasshopper.Kernel.IGH_DataAccess)
Dim numLoop As Integer DA.GetData(1, numLoop)
Dim loopDt As New Grasshopper.Kernel.Data.GH_Structure(Of IGH_Goo)
If cnt = 0 Then Me.startData.Clear() DA.GetDataTree(0, Me.startData) loopDt = startData.Duplicate DA.SetDataTree(0, loopDt) End If
If cnt < numLoop - 1 And cnt > 0 Then DA.GetDataTree(2, loopDt) DA.SetDataTree(0, loopDt) Me.ExpireSolution(True) Else DA.GetDataTree(2, loopDt) DA.SetDataTree(0, loopDt) End If
cnt += 1
End Sub
End Class
RECEIVER
Public Class loopEnd Inherits GH_Component
Dim aData As New GH_Structure(Of IGH_Goo)
Friend Property anyData() As GH_Structure(Of IGH_Goo) Get Return aData End Get Set(value As GH_Structure(Of IGH_Goo)) aData = value End Set End Property
Public Sub New() MyBase.New("loopEnd", "loopEnd", "End the loop with this one.", "Extra", "Extra") End Sub
Public Overrides ReadOnly Property ComponentGuid() As System.Guid Get Return New Guid("3ffa3b66-8160-4ab3-87c9-356b2c17aadd") End Get End Property
Protected Overrides Sub RegisterInputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager) pManager.AddGenericParameter("Data", "dIn", "Data to loop", GH_ParamAccess.tree) End Sub
Protected Overrides Sub RegisterOutputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_OutputParamManager) pManager.AddGenericParameter("Data", "dOut", "Data after the loop", GH_ParamAccess.tree) End Sub
Protected Overrides Sub SolveInstance(ByVal DA As Grasshopper.Kernel.IGH_DataAccess) Me.aData.Clear() DA.GetDataTree(0, Me.aData) runner()
DA.SetDataTree(0, Me.aData) End Sub
Sub runner()
Dim doc As GH_document = Grasshopper.Instances.ActiveCanvas.Document Dim docl As list(Of iGH_DocumentObject) = (doc.Objects)
For i As Integer = 0 To docl.count - 1 Step 1 Dim comp As Object = docl(i) If comp.NickName = "loopStart" Then Dim compp As IGH_Param = comp.Params.input(2) compp.VolatileData.Clear() compp.AddVolatileDataTree(anyData) Exit For End If Next End Sub
End Class
…
option, after downloading check if .ghuser files are blocked (right click -> "Properties" and select "Unblock"). Then paste them in File->Special Folders->User Object Folder. You can download the example files from here. They act in similar way, Ladybug Photovoltaics components do: we pick a surface, and get an answer to a question: "How much thermal energy, for a certain number of persons can my roof, building facade... generate if I would populate them with Solar Water Heating collectors"? This information can then be used to cover domestic hot water, space heating or space cooling loads:
Components enable setting specific details of the system, or using simplified ones. They cover analysis of domestic hot water load, final performance of the SWH system, its embodied energy, energy value, consumption, emissions... And finding optimal system and storage size. By Dr. Chengchu Yan and Djordje Spasic, with invaluable support of Dr. Willian Beckman, Dr. Jason M. Keith, Jeff Maguire, Nicolas DiOrio, Niraj Palsule, Sargon George Ishaya and Craig Christensen. Hope you will enjoy using the components! References: 1) Calculation of delivered energy: Solar Engineering of Thermal Processes, John Wiley and Sons, J. Duffie, W. Beckman, 4th ed., 2013. Technical Manual for the SAM Solar Water Heating Model, NREL, N. DiOrio, C. Christensen, J. Burch, A. Dobos, 2014. A simplified method for optimal design of solar water heating systems based on life-cycle energy analysis, Renewable Energy journal, Yan, Wang, Ma, Shi, Vol 74, Feb 2015
2) Domestic hot water load: Modeling patterns of hot water use in households, Ernest Orlando Lawrence Berkeley National Laboratory; Lutz, Liu, McMahon, Dunham, Shown, McGrue; Nov 1996. ASHRAE 2003 Applications Handbook (SI), Chapter 49, Service water heating
3) Mains water temperature Residential alternative calculation method reference manual, California energy commission, June 2013. Development of an Energy Savings Benchmark for All Residential End-Uses, NREL, August 2004. Solar water heating project analysis chapter, Minister of Natural Resources Canada, 2004.
4) Pipe diameters and pump power: Planning & Installing Solar Thermal Systems, Earthscan, 2nd edition
5) Sun postion and POA irradiance, the same as for Ladybug Photovoltaics (Michalsky (1988), diffuse irradiance by Perez (1990), ground reflected irradiance by Liu, Jordan (1963))
6) Optimal system and storage tank size: A simplified method for optimal design of solar water heating systems based on life-cycle energy analysis, Renewable Energy journal, Yan, Wang, Ma, Shi, Vol 74, Feb 2015.…
but rather than keep everyone waiting, I've decided to share some as they become ready.
This also has the advantage that questions about components can be more easily grouped under the relevant post - so please do add any questions / comments / bugs / suggestions about these examples below.
So today I am posting some examples of the mesh utilities that come with the new release.
While these are not directly physics based, many of the forces and types of relaxation in Kangaroo are designed to work with meshes, and in the process of development I've ended up adding a number of simple utilities to make working with them a little easier.
I recommend also installing Weaverbird which has many more subdivision functions and other useful tools for working with meshes in Grasshopper. Also Plankton, Turtle, MeshEdit and Starling extend these possibilities still further.
Diagonalize
This component replaces every edge of a mesh with a new face. The new faces will always be quads, except for along the boundaries, where they will be triangles. It can be used to easily create diagrids. The input mesh can contain any mix of triangles and quads.
When treating the edges of a quad mesh as springs, diagonalizing it will often significantly change its physical behaviour. If you are trying to planarize a quad mesh, diagonalizing may sometimes allow you to stay closer to a target shape if it matches the curvature directions better.
diagonalize.gh
Checkerboard
This component assigns the faces of a mesh into a checkerboard pattern. The output is a list of 1s and 0s (which could represent black/white or true/false) which can be used to dispatch the faces into 2 lists, where no pair of adjacent faces have the same colour.
One nice application I found for this is applying alternating clockwise and counter-clockwise rotations as shown below. Also, on occasion you may want to planarize a quad mesh, but have some constraints on the shape and grid that prevent this, and triangulating only alternating quads to give a hybrid quad/tri mesh can sometimes be a good compromise, allowing a bit more freedom.
Note - Not all meshes can be assigned a checkerboard pattern!
As a simple example, take a mesh with 3 quads around one vertex - If we assign one black face, then both the neighbouring faces should be white, but then we have 2 white faces adjacent to one another, which violates the checkerboard condition.
Generally, we can say that if a mesh has any internal vertex with an odd number of faces around it, then we cannot apply a consistent checkerboard pattern to it (although not having any odd valence vertices is not in itself an absolute guarantee that a mesh is 'checkerboardable').
checkerboard.gh
WarpWeft
This sorts the edges of a quad mesh into 2 lists of line segments, which are like the warp and weft directions of a fabric. They can also be seen as a sort of mesh equivalent to the u and v isocurves on a NURBS surface.
This can be useful if you want to control the shape of a tension structure, because it allows you to assign different stiffnesses in the 2 directions.
As with the checkerboard component, not all meshes can be consistently assigned warp/weft directions. It follows a similar rule - all internal vertices should have an even number of adjacent faces. With a bit of care, it is usually possible to model the initial mesh in such a way as to allow this.
This component also has an output telling us whether or not each line is on a boundary of the mesh, as we will often want to treat these differently.
Same mesh relaxed with different warp/weft stiffness:
warpweft.gh
MeshCorners
This one is hopefully fairly self explanatory. In many simulations we want to anchor the corner points of a mesh. This saves us having to pick them manually in Rhino.
It works on quad meshes, and looks around the boundary vertices for any which do not have exactly 3 connected edges.
corners.gh
That's all for now. Coming soon - a "mesh tools 2" post explaining more of the components.…