a reply.
Q1. I run two generations in my generation 0 I can distinguish 3 lines...what do they refer to? I got my Fitness as 5 values Heating, Cooling etc and thought there will be 5 lines
Q2. What are values on X/Y/Z axis and color legend? What colors means I got black 409.87 and red 33.63 amd tis dot 99.2:5 and green 2.27:4?
Q3. I can see that in every generation my values are condensed ...of course I shall run this for many more generations... but as result of my simulation which is minimize energy will be the last one that head down?
Q4. I was reading this forum and there is no current way of savings all results for each run ?
Q5. If there are some any general advice how I shall tackle my problem this would be great!
Ps. I will try to run this example over the weekend to see what is the result.
…
lName, signalValue, operationMode):
sigV=signalValue
if sys.version_info[0] == 3:
if type(signalName) is str:
signalName=signalName.encode('utf-8')
if type(signalValue) is bytearray:
sigV = (ct.c_ubyte*len(signalValue))(*signalValue)
if type(signalValue) is str:
signalValue=signalValue.encode('utf-8')
sigV = (ct.c_ubyte*len(signalValue))(*signalValue)
else:
if type(signalValue) is bytearray:
sigV = (ct.c_ubyte*len(signalValue))(*signalValue)
if type(signalValue) is str:
signalValue=bytearray(signalValue)#<========This is line 1052
sigV = (ct.c_ubyte*len(signalValue))(*signalValue)
sigV=ct.cast(sigV,ct.POINTER(ct.c_ubyte)) # IronPython needs this
return c_WriteStringStream(clientID, signalName, sigV, len(signalValue), operationMode)
It displays the following error:
Program started
Connected to remote API server
Runtime error (TypeErrorException): unicode argument without an encoding
Traceback:
line 1052, in simxWriteStringStream, "C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\remoteApiBindings\python\python\vrep.py"
line 70, in script
Any hint?…
are hotter than the least overlapped parts.
I'm trying to create gradients when overlapping between closed surfaces occur. The gradient goes from the center of the most overlapped figure to the edges of the least overlapped figures.
To help understand how I'm thinking it, I will first show you my solution for one figure.
As I said in the title, it's kind of a pseudo gradient. It's a way of organising areas (rings) inside of the geometry. To achieve this I thought in creating a series of rays that then can be divided in segments, in this case 3 segments of same lenght per ray, I could get more resolution in the gradient by dividing in more thus creating more rings...
in this picture the rays are in dark red and go from the center to 4 points in the perimeter, if I wanted more resolution I could have more rays, but with this simple figure 4 is enough
the rings are in a gradient of colors from the center to the perimeter, lighter in color each time:
so when I have 2 overlapping geometries
the center of the gradient should be on the center of the most overlapped part (in red) and go to the perimeter of the pink parts
for the red figure I draw the rays from the center to its perimetry. and for the pink figures the gradient should go from the parts that are in contact with the red figure to the perimeter, something like this:
still that is something I did with rhino and it's pretty intuitive...
the problem gets worse when i have more figures and more "heat centers"
like in these examples
maybe the approach should not be with rays to create the rings... maybe with offsets..
not sure if it's not too complicated to achieve in grasshopper and maybe there's another way of creating a gradient with multiple focuses...
would aprecciate any help
cheers…
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
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
guages I'd recommend all use the RhinoCommon SDK and thus all have access to the same functionality.
How long would it take me to understand and write my own code?
If you already know how to program, it probably won't take too long. If you're past the hurdle of what it means to declare and assign variables, how conditionals and loops work and what scope is, you've already rounded the hardest corner.
Is it even worth it?
That really depends. "Learn programming" is clearly not blanket good advice. Most people out there do not have to learn programming to be happy with their lives and successful in their careers. For some people it can make a small difference, and for a few people it can make a huge difference. If you feel you're in the 'some' category then this is indeed a question you have to answer. Note that the investment for learning programming is a continuous process. Unless you keep up your skills and learn about new stuff that becomes available, you'll lose the ability to write successful code over time.
Where do I start?
Step 1 is to answer the previous question. It is unlikely that anyone besides yourself can answer it, but you can start by making a list of things you do manually now that may be programmable. Then make a list of the things you are unable to do now but which you might be able to do with programming. If while looking at these lists your reaction is: "meh", the answer is probably no.
Step 2 is to pick a language. This is again a very personal thing; there's no wrong answer, because there's no right answer.
Step 3 is to start learning this language. My experience is that the best way to learn a programming language is to try and solve a real problem that you understand very well. If the problem statement is nebulous or poorly understood, you'll be learning two things and that's a recipe for unnecessary frustration.
Here are my thoughts on language:
Python: I don't use Python myself, I can sort of read it while moving my lips. I don't particularly like Python though. The indentation sensitiveness stresses me out, and I find the lack of type-safety disturbing. However it is a good language for mathematical/scientific programs. There are lots of additional code libraries you can easily import that will ease the development of mathematically intense algorithms.
C#: I like C# very much, but it does suffer from geekerosis. A lot of the keywords used in the language are not self-explanatory (abstract, sealed, virtual). For me this is no longer a problem as I've memorised what they all mean. C# is designed to be an efficient language to write, rather than an easy one to learn.
The great thing about C# though is that there's a huge amount of material out there for learning it. It is one of the most popular, mature and modern languages you can hope to pick.
VB: I learned VBScript as my first language, and then moved on to VB5, VB6 and VB.NET. It is somewhat more friendly than C#, and functionally it is almost identical. The switch from VB to C# is reasonably low-threshold and there are excellent tools for translating VB code to C# and vice versa.
Since you already know some Python, it probably makes the most sense to continue on that path. If you want to switch, C# is more like Python than VB, so C# would be my next suggestion.
As for where to get information... you have 4 major options when developing code for Rhino.
If it's a question about the language itself, StackOverflow is a great resource. It can be a pretty hostile place for beginner questions, but I find that mostly the questions I'm asking have been asked already and the answers on SO tend to be good. In fact usually when I google my questions, the first few hits are always SO posts.
If it's a question about the Rhino SDK or Grasshopper, you can ask it either on the GH forums (where we are now), or on Discourse. We're not as quick on the draw as SO, but we do know about Rhino.
If you're looking for a basic explanation of what a keyword or a type is for, perhaps with an example, MSDN is the best first choice. In fact if you google the name a of a .NET type, the first hit is almost always an MSDN page.…
Added by David Rutten at 2:03pm on December 3, 2014
umbrella of Urban Heat Island (UHI) and I am going to try to separate them out in order to give you a sense of the current capabilities in LB+HB.
1) UHI as defined as a recorded elevated air temperature in an urban area:
If you have access to epw files for both an urban area and a rural area, you can use Ladybug to visualize and deeply explore the differences between the two weather files. Ladybug is primarily a tool for weather file visualization and analysis and it can be very helpful for understanding the consequences of UHI on strategies for buildings or on comfort. This said, if you do not have both rural and urban recorded weather data or you want to generate your own weather files based on criteria about urban areas (as it sounds like you want to do), this definition might not be so helpful.
2) UHI defined by air elevated air temperature but viewed as a computer model-able phenomenon resulting primarily from urban canyon geometry, building materials, and (to a lesser degree) anthropogenic heat:
This definition seems to fit more with they type of thing that you are looking for but it is unfortunately very difficult and computationally intensive such that we do not currently have anything within Ladybug to do this right now. I can say that the state-of-the art for this type of modeling is an application called Town Energy Budget (TEB) and this is what all of the advanced UHI researches that I know use (http://www.cnrm.meteo.fr/surfex/spip.php?article7). Unfortunately for those trying to use it in professional practice, it can take a while to get comfortable with it and it currently runs exclusively on Linux (this does mean that it is open source, though, and that you can really get deep into the assumptions of the model). A couple years ago, a peer of mine translated almost all of TEB into Matlab language making it possible to run it on Windows if you have Matlab. He wrapped everything together into a tool called the Urban Weather Generator (UWG), which can take an epw file of a rural area and warp it to an urban area based on inputs that you give of building height, materials, vegetation, anthropogenic heat, etc. I would recommend looking into this for your project, although, bear in mind that is it not open source like the original TEB tool and that you may need to get a (very expensive) copy of MATLAB (http://urbanmicroclimate.scripts.mit.edu/uwg.php).
3) UHI as defined by a thermal satellite image of an urban area depicting an elevated average radiant environment that reaches a maximum a the city center and changes by land use:
This is the definition of UHI that I am most familiar with and was the basis of much of my past research. I feel that it is also a definition of UHI that is a bit more in line with where a lot of contemporary UHI research is headed, which is away from the notion of UHI as a macro-scale meteorological phenomena that is averaged as an air temperature over a huge area towards one that accepts that different land uses have different microclimates and (importantly) different radiant environments. While the air temperature difference between urban and rural areas usually does not change more than 1-4 C, the radiant environment can be very different (on the order of 10-15 C differences). The best way to understand UHI in this context is with Thermal satellite images, for which there is ha huge database of publicly available data on NASA's glovis website (http://glovis.usgs.gov/) or their ECHO website (http://reverb.echo.nasa.gov/reverb/#utf8=%E2%9C%93&spatial_map=satellite&spatial_type=rectangle). I tend to use thermal data from LANDSAT 5-8 and ASTER satellites in my research. Unfortunately, there is a lot f bad data with a lot of cloud cover mixed in with the really good stuff and it can take some time to find good images. Also, there aren't too many programs that read the GeoTiff file format that you download the data as. I know that ArcGIS will read it, a program called ENVI will read it (I think that the open source QGIS can also red it). I have plans to write a set of components to bring this type of data into Rhino and GH (I may get to it a few months down the line).
4) UHI as a computer model-able notion of "Urban Microclimate" with consideration of local differences and the local radiant environment:
This is where a lot of my research has lead and, thankfully, is an area that Honeybee can help you out a lot with. EnergyPlus simulations can output information on outside building surface temperatures and these can be very helpful in helping get a sense of the radiant environment around individual buildings. Right now, I am focusing just on using this data to fully model the indoor environments of buildings as you see in this video:
https://www.youtube.com/watch?v=fNylb42FPIc&list=UUc6HWbF4UtdKdjbZ2tvwiCQ
I have plans to move this methodology to the outdoors once I complete this initial application to the indoors. For now, you can use the "Surface result reader" and the "color surfaces based on EP result" components to get a sense of variation in the outside temperature of your buildings.
I hope that this helped,
-Chris
…
ther math and logic. i can usually conceptualise what i want to do and cobble some semi working thing together but don't know which components to use and how to patch it. so i'm super happy to have someone who knows what he's doing to find this interesting.
and i'm glad you mention the fanned frets again, there is one input parameter that's still missing for the multiscale frets to be fully parametric, it's the angle of the nut or which fret should be straight. it depends a bit on personal preferences and playing posture what is more comfortable. so being able to adjust this easily would be cool. again i have no idea how the maths for that work or if you can just rotate each fret the same amount around it's middle point. The input either as fret number (for the straight fret) or as a simple slider from bridge to nut should do as input setting.
Here are the two extremes and the middle ground:
i've been thinkin today while analysing your patches and cleaning up my mess what exactly the monster should do.
Here are the input parameters needed, i think it's the complete list
scale length low E string
scale length high e string
fret angle/straight fret
string width at nut
string width at bridge
number of frets
fretboard overhang at nut (distance from string to fretboard bounds)
fretboard overhang at last fret
string gauges
string tensions
fretboard radius at nut (for compound radius fretboard radius at bridge is calculated with the stewmac formula)
fretwire crown width
fretwire crown height
action height at nut (distance between bottom of string and fretwire crown top)
action height at last fret
pickup 1 neck position
pickup 2 middle position
pickup 3 bridge position
nut width
the pickup positions should be used to draw circles for the magnet poles on each string so they are perfectly aligned and can be used for the pickup flatwork construction. ideally they would need a rotation control aligning the center line of the pickup so it's somewher between the last fret angle and bridge angle. personally i do this visually depending on the design i'm looking for, some people have huge theories on pickup positioning but personally i don't believe in it.
that should result in everything needed to quickly generate all the necessary construction curves or geometry for nut/fingerboard/frets/pickups. this is the core of what makes a guitar work, the more precise this dynamic system is the better the guitar plays and sounds.
i posted another thread trying to understand how i could use datasets form spreadsheets,databse, csv to organize the input parameters. What would make sense for the strings for example is hook into a spreadsheet with the different string sets, i attached one for the d'Addario NYXL string line which basically covers all combos that make sense.
The string tension is an interesting one, and implmenting it would sure be overkill albeit super interesting to try. it should be possible to extrapolate from the scale length of each string what the tension for a given string gauge of that string would be so that you could say 'i want a fully balanced set' or 'heavy top light bottom) and it would calculate which SKU from d'addario would best match the required tension. All the strings listed in the spreadsheet are available as single strings to buy.
i'm trying to reorganize everything which helps me understand it. i just discovered the 'hidden wires' feature which is great since once i understood what a certain block does or have finished one of my own, i can get the wires out of the way to carry on undistracted. a bit risky to hide so many wires but it makes it so much easier not to get completely lost :-)
btw, the 'fanned fret' term is trademarked, some guy tried to patent it in the 80's which is a bit silly since it has been done for centuries. there is a level of sophistication above this as well, check out http://www.truetemperament.com/ and that really is something else. it really is astounding how superior the tuning is on those wigglefrets, the problem is that it's rather awkward for string bending and also you can't easily recrown or level the frets when they are used. …
l coarse mesh
Subdividing this mesh into strips of thin quads
Relaxing/Planarizing this mesh
Splitting and Unrolling
In this post I deal with the first 2 of these stages.
You can download the example definition here:
developable_strips_tutorial.gh
Drawing the initial mesh
To begin with we need a simple quad mesh. This can be modelled manually in Rhino, and only needs to use enough quads to give the topology and very rough form. No need to worry too much about the exact geometry or dimensions at this point, as we will refine and alter it as we go.
One very important thing that we do need to bear in mind though is that all internal vertices must have even valence (I covered this a bit in the earlier post here).
So for example, this is bad:
(because the highlighted vertex is surrounded by 5 faces)
While this is good (and can still be relaxed to the same shape):
(the top and bottom vertices have valence 8, and the vertices between the arms have valence 4)
With a little practice it should be possible to convert any mesh into one that meets this condition.
The reasons why we need this condition should become more clear in the later steps.
First subdivision
This is where we choose how many strips we want our final model to have, by applying a few rounds of subdivision using the Refine component (you could also use Weaverbird here):
Sorting the face directions
While quad meshes do not carry the same information about u/v directions as a NURBS surface, the individual faces do have a sort of direction given by their vertex ordering. However, these face directions are usually not consistently arranged, especially after subdivision.
The Kangaroo MeshDirection component attempts* to orient all the faces in a mesh so that they match with their neighbours.
For example, before sorting, if we draw a line from the midpoint of the first edge of each face to the midpt of its opposite edge, we might get something like this:
Whereas after sorting, we should get something like this:
*note that I say it attempts to orient the faces consistently. In some cases no valid solution exists, for instance if 3 or 5 faces meet around a vertex, hence the requirement mentioned at the start for even valence vertices.
Directional Subdivision
Now that we have consistent face directions across the mesh, we can apply further subdivision, but this time in one direction only. So we go from roughly square quads to thin rectangles. The idea is that as we apply higher levels of this directional subdivision, the final relaxed result goes towards something semi-discrete. A NURBS surface is fully continuous, and a mesh is fully discrete (made up of separate facets), while this strip model will be smooth in one direction and faceted in the other.
Go to part 2 for the next step of the process
…