About the rhinocommon Gumball

Hi Team!

I tried to implement a gumball in grasshopper as an exercise with relatively successful, it’s not perfect, it has some bugs and strange things in out-of-core issues. The code is available on[ my account of github] (https://github.com/DanielAbalde/GhGumball) and you can donwload the .gha here.

The issue is that I have some questions about the gumball, because I have to implement it for a real project, or perhaps I should make one from scratch. I hope someone can answer my questions.

  1. What is the reason for dividing the object in four different classes? GumballAppearanceSettings, GumballDisplayConduit, GumballObject, GumballPickResult. It is preferable to do, for example, implement any of them in custom classes? or what is the reason? They can be used separately? Honestly, it seemed me a real puzzle.

  2. It is possible to know the algebra of the rhino transformations? Is there any reference? or is only available via openNURBS code?

  3. The current version allows us to move a transformation? I mean, I do for example a rotation at a point in the space, it is possible to remap the transformation to a different point of the space? This I think would be very useful for themes of inverse kinematics, robots and stuff.

  4. If I turn off the TranslateXY, YZ, ZX options of GumballAppearanceSettings, do not let me drag gumball from the plane, as expected, but the planes are not hidden. It may be a bug, I had to give size 0 to hide them.

  5. It may be my fault, but I have not seen a difference in the 3 states of FreeTranslate, nor have understood its description in the SDK.

  6. I have seen strange things using the native gh Gumbal (of point component) with the mine, as if they somehow were mixed. Right now I could not repeat the bug, but the question is, the conduit display makes each source are in different instances? or all the displays are in the same field? Excuse the question, xD, I remake, do you recommend me some reference to understand how the display works? beyond this.

  7. The most important question. I have to implement a gumball which has many restrictions, for example, can only rotate on the x-axis in certain grades. I want to see the available angle, ie looks differently at current gumball. The transformations will be individual and in chain. What do you recommend? I design my own gumball inheriting existing classes? or should I do it all from scratch? I have nothing clear how should do. Any expert advice will be very grateful.

Thanks!

2 Likes

Object oriented programming? The classes you mention wrap internal classes. Quite a bit more modular than a big monolithic class.

Yep, all this is in openNURBS. If you download the C++ version, look in opennurbs_xform.h/cpp.

I’m not sure I understand the question. But you can certainly implement your own functionality. Here is an example:

https://github.com/dalefugier/SampleCsGumballCylinder

I don’t believe this is a bug. The planes are drawn for reference.

The help file is slightly wrong - the default value is 1, not 2. To see the differences, turn on Gumball, select an object, and drag the center point - both the gumball and the object will move. Now hold the Ctrl key down and do the same - only the gumball will move.

Again, not sure I understand the question. But each instance of a gumball should have its own conduit.

There is quite a bit you can do with our gumball, as is demonstrated by my sample code. Of course, you will be forced to do what we do and how we do it (if you choose to use it). Writing these UI gizmos isn’t easy - you might try to see how far you can with with what we have.

1 Like

Awesome! Do you know how to stop the time? I will need this code haha

That’s great, thanks for the source.

I have now seen, thanks.

If you know of any good reference, either code or documentation to learn more in-depth view, would be very grateful if you share it with me.

I have not tested the code yet, but I accept the challenge :slightly_smiling:

Thanks so much for answer.