### Author Topic: Triangulation (re-visited)  (Read 339586 times)

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

#### 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: 3327
• 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)

#### mailmaverick

• Bull Frog
• Posts: 495
##### 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 #732 on: August 06, 2017, 12:36:29 PM »

#### serkancavuslar

• Mosquito
• Posts: 3
##### Re: Triangulation (re-visited)
« Reply #733 on: August 06, 2017, 12:41:15 PM »

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.