Author Topic: How to get all parameters at the self intersection of a curve?  (Read 10056 times)

0 Members and 1 Guest are viewing this topic.

chlh_jd

  • Guest
Re: How to get all parameters at the self intersection of a curve?
« Reply #30 on: August 21, 2012, 02:41:21 PM »
Unfortunately, that will only find start point of obj VLA-OBJECT, but hey, now I can find intersections of 2 separate splines - there are no int osnap for this :
Code: [Select]
(vlax-invoke (setq obj1 (vlax-ename->vla-object (car(entsel)))) 'IntersectWith (setq obj2 (vlax-ename->vla-object (car(entsel)))) acExtendNone)

I was wrong, but fortunately - there is int osnap when intersecting 2 splines - only no int when one spline crosses itself...

M.R.
I'll test this method .
Again one modification :
Code: [Select]
(defun c:test (/ e p pars)
  (setq e (car (entsel "\nSelect a curve:"))
p (getpoint "\nSelect Point : ")
)
 ....
 

By picking start-end point of spline object Faster's code precision is in range of 1e-8, so having that in mind I suppose it is more trust worth than chlh_jd's with witch precision results are in range of 1e-5 no matter if you change in chlh_jd's code line (rtos a 2 15) - still tolerance is 1e-5 in witch subfunction (ss:spline:getcrossparams en 1e-5) operates...
You're right , Ribarm .
I'll  Fix this problem some day later  , Today must to sleep .
      See the spline codes , AutoCAD has three type of spline : 1)  Dual arc Spline (E.G.  SPLINSEGS =  -8 );  2) NURBS(Non-Uniform Rational B-spline) 3) B-spline (Command Pedit will create). 
     'Spline' command will create a NURBS ,  and can be edited by command 'Splinedit' ; AutoCAD use de-Boor-Cox Recursive way to get Co-tangent arc though assumes that the boundary conditions of the tangent  and set weight = 1.0 .
     If Node tolerance (DXF Code 42)  equal 1e-10 , Control point tolerance (DXF Code 43) equal 1e-10 , then the  Fit tolerance (DXF Code 44) will be 1e-5 .
     We often see a spline cross  at the same point times , if zoom the intersection we found that the curve not really coincide in it , because it just coincide in it by  Fit tolerance  . It's why we can't  get the higher accuracy parameters .

chlh_jd

  • Guest
Re: How to get all parameters at the self intersection of a curve?
« Reply #31 on: August 21, 2012, 02:51:01 PM »
Unfortunately, that will only find start point of obj VLA-OBJECT, but hey, now I can find intersections of 2 separate splines - there are no int osnap for this :
Code: [Select]
(vlax-invoke (setq obj1 (vlax-ename->vla-object (car(entsel)))) 'IntersectWith (setq obj2 (vlax-ename->vla-object (car(entsel)))) acExtendNone)
I was wrong, but fortunately - there is int osnap when intersecting 2 splines - only no int when one spline crosses itself...
M.R.

Get self-intersection points with next method:
Code: [Select]
(vlax-invoke (setq obj (vlax-ename->vla-object (car(entsel)))) 'IntersectWith obj acExtendNone)

This method can't get cross-intersections of a cross-spline in 'ttt_t3.dwg' Highflybird often  in reply #6
« Last Edit: August 21, 2012, 02:55:58 PM by chlh_jd »

Faster

  • Guest
Re: How to get all parameters at the self intersection of a curve?
« Reply #32 on: August 21, 2012, 08:49:14 PM »
Unfortunately, that will only find start point of obj VLA-OBJECT, but hey, now I can find intersections of 2 separate splines - there are no int osnap for this :
Code: [Select]
(vlax-invoke (setq obj1 (vlax-ename->vla-object (car(entsel)))) 'IntersectWith (setq obj2 (vlax-ename->vla-object (car(entsel)))) acExtendNone)
I was wrong, but fortunately - there is int osnap when intersecting 2 splines - only no int when one spline crosses itself...
M.R.

Get self-intersection points with next method:
Code: [Select]
(vlax-invoke (setq obj (vlax-ename->vla-object (car(entsel)))) 'IntersectWith obj acExtendNone)

This method can't get cross-intersections of a cross-spline in 'ttt_t3.dwg' Highflybird often  in reply #6
Test for 'ttt_t3.dwg' by acad2008:
Code: [Select]
(mapcar '(lambda (a) (rtos a 2 16))(vlax-invoke (setq obj
(vlax-ename->vla-object (car(entsel)))) 'IntersectWith obj acExtendNone))
return value:
'("1284522.419266591" "-509220.3621771558" "0.000000000000000")
But test in CAD2013,I can not get the result.
« Last Edit: August 21, 2012, 09:53:33 PM by Faster »

chlh_jd

  • Guest
Re: How to get all parameters at the self intersection of a curve?
« Reply #33 on: August 22, 2012, 01:00:52 AM »
Test for 'ttt_t3.dwg' by acad2008:
Code: [Select]
(mapcar '(lambda (a) (rtos a 2 16))(vlax-invoke (setq obj
(vlax-ename->vla-object (car(entsel)))) 'IntersectWith obj acExtendNone))
return value:
'("1284522.419266591" "-509220.3621771558" "0.000000000000000")
But test in CAD2013,I can not get the result.
I test in ACAD2012 , can't get the result .