Processing+GhPython Practice #00 | Communication
Contents
- Practice | answers
- Task1 – processing -> python
- Communication
- Pipeline | Processing
- Pipeline | Python
- Hints | Processing
- Hints | Python
- Task2 – python -> processing
- Communication
- Pipeline | Processing
- Pipeline | Python
- Hints | Processing
- Hints | Python
- Task1 – processing -> python
Practice
Task1 – processing -> python
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
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