Lee Mac Posted May 15, 2009 Posted May 15, 2009 I got it. All set. I've probably worked with the older version of vec.lsp thinking it's the new one. Would be nice to have the value on the screen too. The value is printed to the command line - would you like it as text on screen? PS> The value printed to the command line takes the accuracy of your current system variables, however, the value written to CSV is to 8 decimal places, - as I didn't know what accuracy you needed and it is easier to change this in excel. Quote
lizp Posted May 15, 2009 Author Posted May 15, 2009 The value is printed to the command line - would you like it as text on screen? PS> The value printed to the command line takes the accuracy of your current system variables, however, the value written to CSV is to 8 decimal places, - as I didn't know what accuracy you needed and it is easier to change this in excel. Would be nice to have it on the screen too. I now saw it printed to the command line, after I scrolled up little bit. It was hiding beyond the narrow window set for the the command line. As for accuracy, it should be reasonably high, meaning that it should be of the order of the instruments usually used to measure lengths. Seems as is now, even on the screen, appears to be sufficiently accurate. Quote
Lee Mac Posted May 15, 2009 Posted May 15, 2009 Would be nice to have it on the screen too. I now saw it printed to the command line, after I scrolled up little bit. It was hiding beyond the narrow window set for the the command line. Ok, I shall add this to the code for you Quote
Lee Mac Posted May 15, 2009 Posted May 15, 2009 Ok, this is a bit more elaborate than it needs to be, but I enjoy using the grread function Let me know if you want the text format changed (defun c:vec (/ *error* vlst ovar doc spc Circ bVec path cCen lObj lAng lLen grdat cEnt ofile pt tan angdif tandif radtan pertan tanpt norpt ptlst tBox tHgt tWid bsPt btPt tpPt) (vl-load-com) (defun *error* (msg) (if doc (vla-regen doc acActiveViewport)) (if ovar (mapcar 'setvar vlst ovar)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n<< Error: " msg " >>")) (princ "\n<< Function Cancelled >>")) (princ)) (setq vlst '("CMDECHO" "DIMZIN") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (if (and (setq Circ (car (entsel "\nSelect Circle: "))) (eq "CIRCLE" (cdadr (entget Circ))) (setq bVec (car (entsel "\nSelect Base Vector: "))) (member (cdadr (entget bVec)) '("LINE" "LWPOLYLINE" "POLYLINE"))) (progn (setq path (strcat (getvar "DWGPREFIX") (substr (getvar "DWGNAME") 1 (- (strlen (getvar "DWGNAME")) 4)) ".csv") cCen (cdr (assoc 10 (entget Circ))) lObj (vlax-ename->vla-object bVec) lAng (angle '(0 0 0) (vlax-curve-getFirstDeriv bVec (vlax-curve-getStartParam bVec))) lLen (vla-get-Length lObj)) (princ "\nSelect Curve: ") (while (eq 5 (car (setq grdat (grread t 5 2)))) (if (and (setq cEnt (car (nentselp (cadr grdat)))) (member (cdadr (entget cEnt)) '("LWPOLYLINE" "POLYLINE" "CIRCLE" "ELLIPSE" "ARC" "LINE" "SPLINE")) (not (eq Circ cEnt))) (redraw cEnt 3) (mapcar '(lambda (x) (redraw x 4)) (mapcar 'cadr (ssnamex (ssget "_X")))))) (if cEnt (progn (setq ofile (open path "a")) (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq cObj (vlax-ename->vla-object cEnt) pt (vlax-curve-getClosestPointto cObj (cadr grdat)) tan (vlax-curve-getFirstDeriv cObj (vlax-curve-getParamatPoint cObj pt)) angdif (abs (- (angle '(0 0 0) tan) lAng)) tandif (abs (- (angle '(0 0 0) tan) (angle pt cCen))) tanpt (polar pt (angle '(0 0 0) tan) (* lLen (cos angdif))) radtan (polar pt (angle pt cCen) (* (distance pt tanpt) (cos tandif))) pertan (polar pt (+ (angle pt cCen) (/ pi 2)) (* (distance pt tanpt) (sin tandif))) norpt (polar pt (+ (/ pi 2) (angle '(0 0 0) tan)) (* lLen (sin angdif))) bsvpt (polar pt lAng lLen)) (grvecs (list 3 pt tanpt 3 pt norpt 8 pt cCen 1 pt bsvpt 4 pt radtan 4 pt pertan))) (if (eq 3 (car grdat)) (progn (setq ptlst (mapcar 'vlax-3d-point (list pt tanpt norpt cCen radtan pertan bsvpt))) (vla-put-color (vla-addline spc (car ptlst) (cadr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (caddr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (cadddr ptlst)) (vla-put-color (vla-addline spc (car ptlst) (nth 4 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (nth 5 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (last ptlst)) acRed) (setq torq (* (distance pt cCen) (distance pt pertan))) (princ (strcat "\n<< Calculated Torque: " (rtos torq 2 4) " >>\n")) (write-line (rtos torq 2 ofile) (close ofile) (setq tBox (textbox (list (cons 1 (rtos torq 2 4)) (cons 40 (getvar "TEXTSIZE")) (cons 7 (getvar "TEXTSTYLE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nSpecify Text Position: ") (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq bsPt (cadr grdat) btPt (polar bsPt (/ (* 3 pi) 2) (/ tHgt 2.)) tpPt (polar bsPt (/ pi 2) (/ tHgt 2.))) (grvecs (list 3 (polar btPt 0 (/ tWid 2.)) (polar btPt pi (/ tWid 2.)) 3 (polar btPt 0 (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.)) 3 (polar btPt pi (/ tWid 2.)) (polar tpPt pi (/ tWid 2.)) 3 (polar tpPt pi (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.))))) (if (eq 3 (car grdat)) (Make_Text (cadr grdat) (rtos torq 2 4) 0.0))))))) (princ "\n<!> No Circle Selected <!>")) (command "_regenall") (mapcar 'setvar vlst ovar) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt)))) Quote
lizp Posted May 15, 2009 Author Posted May 15, 2009 This is just excellent. Will have to see now how to apply all this to the actual drawing. When I explode it it gives me 19 elements unexploded. Thanks a lot for the great job you did and will let you know if there's anything further needed. Take care and have a good night. Quote
Lee Mac Posted May 15, 2009 Posted May 15, 2009 This is just excellent. Will have to see now how to apply all this to the actual drawing. When I explode it it gives me 19 elements unexploded. Thanks a lot for the great job you did and will let you know if there's anything further needed. Take care and have a good night. I'm glad that its what you require, and will be happy to make any alterations should you need them. Cheers, Lee Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Hi Lee, thanks for your willingness to continue on this project. Now, it appears that the sense of some of the resultant vectors isn’t right. You may notice that, for instance, in the 11 o’clock vectors in the attached here file. The code shows the resultant vector, perpendicular to the radial line, to have sense which would yield a negative torque (CW) while the torque which this vector will produce is obviously positive (CCW). If you think to fix the sense of vectors is cumbersome leave it as is. One can adjust the signs later by hand in the Excel sheet. However, it would be good to have the correct signs because then the addition, to get the net torque, can be made automatic and can even be displayed on the screen. Other than that all seems to work well and some, @SEANT in particular, may enjoy playing with it. Will be interesting to see what they get. Notice that if you want the torque in Nm the obtained numbers have to be multiplied by 10E-6 in this particular case. W30.dxf Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 Thanks for your feedback Lizp, although I cannot open that dxf file in '04, if you, or someone else, could post it in a different format compatible with '04, it would be much appreciated Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Sorry, I forgot you can't read the 2007 files. Here's one saved for 2004 (see attached). Hope it'll work OK for you. W30_ACAD2004.dxf Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 Hopefully, this solves the problem: (defun c:vec (/ *error* vlst ovar doc spc Circ bVec path cCen lObj lAng lLen grdat cEnt ofile pt tan angdif tandif radtan pertan tanpt norpt ptlst tBox tHgt tWid bsPt btPt tpPt) (vl-load-com) (defun *error* (msg) (if doc (vla-regen doc acActiveViewport)) (if ovar (mapcar 'setvar vlst ovar)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n<< Error: " msg " >>")) (princ "\n<< Function Cancelled >>")) (princ)) (setq vlst '("CMDECHO" "DIMZIN") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (if (and (setq Circ (car (entsel "\nSelect Circle: "))) (eq "CIRCLE" (cdadr (entget Circ))) (setq bVec (car (entsel "\nSelect Base Vector: "))) (member (cdadr (entget bVec)) '("LINE" "LWPOLYLINE" "POLYLINE"))) (progn (setq path (strcat (getvar "DWGPREFIX") (substr (getvar "DWGNAME") 1 (- (strlen (getvar "DWGNAME")) 4)) ".csv") cCen (cdr (assoc 10 (entget Circ))) lObj (vlax-ename->vla-object bVec) lAng (angle '(0 0 0) (vlax-curve-getFirstDeriv bVec (vlax-curve-getStartParam bVec))) lLen (vla-get-Length lObj)) (princ "\nSelect Curve: ") (while (eq 5 (car (setq grdat (grread t 5 2)))) (if (and (setq cEnt (car (nentselp (cadr grdat)))) (member (cdadr (entget cEnt)) '("LWPOLYLINE" "POLYLINE" "CIRCLE" "ELLIPSE" "ARC" "LINE" "SPLINE")) (not (eq Circ cEnt))) (redraw cEnt 3) (mapcar '(lambda (x) (redraw x 4)) (mapcar 'cadr (ssnamex (ssget "_X")))))) (if cEnt (progn (setq ofile (open path "a")) (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq cObj (vlax-ename->vla-object cEnt) pt (vlax-curve-getClosestPointto cObj (cadr grdat)) tan (vlax-curve-getFirstDeriv cObj (vlax-curve-getParamatPoint cObj pt)) angdif (abs (- (angle '(0 0 0) tan) lAng)) tandif (abs (- (angle '(0 0 0) tan) (angle pt cCen))) tanpt (polar pt (angle '(0 0 0) tan) (* lLen (cos angdif))) radtan (polar pt (angle pt cCen) (* (distance pt tanpt) (cos tandif))) pertan (polar pt (- (angle pt cCen) (/ pi 2)) (* (distance pt tanpt) (sin tandif))) norpt (polar pt (+ (/ pi 2) (angle '(0 0 0) tan)) (* lLen (sin angdif))) bsvpt (polar pt lAng lLen)) (grvecs (list 3 pt tanpt 3 pt norpt 8 pt cCen 1 pt bsvpt 4 pt radtan 4 pt pertan))) (if (eq 3 (car grdat)) (progn (setq ptlst (mapcar 'vlax-3d-point (list pt tanpt norpt cCen radtan pertan bsvpt))) (vla-put-color (vla-addline spc (car ptlst) (cadr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (caddr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (cadddr ptlst)) (vla-put-color (vla-addline spc (car ptlst) (nth 4 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (nth 5 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (last ptlst)) acRed) (setq torq (* (distance pt cCen) (distance pt pertan))) (princ (strcat "\n<< Calculated Torque: " (rtos torq 2 4) " >>\n")) (write-line (rtos torq 2 ofile) (close ofile) (setq tBox (textbox (list (cons 1 (rtos torq 2 4)) (cons 40 (getvar "TEXTSIZE")) (cons 7 (getvar "TEXTSTYLE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nSpecify Text Position: ") (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq bsPt (cadr grdat) btPt (polar bsPt (/ (* 3 pi) 2) (/ tHgt 2.)) tpPt (polar bsPt (/ pi 2) (/ tHgt 2.))) (grvecs (list 3 (polar btPt 0 (/ tWid 2.)) (polar btPt pi (/ tWid 2.)) 3 (polar btPt 0 (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.)) 3 (polar btPt pi (/ tWid 2.)) (polar tpPt pi (/ tWid 2.)) 3 (polar tpPt pi (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.))))) (if (eq 3 (car grdat)) (Make_Text (cadr grdat) (rtos torq 2 4) 0.0))))))) (princ "\n<!> Incorrect Selection <!>")) (command "_regenall") (mapcar 'setvar vlst ovar) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt)))) Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Yes, this indeed appears to fix the needed vector (the component perpendicular to the radial line). However, the sense of the base vector and its tangential and normal components is still reversed. I've tried the 11 o'clock slot in W30.dxf. That may be unimportant, but would be good to be fixed if it's not a big problem. Also, it would be good if the actual sign of the torques could also be assessed -- those that cause CCW turn being positive while those turning CW, negative. If that is done, then the net torque may be displayed right on the screen and placed in a special separate file where all the calculated net torques from wheel at various positions can be for a graphical display. I'm trying now to calculate these net torques and present them graphically. As an example, the file I uploaded (W30.dxf) is for a wheel rotated at 30 with respect to a position, considered as the initial position of the wheel. Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Lee, I just saw that the components on the right-hand vectors are reversed with the last code. Probably fixing the left-hand messes up the right hand ones. Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 I've got to admit, I am slightly lost at this point Lizp - I have never done these calculations myself before, hence I made the code just following your direction. Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Yeah, I guess this might be somewhat involved to program. We'll have to think about it. It won't affect the absolute values of the calculated quantities of the individual torques but won't allow to calculate automatically the net torque (one has to assess additionally what the signs are, to calculate it). I suppose one way to figure out the sense of the calculated vectors is to consider that the beginning of the base vector has always a greater value of the y-coordinate than its end and go from there. Any derivative vector should follow that. Of course, that hassle with the sense of the vectors is only to have them properly presented on the screen. Otherwise, like I said, it doesn't affect the absolute values of the individual torques. I was thinking, maybe more important (and probably easier) is to assess the sign of the individual torques. Say, if the radial line falls to the left of the perpendicular going through the center of the circle the product it participates in would be deemed positive. If the radial line taking part in a torque product is on the right-hand side, the torque would be considered negative. That may be a way to correctly set the sign of the individual torques to get the final one and put it in a file with all the rest of the net torques. I will proceed now with the earlier version of vec.lsp (before the last posted code) and will check from time to time here to see if you need anything from me or you have come up with something. Good luck. Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 Ok, I had one last stab at it, but, to be perfectly honest, I don't really know exactly what I am doing at this point (defun c:vec (/ *error* vlst ovar doc spc Circ bVec path cCen lObj lAng lLen grdat cEnt ofile pt tan angdif tandif radtan pertan tanpt norpt ptlst tBox tHgt tWid bsPt btPt tpPt) (vl-load-com) (defun *error* (msg) (if doc (vla-regen doc acActiveViewport)) (if ovar (mapcar 'setvar vlst ovar)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n<< Error: " msg " >>")) (princ "\n<< Function Cancelled >>")) (princ)) (setq vlst '("CMDECHO" "DIMZIN") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (if (and (setq Circ (car (entsel "\nSelect Circle: "))) (eq "CIRCLE" (cdadr (entget Circ))) (setq bVec (car (entsel "\nSelect Base Vector: "))) (member (cdadr (entget bVec)) '("LINE" "LWPOLYLINE" "POLYLINE"))) (progn (setq path (strcat (getvar "DWGPREFIX") (substr (getvar "DWGNAME") 1 (- (strlen (getvar "DWGNAME")) 4)) ".csv") cCen (cdr (assoc 10 (entget Circ))) lObj (vlax-ename->vla-object bVec) lAng (angle '(0 0 0) (vlax-curve-getFirstDeriv bVec (vlax-curve-getStartParam bVec))) lLen (vla-get-Length lObj)) (princ "\nSelect Curve: ") (while (eq 5 (car (setq grdat (grread t 5 2)))) (if (and (setq cEnt (car (nentselp (cadr grdat)))) (member (cdadr (entget cEnt)) '("LWPOLYLINE" "POLYLINE" "CIRCLE" "ELLIPSE" "ARC" "LINE" "SPLINE")) (not (eq Circ cEnt))) (redraw cEnt 3) (mapcar '(lambda (x) (redraw x 4)) (mapcar 'cadr (ssnamex (ssget "_X")))))) (if cEnt (progn (setq ofile (open path "a")) (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq cObj (vlax-ename->vla-object cEnt) pt (vlax-curve-getClosestPointto cObj (cadr grdat)) tan (vlax-curve-getFirstDeriv cObj (vlax-curve-getParamatPoint cObj pt)) angdif (abs (- (angle '(0 0 0) tan) lAng)) tandif (abs (- (angle '(0 0 0) tan) (angle pt cCen))) tanpt (polar pt (angle '(0 0 0) tan) (* lLen (cos angdif))) radtan (polar pt (angle pt cCen) (* (distance pt tanpt) (cos tandif))) pertan (polar pt ((if (> (car pt) (car cCen)) + -) (angle pt cCen) (/ pi 2)) (* (distance pt tanpt) (sin tandif))) norpt (polar pt ((if (> (car pt) (car cCen)) - +) (angle '(0 0 0) tan) (/ pi 2)) (* lLen (sin angdif))) bsvpt (polar pt lAng lLen)) (grvecs (list 3 pt tanpt 3 pt norpt 8 pt cCen 1 pt bsvpt 4 pt radtan 4 pt pertan))) (if (eq 3 (car grdat)) (progn (setq ptlst (mapcar 'vlax-3d-point (list pt tanpt norpt cCen radtan pertan bsvpt))) (vla-put-color (vla-addline spc (car ptlst) (cadr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (caddr ptlst)) acGreen) (vla-put-color (vla-addline spc (car ptlst) (cadddr ptlst)) (vla-put-color (vla-addline spc (car ptlst) (nth 4 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (nth 5 ptlst)) acCyan) (vla-put-color (vla-addline spc (car ptlst) (last ptlst)) acRed) (setq torq (* (if (> (car pt) (car cCen)) -1. 1.) (distance pt cCen) (distance pt pertan))) (princ (strcat "\n<< Calculated Torque: " (rtos torq 2 4) " >>\n")) (write-line (rtos torq 2 ofile) (close ofile) (setq tBox (textbox (list (cons 1 (rtos torq 2 4)) (cons 40 (getvar "TEXTSIZE")) (cons 7 (getvar "TEXTSTYLE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nSpecify Text Position: ") (while (eq 5 (car (setq grdat (grread t 5 0)))) (redraw) (setq bsPt (cadr grdat) btPt (polar bsPt (/ (* 3 pi) 2) (/ tHgt 2.)) tpPt (polar bsPt (/ pi 2) (/ tHgt 2.))) (grvecs (list 3 (polar btPt 0 (/ tWid 2.)) (polar btPt pi (/ tWid 2.)) 3 (polar btPt 0 (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.)) 3 (polar btPt pi (/ tWid 2.)) (polar tpPt pi (/ tWid 2.)) 3 (polar tpPt pi (/ tWid 2.)) (polar tpPt 0 (/ tWid 2.))))) (if (eq 3 (car grdat)) (Make_Text (cadr grdat) (rtos torq 2 4) 0.0))))))) (princ "\n<!> No Circle Selected <!>")) (command "_regenall") (mapcar 'setvar vlst ovar) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt)))) Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 OK, I'll try the code in a bit. I just want to mention something about how to determine the sign of the individual torques. The criterion shouldn't be as to whether or not the radial line is to the right or to the left of the perpendicular. Rather than that, the criterion should be whether or not the point where the radial line crosses the curve is to the right or to the left of its extremums (maximum on top and minimum on the bottom). Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 OK, I'll try the code in a bit. I just want to mention something about how to determine the sign of the individual torques. The criterion shouldn't be as to whether or not the radial line is to the right or to the left of the perpendicular. Rather than that, the criterion should be whether or not the point where the radial line crosses the curve is to the right or to the left of its extremums (maximum on top and minimum on the bottom). Ok, with this extra knowledge, my above code probably won't do the job. You say to the right or left of its extremums, do you mean whether the derivative of the curve at that point is positive or negative? Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Now, that last code is much improved (save the sense of some vectors which we'll have to work later on since it doesn't affect the main goal of this calculation but just the appearance). If there are problems with the signs they are where the low torques are and won't affect the order of magnitude of the final answer. Nevertheless, why not make it precise: As for the signs of the derivatives, the check should be as to whether or not the radial line is to the left or to the right of the point on the curve where the second derivative is zero. If it's to the left then the torque is positive, if it's to the right torque is negative. Quote
lizp Posted May 16, 2009 Author Posted May 16, 2009 Lee, now that I'm working with it I see it would much more convenient to select the base vector only once for the whole calculation, not for each one of the eight points. Would it be possible to do that? Same for selecting the circle -- only once for everything that follows. And, this, if possible 'appload' vec.lsp only once for all eight or whatever number of calculations. EDIT: Sorry, I meant have vec only once invoked at the Command line for the entire calculation after uploading vec.lsp. Quote
Lee Mac Posted May 16, 2009 Posted May 16, 2009 Lee, now that I'm working with it I see it would much more convenient to select the base vector only once for the whole calculation, not for each one of the eight points. Would it be possible to do that? Same for selecting the circle -- only once for everything that follows. I shall see what I can do Quote
Recommended Posts
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.