Author Topic: request to ymg :select 3d faces between 2 break line  (Read 1980 times)

0 Members and 1 Guest are viewing this topic.

motee-z

  • Newt
  • Posts: 40
request to ymg :select 3d faces between 2 break line
« on: November 13, 2015, 12:34:47 PM »
Hi ymg
i think  you are the only one how can help me
i want to select 3d faces which located between tow breakline
manually will takes long time
please see attached drawing
any help will be highly appreciated

ymg

  • Guest
Re: request to ymg :select 3d faces between 2 break line
« Reply #1 on: November 13, 2015, 03:03:01 PM »
motee-z,

If you close your breaklines to make a continuous loop,
the 3dfaces will be erased by Triang  program automatically.

if it's only selecting you want, then after triangulating close
the breaklines and use the polyline as a window crossing polygon.

Look at this section of code and modify:

Code: [Select]
;;                                                            ;
        ;; Erasing Triangles in Holes of Triangulation,               ;
        ;; And Adjusting Triangle List                                ;
        ;;                                                            ;
        ;; Notes: This is a fast hack where we select 3Dfaces with a  ;
        ;;        Crossing Polygon then Computes their Centroid and   ;
        ;;        remove those whose centroid is inside the poly.     ;
        ;;                                                            ;
        ;;        Will change it eventually to offset the polyline    ;
        ;;        to the outside by a few millimeters, and make the   ;
        ;;        Selection by Window Polygon.                        ;
        ;;                                                            ;
       
        (vl-cmdf "_ZOOM" "_E")
        (foreach wp wpl
   (setq wp (mapcar '(lambda (a) (list (car a) (cadr a))) wp))
   (while (equal (car wp) (last wp) 0.001) (setq wp
  (butlast wp)))
                   (setq  ss (ssget "_CP" wp '((0 . "3DFACE"))))
   (repeat (setq i (sslength ss))
      (setq  en (ssname ss (setq i (1- i)))
                    ent (entget en)
     tp (list (cdr (assoc 11 ent))
      (cdr (assoc 12 ent))
      (cdr (assoc 13 ent))
)     
                             
      )
      (if (ptinpoly_p (centroid tp) wp)
                         (setq tr (list (vl-position  (car   tp) pl)
                                        (vl-position  (cadr  tp) pl)
        (vl-position  (caddr tp) pl)
                )
       tl (vl-remove tr tl)
       ** (entdel en)
)     
      )
   )   
)   

ymg

motee-z

  • Newt
  • Posts: 40
Re: request to ymg :select 3d faces between 2 break line
« Reply #2 on: November 13, 2015, 03:15:23 PM »
thank you Mr ymg for reply
actually i insert breaklines after triangulation by a program called ezysurf
it represented edges of cut and fill
so i have to insert other 3dface instead of the one inside breaklines or give it a color or layer

ymg

  • Guest
Re: request to ymg :select 3d faces between 2 break line
« Reply #3 on: November 13, 2015, 06:11:39 PM »
motee-z

Try this, should work with the top of slope line of your road

Very fast hack:

Code: [Select]
(defun c:test ()
   (setq en1 (car (entsel "select first breakline ; "))
         **  (mk_lwp (listpol en1))  
      en1 (entlast)
en2 (car (entsel "select second breakline ; "))
**  (mk_lwp (listpol en2))
en2 (entlast)
en3 (entmakex (list (cons 0 "LINE")
             (cons 10 (vlax-curve-getstartpoint en1))
     (cons 11 (vlax-curve-getendpoint en2))
       )    
             )
en4 (entmakex (list (cons 0 "LINE")
             (cons 10 (vlax-curve-getendpoint en1))
     (cons 11 (vlax-curve-getstartpoint en2))
       )    
             )
   )
   (vl-cmdf "_PEDIT" en1 "_J"  en2 en3 en4 "" "")

   (vl-cmdf "_OFFSET" 0.5 en1 pause "")
   (setq en (entlast))
   (entdel en1)
   
   (vl-cmdf "_ZOOM" "_E")
   
   (setq fence (mapcar 'butlast (butlast (listpol en))))
   (sssetfirst nil (ssget "_WP" fence '((0 . "3DFACE"))))
)


Remain to erase or (entdel en)

I believe that the method for breaklines that you use is flawed.

You should not get that many 3dfaces in the first place.

ymg
« Last Edit: November 13, 2015, 06:22:06 PM by ymg »

motee-z

  • Newt
  • Posts: 40
Re: request to ymg :select 3d faces between 2 break line
« Reply #4 on: November 13, 2015, 07:10:32 PM »
shall i to use sub function from your triang lisp
because the routin can't go on after first line
thank you

ymg

  • Guest
Re: request to ymg :select 3d faces between 2 break line
« Reply #5 on: November 13, 2015, 07:42:14 PM »
motee-z,

Yes, Listpol and mk_lwp are in triang.

All you need to do is load triang

ymg