algorithmic modeling for Rhino
Hello Forum
I'm trying to develop an application that calculates the centre for a range of points where the force has to travel along a specified route for part of the distance. So, whilst the shortest distance - a straight line - might be 300 metres away, because part of the route is fixed, the distance is actually 700 metres. See the diagram to better clarify.
The context is that im trying to develop an application that identifies the best location for a building relative to existing surrounding buildings (the attracting objects) and existing pathways (the fixed routes for forces to travel through).
I'm assuming Kangaroo is the best plugin to do this. I can achieve a system that calculates the centre of a group of objects using springs (see attached), but I can't think how to fix the pulling route for the force to travel through.
Has anyone any ideas?
Tags:
Er ... hard to see why use K2 for that (if I got it correctly, that is).
You have points moving along fixed paths (how??). If they stop moving this is the final point position.
Then you have to calculate the center according to some "weight" per point? (kinda like finding the CoG of n objects in space [density*volume = weight]) ???
If so notify if you need a simple example on that matter.
Hello Peter - thanks for replying.
I'd started with Kangaroo as it seemed a logical place to start. There are perimeter points 'attracting' a centre point - so it sounded a little like physics and Kangaroo got me to the first point being the centre relationship based on a straight line route (using the springline force object). (That's in the attached file in the original post).
I haven't even gotten as far as restricting the springforce (to use the kangaroo terminology) along a path.
I'm a little stuck - a simple example would be very helpful if you're able.
Well ...
Stick to what the attached does (and NOT how it does it: it's also doable with native GH components IF this is what you want).
Given a collection of paths (curves) points are created (atValue) and then coaxial Vectors (user controls the reference Vector) are defined (within a random wMin/wMax length [i.e. the amplitude]) - say the "weights" ... or some gravitational forces ... or whatever.
Then it finds the CoG.
A smallish bug is corrected and a "parallel" solution with native GH components added
Thanks a lot Peter - I just managed to make time to look at this. Its really interesting to 'walk' through your code.
The function doesn't do what I need however. I'm trying to make a function that calculates the centre of gravity where parts of the route between the object and target are pre-defined. So the gravity object is always located at one end of the curve and does not move, the force must always travel through all the curve (and the curve is fixed), at the other end of the curve the route of the force can be direct from the end of the curve to the centre of the object.
Imagine an elastic band between 2 objects where 50% of the band is forced into a particular path. I think I explained it badly before.
Appears that a thing (or two) must change.
What "version" you want? code or components?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by