Jump to content

Something is wrong with my polar function


Recommended Posts

Posted (edited)

All,

 

I am having some issues with my polar function:

 

(setq pre_ang 0)
(setq ang (/ (* 3 pi) 2))
(setq int '(46.8854 43.1495 0.0))
(setq apt_int '(52.8854 49.1495 0.0))
(setq width 6)
(setq ptLst
(mapcar
   '(lambda(x)(trans x 0 1))
	(list
	  (setq eli int)
	  (setq el1 (polar eli (+ pi pre_ang) (/ width 3.)))
	  (setq el2 (polar el1 (+ (/ pi 2) pre_ang) width))
	  (setq el3 (polar eli ang (/ width 3.)))
	  (setq el4 (polar el3 (+ (/ pi 2) ang) width))
	  (setq ela apt_int)
	 )
 )
)
(mapcar '(lambda (x)(command "point" x)) ptlst)

 

el1 and el3 are not going in correctly...

_$
(polar '(46.8854 43.1495 0.0) 3.14159 2.0) ;entered in console [el1]
(44.8854 43.1495 0.0) ; return

Any thoughts why this is not working for me?

 

Kind Regards,

 

Matt

Edited by harrison-matt
Was missing the pre_ang and ang values. I added a point function. I added my evaluation.
Posted

(setq ptLst (mapcar
              '(lambda(x)(trans x 0 1))
                 (list
                    int
                    (polar int (+ pi pre_ang) (/ width 3.))
                    (polar apt_int (+ pi pre_ang) (+ (/ width 3) width))
                    apt_int
                    (polar int ang (/ width 3.))
                    (polar apt_int ang (+ (/ width 3) width))
                    apt_int )))
(mapcar '(lambda (x)(command "point" x)) ptlst))

 

I simplified my code.... Still is not working as it should...

Posted

Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?

Posted

Consider OSnap perhaps - change:

 

(mapcar '(lambda (x)(command "point" x)) ptlst))

 

to:

 

(mapcar '(lambda (x)(command "_.point" "_non" x)) ptlst))

Posted
Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?

 

Points are alway WCS.

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