[CONNECT U14 C#] What is the difference between CurveVector.AreaParity and CurveVector.AreaIntersection

Good morning,

I am trying to work out what is the difference between the AreaParity and AreaIntersection functions on the CurveVector object in the Bentley.GeometryNET library.

The word "Parity" means "Sameness" or "the extent of being equal". I would therefore expect the function AreaParity to return the Area that is the same between the two CurveVectors passed as parameters.

But there is also an AreaIntersection function, is this not the same thing? The area that is the same between the two CurveVectors?

The Documentation just says that AreaParity returns the Parity of the CurveVectors (which is what we already know from the function name).  There is no other mention of the AreaParity function on the forums (even the Chinese one which normally contains very useful information) 

It would be useful if there was some kind of image or further explanation into the behavior of the function as compared to the other Area functions on the CurveVector object.

Maybe I am missing something that is so obvious to others that it does not warrant explanation, but I would really like to know.

Can anyone please assist with an explanation?

Thanks.

  • Hi,

    Can anyone please assist with an explanation?

    did you check C++ MicroStationAPI documentation? There is a little better explanation available than in NET doc.

    The word "Parity" means "Sameness" or "the extent of being equal".

    Do not care (too much ;-) what the word means, because even when "parity" has - for the first sight - a clear meaning, it depends a lot on context and implementation, what "exactly" it means.

    I would therefore expect the function AreaParity to return the Area that is the same between the two CurveVectors passed as parameters.

    I did not use this function (yet), but I think it does something different.

    It would be useful if there was some kind of image or further explanation into the behavior of the function as compared to the other Area functions on the CurveVector object.

    I agree.

    Maybe I am missing something that is so obvious to others that it does not warrant explanation, but I would really like to know.

    I think you do not miss anything, maybe some knowledge of different topology concepts and theories ;-)

    Can anyone please assist with an explanation?

    I have no idea whether I am right and I have no time to write a code + test data to check the results (which is the best way how to evaluate any method), but my explanation is:

    Parity region is a region, where every "boundary cross" changes also in / out feature of such point. It means automatically the parity region has alwayas be formed from at least one closed curve (and more closed curves optionally). I guess it's based on "odd parity rule", which tells that when you have  line, starting from outside of the area, and you will count a number of crossing, odd number means it's inside.

    So I think AreaParity method creates such region from input curves.

    AreaIntersection method is simpler, because it returns the input curves intersection.

    With regards,

      Jan

  • Hallo Jan,

    Thanks for you answer.

    I did have a look at the C++ documentation, before I asked the question but it did not clear up my question because it does not explain the contextual meaning of Parity between two CurveVectors. It does not specify if there are requirements for one or both curve vectors (closed/open/etc), when it will work and when not. 

    I would agree with your reasoning regarding the in / out of a line crossing a boundary of some sort if the function returned a 1 or 0 indicating an odd / even Parity result. But the function returns a new CurveVector constructed from two input curves?

    It could make sense if the AreaParity returns a new CurveVector describing the region area enclosed between boundary crossings of two open CurveVectors.

    Looks like I will have to write code to try and figure out what it is doing and where I should be using it to better my code. The thing with the trial and error code writing approach is that if the function returns nothing one does not know why and one is no closer to understanding than before, so it wastes A LOT of time going back and forth attempting to work out behaviour.

    Thanks for your time, Jan.

    With regards,

    Francois

  • Hi --

    "Parity" is the boolean "exclusive OR" relationship.   A point is "in"    A XOR B     if it is in one but not the other.   

    A point is "in"    A INTERSECT B   if it is in both.

       

    Answer Verified By: Francois Grobler 

  • Hallo Earlin,

    Thanks for your answer. That makes sense when looking at the Area other operations. What you call Parity will invert the areas and return the inverse of the intersect. Thanks for clarifying.

    Area Operations

    You are welcome to add this image to your documentation to clarify the operations or AreaUnion, AreaDifference, AreaIntersection and AreaParity for other users.

    Kind Regards,

    Francois

  • Great diagram!

     
    Regards, Jon Summers
    LA Solutions