Creating a curve by equation
Creating a curve by equation
(OP)
Hello
How should I create a curve by equation?
The equation is the involute equation:
x=r(cos(t)+t*sin(t))
y=r(sin(t)-t*cos(t))
r and t are known and I can get the points(x,y)but I need to draw the curve.
Thanks
Columb
How should I create a curve by equation?
The equation is the involute equation:
x=r(cos(t)+t*sin(t))
y=r(sin(t)-t*cos(t))
r and t are known and I can get the points(x,y)but I need to draw the curve.
Thanks
Columb
Columb





RE: Creating a curve by equation
RE: Creating a curve by equation
Constructing a curve from an equation is something I do using the Excel file method - it's very fast, and it's easy to edit the code and re-run it. In the Help documentation a search for "Creating Elements from an External File" describes the process. An in-depth knowledge of VB is not really necessary - even TurboBasic will run in the macro - with slight alteration.
The equation given is obviously for a planar curve - there is no Z-value mentioned. So, in the macro, Z must be given a value - in this case, of zero.
This is what the involute looks like (with z = 0). The parameter (t) was interrogated for 0<t<2Pi (one rotation). The radius (r) was given an arbitary value of 100, and the number of points calculated was kept low for this excercise, but up to 500 can be used.
The x,y and z values of the curve have been calculted in a VBA macro - to create a Excel file that can be imported into V5. The simplistic code is the active loop that calculates the points. (The rest of the macro has been omitted for clarity)
CODE
For t = 0 To (2 * Pi) Step (Pi / 8)
x = r * (Cos(t) + t * Sin(t))
y = r * (Sin(t) - t * Cos(t))
z = 0
c = c + 1
Cells(c, 1) = x
Cells(c, 2) = y
Cells(c, 3) = z
Next t
Cells(c + 1, 1) = "EndCurve"
End Sub
Cells(c + 2, 1) = "End"
When the Excel macro is up and running properly it will create an Excel sheet - see below. It must be correct or it will not send the point data into Catia. The Help documentation explains how to run the whole process - if points only are required the Option 1 is used in the Main Macro; if the curve is wanted as well, then use Option 2. (Option 3 is for creating a surface)
The format of the Excel sheet below is for creating a curve.
RE: Creating a curve by equation
I'll try what Kapitan said.
Thanks Kapitan for your answer.It looks great.
Columb
RE: Creating a curve by equation
What Kapitan is saying is that you do not create the curve from equation in CATIA. Using Kapitan's script,you create points from the equation in EXCEL.
Then bring those points and build curve in CATIA with the script from the online doc.
indocti discant et ament meminisse periti
RE: Creating a curve by equation
I'm still thinking about the law procedure why I can't use 3 parameters...
Columb
RE: Creating a curve by equation
Finally I succeeded to make the involute in Catia.
I did one law (law1)for the x formula:
x=r(cos(t)+t*sin(t))
and than another law (law2)for the y formula
y=r(sin(t)-t*cos(t))
Using parallel curve to apply the law to a line (with advanced option) and indicate the law#1 I created a curve in XY plan then I did the other projection in the XZ plan in the same way using law#2
The next step is to combine these new projections from xy and xz planes and get a new 3D curve.
Finally project this 3D curve on the other plane yz and get the 2D involute.
Regards
Columb
RE: Creating a curve by equation
I'm stupid, I just realized the same method is in doc at:
Creating a Parameterized Curve
but has a strange name for a curve from equation.
Regards
Columb
RE: Creating a curve by equation
RE: Creating a curve by equation
Anyway I gave you a star.
Regards,
Columb
RE: Creating a curve by equation
RE: Creating a curve by equation
I still have to go in the online doc and look at this.
May be I'll document it with pictures if nobody does it before I find some time.
indocti discant et ament meminisse periti
RE: Creating a curve by equation
It seems to me that this particular Law method of making the involute of a circle is unnecessarily complicated - and not the best way of constructing an involute (in this case, of a circle) in V5. What appears to be happening is that two component plane curves - x(t) and y(t), shown as red and light-blue - are being constructed, then combined to form a helical-type space curve (x,y,z), in yellow. This is then projected, or effectively collapsed, on to a plane (blue) to make the involute (x,y). Why go from 2D to 3D and back to 2D - when the calcs can be done direct in 3-space? Is it because the Excel-macro method is using a tool that's outside Catia?
The black involute shown below the blue one is an Excel-macro one - both curves are identical - but one is far simpler to do than the other.
The construction of a circle involute is simple - after all the curve is, in effect, the locus of the end of a piece of string being unwound from a circular drum - and the parameter 't' is the angle of unwinding - at the point of tangency. Ignoring 'z' - as it's zero, this involute has 2 variables (x,y) - each of which is a different function of a single parameter (t). (This involute is so elementary that the normal at any point on the curve can be found by constructing a single line - from that point so that it's a tangent to the approaching side of the circle - rather than the retreating side.)
Involute of a Circle - by kinematic construction
But there is another, and very different, approach - if you have the Kinematics licence then there is probably no faster way of creating a pure involute than rolling a line around a circle - and tracing the end point of the line. An involute is one of the so-called 'classic' curves that can be described by a mechanism. (Even a Bezier curve, using control points, can be driven from a set of simultaneous mechanisms - there's no practical point in actually doing it, and it gets complicated - it's just interesting...and it would make a good, advanced, kinematic training exercise.)
The picture above shows a circle of radius (r) - with a line of length (2 * Pi * r) being rolled around its circumference. The involute is the yellow curve. A line of this length will obviously rotate one revolution. A trace of the other end of the line will give the opposite handed curve.
If, for some reason, the curve must be constructed completely within Catia, with a Law, (ie not with Excel), then here's a link to how to go about it - but I certainly wouldn't do all this to get an involute. If I'm going to make plane curves, space curves or surfaces that can be defined by either Cartesian, parametric or polar equations, I wouldn't hesitate to go the Excel way, and if that didn't give a satisfactory result then I'd think about some other method.
This subject has also become a lengthy thread here, since it began earlier this year.
RE: Creating a curve by equation
Regards
Fernando
RE: Creating a curve by equation
RE: Creating a curve by equation
I agree with PeterGuy about associativity.The radius would suffer most changes for sure and a new involute is updated immediately.
Thanks Kapitan for explanation and the links.
Definitely you are the master of explanations.
Regards
Columb