コード例 #1
0
char SegmentTriangleIntersection::SegTriInt( tPointi T, tPointd q, tPointd r, tPointd p )
{
    int code = '?';
    int m = -1;

    code = SegPlaneInt( T, q, r, p, &m );
    //printf("SegPlaneInt code=%c, m=%d; p=(%lf,%lf,%lf)\n", code,m,p[X],p[Y],p[Z]);

    if      ( code == '0')
        return '0';
    else if ( code == 'q')
        return InTri3D( T, m, q );
    else if ( code == 'r')
        return InTri3D( T, m, r );
    else if ( code == 'p' )
        return InPlane( T, m, q, r, p );
    else if ( code == '1' )
        return SegTriCross( T, q, r );
    else /* Error */
        return code;
}
コード例 #2
0
ファイル: inhedron.c プロジェクト: ohinds/surface_constructor
char    SegTriInt( tPointi T, tPointd q, tPointd r, tPointd p )
{
    int code = '?';
    int m = -1;

    code = SegPlaneInt( T, q, r, p, &m );


    if      ( code == '0')
       return '0';
    else if ( code == 'q')
       return InTri3D( T, m, q );
    else if ( code == 'r')
       return InTri3D( T, m, r );
    else if ( code == 'p' )
       return InPlane( T, m, q, r, p );
    else if ( code == '1' )
       return SegTriCross( T, q, r );
    else /* Error */
       return code;
}