Author Topic: Triangulation (re-visited)  (Read 312797 times)

0 Members and 2 Guests are viewing this topic.

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #720 on: March 02, 2017, 07:33:06 PM »
Hi, thanks for answering, I'm going to test your routines, a question, do you happen to have a routine to exchange triangles ?? Thank you
Thanks for help

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Triangulation (re-visited)
« Reply #721 on: March 03, 2017, 05:22:56 AM »
I don't know, do you think on swap 2 adjacent 3DFACEs (triangles)... If so, try this :

Code - Auto/Visual Lisp: [Select]
  1. (defun c:swap2adj3df ( / unique _reml ss 3df1 3df2 pl1 pl2 ppl prl )
  2.  
  3.   (defun unique ( l )
  4.     (if l (cons (car l) (unique (vl-remove-if (function (lambda ( x ) (equal x (car l) 1e-6))) l))))
  5.   )
  6.  
  7.   (defun _reml ( l1 l2 / a n ls )
  8.     (while
  9.       (setq n nil
  10.             a (car l2)
  11.       )
  12.       (while (and l1 (null n))
  13.         (if (equal a (car l1) 1e-8)
  14.           (setq l1 (cdr l1)
  15.                 n t
  16.           )
  17.           (setq ls (append ls (list (car l1)))
  18.                 l1 (cdr l1)
  19.           )
  20.         )
  21.       )
  22.       (setq l2 (cdr l2))
  23.     )
  24.     (append ls l1)
  25.   )
  26.  
  27.   (prompt "\nSelect 2 adjacent 3DFACEs...")
  28.   (setq ss (ssget "_:L" '((0 . "3DFACE"))))
  29.   (if (and ss (= (sslength ss) 2))
  30.     (progn
  31.       (setq 3df1 (ssname ss 0) 3df2 (ssname ss 1))
  32.       (setq pl1 (mapcar (function cdr) (vl-remove-if-not (function (lambda ( x ) (vl-position (car x) '(10 11 12 13)))) (entget 3df1))))
  33.       (setq pl2 (mapcar (function cdr) (vl-remove-if-not (function (lambda ( x ) (vl-position (car x) '(10 11 12 13)))) (entget 3df2))))
  34.       (setq pl1 (unique pl1) pl2 (unique pl2))
  35.       (if (= 4 (length (unique (append pl1 pl2))))
  36.         (progn
  37.           (setq ppl (_reml (append pl1 pl2) (unique (append pl1 pl2))))
  38.           (setq prl (vl-remove-if (function (lambda ( x ) (vl-position x ppl))) (append pl1 pl2)))
  39.           (entdel 3df1)
  40.           (entdel 3df2)
  41.           (if (minusp (- (* (car (mapcar '- (car prl) (car ppl))) (cadr (mapcar '- (cadr prl) (car ppl))))
  42.                          (* (cadr (mapcar '- (car prl) (car ppl))) (car (mapcar '- (cadr prl) (car ppl))))
  43.                       )
  44.               )
  45.             (entmake
  46.               (list
  47.                 '(0 . "3DFACE")
  48.                 (cons 10 (car ppl))
  49.                 (cons 11 (car ppl))
  50.                 (cons 12 (cadr prl))
  51.                 (cons 13 (car prl))
  52.               )
  53.             )
  54.             (entmake
  55.               (list
  56.                 '(0 . "3DFACE")
  57.                 (cons 10 (car ppl))
  58.                 (cons 11 (car ppl))
  59.                 (cons 12 (car prl))
  60.                 (cons 13 (cadr prl))
  61.               )
  62.             )
  63.           )
  64.           (if (minusp (- (* (car (mapcar '- (cadr prl) (cadr ppl))) (cadr (mapcar '- (car prl) (cadr ppl))))
  65.                          (* (cadr (mapcar '- (cadr prl) (cadr ppl))) (car (mapcar '- (car prl) (cadr ppl))))
  66.                       )
  67.               )
  68.             (entmake
  69.               (list
  70.                 '(0 . "3DFACE")
  71.                 (cons 10 (cadr ppl))
  72.                 (cons 11 (cadr ppl))
  73.                 (cons 12 (car prl))
  74.                 (cons 13 (cadr prl))
  75.               )
  76.             )
  77.             (entmake
  78.               (list
  79.                 '(0 . "3DFACE")
  80.                 (cons 10 (cadr ppl))
  81.                 (cons 11 (cadr ppl))
  82.                 (cons 12 (cadr prl))
  83.                 (cons 13 (car prl))
  84.               )
  85.             )
  86.           )
  87.         )
  88.         (progn
  89.           (prompt "\nSelected 2 3DFACEs not adjacent... Quitting, retry routine again with valid selection...")
  90.           (exit)
  91.         )
  92.       )
  93.     )
  94.     (prompt "\nEmpty sel. set or selected more or less than 2 3DFACEs... Retry routine again with valid selection...")
  95.   )
  96.   (princ)
  97. )
  98.  
« Last Edit: March 03, 2017, 06:00:08 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #722 on: March 03, 2017, 12:45:08 PM »
ribarm, Oh well, thanks for everything !!!
Thanks for help

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Triangulation (re-visited)
« Reply #723 on: March 05, 2017, 11:41:43 AM »
ribarm, Oh well, thanks for everything !!!

You're welcome...
New input here :
https://www.theswamp.org/index.php?topic=9042.msg576276#msg576276

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

mailmaverick

  • Bull Frog
  • Posts: 494
Re: Triangulation (re-visited)
« Reply #724 on: March 16, 2017, 07:46:31 AM »
Hi All

First of all I would like to Congratulate and Thank all those who have put in so much of effort in creating this wonderful Triangulation Routine. I'm sure no other forum in the entire World Wide Web would have a LISP routine matching this capability.

My suggestion - When I used the Routine for creating Voronoi Diagrams, I found that the Voronoi Diagrams extend to a large extent outside the boundary of the project area which are difficult to trim because they are regions.

Is there a possibility that a feature can be added in Triangulation routine to limit the TIN and Voronoi regions upto a selected Closed Boundary, i.e. Trim Along the Selected Boundary.

Thanks.
« Last Edit: March 16, 2017, 07:54:25 AM by mailmaverick »

rw2691

  • Newt
  • Posts: 133
Re: Triangulation (re-visited)
« Reply #725 on: March 16, 2017, 08:56:43 AM »
mailmaverick,

The function BOUND builds a polyline boundary that automatically trims the TIN. It will, however, leave a few TIN's to be deleted manually. But it is also easy enough to customize the code to be more exhaustive with the process. You can search this forum thread for "BOUND" to see how it works. But I believe that the Veroni frames are not trimmed.

Rick
Hippocrates (400BC), "Life is short, craft long, opportunity fleeting, experiment treacherous, judgment difficult."

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #726 on: March 30, 2017, 03:52:17 PM »
Hi ymg . What happened with this project ? Any new update !!  :-)

xuanxiang

  • Guest
Re: Triangulation (re-visited)
« Reply #727 on: July 07, 2017, 07:16:29 AM »
Thanks for the upload, I will take a look at them and revert.

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #728 on: July 16, 2017, 10:32:59 AM »
Any new update??

anhquang1989

  • Newt
  • Posts: 74
Re: Triangulation (re-visited)
« Reply #729 on: August 06, 2017, 05:09:10 AM »
Help me!
I used lisp Triangulation v.0.6.7. But I want to create a Tin surface form Autocad like C3D.

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #730 on: August 06, 2017, 05:13:56 AM »
perhaps you need to add some break lines or you have a missing point !!!
« Last Edit: August 06, 2017, 05:18:11 AM by Topographer »

anhquang1989

  • Newt
  • Posts: 74
Re: Triangulation (re-visited)
« Reply #731 on: August 06, 2017, 07:43:31 AM »
I deleted some points to simplify the test so there is a difference between Test.dwg files.
You may misunderstand me. My main goal is to create Tin surface from 3d face and 3d point  same as when creating surface in civil 3d.


serkancavuslar

  • Mosquito
  • Posts: 3
Re: Triangulation (re-visited)
« Reply #733 on: August 06, 2017, 12:41:15 PM »
https://knowledge.autodesk.com/support/autocad/learn-explore/caas/screencast/Main/Details/11fb538e-dde8-4a5d-8d48-21e813d4fe78.html


Tek bir komut ile 5~6 ayda yapıla bilecek bir çok işi 2-3dk da Doğru, Eksiksiz, Kaliteli, Hızlı ... yapılmasını sağlıyor.
Yani normal AutoCAD komutları ile çalışmak yerine 1 komut kullanarak 5~6 ay kazanmış oluyorsunuz.
Yeni "Zaman Makinesi" "Time Machine" diye biliriz.
 
Noktalar "POINT" referans alınarak,
Belirtilen Aks-Cam Mesafesine,
Belirtilen İş emri ölçülendirme stiline,
Belirtilen Başlangış Poz Numarasına göre,
3d "Aks, Levha, Cam, Profil, Çelik, Referans Noktası, Poz Numarası, (Mantaj Paftası)
2d "Levha, Cam, Profil, Çelik, Poz, Antet, Detay, Referans Noktası, Ölçülendirme, açılımı ile birlikte" (İş Emri)
2-3dk da çizmekte ve CNC Step dosyalarını hazırlamaktadır.
 
Free Form veya Amorf Cephe
Dizaynı, Montajı, İş Emri En Zor ve hataların en çok yapıldığı işlerden sadece bir tanesidir.

anhquang1989

  • Newt
  • Posts: 74
Re: Triangulation (re-visited)
« Reply #734 on: August 07, 2017, 12:16:07 AM »
Thank you for the information.