Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX8.5: using nth and mod functions in law curve 2

Status
Not open for further replies.

JeroenD

Industrial
Jan 21, 2015
13
Hello,

I'm trying to wrap a series of lines onto a cilindrical surface that's bent in 2 direction (it's a wedding ring, see picture in attachment).
For this I'm trying to use a single law curve.
ring_itkhn7.png


As input I have a list of coordinates that should form the end points of these series of lines. I already have the formulas ready for wrapping 1 line, but I'm having trouble constructing the law curve using variable coordinates (or coordinates from a list).
To make testing simpler, I'm trying to get the law curve working with the nth-function in 2D first (without the wraping).

Variables:
Var = 0
Func = nth(1, Lijst_VlakX) + (Var*(nth(2, Lijst_VlakX)-nth(1, Lijst_VlakX)))
Lijst_VlakX = {1,2,3,3,4,2}

The law curve using the function Func with parameter Var as X-equation.
The function is a function for a line: y = a*x + b where x = Var; a = (nth(2, Lijst_VlakX)-nth(1, Lijst_VlakX)); b = nth(1, Lijst_VlakX)
The law curve uses a constant Y of 0 and its Z-value ranges 0-10.

The X-value should range from 1 to 2.
The curve however, sits still at 2.

Is what I'm trying to accomplish possible?
If yes, what am I doing wrong.
If no, can I achieve my endgoal any other way?

Kind regards,
Jeroen
 
Replies continue below

Recommended for you

Law curves by Equation will smoothly vary your "Var" parameter from zero to one (0 to 1) to create the law curve -- essentially sampling points along that continuum and smoothly connecting the dots.

You'll need to design equations for X, Y and Z that all refer to this same "Var" parameter and respond to that 0 to 1 parameterization.

I think your list construction is probably complicating things for the moment, so if we resolve those function calls for just a minute, you've got:

[pre]
Func = 1 + 2*Var - 1 (Which simplifies to just 2*Var)
a = 2-1 (Which simplifies to just 1)
b = 1 (Which is pretty simple to start with)
[/pre]

And so the equation of your line is just:

[pre]
y = a*x + b
y = x + 1
[/pre]
...which I suspect may not be the pretty curve I think you're after. :)

Try rethinking your curves a bit, without the nth() function in there. (You'll want to create each unique curve separately first anyway, before patterning.) Each law curve will need:

[ol 1]
[li]var (which NX will automatically vary from 0 to 1 in order to generate the curve)[/li]
[li]An equation for X
(an equation in terms of "Var" that will produce the X coordinate of your first endpoint when Var=0 and the X coordinate of your last endpoint of your curve when Var=1.)[/li]
[li]An equation for Y
(an equation in terms of "Var" that will produce the Y coordinate of your first endpoint when Var=0 and the Y coordinate of your last endpoint of your curve when Var=1.)[/li]
[li]An equation for Z
(an equation in terms of "Var" that will produce the Z coordinate of your first endpoint when Var=0 and the Y coordinate of your last endpoint of your curve when Var=1.)[/li]
[/ol]

If you have constant values for Y or Z (if the Y or Z coordinate of every point along your curve is the same) then you can certainly use the "Constant" option in the dialog.

And similarly, if you know that the Z coordinate varies linearly from the start to the end of your curve (Z coordinate of first endpoint in zero, for instance, and the Z coordinate of the last endpoint is 10, for instance) then the "Linear" option makes sense.

....and so forth.

But the best way to understand Law Curves is By Equation, manually constructing all three formulas for X, Y and Z, and how each relate to Var.

Does that make sense?

And then in the end, you can either use the wrap function to wrap the curves around the ring, or add a bit of trigonometry into your equations to just create your curve in a wrapped state in the first place, directly from the equations. :)


Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
 
Law curves aren't my area, however a couple of things:

1. If you're talking about the outermost surface - that appears to be spherical or toroidal, not cylindrical. Probably doesn't matter but might lead to confusion since the innermost surface appears to be cylindrical.

2. If you have the licensing, you may wish to try Curve on Surface unless you're absolutely certain a law curve is necessary.

Tim Flater
NX Designer
NX 9.0.3.4 Win7 Pro x64 SP1
Intel Xeon 2.53 GHz 6GB RAM
NVIDIA Quadro 4000 2GB
 
Thank you both for your response.

It is indeed a toroidal surface instead of a cilindrical one.
I have tried the Curve on Surface option as Xwheelguy suggested, but it doesn't give the desired result (although it could come in handy in other drawings).

I have managed to create what I wanted by using multiple law curves (wrapped using trigonometry) in the formulas.

There is something I find odd. I have tried to make a sawtooth law curve with the formula:
Mod(100*Var,5)​

That should give 20 sawtooths with a height of 0 to 5.
What I get instead is a lineair line at height 2,25.

Is it possible NX doesn't sample enough points?
Or does the Mod function not work with law curves?

 
You are correct that NX is struggling with your sawtooth function. I can replicate it in Excel, but not in a law curve at the moment. The expressions seems to be behaving nicely, but the curve is coming out just as you describe.

I suspect there's some undersampling and then some curve fitting going on, but I'm not sure. Sounds like a great reason to call GTAC and submit an IR. (Hint, hint...)

At any rate, I don't think law curves were designed to create curves with this many sharp points in them anyway... They work really well for smoother, more continuous curves. :)

With this sawtooth function really representing some straight lines, I'd probably create one "tooth" and then use a pattern feature to replicate it 20 times. With just a bit of math in your expression formulas, that should be rock solid parametrically, and easy to maintain.

Does that help?

Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
 
For what it's worth, it might be worthwhile to post what your goal or intent is with the model rather than focusing on using a law curve for something which it probably isn't intended, at least as far as the sawtooth is concerned. There are many experienced, talented and creative users on here that are capable of figuring out many ways to skin a cat, so to speak.

Tim Flater
NX Designer
NX 9.0.3.4 Win7 Pro x64 SP1
Intel Xeon 2.53 GHz 6GB RAM
NVIDIA Quadro 4000 2GB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor