Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

make a edge from a curve based on the start and end parameter

Status
Not open for further replies.

lugan2

Mechanical
Apr 10, 2013
42
Hi all
Does anyone know which command should I use to make an edge on the curve between parameters p1 (start) and p2 (end), using OpenNX API? I want to add several trimmed edges to form a polygon.
Many Thanks!
 
Replies continue below

Recommended for you

Basically, this will be a trimming operation.

Thanks!
 
I'm not clear on what your end goal is.
Do you want to create a planar sheet body polygon? If so, create the curves to form the perimeter of the polygon and extrude them with a zero thickness.

www.nxjournaling.com
 
I am actually using the NX C++ API to do our own project. The goal is to use the primitives provided by NX to write our program so as to create our own product. The NX GUI is merely used for visualization purpose. We will start with the 2D level, such as, polygon boolean operation to form the 2D sketches of the product, and then extrude/revolve the 2D sketches into 3D. For the 2D operations, the operations, such as, polygon Boolean operation, curve trim and curve intersection, will be used.

Now suppose I have a curve being created. I want to trim the curve by adjusting the curve starting and ending points, parametrically, and do it through c++ programming. For example, I have a line, line1, starts from (0., 0., 0) and ends at (2., 0., 0). If I want to trim it by starting from its 1/4 position and ending at its 3/4 position, (in programming, the favorable function would be: trim(&line, 1/4, 3/4)), the newly created line would be starting from p0(0.25, 0., 0) and ending at (0.75, 0., 0). Is there a function in NX can implement it?

Many thanks!
 
Do you have access to the NX help files? The "programming guide" section is a handy reference.

One approach would be by using the CreatePoint method; it has an option to create a point at a certain percentage along an existing curve's length. You could create 2 of these points at the desired locations then use them to either create a new line or redefine your existing line.

p.s. NX does not support 2D boolean operations.

www.nxjournaling.com
 
Thank you cowski for your responds. I think the function you mean is UF_POINT_create_on_curve, right?
Yes, I think this certainly can do the work. Steps may be:
1. find the desired point on the curve based on the parameter;
2. based on the point create a line or plane as the reference object for trimming;
3. and use the line/plane to trim the curve using UF_create_trim function.


Apart from that, I also found another way to do that, using the 'UF_CURVE_edit_length' function. It can adjust the total length of the curve, and can be used as trim/extend function. Basically, it solves the problem.

Yes, I am aware that the 2D Boolean operations are not viable in NX.

Many thanks!
 
lugan2 said:
I think the function you mean is UF_POINT_create_on_curve, right?

I use the .NET version of the API, so for me it is the CreatePoint method (one of the overloaded versions), but I'm glad you were able to translate that over to what you needed.

You might even be able to use the point directly in the curve trim operation (it works in interactive NX, anyway).

www.nxjournaling.com
 
Oh, yes. I remember that I can use the point as the suggested point for the bounding condition to trim.

Thanks for you help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor