Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Cycle through all curves to find intersections C++

Siemens Phenom Siemens Phenom
Siemens Phenom

 

I recently posted an example program on the GTAC website (Solution Center) called

 

Sample NX Open C++ program : create named point at each curve intersection using interop

 

You can also find it if you search for nx_api5674.

 

By the way, anytime you find an example on that site, or a response in an FAQ article, if you click the Yes box to tell us that it helped, then that feedback helps us to know what kind of things are valuable to the user community.

 

Re: Cycle through all curves to find intersections C++

Creator
Creator

Is there any way to find where coinciding (overlapping) lines have intersection points? By this I mean where they start and stop overlapping. I've tried to use UF_MODL_intersect _objects but I cant get it to work for some reason. It'll report that 2 overlapping lines have 1 intersect, but then I cant get it to create points at where the lines start and stop overlapping. The following is  the code after

switch { 

 

case UF_MODL_INTERSECT_POINT:
/////intersection point code//// works fine///

case  UF_MODL_INTERSECT_COINCIDE:

double parmI1,
parmI2,
parmJ1,
parmJ2;

UF_CALL(UF_OBJ_delete_object(
intersections[ii]->intersect.coincide.identifier));

parmI1= intersections[ii]->
intersect.coincide.object_1_first_parm;
parmI2= intersections[ii]->
intersect.coincide.object_1_second_parm;
parmJ1= intersections[ii]->
intersect.coincide.object_2_first_parm;
parmJ2= intersections[ii]->
intersect.coincide.object_2_second_parm;
double
junk1[3]
pac1[3], //point at start of overlap
pac2[3]; //point at end of overlap
UF_MODL_ask_curve_props(tokeep[i], parmI1, pac1, junk1, junk1, junk1, junk1, junk1); UF_MODL_ask_curve_props(tokeep[i], parmI2, pac2, junk1, junk1, junk1, junk1, junk1); tag_t cippt; UF_CALL(UF_CURVE_create_point(pac1, &cippt)); UF_CALL(UF_CURVE_create_point(pac2, &cippt)); allippts.push_back(newPt); if (parmI1= 0 || 1) { sprintf_s(buffer, " ENDPOINT, point created at %f, %f, %f \n",pac1[0],pac1[1],pac1[2]); UF_CALL( UF_UI_write_listing_window(buffer) ); } else { sprintf_s(buffer, " DIVIDING coincident point created at %f, %f, %f \n",ippt[0],ippt[1],ippt[2]); UF_CALL( UF_UI_write_listing_window(buffer) ); ippts.push_back(cippt); } if (parmI2= 0 || 1) { sprintf_s(buffer, " ENDPOINT, point created at %f, %f, %f \n",pac1[0],pac1[1],pac1[2]); UF_CALL( UF_UI_write_listing_window(buffer) ); } else { sprintf_s(buffer, " DIVIDING coincident point created at %f, %f, %f \n",ippt[0],ippt[1],ippt[2]); UF_CALL( UF_UI_write_listing_window(buffer) ); ippts.push_back(cippt); } break;

 

 

I've been basing my intersect code off this GTAC solution:

 

nx_api2174

 

Any ideas would be greatly appreciated