• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

extract the coordinates of the vertices of each single composite triangle a dye

  • Thread starter Thread starter salviotto
  • Start date Start date

salviotto

Guest
Hello I press that it is my first post on this forum, but I immediately come to the problem.

I have a model of the ground in triangles (tin) made with a sw of topography.
I have the need to pull out the mathematical data of the digital model therefore since obviously my topographic sw does not, I am trying to obviate with autocad, precisely with the foreign command data.

I would like to extract an ascii containing the data of each triangle, i.e.:
id( not necessarily),n,e,q,n,e,q,n,e,q - that is the 3d coordinates of the three vertices that make up every single triangle.

I tried with extra data, but when I select the 3d face object it doesn't give me any geometry parameter, and then I ask for help to the community, someone of you (like the guru tristan) has an idea of how to do it?

Thank you in advance, anyone who can help me

greetings marco
 
with extinct is not possible, see if this lisp can go.
Code:
;; writes in a txt file the coordinates of the vertices of the selected 3dfaces;
;; 14/1/2013 - cattaneo gian paolo;;

(defunc c:3df2file (/ 3df e1 n p2 p3 v1 listv nf e2)
(if (setq 3df (ssget '(0 . "3dface")))))
(progn)
(repeat (setq n (sslength 3df))
(setq e1 (ssname 3df (setq n (1-n))))
(setq p1 (cdr 10 (entget e1))))
(setq p2 (cdr (assoc 11 (entget e1))))
(setq p3 (cdr 12 (entget e1))))
(setq v1 (list p1 p2 p3))
(setq listv (cons v1 listv)
)
(if (setq nf (getfiled "txt file" to write) (getvar "dwgprefix") "txt" 1 )
(progn)
(setq f (open nf "w"))
(repeat (length listv)
(setq e2 (car listv)
(write-line)
(rtos (car e2))
(rtos) ","
(rtos) ","
(rtos (car) ","
(rtos) ","
(rtos) ","
(rtos (car) ","
(rtos)
(rtos)
)
♪
)
(setq listv)
)
(close f)
)
)
)
(alert (strcat "no 3dface selected")
)
(princ)
)
 
Thank you very much, but you should also tell me how to use it....
Sorry but my level is not even comparable to yours.
 
copy the text in the pane and paste it into a win note block file. save it with any name but from the "lsp" extensions, then take the file and drag it into the autocad design. last step, write to the 3df2file prompt and follow the instructions :wink:
 
I'm sorry if I'm gonna break the boxes, but I'm not able to cuff the lisp.
always regarding the above, would it be possible to export an id of every triangle?

Would it also be possible to carry out the reverse situation? or read a txt formed by: id triangle,e,n,q,e,n,q,e,n,q?

Thank you in advance

a greeting marco
 
What do you mean by id?
a number given by you or an identification given by autocad.

for the second question the answer is (clearly) yes.

:smile:
 
I have to somehow identify the triangles, so it would be better an id given by me so that maybe 1,2,3,4,5,6,...., but to the bad if the thing is not possible I can also arrange with an identifier given by autocad

thank you again for the celery answer
 
As soon as I have a moment I see what can be done.

curiosity, about how many 3dfaces you have to treat?
 
In fact several ....... 15000 is the model to triangles of a road under construction.
I know you'll think the best thing would be a sw of topography, and I have it (Leonardo) but it's what doesn't do it I think it might be the topko serum, but I'm not sure.

Anyway thank you again
 
In fact several ....... 15000 is the model to triangles of a road under construction.
I know you'll think that the best thing would be a sw of topography, and I have it (Leonardo) but it's what doesn't do it I think it might be the topko sierra, but I'm not sure....
I do not remember that the products of sierrasoft also generated the id of triangles.
the prost from which I remember did not. I don't know the later versions of mine, on which it's a bit that I don't take my hand.
 
3df2txt insert a numbering at the 3dfaces in the dwg and then export everything to a txt.
txt23df draws 3dfaces and numbering by withdrawing data from txt
imported 3dfaces are drawn on the layer "3df" the numbering on the layer "3df_n"
to change layers look for these strings
'(8. "3df")
'(8 . "3df_n"
and replace the part in red.


both lisp use current height and text style.

on a dtm of 15000 triangles took 4/5 seconds to perform the test.


p.s.: for loading the lisp take a look at This is thread.
 

Attachments

gp I don't know how to thank you, it works perfectly!...I know that probably for you it was a boy game or almost, but I just can't compliment you, and thank you again.
a cordial greeting
Mar
 
a drink would cost to sage x €uro, with lunch we are at 6x €uro minimum. Not bad as a businessman gp!
 
Unfortunately I don't have the truffle dog...... but if you were to pass by siena don't worry that something good is found!....... Of course, astemio.... .
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top