Grasshopper

algorithmic modeling for Rhino

Hi All,

 

I would like to compare two domains to see if there is an overlap of the ranges.

 

For example:

 

Domain One: 1 to 10

 

Domain Two: 9 to 15

 

Overlap = True

 

Is there any component that can help me achieve this?

 

Many thanks

 

Luke

Views: 988

Replies to This Discussion

I would start with the Domain Includes component and test for inclusion of the domain components. Depending on the situation you might need to adjust the data tree management a bit.

 

Since you posted this in the C#/VB forum, you can use the static method on Interval to create an interval that is the intersection of two existing intervals. If this method returns an invalid interval, the two did not intersect.

Dim intX As Interval = Interval.FromIntersection(intA, intB)

If (intX.IsValid) Then 'intA and intB intersect

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Many thanks

Luke

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service