- Faces & Facets
- :
- Spatial Product Discussions
- :
- 3D Modeling
- :
- Computing orientation of the COEDGE

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
# Computing orientation of the COEDGE

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-29-2013 12:20 AM

Hi,

A question about orientation of COEDGEs.

Is the following code for computing the tangent to coedge (aligned with its actual orientation so that the face is on the left side) correct?

================================================

REVBIT sens = FORWARD;

COEDGE * coedg0 = (COEDGE *)coedg_List[0];

if(coedg0->sense() == REVERSED)

{

sens = sens ^ 1;

}

if(fac0->sense() == REVERSED)

{

sens = sens ^ 1;

}

EDGE * edg0 = coedg0->edge();

const curve * cur = &(edg0->geometry()->equation());

SPAunit_vector unitTang = cur->eval_direction(curveParam);

unitTang = unitTang * bodyTrans;

if(sens == REVERSED)

{

unitTang = - unitTang;

}

================================================

The above code does not seem to work with the attached model (tool.sat).

I tried the above on the attached sat file and plotted the tangent (cotangentOrient.jpg) and it looks like the face is on the right side of the cotangent.

Thanks in advance for any help.

Jinesh.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content

04-29-2013 03:39 AM

There are 2 COEDGES on one EDGE. It seems that you give COEDGE for triangular FACE near from your FACE.

Also there is no need to consider the FACE/SURFACE relationship in "fac0->sense()" because FACE describes own COEDGES in right direction.

COEDGE * coedg0 = (COEDGE *)coedg_List[0]; EDGE * edg0 = coedg0->edge(); const curve * cur = &(edg0->geometry()->equation()); SPAunit_vector unitTang = cur->eval_direction(curveParam); unitTang = unitTang * bodyTrans; if(coedg0->sense(edg0->sense())) { unitTang = - unitTang; }

0

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content

04-30-2013 02:25 AM

Hello Vi2,

I tried your suggestion but that did not solve the problem. In order to be sure that I am working with the correct FACE, i plotted a point on that FACE. Here is the code and the attached the image (coedgeOrient2.jpg)

api_get_faces(entList.first(), face_List); FACE * fac0 = (FACE *)face_List[0]; SPApar_box parBox; int result = sg_get_face_par_box(fac0, parBox); SPApar_pos facParPos(parBox.u_range().mid_pt(), parBox.v_range().mid_pt()); SPAposition facPos = surf->eval_position(facParPos); facPos = facPos * bodyTrans; APOINT * pnt = ACIS_NEW APOINT(facPos); renderList.add(pnt); api_get_coedges(fac0, coedg_List); COEDGE * coedg0 = (COEDGE *)coedg_List[coid]; EDGE * edg0 = coedg0->edge(); const curve * cur = &(edg0->geometry()->equation()); SPAinterval edgIntrvl = edg0->param_range(); double param = edgIntrvl.mid_pt(); SPAunit_vector unitTang = cur->eval_direction(param); unitTang = unitTang * bodyTrans; if(coedg0->sense(edg0->sense())) { unitTang = - unitTang; }

An associated question is that how are the orientations of the COEDGE and the underlying pcurve (coedge->geometry()->equation()) related?

Thanks and kind regards,

Jinesh.

0

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content

04-30-2013 10:48 AM

I don't see any troubles with your sat file. You should write numerical values of point and vector that you have calculated.

It seems that your SC is left-hand oriented. Maybe there is a problem.

0

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content

04-30-2013 11:15 PM

Thats right, the coordinate system was left-handed. Thanks for pointing that out.

I feel stupid :-)

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for