) function if you've already got a boolean value.
This expression:
x < 12
results in exactly the same things as this expression:
If( x < 12, True, False )
If() is only really useful when you want to return non-boolean data, like so:
If( x < 12, x, 100-x )
In this case, the expression will return either x, or 100-x if x is larger than or equal to 12:
x result
1 1
2 2
10 10
11 11
12 88
13 87
14 86
18 82
70 30
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 7:22am on August 10, 2011
掌握编程过程中遇到的思路方面和技术方面的问题. 内容包括以下几个方面:
反向逻辑思维能力的培养;
建立清晰的编程逻辑思维能力;
GH 的程序设计理念;
并行数据结构深入理解和控制.
Grasshopper course of McNeel Asia focus on the cultivation of students flexible use of programming techniques, the ability to solve practical problems. Our course deep into the whole process of programming, from programming thinking model, the components principle to usage details do detailed explanation, help students complete mastery programming encountered in the process of thinking and technical aspects, include the following content:
Ability of reverse logical thinking;
Establishment of clear programming logical thinking ability;
The program design concept of Grasshopper;
Understanding parallel data tree structure and how to control it.
更多详细内容... More details…
授课讲师 Instructor 课程由Grasshopper原厂McNeel公司在中国地区的两位 Rhino 原厂技术推广工程师 – Dixon、Jessesn联合授课。课程结束后对达到授课预定目标的学员颁发唯一由Grasshopper原厂认证的结业证书.
Dixon & Jessesn, McNeel Asia Support engineer, by the end of course student who achieve the intended target will get the authentication certificate from McNeel Asia.
课程报名 Register this course 课程即日开始报名, 开课一周前停止报名, 名额满提前报名结束. This course begin to sign up, stop sign up a week ago, with the quota ahead over.
在线报名参加课程...
Sign up to this course…
课程日期 Schedule 7/15-7/20 Beijing 北京 7/26-7/31 Shanghai 上海 7/07-7/12 Shenzhen 深圳
课程范例演示 Samples of Grasshopper course demo
Note: pls follow below comments by Jessesn to see the samples…
思った感じになりません。
balls の代わりにplanarカーブを直接入れてみましたがエラーが出ます。
ファンクションにしてみたところ、forループので作った数値が反映されていません。
ファンクションのインスタンス?を出力していないと思い上記のようにしましたがエラーが出てしまいます。
以上の事から自分の認識が正しいのかよくわからなくなりました・・・
python自体の深いところをわかっているわけではないので余計こんがらがりました。
そこで、for b in ballsはどのような条件または使い方であれば使えるのでしょうか?
そして、上記のように別のオブジェクトに対しての使い方はどのようにすればできるのでしょうか?
2:同じファンクション内のdist = rs.Distance(self.pos,b.pos)についてですが
この文章も for b in balls によってbはBallのインスタンスであると定義?されたためb.posがbの位置であると分かるのでしょうか?
pythonは定義しなくても動いてしまうのでどのような時に使えるのか文章見ただけではよくわかりません・・・
大変細かいことかもしれませんが、よりpythonをしっかりと理解するためにも、どなたかわかる方ご教授いただけると幸いです。…
points within the bounds of the site boundary and use each location as an attractor point controlling a variable at each point in the grid (radius of a circle/height of a cube/colour based on a gradient etc.).This would be based on proximity to the attractor points with the effect of each attractor point essentially scaled by the percentage associated with it. For example a location with 88% visitor rates would have a more dramatic effect than a location with 26% visitor rates.
I've had a bit of a play around but can't seem to get beyond the point of what is shown in basic point attractor tutorials online. I'm definitely a novice.
Here's how I figured it would be done:
1) Create a grid of source points within a boundary curve.
2) Select 18 pre-defined attractor points.
2) Measure the distance between the source points and the attractor points.
3) Invert this data so that variables increase with proximity rather than decrease.
4) Give each of the attractor points a strength value from 1-100% based on the visitor rates.
5) Use the scaled data to control a variable at each of the source points.
6) Create some way to control the drop-off rate of the effect from each point.
It is at step 3 that I get completely lost.
I hope my description is clear. Any help would be greatly appreciated,
Adam
…
18): 'Rhino.Geometry.AnnotationBase.Text' is obsolete: 'Use RichText or PlainText' (line 88)
2. Warning (CS0618): 'Rhino.Geometry.AnnotationBase.FontIndex' is obsolete: 'Use Font property instead' (line 92)
3. Warning (CS0618): 'Rhino.RhinoDoc.Fonts' is obsolete: 'Use DimStyles table instead' (line 92)
1. Error (CS1061): 'Rhino.Geometry.TextEntity' does not contain a definition for 'AnnotativeScalingEnabled' and no extension method 'AnnotativeScalingEnabled' accepting a first argument of type 'Rhino.Geometry.TextEntity' could be found (are you missing a using directive or an assembly reference?) (line 94)
Wondering, if perhaps, you will be updating for Rhino 6 compatibility?
Cheers
Lyndon
…
make a new curve from points I attempt to do it by writing:
Curve cv = new Curve();
This gives me the error:Error: 'Rhino.Geometry.Curve.Curve()' is inaccessible due to its protection level (line 88)
I have also tried calling the CreateInterpolatedCurve() from the Curve class, but
Curve cv = null; cv = new Curve.CreateInterpolatedCurve(Mould.Branch(0), 3);
But from this i get:
Error: 'Rhino.Geometry.Curve.CreateInterpolatedCurve(System.Collections.Generic.IEnumerable<Rhino.Geometry.Point3d>, int)' is a 'method' but is used like a 'type' (line 89)I'm really quite lost about how I can this to work. Can anyone help me?…
,
and then I saw under Application that resources are managed by 'Icon and manifest'.
That can also be set as 'Resource file', but then a file path is required.
Is 'Icon and manifest' OK, or have I to set thing differently ?
Also, in the class code I inserted the following:
( I saw it mentioned here in the forum )
protected override Bitmap Icon { get { return Resources.colour; } }
( colour.png is the image file's name )
but VS gives me an error, saying:
Error 1 The name 'Resources' does not exist in the current context C:\Program Files\Rhinoceros 5 Evaluation\gh\plug-ins\ColourRhOb\Class1.cs 88 26 ColourRhOb
Did I miss a reference in the code ? Here they are:
using System;using System.Drawing;using System.Collections.Generic;using Grasshopper.Kernel;using Grasshopper.Kernel.Types;using Rhino;using Rhino.DocObjects;using Rhino.Geometry;
What am I doing wrong ?
Thanks
emilio
…