make 3DFace

make 3DFace

k005
Advisor Advisor
1,332 Views
21 Replies
Message 1 of 22

make 3DFace

k005
Advisor
Advisor

Hello friends,


How can we turn the clicked Closed area into a 3Dface?


Thanks in advance to the helpful friend.

 

 

 

0 Likes
Accepted solutions (2)
1,333 Views
21 Replies
Replies (21)
Message 2 of 22

hosneyalaa
Advisor
Advisor

There is a difference in height
Can you elaborate?

E.gif

0 Likes
Message 3 of 22

k005
Advisor
Advisor

Yes. There is a height difference.


This height will be used as the highest level. That is, a surface must be created according to the 3D length.

 

* I updated the attachment. The previous one was wrong.

0 Likes
Message 4 of 22

hosneyalaa
Advisor
Advisor

@k005 

TRY

 

 

(defun c:Test (/  CUR ED EN I INT LIT PREV PTNEWLST SEL SLEN SS)
 
  (princ "\nSelect LINES objects to Convert 3DFACE : ")
  (setq ss (ssget '((0 . "LINE"))))
  
  (IF (= 3 (sslength ss))
       (PROGN
       (setq i (sslength ss)
        slen i)
       (while (not (minusp (setq i (1- i))))
         (setq en (ssname ss (fix i))
               ed (entget en)
               LIT (CONS (cdr (assoc  10 ed)) LIT)
               LIT (CONS (cdr (assoc  11 ed)) LIT)
               )
         )

       ;;;    komondormrex 
;**********************************************************************************************************************************************************
  
(defun remove_duplicates (_list / duplicateless_list)
	(while _list
		(if (not (equal (car (setq list_element (car _list))) (caar (setq _list (cdr _list)))))
			(setq duplicateless_list (append duplicateless_list (list list_element)))
		)
	)
)
(setq ptnewlst (remove_duplicates LIT))
;**********************************************************************************************************************************************************



 (entmake (list (cons  0 "3DFACE")
                 (cons  8 "00")
                 (cons 10 (CAR ptnewlst))
                 (cons 11 (CADR ptnewlst))
                 (cons 12 (CADDR ptnewlst))
                 (cons 13 (CADDDR ptnewlst))
                 (cons 62 256)
                 (cons 62 4)
                 (cons 70 0)))
       
       ))

       

  
  (princ)
  )

 

 

DD.gif

 

 

Message 5 of 22

k005
Advisor
Advisor

Thank you very much for the answer.


- Instead of selecting the lines, I want to click inside the closed area and perform this operation.


The closed area also meets at a Point (Z). Therefore, this area should be translated...

0 Likes
Message 6 of 22

Sea-Haven
Mentor
Mentor

You could pick a point but how do you find other objects ? You could use a ssget "F" with an expanding shape till it finds 3 items, a good time for you to have a go, you post a lot. Use (repeat 10 would be used to make a 10 sided object, using polar for each point into a list, note add last to list so its closed. Just keep changing the offset distance.

0 Likes
Message 7 of 22

k005
Advisor
Advisor

I thought it should have a logic similar to the Area command for other objects.


What do you mean by sharing too much? We are the explainers.

 

 

0 Likes
Message 8 of 22

Kent1Cooper
Consultant
Consultant

Are there ever more than 3 edges?  If always only 3 or 4, and with the updated sample drawing in which endpoints meet, JOIN could be used to make a 3DPolyline, then 3DFACE used with the resulting vertices.  But if there could be more than 4 edges, more than one 3DFACE would be needed, so there would need to be some figuring out of which edges to use for which 3DFACE, and you would need to consider whether you want any Invisible edge(s), and if so, which one(s).

Kent Cooper, AIA
Message 9 of 22

ronjonp
Mentor
Mentor

@hosneyalaa FWIW, If you check for the existence of the points within your loop you can eliminate the remove duplicates sub.

 

(while (not (minusp (setq i (1- i))))
  (setq	en (ssname ss (fix i))
	ed (entget en)
  )
  (foreach dxf '(10 11) (or (member (setq p (cdr (assoc dxf ed))) lit) (setq lit (cons p lit))))
)

 

 

Message 10 of 22

k005
Advisor
Advisor

More than three... I'm actually going to use this to calculate the surface area of ​​a roof. I wanted


I add another prefix. roof plan

 

 

 

0 Likes
Message 11 of 22

ronjonp
Mentor
Mentor
Accepted solution

@k005 

You could use master ElpanovEvgeniy's triangulate lisp to place the 3dfaces. I've put two functions up top 'foo' which generates the TIN using a selection of lines and 'AAREA' which calculates the total area of selected 3d faces.

ronjonp_0-1736269609780.png

 

Message 12 of 22

k005
Advisor
Advisor

In one word, perfect. Thank you very much.

0 Likes
Message 13 of 22

ronjonp
Mentor
Mentor

@k005 wrote:

In one word, perfect. Thank you very much.


Glad to help! Although the majority of the credit goes to ElpanovEvgeniy.

Message 14 of 22

Sea-Haven
Mentor
Mentor

Just a cooment I have a draw roofs function it uses Pface for each roof plane so could use all those points to work out surface area. Marko-ribar has a nice do roofs lisp that may be useful for drawing the roof in the 1st place. Do a google.

 

Another issue is when looking at the Ronjonp image it may have an error in the roof shape, roofs are normally planes so the right side is made up of 2 - 3dfaces rather than a true plane answer which would be more 3dfaces.

SeaHaven_0-1736389653729.png

 

0 Likes
Message 15 of 22

k005
Advisor
Advisor

Yes, it is planar. But I use 3D face to find the actual value of Surface area - Coverage area. Otherwise, when we look at it as a plan, incorrect or incomplete results will appear.

 

Ribar? I'm hearing this for the first time. If you add the function I will test it.


Thanks.

 

0 Likes
Message 16 of 22

Sea-Haven
Mentor
Mentor

I do apoligise Marko-Ribar has some roof stuff so does Gilles Chanteau. Same I have a house drafting package that includes roofs.

Message 17 of 22

k005
Advisor
Advisor

I understand Ok.

0 Likes
Message 18 of 22

ronjonp
Mentor
Mentor

@Sea-Haven wrote:

...

Another issue is when looking at the Ronjonp image it may have an error in the roof shape, roofs are normally planes so the right side is made up of 2 - 3dfaces rather than a true plane answer which would be more 3dfaces.

SeaHaven_0-1736389653729.png

 


@Sea-Haven 

This scenario was in the sample drawing and the triangulation is correct.

ronjonp_0-1736437649001.png

 

For Marko's ridge line code, it's HERE. I don't know if this is the latest version because there are 20 pages in that thread. 

 

0 Likes
Message 19 of 22

Sea-Haven
Mentor
Mentor

@ronjonp if the original line work is wrong then yes the 3dfaces will not be correct. We can only work with what we are given. Note having spent like 40 years playing with TIN's an improvement to a TIN is to always add breaklines. 

0 Likes
Message 20 of 22

marko_ribar
Advisor
Advisor
Accepted solution

@k005 

Note that if you have hipped roof like you/others presented in pictures, to get area of roof, you just have to divide area of object in floor plan with cosine of pitch angle...

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