inters

inters

Anonymous
Not applicable
622 Views
3 Replies
Message 1 of 4

inters

Anonymous
Not applicable

Hello

 

I am trying to use the inters function. It doesn't seem to work? I click on four points through which I know that there will be a point of intersection. But my variable "tint" in the following code returns 'nil'?

 

(defun c:tint ()


(setq p1 (getpoint "Click first point"))
(setq p2 (getpoint "Click second point"))
(setq p3 (getpoint "Click third point"))
(setq p4 (getpoint "Click fourth point"))

 

(setq tint (inters p1 p2 p3 p4))


)

 

Why is this the case?

 

Kind regards

 

Derryck

0 Likes
Accepted solutions (1)
623 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

It works good. See help
http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-A181D474-F817-4550-86E9-87649262FA8A

You need to specify these points across... p1-p2 is one line, p3-p4 is another.
If you specify these point next to each other, you need to set "onseg" (see help) as nil to get an apparent intersection.

0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks BeekeeCZ

I actually did find out that on online help now as well.

Cheers

Derryck
0 Likes
Message 4 of 4

dbroad
Mentor
Mentor

Even though you've solved your problem, I might clarify that even though some lines look like they intersect, they may not really.  For example

 

(inters '(0 0 0) '(1 0 0) '(0 0.5 1) '(0 -0.5 1))

 

returns nil because the two lines do not lie on the same plane.  The onseg variable would not change the result.

 

Happy lisping.

Architect, Registered NC, VA, SC, & GA.
0 Likes