Grasshopper

algorithmic modeling for Rhino

Hey Karembers,

I'm looking for the 'Line-Line Intersection' method, which should be in the Utilities namespace (I'm looking in the Karamba 1.1.0 Hacker's edition .chm) but can't manage to find the reference :/

Any clue ?

Cheers,

PS :I'll call it in Cython, hope that my free license takes that up

Views: 360

Replies to This Discussion

Hi Mac,

the 'LineLineIntersection'-componeet is one of those whose functionality has not yet been separated from the user-interface.

I will try to do that for Karamba 1.3.2.

Best,

Clemens

Hi Mac,

in Karamba 1.3.2 the intersection component makes use of the static method Karamba.Geometry.Line3Line3Intersection.solve(...) in order to do its job. It can be found in karambaCommon.dll.

This is the solve method of the component:

protected override void SolveInstance(IGH_DataAccess DA)
{
var ldist = INIReader.Instance().asDouble("limit_dist", default_limit_dist);
DA.GetData<double>(1, ref ldist);

var in_gh_lines = new List<GH_Line>();
if (!DA.GetDataList<GH_Line>(0, in_gh_lines)) return;
var lines = FromGH.Values(in_gh_lines);

var res = Line3Line3Intersection.solve(lines, ldist);

DA.SetDataTree(1, ToGH.Values(res.Item1, DA));
DA.SetDataList(0, ToGH.Values(res.Item2));
}

FromGH.Values and ToGH.Values are methods contained in Karamba.GHopper.Utilities which do the conversion from GH-types to Karamba-types and vice versa. They reside in karamba.gha.

Best,

Clemens

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service