how can i model such a plot in autocad.
Solved! Go to Solution.
how can i model such a plot in autocad.
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Welcome to these Forums! [I saw this over at the CADFORUM.cz site.]
Can you post a link to the Mathlab web-page, so we can see what all the terms in that equation represent, and understand what the two curves of different colors are about?
Welcome to these Forums! [I saw this over at the CADFORUM.cz site.]
Can you post a link to the Mathlab web-page, so we can see what all the terms in that equation represent, and understand what the two curves of different colors are about?
HI @dim678,
Obviously AutoCAD is not a mathematics modeling package. However, if there is a set of data points or other properties that you can provide perhaps there is a way to create a model of some value. Do you have such a dataset and an example of the type of output for which you are looking?
HI @dim678,
Obviously AutoCAD is not a mathematics modeling package. However, if there is a set of data points or other properties that you can provide perhaps there is a way to create a model of some value. Do you have such a dataset and an example of the type of output for which you are looking?
the colors have no meaning its just a contour
the colors have no meaning its just a contour
i have only the points of the contour
i would like to create a 3d of the shape with width og 1 mm
is there a way?
thanks
i have only the points of the contour
i would like to create a 3d of the shape with width og 1 mm
is there a way?
thanks
@yafimv wrote:
the colors have no meaning its just a contour
But it's two contours. The colors are not what I was wondering about, but why there are two of them. Do they represent running the same equation twice with different values for something in the equation? I don't think they can both be part of one result from the same equation. I'm assuming the 'r' is the radius out from the origin. As you step outward in small increments of 'r', you get different angle results [phi], and that's what's doing the sweeping back and forth. But it looks like that equation would give only one angle result for any value of 'r', but there's one location on each of the two curves for any given radius. They look like they might be exactly the same shape except for the greenish extension off the outer end of the brownish one, but maybe they're slightly different..
So what's alpha? What's R-sub-zero? [The outermost radius limit?] What's tau? What's ln? That last one may just be mathematical terminology for some function I haven't encountered, though it may be clear from the source, but the others look more definitely like variables you plug specific values into. Presumably this shape is the result of a specific set of values for those, and with different values the resulting shape would be different.
That's why two of us have asked for a link to a web page, in hopes of answering these questions. It might be comparatively simple to generate the same curve(s) in AutoCAD, along which you could Sweep or Extrude something, but not without those answers.
@yafimv wrote:
the colors have no meaning its just a contour
But it's two contours. The colors are not what I was wondering about, but why there are two of them. Do they represent running the same equation twice with different values for something in the equation? I don't think they can both be part of one result from the same equation. I'm assuming the 'r' is the radius out from the origin. As you step outward in small increments of 'r', you get different angle results [phi], and that's what's doing the sweeping back and forth. But it looks like that equation would give only one angle result for any value of 'r', but there's one location on each of the two curves for any given radius. They look like they might be exactly the same shape except for the greenish extension off the outer end of the brownish one, but maybe they're slightly different..
So what's alpha? What's R-sub-zero? [The outermost radius limit?] What's tau? What's ln? That last one may just be mathematical terminology for some function I haven't encountered, though it may be clear from the source, but the others look more definitely like variables you plug specific values into. Presumably this shape is the result of a specific set of values for those, and with different values the resulting shape would be different.
That's why two of us have asked for a link to a web page, in hopes of answering these questions. It might be comparatively simple to generate the same curve(s) in AutoCAD, along which you could Sweep or Extrude something, but not without those answers.
Hello,answers to your question are as follows
"Do they represent running the same equation twice with different values for something in the equation?"
each curve has a different formula but the input values are the same.
"So what's alpha? What's R-sub-zero? [The outermost radius limit?] What's tau? What's ln?"
ln is a logarithmic function , alpha and R are just constants which i put in the formula,basickly"
basically i can get the polar coordinates of the contour,what should i do afterwards.
thanks
Hello,answers to your question are as follows
"Do they represent running the same equation twice with different values for something in the equation?"
each curve has a different formula but the input values are the same.
"So what's alpha? What's R-sub-zero? [The outermost radius limit?] What's tau? What's ln?"
ln is a logarithmic function , alpha and R are just constants which i put in the formula,basickly"
basically i can get the polar coordinates of the contour,what should i do afterwards.
thanks
You can use our 2DPLOT utility (see http://www.cadstudio.cz/en/apps/2dplot/). You equation then should be expressed in cartesian space (X/Y) - in LISP:
You can use our 2DPLOT utility (see http://www.cadstudio.cz/en/apps/2dplot/). You equation then should be expressed in cartesian space (X/Y) - in LISP:
@Kent1Cooper wrote:
... What's ln? That last one may just be mathematical terminology for some function ....
Well, duh on me -- the natural log [I don't have any use for them often enough to have recognized it at first].
Since this is a fundamentally radially-oriented operation, it seems to me it's overkill to do it with a function that converts to X and Y coordinates. It can more concisely be done with one that uses (polar):
(defun wavy (R0 inc alpha tau / r) (setq r 0) (setvar 'cmdecho 0) (command "_.spline" '(0 0 0)) (repeat (fix (/ R0 inc)) (command (polar '(0 0 0) (* alpha (sin (/ (* pi (log (/ (setq r (+ r inc)) R0))) (log tau)))) r ); polar ); command ); repeat (command "" "" ""); conclude Spline (setvar 'cmdecho 1) (princ) ); defun
That long line is the conversion of the formula into AutoLisp terminology. 'R0' is the outermost extent, 'inc' is the size of the stepping increment in radius between calculated points in the Spline. This is the result of using that with these arguments:
(wavy 1.5 0.001 1.0 1.4)
and looks pretty similar to [one of the curves in] the image:
I leave it to you to fine-tune the arguments to get a shape more precisely as you want it. You can use a polar Array, or Copy it in place and Rotate one of them about 0,0, if you need two as in the original image.
@Kent1Cooper wrote:
... What's ln? That last one may just be mathematical terminology for some function ....
Well, duh on me -- the natural log [I don't have any use for them often enough to have recognized it at first].
Since this is a fundamentally radially-oriented operation, it seems to me it's overkill to do it with a function that converts to X and Y coordinates. It can more concisely be done with one that uses (polar):
(defun wavy (R0 inc alpha tau / r) (setq r 0) (setvar 'cmdecho 0) (command "_.spline" '(0 0 0)) (repeat (fix (/ R0 inc)) (command (polar '(0 0 0) (* alpha (sin (/ (* pi (log (/ (setq r (+ r inc)) R0))) (log tau)))) r ); polar ); command ); repeat (command "" "" ""); conclude Spline (setvar 'cmdecho 1) (princ) ); defun
That long line is the conversion of the formula into AutoLisp terminology. 'R0' is the outermost extent, 'inc' is the size of the stepping increment in radius between calculated points in the Spline. This is the result of using that with these arguments:
(wavy 1.5 0.001 1.0 1.4)
and looks pretty similar to [one of the curves in] the image:
I leave it to you to fine-tune the arguments to get a shape more precisely as you want it. You can use a polar Array, or Copy it in place and Rotate one of them about 0,0, if you need two as in the original image.
so after plotting this how can created a shifted version by a certain angle and afterward to add a width of 1 mm.
thanks
so after plotting this how can created a shifted version by a certain angle and afterward to add a width of 1 mm.
thanks
@yafimv wrote:
so after plotting this how can created a shifted version by a certain angle and afterward to add a width of 1 mm. ....
I edited my Reply, perhaps after you saw it, with a description of two ways to get two of them. If you want to apply width, Splines can't do that, but Polylines can. With as small a radius increment as I used, you probably wouldn't be able to tell the different in smoothness even if the Polyline is made up of only line segments. Change this line:
(command "_.spline" '(0 0 0))
to this:
(command "_.pline" '(0 0 0))
and this line:
(command "" "" ""); conclude Spline
to this:
(command ""); conclude Pline
If you use a larger increment / fewer segments, you could use PEDIT on the resulting Polyline, and its Spline-curve option, to smooth out the curvature, and it would still be able to have width.
@yafimv wrote:
so after plotting this how can created a shifted version by a certain angle and afterward to add a width of 1 mm. ....
I edited my Reply, perhaps after you saw it, with a description of two ways to get two of them. If you want to apply width, Splines can't do that, but Polylines can. With as small a radius increment as I used, you probably wouldn't be able to tell the different in smoothness even if the Polyline is made up of only line segments. Change this line:
(command "_.spline" '(0 0 0))
to this:
(command "_.pline" '(0 0 0))
and this line:
(command "" "" ""); conclude Spline
to this:
(command ""); conclude Pline
If you use a larger increment / fewer segments, you could use PEDIT on the resulting Polyline, and its Spline-curve option, to smooth out the curvature, and it would still be able to have width.
i have inserted the following code and saved .
when i loaded it and wrote the name of the file ,it said unknown command,
what am i missing?
thanks
i have inserted the following code and saved .
when i loaded it and wrote the name of the file ,it said unknown command,
what am i missing?
thanks
@yafimv wrote:
....
when i loaded it and wrote the name of the file ,it said unknown command,
what am i missing?
....
It's not a command definition, it's a function with arguments. You use it as in Post 10, in parentheses with the arguments included.
If you prefer, it could be altered easily to make it a command, which would prompt the User for the values, so that you don't have to define a different command for every set of values you might ever want [that's why I did it in the function-with-arguments approach -- it's much easier to use with different values, so you can tweak them to get the best result].
@yafimv wrote:
....
when i loaded it and wrote the name of the file ,it said unknown command,
what am i missing?
....
It's not a command definition, it's a function with arguments. You use it as in Post 10, in parentheses with the arguments included.
If you prefer, it could be altered easily to make it a command, which would prompt the User for the values, so that you don't have to define a different command for every set of values you might ever want [that's why I did it in the function-with-arguments approach -- it's much easier to use with different values, so you can tweak them to get the best result].
i am trying to see where to go in the interface of auto cad to run this function(attached the photos of the CAD menu bellow),could where in the menus to go?
thanks
i am trying to see where to go in the interface of auto cad to run this function(attached the photos of the CAD menu bellow),could where in the menus to go?
thanks
Hello Vladimir, could you say in what menu should(photo attached bellow) i go in order to run this fntion,
because i went to "Visual LISP editor" and saved the code as a lisp file and load it
but when i run the file name ,it say that its not recognized.
if you could help we with running it
Thanks
Hello Vladimir, could you say in what menu should(photo attached bellow) i go in order to run this fntion,
because i went to "Visual LISP editor" and saved the code as a lisp file and load it
but when i run the file name ,it say that its not recognized.
if you could help we with running it
Thanks
@yafimv wrote:
i am trying to see where to go in the interface of auto cad to run this function....
Save the code to a .lsp file in some known location [it looks like you have already done that]. Type APPLOAD, navigate to that file, and Load it. Use it as shown before.
If you want it to be loaded automatically in every drawing you open, add a line like this to your acaddoc.lsp file:
(load "YourFileName")
[you don't need to include the .lsp filetype ending, but you can if you want to].
If you don't have an acaddoc.lsp file yet, make one, even if that's the only thing in it, and put it in some location that's in the Support File Search Path list in the Files tab in OPTIONS.
@yafimv wrote:
i am trying to see where to go in the interface of auto cad to run this function....
Save the code to a .lsp file in some known location [it looks like you have already done that]. Type APPLOAD, navigate to that file, and Load it. Use it as shown before.
If you want it to be loaded automatically in every drawing you open, add a line like this to your acaddoc.lsp file:
(load "YourFileName")
[you don't need to include the .lsp filetype ending, but you can if you want to].
If you don't have an acaddoc.lsp file yet, make one, even if that's the only thing in it, and put it in some location that's in the Support File Search Path list in the Files tab in OPTIONS.
You don't have to bother with the VisualLISP editor. Just take the supplied code and copy it (Ctrl+C/Ctrl+V) to your AutoCAD command line or save it to a .LSP file, edit (e.g. in Notepad) it as neccessary and load it into AutoCAD with the APPLOAD command.
The 2DPlot utility makes LWPOLYLINEs so you can add width easily by changing the Lightweight property in the polyline properties (Ctrl+1).
You can also spice up the output by superimposing the resulting shape on an automatically generated radial grid from another freeware add-on - the DrGrid utility - see http://www.cadforum.cz/cadforum_en/drgrid-parametric-grid-for-autocad-drawings-tip9829 - like this:
Vladimir Michl, www.cadstudio.cz www.cadforum.cz
You don't have to bother with the VisualLISP editor. Just take the supplied code and copy it (Ctrl+C/Ctrl+V) to your AutoCAD command line or save it to a .LSP file, edit (e.g. in Notepad) it as neccessary and load it into AutoCAD with the APPLOAD command.
The 2DPlot utility makes LWPOLYLINEs so you can add width easily by changing the Lightweight property in the polyline properties (Ctrl+1).
You can also spice up the output by superimposing the resulting shape on an automatically generated radial grid from another freeware add-on - the DrGrid utility - see http://www.cadforum.cz/cadforum_en/drgrid-parametric-grid-for-autocad-drawings-tip9829 - like this:
Vladimir Michl, www.cadstudio.cz www.cadforum.cz
Can't find what you're looking for? Ask the community or share your knowledge.