Jump to content

How to Create Custom CUrve In AutoCAD?


Recommended Posts

Beside spline curve, please tell me how to create a custom curve such as y = x^2, y = sin x, and parametric curve.

Edited by basty
Link to comment
Share on other sites

Obviously a polyline can plot data point with an arbitrary level of precision (though would never be absolutely perfect).

 

Or are you talking about an actual custom object? if that is the case then you are talking programming via ObjectARX. So for instance, a Sine curve could be programmed such that any point/parameter/intersection would give a mathematically perfect value. The graphics subsystem could be used to generate the onscreen curve, or perhaps just use a reasonably close Pline/Spline for the visual, assured that the backend ARX code will spit out the proper values once queried.

Link to comment
Share on other sites

Incidentally, I think the Autodesk programmers did that with the fairly modern Helix entity; use a reasonably close facsimile for the visual, but generally accurate return values for downstream operations.

Link to comment
Share on other sites

Are you looking to create a new data type in the AutoCAD database or are you trying to make a curve (spline) that exactly (or approximately) represents a specific function for a defined range? Since y = x^2 is a polynomial (parabola) either a polyline spline or a regular spline object can exactly represent it although you could not directly specify the coefficients of the polynomial. (Note, of the four conic sections - circle, ellipse, parabola, hyperbola; only the parabola is a polynomial). The equation y = sin x would require the use of a regular spline (NURBS) to exactly reproduce the shape.

 

How do you plan to use the curve once it has been constructed? If it is a new object type then there might be issues as to how it works with other functions (e.g., explode, trim, etc.).

 

~Lee

Link to comment
Share on other sites

. . . .Since y = x^2 is a polynomial (parabola) either a polyline spline or a regular spline object can exactly represent it . . . .

 

That will be an approximation as well, regardless of SPLINESEGS setting. I recommend the use of Degree 2 splines as the best Parabola/Hyperbola entities. Extremely data efficient, and capable of accurate length measures, intersections, and Per/Tan "Osnap"ing.

Link to comment
Share on other sites

Beside spline curve, please tell me how to create a custom curve such as y = x^2, y = sin x, and parametric curve.

 

If just a curve is needed - not necessarily parametric within the AutoCAD drawing editor - Microsoft Excel can be set up to generate the data points. If formatted correctly, the data can be cut and pasted into the AutoCAD command line prompt during the Polyline command. The resultant Poly will have vertices at those data points.

Link to comment
Share on other sites

  • 4 years later...

To draw any kind of math expression or any object defined by a math formula you can use LitioLAB:

http://www.litio.si/litiolab.htm

 

LitioLAB 1.0 is an advanced, complex-shape, mathematical drawing tool for AutoCAD/GStarCAD, that helps you draw complex shapes (either 2D curves, 3D curves or 3D surfaces), that are not available as standard commands within AutoCAD/GStarCAD.

It helps you draw shapes that follow a mathematical equation or formula and import a series of XLS points (or other formats) into your drawing, to draw them as a series of POINTs, LINE segments or 2D or 3D POLYLINEs
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...