mcneel / ghpython

A Grasshopper component for Rhino.Python
http://www.food4rhino.com/project/ghpython
118 stars 34 forks source link

Grip support #30

Open piac opened 12 years ago

piac commented 12 years ago

Add Grips support as requested here:

http://www.grasshopper3d.com/forum/topics/a-rhinoscript-method-is-not-working-in-ghpython

sbaer commented 12 years ago

My first inclination would be to do something very similar to what core Rhino does. When GripsOn is called for a curve in Rhino, several GripObjects are added to the document. In the context of Grasshopper, I think you would add several AttributedGeometry instances to the ghdoc where the geometry is a Point3d and there is some sort of knowledge that this is a grip referencing a "parent" curve.

Filippos-Filippidis commented 8 years ago

Hi to both! Is there any update on the Grips method? Thanks

piac commented 8 years ago

Hi Phil,

I actually do not think this makes much sense in a Grasshopper perspective: Grasshopper does not have grips so that way of thinking is "alien" to it. Is there some method that we could use instead? What are you trying to do?

Thanks, Giulio

Filippos-Filippidis commented 8 years ago

Hi Giulio.

I understand what you mean about the grips being alien to grasshopper and I agree it doesn't make a lot of sense to have them in GH. I was asking because i wrote a piece of code in python via editPythonScript and was trying to pass it over to GH. The script basically simulates the frei otto wool experiment. The way it was written is that it gets some crvs and then used the grips , grip Locations and distance between each other and attracted the grips modifying the initial crvs. I tried Rhinocommon but Im not very proficient with it and got lost..If you have any idea or way around it let me know.

Thanks for the fast reply,

Best, phil

piac commented 8 years ago

@philpidis if you were able to show me a sample of what you were doing with grips, it should be possible to either rewrite the code in RhinoCommon or use RhinoScript methods to delete these curves and recreate them with the right control points.

Filippos-Filippidis commented 8 years ago

@piac It worked with Rhinocommon! thanks