Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi,
Is there an easy way to create a curve of the unwraped cut with an oblique line in a cylinder?
I did something for the first "complete cut" of the cylinder. See the image for understanding what I am talking about
I believe is correct. I write here the equation for future use of others and please correct it if I'm wrong.
X=Cylinder_Diameter*PI*T
Y=Cylinder_Diameter/2*TAN(Cut_Angle)*(1-SIN(T*360+90))
The "+90" should translate the sine curve so it starts from the uncut diameter of the cylinder.
In my model the "From: To:" parameter in the defining the curve, it does not work. Whatever values i put it only makes one complete sine curve (360deg)
Nic.
Solved! Go to Solution.
Now that I look at it, I can define the result without the IF/ELSE/THEN structure. Putting the involved angles back in degrees, also, I get the following:
X = PI * D * t
Y = MIN ( E, E + ( K - D * ( 1 - COS ( t * 360 ) ) / 2 ) * TAN ( alpha ) )
Bonus is that it eliminates the need for the "S" working variable, too. Again, check my math, and you might need manipulate the input angles to the trig functions to get things working properly. Also, I couldn't find any documentation to verify the syntax for the "MIN" function, so am assuming what is shown.
Is there some reason why you aren't just doing a protrusion perpendicular to a plane through the axis of the cylinder?
I don't think I understand your solution. Make a protrusion? Like an extrude cut?
Doing so I will obtain the final geometry like in my image, isn't it right?
I guess I didn't understand what you were looking for. Looking at it again, it seems like you're trying to create a curve that would define the cut edge of the cylinder if the outer cylindrical surface were flattened. Like creating a flat pattern if the cylinder were made of sheet metal?
I just want to unwrap the cut cylinder and have the curve of the cut in plane.
I did it for the whole cut (using the equations I shown- even if the "t" variable doesn't work as it should- see the attachment of the unwraped cylinder and the profile of the cut which is a sine curve). I can't "translate" it for the partial cut.
Any idea?
I think the calculation of a Y value for a given t is more complicated that what you've shown. You have to account for the fact that the oblique cut causes a discontinuity in the curve at the transition from "cut" to "uncut".
My look at the math for this got me the following:
D = diameter of cylinder
K = distance from edge of cylinder that angled cut start
alpha = angle of the cut
E = height of uncut cylinder
X = horizontal distance along unrolled outer face
Y = vertical height at a given "X"
S = linear horizontal distance from edge of cylinder (convenience "working" parameter)
X = PI * D * t
S = D * ( 1 - COS ( t * PI * 2 ) ) / 2
IF S <= K
Y = E
ELSE
Y = E + ( K - S ) * TAN ( alpha * PI / 180 )
ENDIF
Note that my t = 0 is on the "far right" edge. I tried the equations in Excel and the results seem to be good, but check the math as we are not infallible. Creo's trigonometic functions might be defined differently in terms of the angular ranges they will handle, etc.
If nothing else Creo uses degrees while Microsoft thought that radians should be the unit and didn't offer a parallel set of functions for degrees.
I'm not entirely sure, but I recall that IF statements can't be used in Creo equations to create discontinuous behavior.
I wasn't sure if the capabilities of equations were the same as those in the relations and am not in ready access to a seat of Creo so couldn't try the math out. The units of the angles was something I couldn't remember so the equations would be even easier. The big concern I had was the range of values the trig functions would accept. Is -180 to +180 the range? 0 to 90? 0 to 360? This, too, is something the various programmers seem to differ on. One would think that over the years the code would become robust enough to handle anything logical within the scope of a full circle, but apparently not.
Now that I look at it, I can define the result without the IF/ELSE/THEN structure. Putting the involved angles back in degrees, also, I get the following:
X = PI * D * t
Y = MIN ( E, E + ( K - D * ( 1 - COS ( t * 360 ) ) / 2 ) * TAN ( alpha ) )
Bonus is that it eliminates the need for the "S" working variable, too. Again, check my math, and you might need manipulate the input angles to the trig functions to get things working properly. Also, I couldn't find any documentation to verify the syntax for the "MIN" function, so am assuming what is shown.
@dschenken: resolved the problem with the "t" variable: for some rason, the relation of the cuting angle was inhibitting the normal variation of "t". Replaced the relation of "alfa" with an input from Pro?Program in the assy, resolved the situation.
Kenneth, dschenken was right about what you can use in the curve from equation:
|
You cannot use the following statements in an equation that defines a datum curve: abs, ceil, floor, else, extract, if, endif, itos, and search.
|
as from Creo help.
I will try to see if the MIN function works.
Thank you both for the help.
Some other caveats about this method:
(1) The curve has two abrupt changes in curvature at the transitions from the cut to the uncut region. If a single spline is generated with the equation, you might see some odd behavior in that area. A "bulge" of the curve or something like that.
(2) If you're trying to define a sheet metal plate that will be rolled into the cylinder and then welded, you might need to adjust the total "X" length to account for shrinkage or the addition of filler material, depending on what welding method is used, materials, etc.
(3) Also, if you're doing sheet metal, you will need to define everything at the mid thickness of the material that is to be used.
I've noticed the (1) issue. Did you understand what is the cause?
Issues (2) and (3) are not so important as the cut is only graphic. The actual cut it will be done after the sheet is wrapped into a cylinder.
What I don't understand is if you do the same cut symmetric, on the other side of the bush: I simply mirrored the curve respect to the symmetry ax. It became very thin in the middle, much thinner than the actual dimension (see attachment)
Kenneth, you gave me the idea of cunstructing my curve!
My approach was a bit different, so it is independent of the width "E" of the bush: when Y=0 means that the cylinder (bushing) it is not cut.
I was able to constructing the "whole" curve but I hadn't had any idea how to cut it with the X axis until you used the "min" function. So, I translated my sine curve lower so it intersects the X axis at the "unwrapped K" distance- driven by
uK=D/2*acos((D-2*K)/K)*PI/180 !!BE AWARE OF THE DIFFERENCE BETWEEN RADIANS AND DEGREES!!
So my equation becomes
X=D*PI*t
Y=MAX(0, -D/2*1/ACOS((D-2*K)/D)*PI/180+D/2*TAN(ALPHA)*(1-COS(360*t)))
What do you say? Seems like the incontinuos dissapear and it is really a "cut" with the X axis of the sine curve (as it should be). If you have the patience to look at it and see something strange, please let me know.
I put your answer before (the one with the "min" function) as the correct answer because that was the ice braker.
The cause of the curve being discontinuous at the transitions is that's what the equations are defining. It is an inherent fact of the geometry. The bump in the spline will be because a finite number of points are used to define it. The spline maintains tangency from point to point, so when it passes through the strange region it can go a little weird.
If I were making such a thing, I would make the rectangular portion (with Y = E as a constant), then do the cut that defines the oblique end as a separate operation.That will get the geometry to be exactly what you want, with a sharp corner at the "K" distance.
T is evaluated from 0 to 1. You multiplied it by 360 so the range is 0-360. Then you added 90 so the range is from 90 to 450. Which is still a 360 degree segment.
Try not multiplying by 360 to change the range to the angle range you want.
That's what i thought: T is evaluated from 0 to 1. So if I change the value of T
From 0.25
To 0.75
I would expect to have just the middle portion of the curve.
Which it is NOT happening. Whatever values I give to T, the curve remains the same: a perfect sine curve from 0 to 360deg.
Any idea for the second cut? The "partial" one means that basicaly my sine curve should translate along the Y axis until it starts from the unwraped "K" value of it: K x THETA_ANGLE
I see you opened another question. However, if the evaluation is not right you need to let people know what version and release of Creo you are using. Also, you can change the equation, even if the evaluation of the limits isn't working right.
Errors with fundamental functions are either because there is something wrong with that release or because there is a failure with that particular model file or there is a failure with that particular session of Creo. Of these there is nothing the community can resolve.
The workable methods are:
A) Submit the file to PTC
B) Try a new (not from template or copy) model file to see if it still occurs
C) Reboot.