Home
Reply
Regular Contributor
castillor
Posts: 74

Reversing an edge

Hi. Is there any other way to reverse an edge so that the sense will be reverse and the start and end points will be flipped? I found a code in "scm/scmext/cstr/edge_scm.cpp" that does exactly this, but upon testing sometimes the edge gets messed up. On some of the edges, the length changes and sometimes the edge length becomes 0 and the start and end point becomes the same. Are there any other alternatives in  implementing this kind of operation? The code that I was referring to is indicated below.

 

 

    VERTEX * old_start = e->start();
    VERTEX * old_end   = e->end();

    e->set_sense (e->sense() == FORWARD ? REVERSED : FORWARD);
    e->set_start (old_end);
    e->set_end   (old_start);

    // Switch the sense flags on the coedges also
    COEDGE *first_coedge = e->coedge();

    // STI let (r7769): Don't operate on coedges that don't exist
    if (first_coedge) {
        COEDGE *flip_coedge = first_coedge;
        flip_coedge->set_sense (flip_coedge->sense() == FORWARD ?
                                            REVERSED : FORWARD);
        while(flip_coedge->partner() &&  flip_coedge->partner() != first_coedge)
        {
            flip_coedge = flip_coedge->partner();
            flip_coedge->set_sense (flip_coedge->sense() == FORWARD ?
                                            REVERSED : FORWARD);
        }
    }

 

 

Thank you,

Raymond

Spatial Employee
RTadlock
Posts: 40

Re: Reversing an edge

Hi Raymond,

 

Do you have any examples off where this code isn't working for you?

 

Thanks,

 

Robert

Regular Contributor
castillor
Posts: 74

Re: Reversing an edge

Hi Robert,

 

Actually the failure is only observed in a particular CAD model. Sadly I cannot post the CAD model here. We already sent this problem to Spatial support but I was just wondering if there was some other way to do this.

 

Thank you,

Raymond

Contributor
Sarvnaz
Posts: 25

Re: Reversing an edge

Did you submit an incident for this issue? if so, would you please post the incident number, so we can take a look at them?

thanks

Regular Contributor
castillor
Posts: 74

Re: Reversing an edge

It would be Incident: 090921-000008.

 

Thank you,

Raymond

Contributor
Sarvnaz
Posts: 25

Re: Reversing an edge

Raymond,

We looked at this incident and we determined that there was a bug with reversing the edges. However, there are problems with the original Parasolid file you provided and we need more information from you to process this. Please look at the incident for more information.

Thanks