[v8i vba] Detect if shapes are coplanar?

HI all,

I cannot for the love of all things unholy find a function that tells me if either:

1. Two shapes are coplanar, or
2. Two plane3d are coplanar, or
3. A function that unifies all shapes that are coplanar, regardles of all shapes in the array actually being coplanar to begin with.

See, I want to merge (union) some simple triangular shapes together.
That is easy - as long as the shapes are coplanar - using GetRegionUnion. But if there is even a slight difference in copla..narity (?) it goes belly up.

Do I really need to DO MATH?

Regards,
/T

Parents
  • Unknown said:

    I cannot find a function that tells me if either:

    1. Two shapes are coplanar, or
    2. Two plane3d are coplanar

    We wrote a VBA project answering your question that is explained in this article.

    Unknown said:
    From what I read, the essence is that we have to do math.  Do I really need to do math?

    No: in this case MicroStation VBA does the hard work for you.  However, you need to understand the geometric 3D concepts of points, planes and normals for the solution to make sense.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Torben 

  • Hi Guys,

    Wow! Thanks for all the nice work. I am sure that will save a few future math-questions around here! :)
    As stated earlier I went with this semi built-in functionality:

    Function isCoplanar(a As Element, b As Element) As Boolean
    
        On Error Resume Next
    
        isCoplanar = True
        
        Dim aa(0) As Element
        Set aa(0) = a
        Dim ab(0) As Element
        Set ab(0) = b
        
        GetRegionUnion aa, ab, Nothing
        If Err.Number <> 0 Then
            isCoplanar = False
            Err.Clear
        End If
        
        Erase aa
        Erase ab
        
    End Function

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

Reply
  • Hi Guys,

    Wow! Thanks for all the nice work. I am sure that will save a few future math-questions around here! :)
    As stated earlier I went with this semi built-in functionality:

    Function isCoplanar(a As Element, b As Element) As Boolean
    
        On Error Resume Next
    
        isCoplanar = True
        
        Dim aa(0) As Element
        Set aa(0) = a
        Dim ab(0) As Element
        Set ab(0) = b
        
        GetRegionUnion aa, ab, Nothing
        If Err.Number <> 0 Then
            isCoplanar = False
            Err.Clear
        End If
        
        Erase aa
        Erase ab
        
    End Function

    System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.

Children
No Data