THIS FORUM IS NO LONGER ACTIVE. PLEASE POST ANY NEW QUESTIONS OR DISCUSSION ON:
https://discourse.mcneel.com/c/grasshopper/kangaroo
The discussions here are preserved for reference, but new questions posted here are likely to go unanswered.
Kangaroo is a Live Physics engine for interactive simulation, optimization and form-finding directly within Grasshopper.
Hi everyone,
I have finally found some time to try and develop some custom goals for Kangaroo, and I would like to ask if I am going down the right direction, because when I am using the goal I made it doesnt seem to do much. It is supposed to be an inflate component with a cotangent based weighting scheme.
I have attached a GH doc with the inputs internalised. It is from the Rhino WIP and uses the spatial slur library to calculate weights pr node. if you want that library please visit: http://spatialslur.com/code/
Any help is much appreciated.
Petras Vestartas
Hi,
Can you initialize geometry?
Thanks,
Petras
Dec 12, 2016
Daniel Piker
Hi Jens,
The key problem I see here is that you use the PPos array to build your mesh at each iteration.
PPos is the initial positions of the particles. It is only used in the initialization.
To get the positions of the particles at the current iteration you can call:
this.GetCurrentPositions(p)
which will return an array of Point3d
Aside from that, some other general comments on the code:
Building a halfedge mesh every time is a lot of work to simply get the neighbours around each vertex. This is easy to get from a Rhino mesh.
There is also some strange conversion to degrees in there - no need for this, as the default math operators work with radians.
You could also write a per triangle goal (acting on only 3 points) to get the same result in a simpler way, by modifying the existing pressure goal so that instead of splitting the force over the 3 vertices evenly, it divides it according to Voronoi area (which is what the cotan weighting achieves).
Hope that helps. Let me know if you have more questions.
Dec 13, 2016
Jens Pedersen
Hi Guys,
Thank you for all your help. I have attached a simple version of what I am doing where the inflation is controlled by a field pr verticy. I also have one where I have the area weights, I simply need to factor them correctly for it too work properly. But if it has any interest I have attached the simple version to this message. It only uses Kangaroo and no HE
Dec 15, 2016