Grasshopper

algorithmic modeling for Rhino

Hi David,

 

Could you have a look into why the Fillet component is behaving differently in the same definition. Some corners are square because the input curve is too short for the given radius. Highlight in blue. Whilst others are rounded at a smaller radius. Highlight in Magenta. Files can be found here

I must say that it wouldn't be a bad option to be able to choose either of these results but having them at the same time is undesirable.

 

Thanks.

Danny

PS I love the new SET Components and If you haven't already seen, the Slider=10 for integers 10.0 for decimals. How easy would it be to implement on components like Shift=-1, Item=1, etc?

 

Views: 1549

Replies to This Discussion

I'll look into the Fillet problem.

 

 

"How easy would it be to implement on components like Shift=-1, Item=1, etc?"

 

quite easy, it was a bit of typing for the slider, but when the assignment is simple, such as with TextPanels, all the code needed is something like:

 

Public Sub SetInitCode(ByVal code As String) Implements IGH_InitCodeAware.SetInitCode     

  m_usertext = code    

End Sub

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Side issue: 

 

I was thinking it would be great to include the SetInitCode on components like:

Shift List, List Item, Split List where there was one obvious input to assign it to.

eg. Split List = 1

Even Operators like Larger Than = 0 or some of them could set the B input to the user text like Addition = 1 would be great for Input stream to A + 1

Or  Vectors: like Z=-1, Amplitude = 5 

Primitives: Boolean =True, Colour = Green

 

What do you think?

I think it all makes sense. It's a feature that caters for the expert user without getting into the way at all of beginners and intermediates. If only all UI decisions were this clear cut...

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I only added these to where I thought it made sense. If a component had two inputs that could both make sense, I typically didn't add any parsing logic.

 

Note that the code you supply is an expression, so if you want Strings, be sure to encase them in double quotes:

 

Concat = " alcohol doesn't affect me"

 

● Added initialization code to the Cull Nth component. 

● Added initialization code to the Cull Index component. 

● Added initialization code to the Random Reduce component. 

● Added initialization code to the Duplicate component. 

● Added initialization code to the List Item component. 

● Added initialization code to the Repeat Data component. 

● Added initialization code to the Shift List component. 

● Added initialization code to the Split List component. 

● Added initialization code to the Sequence component. 

● Added initialization code to the Constant E component. 

● Added initialization code to the Constant Epsilon component. 

● Added initialization code to the Factorial component. 

● Added initialization code to the Fibonacci component. 

● Added initialization code to the Golden Ratio component. 

● Added initialization code to the Constant Pi component. 

● Added initialization code to the Random component. 

● Added initialization code to the Range component. 

● Added initialization code to the Series component. 

● Added initialization code to the Square component. 

● Added initialization code to the Square Root component. 

● Added initialization code to the Cube component. 

● Added initialization code to the Cube Root component. 

● Added initialization code to the Log10 component. 

● Added initialization code to the Log component. 

● Added initialization code to the Exponent component. 

● Added initialization code to the Power of 2 component. 

● Added initialization code to the Power of 10 component. 

● Added initialization code to the Sine component. 

● Added initialization code to the Sinc component. 

● Added initialization code to the Cosine component. 

● Added initialization code to the Tangent component. 

● Added initialization code to the ArcSine component. 

● Added initialization code to the ArcCosine component. 

● Added initialization code to the ArcTangent component. 

● Added initialization code to the Secant component. 

● Added initialization code to the Cosecant component. 

● Added initialization code to the Cotangent component. 

● Added initialization code to the One over X component. 

● Added initialization code to the Absolute component. 

● Added initialization code to the Sign component. 

● Added initialization code to the ToDegrees component. 

● Added initialization code to the ToRadians component. 

● Added initialization code to the N-Base log component. 

● Added initialization code to the Smaller Than component. 

● Added initialization code to the Larger Than component. 

● Added initialization code to the Equal To component. 

● Added initialization code to the Similar To component. 

● Added initialization code to the Addition component. 

● Added initialization code to the Subtraction component. 

● Added initialization code to the Multiplication component. 

● Added initialization code to the Division component. 

● Added initialization code to the Integer Division component. 

● Added initialization code to the Minimum component. 

● Added initialization code to the Maximum component. 

● Added initialization code to the Modulus component. 

● Added initialization code to the Power component. 

● Added initialization code to the Concatenate component. 

● Added initialization code to the String Split component. 

● Added initialization code to the String Join component. 

● Added initialization code to the Evaluate Length component. 

● Added initialization code to the Circle component. 

● Added initialization code to the Circle CNR component. 

● Added initialization code to the Arc component. 

● Added initialization code to the Curve component. 

● Added initialization code to the Interpolated Curve component. 

● Added initialization code to the Offset Curve component. 

● Added initialization code to the Offset Curve Loose component. 

● Added initialization code to the Offset Curve On Surface component. 

● Added initialization code to the Extend Curve component. 

● Added initialization code to the Catenary component. 

● Added initialization code to the Line SDL component. 

● Added initialization code to the Fillet component. 

● Added initialization code to the Fillet Distance component. 

● Added initialization code to the Move component. 

● Added initialization code to the Scale component. 

● Added initialization code to the Mesh Plane component. 

● Added initialization code to the Mesh Box component. 

● Added initialization code to the Mesh Sphere component. 

● Added initialization code to the Sphere component. 

● Added initialization code to the Surface Offset component. 

● Added initialization code to the Surface Offset Loose component. 

● Added initialization code to the Divide Curve component. 

● Added initialization code to the Divide Curve Length component. 

● Added initialization code to the Divide Curve Distance component. 

● Added initialization code to the Curve Frames component. 

● Added initialization code to the Curve Perpendicular Frames component. 

● Added initialization code to the Square Grid component. 

● Added initialization code to the Rectangular Grid component. 

● Added initialization code to the Vector Amplitude component.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

Brilliant, simply brilliant!

 

Hi David and Danny,

 

This is great :] I was wondering when could it be included. Thank you again, David.

 

Adding components to the canvas by typing (Slider = 10) is fast, easy and powerful. It could be the best UI.

 

I think difference is made by 'Slider = 10' vs 'Slider = 10.000' more than by simple input/component initialization so, why to stop when it could be even more powerful?

 

            Slider = 0 To 5 --- Slider in [0, 5]

            Slider = {3; 0 To 5}

            Slider = {3;0;5}

            Slider = 3;0;5

            Slider = 3 0:5

            Slider = 3,0,5

            Slider = 3 0 5 --- Value and range (min max)

 

            3 0.0 5 --- 3.0 0.0 5.0

            3 0 5.0 --- 3.0 0.0 5.0

            3.0 0 5 --- 3.0 0.0 5.0

            -1 0 5 --- 0 0 5 (-1 -1 5)

            6 0 5 --- 5 0 5 (6 0 6)

 

            Slider = 0:2:6 --- Even numbers: 0, 2, 4, 6.

            Slider = 1:2:7 --- Odd numbers: 1, 3, 5, 7.

 

            0:2:5 --- 0:2:4 (or 0:2:6)

            3:2:8 --- 3:2:7 (or 3:2:9)

 

            3 1:2:7 --- 1 3 5 7 (value 3)

 

            Bang! = 7 --- 7 outputs

            Merge = 5 --- 5 inputs

 

What's your opinion about Bang! = 7? As it's setting number of inputs, should it use different format? Bang! 7? Bang! (7)? Bang! i7?

 

            + * - / \ % ^ & | ! = > --- Addition, Multiplication, Subtraction, Division, Integer Division, Modulus, Power, AND, OR, NOT, Larger than, &c.   

 

            = could be a problem.

            \ Integer division or Set difference?

            ! could be NOT but also Factorial.

            | could mean intersection.

            & could mean concatenate.

 

            1+ --- Addition: input A = 1

            2* --- Multiplication: input A = 2

            +{0,1,1} --- Addition: input B = {0,1,1}

 

            0-, 1/, 2^, 10^, e^ have their own components

 

            Flatten = {7} or Flatten = 7 --- Input P = {7} (off-topic: Why can’t P be a list?)

 

            Pt = {1, 2, 3} --- Point XYZ, X = 1, Y = 2, Z = 3.

 

            Swatch = 129,239,231 (102)

            Swatch = 129 139 231 102

 

            F2 = "x^2+y"

 

"List Length" and "List Insert" don't work properly: "Value List" is choosen. Why? What's the reason to this choice? Well, I'd like to know how the whole thing (search by keywords) works, David.

 

Name and nickname can be now used as keywords. "Larger" works for ">" but "greater" doesn't. Could it be improved? Could synonyms be used? Could a short description even be used (I know this could be a bit weird)?

 

            more than --- >

            more or less --- Similarity

            more less --- Similarity

            red green --- Sets.List components should be showed

            lightning --- Split Tree

 

What about use Curve.Analysis or Math.Boolean to display those Tab.Panel components? Param, Math, Sets, Vector? Primitive, Special, Util? Tab, Panel, and Tab.Panel as keywords.

 

At the moment that I write this, I check that ignoring accents in keywords has almost been included (0.8.0009): p`anel, pañel, pánel --- panel (almost)

 

Shouldn’t 'Dom2' work for Dom²?

 

What about nested search? You type some keywords (say 'Params' or 'Params.Geometry', or 'red green', or 'lst') and then you make a fine-tunning search over previous results/keywords. Tab.Panel and/or nested geometry could be useful when search by plug-in is desired or when you want to search among .ghuser components (first 'ghuser' or 'Extra.MyPlugIn' or 'lst' keyword and then fine-tunning, specific, search).

 

Is 'list length' performing this nested search right now ('lst' > 'length')? Anyway, I am thinking about UI (graphical) changes; successive searches.

 

As I said, description (and even words from the help info) could be used to search. What about "some kind of tags"? I mean that if 'list l' to finally choose List Length has been used for a while, that could be learned. Eventually, an XML file could store these tags, so you could even edit them. That could implement description, name, nickname, help info, Tab.Panel, .ghuser, synonyms (lots of them), tags/shortcuts or wathever.

 

How could flatten/graft/reverse be used? Initialize graft+Simplify or graft+Bang! could be really useful.

What about expressions? I don't how could it be done properly: would Slider = x^2 (expression) work? I mean, aren't expressions parsed when initializing?

 

Is Panel somehow doing this? 'panel = wathever' always suppose that wathever is a string, so you can't use 'panel = <pi>'. Sets.Strings components also do this.

 

I've been about to write several paragraphs about height/width (resizable components: Panel, Graph Mapper, Slider, &c.), input/output names (Scripts, F components; or any component with editable input/output names), orientation (Scribble), type hint and access option, nickname, &c. but, to sum up: being able to set any property when initializing would be really useful. I'd like to know the best choice of syntax but I'm sure that, David, you're closer to the answer. What do you think about this?

 

            Slider: 3 0 5 "MySlider" "Slider^2"

            Panel: "This is the content" "This is the title"

            VB: "N" List Integer 7 "r" Item Double

            Addition: A 1 B 2

 

I guess that any unified syntax would be elegant and useful, but additional ad hoc syntax (per component) could be even better (cleaner).

 

What about use lists of values? I'm not sure about format: panel = ("Hello", "Bonjour", "Hola")? If any valid format/syntax is found, maybe more sophisticated fetaures could be achieved: panel = {0;0} ("A", "B", "C") {0;1} ("1", "2", "3") How would you like this to be implemented?

 

There is a much simpler and interesting feature that would be useful, in my opinion: being able to initialize more than one component. I mean say 7xSlider = 10.0 and get 7 sliders and I also mean multiline (multi-component) initialization: Ctrl+Intro when you want to start a new line and Intro (or even some Accept/Cancel buttons when you activate multiline mode) to initialize (every line/component), for example. I mean:

 

            3 x Slider = 1

            Panel

            Mass addition

            Panel

 

And the whole bunch of components that were in mind (pre-thinked definition) is initialized. It speeds up the workflow, making more dynamic to add components that are only available via the drop-down panels.

 

Should this multiplier be something like a text box adjacent to search field more than '7x'?

 

These are some of my thoughts about intitializing. Please let me know your opinion :]

 

Oh dear, this is using the Rhino fillet function, which is very difficult to control. I don't think I can fix that problem. What I could do is write a combination of Polyline/Freeform fillets, where I take over filletting logic if two adjacent segments are linear. Do you think it might make sense to add that to the Fillet component? Or is that too dangerous?

 

The main problem with the above solution is that you might get radically different behaviour for curves with linear segments vs similar curves with ever so slightly curved segments.

 

I can certainly add a 'skip-fillet-if-too-big' option.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

If you look at the curves using a Text Panel, you'll see that some of them are Polylines while others are described as Closed Planar Curves. I already special case polylines, so I suppose the break in behaviour is already present and therefore probably not as big a stumbling block as I just made out.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

I'm not sure what the implications of this are. Are you saying that it is purely based on Line Type as to whether the fillet gets applied in different ways?

Yes, if the entire curve is a polyline (or can be represented as a polyline) I use my own filleting logic. The kind that measures segment lengths and adjusts fillet radi accordingly. If the curve cannot be represented as a polyline (i.e. if it has curved segments to it) then I revert to Rhino's filleting logic. Creating fillets on polyline corners is a piece of goniometric cake. Creating fillets on freeform curves is very difficult indeed, hence the split.

 

However, instead of looking at the curve at large, I can look at the individual segments and decide per curve corner whether I need to resort to Rhino's advanced fillet algorithm or whether I can get away with my own.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Oh I see now. The Corner pieces have a curved section from the sphere part of the boolean and therefore as a whole get the Rhino treatment, thus square corners where to big and the centre pieces are purely polylines and get the DR treatment. I think it would be nice then to have a boolean toggle for reduced radius or skipped fillet option.

 

did you see my side issue above?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service