nd improvements. Many of the new features and components announced in the last release have become stable and have emerged from their WIP section. Additionally, after two years of work, we are happy to announce that we finally have full support of an OpenStudio connection within Honeybee, which has ushered in a whole host of new features, notably the modelling of detailed HVAC systems. As always you can download the new release from Food4Rhino. Make sure to remove the older version of Ladybug and Honeybee and update your scripts.
LADYBUG
1 - Solar Hot Water Components Out of WIP
After much beta-testing, bug-fixing, and general development, all of the Photovoltaic and Solar Hot Water components are now fully out of WIP! The main component is based on a Chengchu Yan's publication. Components have been added to Ladybug thanks to the efforts of Chengchu Yan and Djordje Spasic.. See Djorje’s original release post of the solar hot water components for more information on the components that just made it out of WIP.
2 - New Terrain Shading Mask Released in WIP
In addition to Djordje’s prolific addition of renewable energy components, he has also contributed a widely-useful component to generate terrain shading masks, which account for the shading of surrounding mountains/terrain in simulations. While initially added to assist the solar radiation radiation and renewable energy components, the component will undergo development to optimize it for energy and daylight simulations over the next few months. Another new component called Horizon Angles can be used to visualize and export horizon angles. You can test them out now by accessing them in the WIP section. For more information, see Djordje’s release post on the GH forum here.
3 - New Mesh Selector Component
After realizing that the Optimal Shade Creator component has applications to a whole range of analyses, it has now been re-branded as the Mesh Selector and has been optimized to work easily with these many analyses. Specifically, the component selects out the portion of a mesh that meets a given threshold. This can be the portion of a shade benefit analysis meeting a certain level of shade desirability, the portion of a radiation study meeting a certain level of fulx, the portion of a daylight analysis meeting a certain lux threshold, and much more!
4 - Solar Adjusted Temperature Now Includes Long Wave Radiation
Thanks to a question asked by Aymeric and a number of clarifications made by Djordje Spasic, the Solar Adjusted Temperature component now includes the ability to account for long-wave radiative loss to the sky in addition to it original capability to account for short wave radiation from the sun. As such, the component now includes all capabilities of similar outdoor comfort tools such as RayMan. The addition of this capability is also paralleled by the addition of a new horizontalInfraredRadiation output on the ImportEPW component. See the updated solar adjusted example file hereto see how to use the component properly.
5 - Support for both Log and Power Law Wind Profiles
In preparation for the future release of the Butterfly CFD-modelling insect, the Ladybug Wind Profile component now includes the option of either power law or log law wind profiles, which are both used extensively in CFD studies. Thanks goes to Theodoros Galanos for providing the formulas!
6 - New Radiant Asymmetry Comfort Components
Prompted by a suggestion from Christian Kongsgaard, Ladybug now includes components to calculate radiant asymmetry discomfort! For examples of how to use the components see this example file for spatial analysis of radiant asymmetry discomfort and this example for temporal analysis.
7 - Pedestrian Wind Comfort Component Released in WIP
In preparation for the impending release of the butterfly CFD-modelling insect, Djordje Spasic with assistance from Liam Harrington has contributed a component to evaluate outdoor discomfort and pedestrian safety. The component identifies if certain areas around the building are suitable for sitting, building entrances-exits, window shopping... based on its wind microclimate. Dangerous areas due to high wind speeds are also identified.You can check it out now in the WIP section.
HONEYBEE
1 - New HVAC Systems and Full OpenStudio Support
After a significant amount of development on the part of the OpenStudio team and two years of effort on the part of LB+HB developers, we (finally!) have full support for an OpenStudio connection within Honeybee. By this, we mean that any energy simulation property that can be assigned to a HBZone will be taken into account in the simulation run by the OpenStudio component. The connection to OpenStudio has brought with it several new capabilities. Most notably, you can now assign full HVAC systems and receive energy results in units of electricity and fuel instead of simple heating and cooling loads. This Honeybee release includes 14 built-in HVAC template systems that can be assigned to the zones, each of which can be customized:
0. Ideal Air Loads 1. PTAC | Residential 2. PTHP | Residential 3. Packaged Single Zone - AC 4. Packaged Single Zone - HP 5. Packaged VAV w/ Reheat 6. Packaged VAV w/ PFP Boxes 7. VAV w/ Reheat 8. VAV w/ PFP Boxes 9. Warm Air Furnace - Gas Fired 10.Warm Air Furnace - Electric 11.Fan Coil Units + DOAS 12.Active Chilled Beams + DOAS 13.Radiant Floors + DOAS 14.VRF + DOAS
Systems 1-10 are ASHRAE Baseline systems that represent much of what has been added to building stock over the last few decades while systems 11-14 are systems that are commonly being installed today to reduce energy use. Here is an example file showing how to assign these systems in Honeybee and interpret the results and here is an example showing how to customize the HVAC system specifications to a wide variety of cases. To run the file, you will need to have OpenStudio installed and you can download and install OpenStudio from here.
In addition to these template systems within Honeybee, the OpenStudio interface includes hundreds of HVAC components to build your own custom HVAC systems. OpenStudio also has a growing number of user-contributed HVAC system templates that have been integrated into a set of scripts called "Measures" that you can apply to your OpenStudio model within the OpenStudio interface. You can find these system templates by searching for them in the building components library. Here is a good tutorial video on how to apply measures to your model within the OpenStudio interface. Honeybee includes a component that runs these measures from Grasshopper (without having to use the OpenStudio interface), which you can see a demo video of here. However, this component is currently in WIP as OpenStudio team is still tweaking the file structure of measures and it is fairly safe to estimate that, by the next stable release of Honeybee, we will have full support of OpenStudio measures within GH.
2 - Phasing Out IDF Exporter
With the connection to OpenStudio now fully established, this release marks the start of a transition away from exporting directly to EnergyPlus and the beginning of Honeybee development that capitalizes on OpenStudio’s development. As such THIS WILL BE THE LAST STABLE RELEASE THAT INCLUDES THE HONEYBEE_RUN ENERGY SIMULATION COMPONENT.
The Export to OpenStudio component currently does everything that the Run Energy Simulation component does and, as such, it is intended that all GH definitions using the Run Energy Simulation component should replace it with the OpenStudio component. You can use the same Read EP Result components to import the results from the OpenStudio component and you can also use the same Energy Sim Par/Generate EP Output components to customize the parameters of the simulation. The only effective difference between the two components is that the OpenStudio component enables the modeling of HVAC and exports the HBZones to an .osm file before converting it to an EnergyPlus .idf.
For the sake of complete clarity, we should state that OpenStudio is simply an interface for EnergyPlus and, as such, the same calculation engine is under the hood of both the Export to OpenStudio component and the Run Energy Simulation component. At present, you should get matching energy simulation results between the Run Energy Simulation component and a run of the same zones with the OpenStudio component (using an ideal air system HVAC).
All of this is to say that you should convert your GH definitions that use the Run Energy Simulation component to have the OpenStudio component and this release is the best time to do it (while the two components are supported equally). Additionally, with this version of Honeybee you will no longer need to install EnergyPlus before using Honeybee and you will only need to install OpenStudio (which includes EnergyPlus in the install).
3 - New Schedule Generation Components
Thanks to the efforts of Antonello Di Nunzio, we now have 2 new components that ease the creation of schedule-generation in Honeybee. The new components make use of the native Grasshopper “Gener Pool” component to give a set of sliders for each hour of the day. Additionally, Antonello has included an annual schedule component that contains a dictionary of all holidays of every nearly every nation (phew!). Finally, this annual schedule component can output schedules in the text format recognized by EnergyPlus, which allows them to be written directly into the IDF instead of a separate CSV file. This will significantly reduce the size of files needed to run simulations and can even reduce the number of components on your canvas that are needed to add custom schedules. For more information, see Antonello’s explanatory images here and Antonello's example file here. You can also see a full example file of how to apply the schedules to energy simulations here.
4 - EnergyPlus Lookup Folder, Re-run OSM/IDF, and Read Result Dictionary
With the new capabilities of OpenStudio, we have also added a number of components to assist with managing all of the files that you get from the simulation. In particular, Abraham Yezioro has added a Lookup EnergyPlus Folder component that functions very similarly to the Lookup Daylight Folder component. This way, you can run an Energy simulation once and explore the results separately. Furthermore, we have added components to Re-Run OpenStudio .osm files or EnergyPlus .idf files within Grasshopper. These components are particularly useful if you edit these .osm or .idf files outside of Honeybee and want to re-run them to analyze their results in Grasshopper. Lastly, a component has been added to parse the .rdd (or Result Data Dictionary) file that EnergyPlus produces, enabling you to see all of the possible outputs that you can request from a given simulation.
5 - Electric Lighting Components Out of WIP
After Sarith Subramaniam’s initial components to model electric lights with Radiance in the last release, we are happy to report that they have been fully tested and are out of WIP. Improvements include support for all types of light fixture geometries and the ability to use the components in a more “Grasshoppery” list-like fashion. See Sarith’s original release post for more information and several example files showing how to use the components can be found here. 1 , 2 , 3 .
6 - Improvements to THERM Components
A number of bug fixes and improvements have been made to the THERM components in order to make their application more flexible and smooth. Special thanks is due to Derin Yilmaz , Mel King , Farnaz , Ben (@benmo1) , and Abraham Yezioro for all of the great feedback in the process of improving these components.
7 - HBObject Transform Components
After some demand for components that can ease the generation of buildings with modular zone types, two components to transform HBObjects with all of their properties have been added to the 00 | Honeybee section. The components allow you to produce copies of zones that are translated or rotated from the original position.
8 - Comfort Maps Supports PET and Integration of CFD Results
Thanks to the addition of the ‘Physiological Equivalent Temperature’ (PET) component by Djordje Spasic in the last stable release, it is now possible to make comfort maps of PET with Honeybee. PET is particularly helpful for evaluating OUTDOOR comfort with detailed wind fields at a high spatial resolution. As such, the new PET recipe has also been optimized for integration with CFD results. The windSpeed_ input can now accept the file path to a .csv file that is organized with 8760 values in each column and a number of columns that correspond to the number of test points. Components to generate this csv from Butterfly CFD results will be coming in later releases. Stay tuned!
As always let us know your comments and suggestions.
Enjoy!Ladybug Analysis Tools Development Team
…
me of the dimensions that changed ( become Diagonal after they were Vertical or Horizontal)
I sometime use Record History in rhino for saving time, but when I change some points of curves or trim curves , I have problems with dimensions (see the two pictures below).
Problem 2 :
After trimming , only two dimensions should be changed depending on their place in changed curves . But what happens is that all the dimensions become crazy!!!!!!
I always use Aligned dimension in rhino. Now I know that dimensionsdo not exist in grasshopper. So I ask you if we have expertise in BV , C#, can we create a script for dimensions or is it impossible ??
If we can , I only need Aligned dimension.
I hope that I find or create a script that can define all points: start and end of curve ribs and create dimensions from grasshopper to rhino directly with or without the ability to change automatically .
Thank you
…
mesh by an infinite plane
Namespace: Rhino.GeometryAssembly: RhinoCommon (in RhinoCommon.dll) Version: 5.0.15006.0 (5.0.20693.0)
Syntax
C#
public Mesh[] Split( Plane plane )
Visual Basic
Public Function Split ( _ plane As Plane _ ) As Mesh()
Parameters
plane
Type: Rhino.Geometry..::..Plane[Missing <param name="plane"/> documentation for "M:Rhino.Geometry.Mesh.Split(Rhino.Geometry.Plane)"]
Return Value
[Missing <returns> documentation for "M:Rhino.Geometry.Mesh.Split(Rhino.Geometry.Plane)"]
See Also
Mesh Class
Rhino.Geometry Namespace
Last updated 3 June 2011 - Robert McNeel and Associates
Send comments on this topic to steve@mcneel.com
Report wishes and bugs: https://github.com/mcneel/rhinocommon/issues
Is this the function?
I have a VB component with this:
a = rhino.Geometry.Mesh.CreateBooleanSplit(x, y)
but this is a boolean split, so I have only one mesh, with the intersection. I would like to have several splitted meshes.
Thank you in advance again.
…
, Engineer and Researcher from France with broad programming experience. He is the author of the City in 3D Rhinoceros plugin for creation of buildings according to geojson file and with real elevation. Guillaume already created a new component: "Address to Location". It enables getting latitude and longitude values for the given address:
2) Support of Bathymetry data: automatic creation of underwater (sea/river/lake floor) terrain. This feature is now available through new source_ input of the "Terrain generator" component. Here is an example of terrain of the Loihi underwater volcano, of the coast of Hawaii:
3) A new terrain source has been added: ALOS World 3D 30m. ALOS is a Japanese global terrain data. Gismo "Terrain Generator" component has been using SRTM 30m terrain data, which hasn't been global and was limited to -56 to +60 latitude range. With this addition, it is possible to switch between SRTM and ALOS World 3D 30m models with the use of source_ input.
4) 9 new components have been added:
"Address To Location" - finds latitude and longitude coordinates for the given address.
"XY To Location" - finds latitude and longitude coordinates for the given Rhino XY coordinates. "Location To XY" - vice versa from the previous component: finds Rhino XY coordinates for the given latitude longitude coordinates. "Z To Elevation" - finds elevation for particular Rhino point. "Rhino text to number" - convert numeric text from Rhino to grasshopper number. "Rhino unit to meters" - convert Rhino units to meters. "Deconstruct location" - deconstructs .epw location. "New Component Example" - this component explains how to make a new Gismo component, in case you are interested to make one. We welcome new developers, even if you contribute a single component to Gismo! "Support Gismo" - gives some suggestions on how to make Gismo better, how to improve it and support it.
5) Ladybug "Terrain Generator" component now supports all units, not only Meters. So any Gismo example file which uses this component, can now use Rhino units other than Meters as well. Thank you Antonello Di Nunzio for making this happen!!
Basically just forget about this yellow panel:
This panel is not valid anymore, so just use any unit you want.
6) A number of bugs have been fixed, reported in topics for the last couple of weeks. We would like to thank members in the community who invested their time in testing, finding these bugs and reporting them: Rafat Ahmed, Peter Zatko, Mathieu Venot, Abraham Yezioro, Rafael Alonso. Thank you guys!!! Apologies if we forgot to mention someone.
The version 0.0.2 can be downloaded from here:
https://github.com/stgeorges/gismo/zipball/master
And example files from here:
https://github.com/stgeorges/gismo/tree/master/examples
Any new suggestions, testing and bug reports are welcome!!…
Added by djordje to Gismo at 5:13pm on March 1, 2017
,with OpenfoamV1612+ in Windows 10 64bit.The blockmesh worked good.And the snappyhexmesh crashed in the process.My computer memory is not enough? Or some settings wrong?Could you help me solve this question?/---------------------------------------------------------------------------| ========= | || \ / F ield | OpenFOAM: The Open Source CFD Toolbox || \ / O peration | Version: v1612+ || \ / A nd | Web: www.OpenFOAM.com || \/ M anipulation | |*---------------------------------------------------------------------------*/Build : v1612+Exec : snappyHexMeshDate : Aug 27 2017Time : 09:39:54Host : "default"PID : 13443Case : /home/ofuser/workingDir/butterfly/outdoor_airflownProcs : 1sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //Create time
Create mesh for time = 0
Read mesh in = 2.14 s
Overall mesh bounding box : (-241.5472 -241.4418 0) (496.4376 536.2438 144.8633)Relative tolerance : 1e-06Absolute matching distance : 0.001081851
Reading refinement surfaces.Read refinement surfaces in = 0.01 s
Reading refinement shells.Refinement level 3 for all cells inside around_buildings_area.stlRead refinement shells in = 0 s
Setting refinement level of surface to be consistent with shells.For geometry outdoor_airflow.stl detected 0 uncached triangles out of 120Checked shell refinement in = 0 s
Reading features.Read features in = 0 s
Determining initial surface intersections
Edge intersection testing:Number of edges : 1684728Number of edges to retest : 1684728Number of intersected edges : 5583Calculated surface intersections in = 1.68 s
Initial mesh : cells:554112 faces:1684728 points:576779Cells per refinement level:0 554112
Adding patches for surface regions
Patch Type Region
outdoor_airflow:
6 wall buildings
Added patches in = 0.03 s
Edge intersection testing:Number of edges : 1684728Number of edges to retest : 0Number of intersected edges : 5583Selecting decompositionMethod none
Refinement phase
Found point (127.4452 147.401 72.43167) in cell 402042 on processor 0
Surface refinement iteration 0
Marked for refinement due to surface intersection : 8820 cells.Determined cells to refine in = 3.87 sSelected for refinement : 8820 cells (out of 554112)Edge intersection testing:Number of edges : 1883850Number of edges to retest : 250376Number of intersected edges : 21198Refined mesh in = 1.77 sAfter refinement surface refinement iteration 0 : cells:615852 faces:1883850 points:652499Cells per refinement level:0 5452921 70560
Surface refinement iteration 1
Marked for refinement due to surface intersection : 38502 cells.Determined cells to refine in = 0.04 sSelected for refinement : 40392 cells (out of 615852)Edge intersection testing:Number of edges : 2787132Number of edges to retest : 1118049Number of intersected edges : 85655Refined mesh in = 3.17 sAfter refinement surface refinement iteration 1 : cells:898596 faces:2787132 points:990317Cells per refinement level:0 5432351 486812 306680
Surface refinement iteration 2
Marked for refinement due to surface intersection : 159213 cells.Determined cells to refine in = 0.1 sSelected for refinement : 168471 cells (out of 898596)Edge intersection testing:Number of edges : 6576117Number of edges to retest : 4737635Rhino Model and GH files is in t'he zip file.Please help me solve this question!~~…
rtitions." (http://wias-berlin.de/software/index.jsp?id=TetGen&lang=1)
To continue with my wrapping career, TetRhino (or Tetrino) is a .NET wrapper for the well-known and pretty amazing TetGen mesh tetrahedralization program. It provides one new GH component for discretizing or remeshing objects using TetGen. Basic tetrahedralization functionality is exposed with a few different output types that can be controlled. At the moment, the only control for tetrahedra sizes is the minimum ratio, which is controlled by a slider. This is hardcoded to always be above 1.0-1.1, as it is very easy to generate a LOT of data (and crash)...
The libs are divided again into different modules to allow flexibility and fun with or without Rhino and GH, so have fun. All 4 libs should be placed in a folder (maybe called 'tetgen') in your GH libraries folder. Remember to unblock.
Once again, the libs are provided as-is, with no guarantee of support for now, as I use them internally and do not intend to develop this into a shiny, polished plug-in. If there is enough interest, I can tidy up the code-base and upload it somewhere if someone more savvy than me wants to play.
TetgenGH.gha - Grasshopper assembly which adds the 'Tetrahedralize' component to Mesh -> Triangulation.
TetgenRC.dll - RhinoCommon interface to the Tetgen wrapper.
TetgenSharp.dll - dotNET wrapper for Tetgen.
TetgenWrapper.dll - Actual wrapper for Tetgen.
Obviously, credit where credit is due for this excellent and tiny piece of software:
"The development of TetGen is executed at the Weierstrass Institute for Applied Analysis and Stochastics in the research group of Numerical Mathematics and Scientific Computing." See http://wias-berlin.de/software/index.jsp?id=TetGen&lang=1 for more details about TetGen.
To wrap up, some notes about the inputs:
These are the possible integer Flags (F) values and resultant outputs for the GH component:
0 - Output M yields a closed boundary mesh. Useful for simply remeshing your input mesh.
1 - Output M yields a list of tetra meshes.
2 - Output I yields a DataTree of tetra indices, grouped in lists of 4. Output P yields a list of points to which the tetra indices correspond.
3 - Output I yields a DataTree of edge indices, grouped in lists of 2. Output P yields a list of points to which the edge indices correspond. Useful for lots of things, very easy to create lines from this to plug into K2 or something for some ropey FEA (or not so ropey!) ;)
As this component can potentially create a LOT of data, especially with dense meshes, care should be taken with the MinRatio (R) input. This will try to constrain the tetra to be more or less elongated, which also means that the lower this value gets, the more tetra need to be added to satisfy this constraint. Start with very high values and lower them until satisfactory.
Hopefully shouldn't be an issue, but it's possible that you need the 2015 Microsoft C++ Redistributable.
Happy tetrahedralizing...
UPDATE: The tetgen.zip has been updated with some fixes.
UPDATE2: This is now available on Food4Rhino: http://www.food4rhino.com/app/tetrino
…
Added by Tom Svilans at 1:27am on October 24, 2017
nts for Ladybug too. They are based on PVWatts v1 online calculator, supporting crystalline silicon fixed tilt photovoltaics.
You can download them from here, or use the Update Ladbybug component instead. If you take the first option, after downloading check if .ghuser files are blocked (right click -> "Properties" and select "Unblock").
You can download the example files from here.
Video tutorials will follow in the coming period.
In the very essence these components help you answer the question: "How much energy can my roof, building facade, solar parking... generate if I would populate them with PV panels"?
They allow definition of different types of losses (snow, age, shading...) which may affect your PV system:
And can find its optimal tilt and orientation:
Or analyse its performance, energy value, consumption, emissions...
By Djordje Spasic and Jason Sensibaugh, with invaluable support of Dr. Frank Vignola, Dr. Jason M. Keith, Paul Gilman, Chris Mackey, Mostapha Sadeghipour Roudsari, Niraj Palsule, Joseph Cunningham and Christopher Weiss.
Thank you for reading, and hope you will enjoy using the components!
EDIT: From march 27 2017, Ladybug Photovoltaics components support thin-film modules as well.
References:
1) System losses:
PVWatts v5 Manual, Dobos, NREL, 2014
2) Sun postion equations by Michalsky (1988):
SAM Photovoltaic Model Technical Reference, Gilman, NREL, 2014
edited by Jason Sensibaugh
3) Angle of incidence for fixed arrays:
PVWatts Version 1 Technical Reference, Dobos, NREL, 2013
4) Plane-of-Array diffuse irradiance by Perez 1990 algorithm:
PVPMC Sandia National Laboratories
SAM Photovoltaic Model Technical Reference, Gilman, NREL, 2014
5) Sandia PV Array Performance Module Cover:
PVWatts Version 1 Technical Reference, Dobos, NREL, 2013
6) Sandia Thermal Model, Module Temperature and Cell Temperature Models:
Photovoltaic Array Performance Model, King, Boys, Kratochvill, Sandia National Laboratories, 2004
7) CEC Module Model: Maximum power voltage and Maximum power current from:
Exact analytical solutions of the parameters of real solar cells using Lambert W-function, Jain, Kapoor, Solar Energy Materials and Solar Cells, V81 2004, P269–277
8) PVFORM version 3.3 adapted Module and Inverter Models:
PVWatts Version 1 Technical Reference, Dobos, NREL, 2013
9) Sunpath diagram shading:
Using sun path charts to estimate the effects of shading on PV arrays, Frank Vignola, University of Oregon, 2004
Instruction manual for the Solar Pathfinder, Solar Pathfinder TM, 2008
10) Tilt and orientation factor:
Application for Purchased Systems Oregon Department of Energy
solmetric.com
11) Photovoltaics performance metrics:
Solar PV system performance assessment guideline, Honda, Lechner, Raju, Tolich, Mokri, San Jose state university, 2012
CACHE Modules on Energy in the Curriculum Solar Energy, Keith, Palsule, Mississippi State University
Inventory of Carbon & Energy (ICE) Version 2.0, Hammond, Jones, SERT University of Bath, 2011
The Energy Return on Energy Investment (EROI) of Photovoltaics: Methodology and Comparisons with Fossil Fuel Life Cycles, Raugei, Fullana-i-Palmer, Fthenakis, Elsevier Vol 45, Jun 2012
12) Calculating albedo: Metenorm 6 Handbook part II: Theory, Meteotest 2007
13) Magnetic declination:
Geomag 0.9.2015, Christopher Weiss…
.
Things have been working swimmingly in many areas of the plugin, but one particular problem has been tough to solve. I have two components that are trying to read/write to the same memory at the same time, causing Rhino exceptions and crashes.
The conflicts appear to be happening between two components -- one is a "Layer Events Listener" that reports essentially what type of layer event just happened. The other is a "Set Layer Visibility" component that toggles the visibility of a list of layers.
The code:
public class LayerTools_LayerEventsListener : GH_Component { /// <summary> /// Initializes a new instance of the LayerTools_LayerListener class. /// </summary> public LayerTools_LayerEventsListener() : base("Layer Events Listener", "Layer Listener", "Get granular information about the layer events happening in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to listen to layer events in the Rhino document.", GH_ParamAccess.item, false); pManager.AddTextParameter("Exclusions", "E", "Provide a list of exclusions to stop reading specific events (Added, Deleted, Moved, Renamed, Locked, Visibility, Color, Active).", GH_ParamAccess.list); pManager[1].Optional = true; }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddBooleanParameter("Initialized", "I", "Whether the listener changed from passive to active.", GH_ParamAccess.item); pManager.AddTextParameter("Document Name", "doc", "Name of the Rhino document that is changing.", GH_ParamAccess.item); pManager.AddTextParameter("Layer Path", "path", "Path of the modifed layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Layer Index", "ID", "Index of the modified layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Sort Index", "SID", "Sort index of the modified layer.", GH_ParamAccess.item); pManager.AddTextParameter("Event Type", "T", "Type of the modification.", GH_ParamAccess.item); pManager.AddBooleanParameter("Added", "A", "If the layer has been added.", GH_ParamAccess.item); pManager.AddBooleanParameter("Deleted", "D", "If the layer has been deleted.", GH_ParamAccess.item); pManager.AddBooleanParameter("Moved", "M", "If the layer has been moved.", GH_ParamAccess.item); pManager.AddBooleanParameter("Renamed", "R", "If the layer has been renamed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Locked", "L", "If the layer locked setting has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Visibility", "V", "If the layer's visibility has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Color", "C", "If the layer's color has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Active", "Act", "If the active layer has changed.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; List<string> exclusions = new List<string>();
DA.GetData(0, ref active); DA.GetDataList(1, exclusions);
RhinoDoc thisDoc = null;
bool initialize = false;
string dName = null; string activePath = null; int layerIndex = -1; int sortIndex = -1; string eventType = null; bool added = false; bool deleted = false; bool moved = false; bool renamed = false; bool locked = false; bool visibility = false; bool color = false; bool current = false;
if (active) { thisDoc = RhinoDoc.ActiveDoc;
initialize = (!previouslyActive) ? true : false;
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; RhinoDoc.LayerTableEvent += RhinoDoc_LayerTableEvent; previouslyActive = true;
} else {
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; previouslyActive = false; }
if (ev != null) { dName = ev.Document.Name; layerIndex = ev.LayerIndex; eventType = ev.EventType.ToString();
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Current") { // active layer has just been changed current = true; }
}
if (!exclusions.Contains("Moved")) { if (ev.EventType.ToString() == "Sorted") { // active layer has just been changed moved = true; }
}
if (!exclusions.Contains("Added")) { if (ev.EventType.ToString() == "Added") { // layer has just been added activePath = ev.NewState.FullPath; added = true; }
}
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Deleted") { // layer has just been added
deleted = true; } }
if (ev.EventType.ToString() == "Modified") { // layer has been modified activePath = ev.NewState.FullPath;
//skip sortindex eventType = ev.EventType.ToString();
if (ev.OldState != null && ev.NewState != null) { if (!exclusions.Contains("Locked")) { if (ev.OldState.IsLocked != ev.NewState.IsLocked) locked = true;
} if (!exclusions.Contains("Visibility")) { if (ev.OldState.IsVisible != ev.NewState.IsVisible) visibility = true; }
if (!exclusions.Contains("Moved")) { if (ev.OldState.ParentLayerId != ev.NewState.ParentLayerId) moved = true; }
//if (ev.OldState.SortIndex != ev.NewState.SortIndex) moved = true; if (!exclusions.Contains("Renamed")) { if (ev.OldState.Name != ev.NewState.Name) renamed = true; }
if (!exclusions.Contains("Color")) { if (ev.OldState.Color != ev.NewState.Color) color = true; } }
} }
DA.SetData(0, initialize); DA.SetData(1, dName); DA.SetData(2, activePath); DA.SetData(3, layerIndex); DA.SetData(4, sortIndex); DA.SetData(5, eventType); DA.SetData(6, added); DA.SetData(7, deleted); DA.SetData(8, moved); DA.SetData(9, renamed); DA.SetData(10, locked); DA.SetData(11, visibility); DA.SetData(12, color); DA.SetData(13, current);
}
static bool previouslyActive = false; Rhino.DocObjects.Tables.LayerTableEventArgs ev = null;
void RhinoDoc_LayerTableEvent(object sender, Rhino.DocObjects.Tables.LayerTableEventArgs e) { ev = e;this.ExpireSolution(true); }
And for the layer visibility component:
public LayerTools_SetActiveLayer() : base("Set Active Layer", "SetActiveLayer", "Set the active layer in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to change the active layer in Rhino.", GH_ParamAccess.item, false); pManager.AddTextParameter("Path", "P", "Full path of the layer to be activated.", GH_ParamAccess.item); }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddIntegerParameter("Layer ID", "ID", "Index of layer that has been activated.", GH_ParamAccess.item); pManager.AddBooleanParameter("Status", "St", "True when the layer has been activated.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; string path = "";
if (!DA.GetData(0, ref active)) return; if (!DA.GetData(1, ref path)) return;
int layer_index = -1; bool status = false;
if (path != null) {
Rhino.RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc; Rhino.DocObjects.Tables.LayerTable layertable = doc.Layers;
layer_index = layertable.FindByFullPath(path, true);
if (layer_index > 0) { // if exists RhinoDoc.ActiveDoc.Layers.SetCurrentLayerIndex(layer_index, true); status = true; } }
DA.SetData(0, layer_index); DA.SetData(1, status); }
Now originally I was getting exceptions when changing multiple layers' visibility properties, which would cause the Event Listener to fire and try to read the Visibility property before the memory has been released by the Set Layer Visibility component. That led me to add an "Exceptions" input, that would allow me to disable the reading of Visibility events at the source in the Layer Events listener. That helped me manage about 95% of the crashes I was getting, but I still get strange crashes in other event properties, even when that property shouldn't be affected. For instance, I am getting a crash here on the Name property in the event from the delegate function, even though I am only changing Visibility at any one time:
I have a few ideas but they all seem pretty hacky. One is to try to set a flag that is readable by any component in the plugin -- so that the event listener can see if a "set" component is currently running and abort before causing an exception. The other is creating a delay in the event listener, somthing like 200ms, to allow any set components to finish what they are doing before reading the event. Neither seems super ideal.
Any ideas?
Thanks,
Marc
…
Karamba.
I am using your plug-in for normal forces evaluation in the transvere wires and spreaders of a sailboat. Mast is solved in another way, so I am not taking forces from Karamba in that case.
Basing on the forces value an adequate wire size (diameter) is choosen. Then masses of wires are being calculated. Loads (forces) on longitudinal wires are calculated without Karamba. The problem is when choosing transverse wires’ mass minimization as a criteria, the Octopus doesn’t get any results - is changing the sliders (genes) too fast for Karamba to calculate the forces (so Octopus gets only nulls):
When minimization of a e.g. longitudinal wires’ mass (calculated without Karamba) is taken as a criteria Octopus works fine.
Which suggests that the problem is in interaction of two plug-ins.
Any ideas how to avoid that problem?
Thanks,
M.
Below some screenshots of definition part with Karamba:
1675×807 200 K
image.png1680×789 398 KB
Despite the ‘orange warning’ the values are correct (double checked with other software).However I don't know why does it say that there is a part that can move freely without deformation,as the model looks like this:
image.png1239×343 55.5 KB
…
ndard length elements without any cutting, and using only simple connections, such as cable ties or scaffold swivel couplers.
To summarize the approach I present here:
Design an initial shape
Remesh this form so that the edges are all roughly the length of the tubes we will use to build the structure
Rotate and extend the edges of this mesh to create the crossings
Apply a relaxation to optimize the positions of the tubes for tangency
demo_reciprocal_structures.gh
Initial form
In this example I show how to apply this system to a simple sphere. You can replace this with any arbitrary shape. It can be open or closed, and have any topology.
Remeshing
The new ReMesher component takes an input mesh, and a target edge length, and iteratively flips/splits/collapses edges in order to achieve a triangulated mesh of roughly equal edge lengths.
Press the Reset button to initialize, then hold down the F5 key on your keyboard to run several iterations until it has stabilized. (F5 just recomputes the solution, and this can be a quick alternative to using a timer)
Once the remeshing is complete, bake the result into Rhino and reference it into the next part of the definition (I recommend doing this rather than connecting it directly, so that you don't accidentally alter the mesh and recompute everything downstream later).
Alternatively you can create your mesh manually, or using other techniques.
Rotate and Extend
We generate the crossings using an approach similar to that described by Tomohiro Tachi for tensegrity structures here:
http://www.tsg.ne.jp/TT/cg/FreeformTensegrityTachiAAG2012.pdf
Using the 'Reciprocal' component found in the Kangaroo mesh tab, each edge is rotated about an axis through its midpoint and normal to the surface, then extended slightly so that they cross over.
By changing the angle you can change whether the fans are triangular or hexagonal, and clockwise or counter-clockwise.
Choose values for the angle and scaling so that the lines extend beyond where they cross, but not so far that they clash with the other edges.
Note that each rod has 4 crossings with its surrounding rods.
There are multiple possibilities for the over/under pattern at each 'fan', and which one is used affects the curvature:
A nice effect of creating the pre-optimization geometry by rotating and extending mesh edges in this way is that the correct over/under pattern for each fan gets generated automatically.
Optimization for tangency
We now have an approximate reciprocal structure, where the lines are the centrelines of our rods, but the distances between them where they cross vary, so we would not actually be able to easily connect the rods in this configuration.
To attach the rods to form a structure, we want them to be tangent to one another. A pair of cylinders is tangent if the shortest line between their centrelines is equal to the sum of their radii:
Achieving tangency between all crossed rods in the structure is a tricky problem - if we move any one pair of rods to be tangent, we usually break the tangency between other pairs, and because there are many closed loops, we cannot simply start with one and solve them in order.
Therefore we use a dynamic relaxation approach, where forces are used to solve all the tangency constraints simultaneously, and over a number of iterations it converges to a solution where they are all met. The latest Kangaroo includes a line-line force, which can be used to pull and push pairs of lines so that they are a certain distance apart. Each rod is treated as a rigid body, so forces applied along its length will cause it to move and rotate.
The reciprocal component uses Plankton to find the indices of which lines in the list cross, which are then fed into the force for Kangaroo. We also use springs to keep each line the same length.
If the input is good, when we run the relaxation (by double clicking Kangaroo and pressing play), the rods should move only a little. We can see whether tangency has been achieved by looking at the shortest distance between the centerlines of the crossing rods. When this is twice the rod radius, they are tangent. Wait for it to solve to the desired degree of accuracy (there's no need to wait for 1000ths of a millimeter), and then press pause on the Kangaroo controller and bake the result.
The radius you choose for the pipes, curvature of the form and length of the edges all affect the result, and at this stage you may need to tweak these input values to get a final result you are happy with. If you find the rods are not reaching a stable solution but are sliding completely off each other, you might want to try adding weak AnchorSprings to the endpoints of the lines, to keep them from drifting too far from their original positions.
For previewing the geometry during relaxation I have used the handy Mesh Pipe component from Mateusz Zwierzycki, as it is much faster than using actual surface pipes.
To actually build this, you then need to extract the distances along each rod at which the crossings occur, and whether it crosses over or under, mark the rods accordingly, and assemble (If there is interest I will also clean up and post the definition for extracting this information). While this technique doesn't require much equipment, it does need good coordination and numbering!
There is also a ReciprocalStructure user object component that can be found in the Kangaroo utilities tab, which attempts to apply steps 3 and 4 automatically. However, by using the full definition you have more control and possibility to troubleshoot if any part isn't working.
The approach described here was first tested and refined at the 2013 Salerno Structural Geometry workshop, lead by Gennaro Senatore and myself, where we built a small pavilion using this technique with PVC tubes and cable ties. Big thanks to all the participants!
Finally - this is all very experimental work, and there are still many unanswered questions, and a lot of scope for further development of such structures. I think in particular - which of the relative degrees of freedom between pairs of rods are constrained by the connection (sliding along their length, bending, and twisting) and how this affects the structural behaviour would be interesting to examine further.
Steps 3 and 4 of the approach presented above would also work with quad meshes, which would have different stability characteristics.
There is also the issue of deformation of the rods - as the procedure described here solves only the geometric question of how to make perfectly rigid straight cylinders tangent. The approach could potentially be extended to adjust for, or make use of the flexibility of the rods.
I hope this is useful to somebody. Please let me know if you do have a go at building something using this.
Any further discussion on these topics is welcome!
Further reading on reciprocal structures:
http://vbn.aau.dk/files/65339229/Three_dimensional_Reciprocal_Structures_Morphology_Concepts_Generative_Rules.pdf
http://www3.ntu.edu.sg/home/cwfu/papers/recipframe/
http://albertopugnale.wordpress.com/2013/04/05/form-finding-of-reciprocal-structures-with-grasshopper-and-galapagos/
…