cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Conditional Statements in a Curve by Equation w Cylindrical Coordinates

EPeters_PE
10-Marble

Conditional Statements in a Curve by Equation w Cylindrical Coordinates

Ok this should be simple, problem I am working is way more complex...

 

I would like to use IF / conditional statements to revolve an equation driven curve that is utilizing a cylindrical coordinate system.  I CAN NOT get it to work.

 

Example:

Create a coordinate system to revolve around

Create a Datum / Curve / From Equation <dialog opens>

Change to Cylindrical / Pick the Reference Coordinate / Equation <now in a relation editor>

Eqns:

z=0

theta = 360*t

r=2*t

 

No problem, you get a linearly increase radius curve that starts at R=0 and grows to R=2 thru 360°

 

Now I would like to create a curve that starts at 0 goes to 180° increasing in radius from 0 to 1, then continue on at a constant radius of 1 from 180° to 360°.  I do believe the equation would be as simple as below, but, it does not work, just get a failed curve feature.

z=0
theta=360*t
IF theta<180
r=2*t
ELSE
r=1
ENDIF

 

Is this due to the sudden change in the curvature?. 

 

I can work around by making many curves each from their own start/finsh but, would rather just run it through one equation with multiple changes in the relationship of radius to the t value.

 

Thanks,

Erik

 

 

 

 

 

 

 

6 REPLIES 6
tbraxton
22-Sapphire I
(To:EPeters_PE)

I do not think this is a case of curve discontinuity. Conditional statements are not permitted in this context. This from the Creo  documentation.

You cannot use the following statements in an equation that defines a datum curve: abs, ceil, floor, else, extract, if, endif, itos, and search.

 

Assuming that the conditional statements are mathematically valid you should be able to in theory write relations for the parameters to drive two curve from equation features and apply the conditional tests to each curve. With your example I think you would have a discontinuity at the transition which you could resolve with a third curve.

 

If you were to clarify the design intent of what you need you may get some more ideas on how to handle it. Have you considered a helical sweep feature?

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

Multiple features with a Pro/PROGRAM and a reference startpoint to chain them?

It is very much the fact that you cannot use conditional statements or any of the others given by tbraxton.

I've come across this problem myself in the past, with a similar needed curve. The trick in this case is to use the "min" function.

z=0
theta=360*t
r=MIN(2*t,1)

Regrettably, you will likely find, like I did, that there is a discontinuous "kink" in the curve at the transition point at t=0.5. Be sure to zoom in to the curve and see how it looks.

Is there a limit to the number of min statements?

Actual problem is for a lobe of a cam profile I am working on that goes through a change in shape derived from higher order equations and had six or so changes in shape but always growing or reducing dependent on theta.
tbraxton
22-Sapphire I
(To:EPeters_PE)

Regarding the cam profile, I gather from your statement that you have six changes in the defined curvature through a full 360 deg. If you plot these curves in cylindrical coordinates are there any discontinuities? Does the angular velocity in use require that acceleration and jerk are considered for performance? If so then you will need a higher order of continuity where the curves connect and that will complicate the problem as getting more than tangent continuity is likely going to drive you to splines.

 

If you can not define a single parametric planar curve and plot it such that it is continuous then I think you would have to break it down into piecewise continuous segments. Does the profile have a plane of symmetry? If so you may only need 3 curve segments.

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

For the simple situation you originally asked about, the MIN "trick" was somewhat adequate, if you were willing to accept the stated discontinuity in the curve. If you're making something like a cam, you'd probably be better served by putting the time in to understand how to do a graph driven feature. Here's a sample discussion from the past:

Datum Graphs in Relations Discussion 

Using this method will likely get you to the shape you are after. I don't know how easy it will be to make the design controllable by relations, maybe someone else will have some experience doing so...

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags