Processing+GhPython Practice #00 | Communication

Contents

  1. Practice | answers
    1. Task1 – processing -> python
      1. Communication
      2. Pipeline | Processing
      3. Pipeline | Python
      4. Hints | Processing
      5. Hints | Python
    2. Task2 – python -> processing
      1. Communication
      2. Pipeline | Processing
      3. Pipeline | Python
      4. Hints | Processing
      5. Hints | Python

Practice

Task1 – processing -> python

スクリーンショット 2015-02-24 19.09.14

Communication
  • Processing -> Python
    • All the positions of particles within
    • All the velocities of particles(Vector)
Pipeline | Processing
  • Declaration
    • OscP5, NetAdress
    • PeasyCam
    • Amount of particles, speed
    • List of PVectors for position and velocity
  • Init
    • Init OscP5, NetAdress
    • Init PeasyCam
    • Init List of PVectors
  • Function | sendOSC
    • define OscMessage with title “/osc”
    • make a list for strings for positions
    • define strings for positions and substitute it to the list
    • join strings and add it to the OscMessage
    • make a list for strings for velocities
    • define strings for positions and substitute it to the list
    • join strings and add it to the OscMessage
    • send OscMessage
  • loop
    • fill background with white
    • draw every point on canvas
    • if points are out side of canvas, inverse velocities
    • sendOSC
Pipeline | Python
  • import
    • import rhinoscriptsyntax
  • function | convertStringToPoints
    • declare list of points
    • split string into strings
    • for each strings split strings and generate points
    • append points to the list
    • return points
  • generation
    • declare list for lines
    • generate position point from string
    • generate velocity point from string
    • for each points in each list draw line between p and p+v
    • append lines to the list
    • generate loft surface with lines

Task2 – processing -> python

スクリーンショット 2015-02-24 18.48.00

Communication
  • Python -> Processing
    • Verts’ infomation
    • Faces’ information
Pipeline | Python
  • import
    • import rhinoscriptsyntax
  • generation
    • generate mesh verts
    • generate mesh faces
    • declare list <messages>
    • append <“/osctest”>to <messages>
    • declare empty text variable <message>
    • declare list <ss>
    • for every verts, generate text and append it in <ss>
    • join <ss> with “/” and add it to <message>
    • add “:” to <message>
    • initialize <ss>
    • for every faces, generate text and append it in <ss>
    • join <ss> with “/” and add it to <message>
    • append <message> in <messages>
Pipeline | Processing
  • Declaration