Jump to content

Recommended Posts

Posted

What is the reason why the divisions are not always accurate? For example, 28 divisions? But with other dividers.

I appreciate the explanation.

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun DTR (A)
(* PI (/ A 180.0))
)
(defun c:STA (/ nr len ang ang1 pc1 pc2 )
(setq nr (getint "\n Nr. Divisions? "))
(setq len (getdist "\n Segments Length? "))
(setq ang (/ 360 nr))
(setq ang1 (dtr 0))
(setq pc1 (getpoint "\n Central Point: "))
(setq pc2 (polar pc1 ang1 len))
(command "_.line" "_non" pc1 "_non" pc2 "")
(repeat nr
(setq ang1 (+ ang1 ang))
(setq pc2 (polar pc1 (dtr ang1) len))
(command "_.line" "_non" pc1 "_non" pc2 "")
)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Posted

Could it have anything to do with the setting of units > precision?

Posted

Please pay atention that by dividing two integers the result will be rounded. This will fix your code:

(setq ang (/ 360[color=red].0[/color] nr))

Posted

In fact, it seems solved.

 

ReMark and MSasu

Thanks for the help.

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