Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

Posted

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.

Posted

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

Posted
. . . .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.

Posted
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.

  • 4 years later...
Posted

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
 

  • 3 years later...
Posted (edited)

Now, this is a cool subject... ObjectARX programing...

I was looking for a way to draw a helix with continuous pitch change (i.e. variable slope) in AutoCAD... Does anyone have idea how to approach the problem?

I feel like LISP will not be too helpful here... or am i wrong?

 

Irm... you are talking about a new data type in the AutoCAD database... Helix exists, but does not have that kind of functionality... in Inventor it does, or better, seems to have it...

 

How hard could it be, I wonder...

 

Edited by ibach

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...