Grasshopper

algorithmic modeling for Rhino

How can i update a geometry, whose reference points were transformed (moved) by a custom component using the timer object? I tried the following:


// registerinput

AddPointParameter("pntin", "pntin", "pntin", GH_ParamAccess.list);

AddGeometryParameter("geoin", "geoin", "geoin", GH_ParamAccess.tree);

// registeroutput

AddPointParameter("pntout", "pntout", "pntout", GH_ParamAccess.list);

AddGeometryParameter("geoout", "geoout", "geoout", GH_ParamAccess.tree);

// solveinstance (declaring)

List<Point3d> pnts = new List<Point3d>();

Grasshopper.Kernel.Data.GH_Structure<Grasshopper.Kernel.Types.IGH_GeometricGoo> geo;

// solveinstance (connecting)

if (!DA.GetDataList(0, pnts)) return;

if (!DA.GetDataTree(1, out geo)) return;


something in between (transform points)


// return

DA.SetDataList(0, pnts);

DA.SetDataTree(1, geo);


Result: Points are up to date, Geometry is unchanged. 


The kangaroo physics engine does what i want, but how?


Markus

Views: 466

Replies to This Discussion

What are the 'reference points' of a 'geometry'?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

2 points -> line (geometry object defined by points)

Something like this...

Attachments:

- Gets the start and end points of the line

- Compares them to the list of points that make the nodes of the simulation. Finds the coincident points and remembers its indices

- Runs simulation, nodes change position

- Creates new line using the previously stored index numbers and the new position of the nodes

 

 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service