MIT

Attractor Paths (2 versions)

Catherine Winfield

Description: The attractor path codes are approached from two directions. In the first code the objects (in the field of objects) find the path that is closest to them and respond to the direction of that path. In the second version the objects take the average of the paths around them, in a way the objects are creating their own path (the path average).

Images:

Before

During

Done

Render

Pseudo Code Closest Path:

  • ‘Get the field of objects
  • ‘Get the attractor paths
  • ‘Get the volume centroid of each object
  • ‘Find the min/max for each attractor path to volume centroid
  • ‘Orient each of the objects

Pseudo Code Average Path:

  • ‘Get the field of objects
  • ‘Get the centroid of each object
  • ‘Get the circulation paths
  • ‘-For Each Centroid point:
  • ‘Use Rhino.curveclosestpoint To Get the domain parameter at that point (for both path(s))
  • ‘Use Rhino.CurveCurvature To Get the tangent vector at each domain parameter
  • ‘Use pointAdd To Get the End point of the tangent vector for each average found
  • ‘Get the distance from each centroid to each closest point
  • ‘Get the average of the Vector to Distance for each centroid
    ‘Get the Vector Numerator (the tangent vector over the distance)

    ‘Get the average of the Vector to Distance for each centroid ‘Get the Vector Numerator (the tangent vector over the distance)

  • ‘Get the Vector denominator (the 1 over the distance)
  • ‘Orient the object face (rotate) to each end point

Code:

Closest Path Script

Average Path Script

Advertisements
%d bloggers like this: