Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modeling a terrain as a solid (not a mesh) in Autocad, with a smooth surface

60 REPLIES 60
SOLVED
Reply
Message 1 of 61
teocruz105
6463 Views, 60 Replies

Modeling a terrain as a solid (not a mesh) in Autocad, with a smooth surface

Hi. I've been facing problem creating a solid 3D terrain in AutoCad. I'm using DRAPE to create a mesh from curve level. the Mesh looks great. But I need it as a solid. So when I convert it to a solid, the surface looks really bad. I need it as a solid to edit it as such, and the then to export it to STL. The stl file will look as bad as the solid. Does any one know a procedure which allows me to creat a decent solid terrain in AutoCad as solid? I posted this question here some weeks ago( https://forums.autodesk.com/t5/autocad-forum/modeling-a-terrain-solid-not-a-mesh-with-a-soft-surface...

and I received good adviceces, but the issue is not solved yet. I am attaching a file that can better explain what I'm talking about.

60 REPLIES 60
Message 21 of 61
j.palmeL29YX
in reply to: j.palmeL29YX

... and if you want to know what I did: I hope >>this video<< will be self explaining. 

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 22 of 61
Anonymous
in reply to: teocruz105

Hi Everyone,

 

I have a model in revit which consists of building and terrain. I approached it to take from two way, one is from placemaker revit and the other is from SOSI. my main intension is to perform CFD simulation in simcentre star ccm+ and i need a solid model of terrain and building. But the problem that i am having now is that there is the building protusion beneath the terrain level both in Placemaker revit file and also in SOSI file. Can anyone help me out to deal with this problem. I have herewith attached a revit and autocad file with the picture. I would be really greatful for your reply.

thank you

Message 23 of 61
DentonYoder
in reply to: teocruz105

I did that the hard way... I wrote a lisp routine to draw triangular columns following the tin.  Then sliced each column with the triangles vertices deleting the top half.  Then unioned all the triangles together on the bottom.

Message 24 of 61
j.palmeL29YX
in reply to: Anonymous

Is the attached attempt what you want to achieve? 

(To see the result better move the block away or disable its visibility)

 

 

 

 

 

If my reply solves your problem, click the "accept as solution" button. This can help others find solutions faster

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 25 of 61
Anonymous
in reply to: teocruz105

Hi,

thanks for your reply. i would be happy if you could share the video of what you did. Actually i am working on a real model of a small area in Oslo. the terrain and the buildings that i attached previously are real and building have exact height. The problem with the model is the buildings exceeding the terrain underneath. If you see below the terrain then you can see that buildings are protruding beneath. Norway have their mapping authority which works works in topography and geodata in SOSI file format and that is most reliable to work with geodata in Norway. I got the same model from two different source, one from placemaker revit and one from SOSI format via Novapoint. In both the format building seems to be protruding underneath. buildings are not exactly on the terrain surface with no protusion underneath. Can anyone suggest any idea to deal with it. i have attached  picture and the dwg format of what i really want to convey. Thank you

Message 26 of 61
j.palmeL29YX
in reply to: Anonymous


@Anonymous wrote:

 

building seems to be protruding underneath. buildings are not exactly on the terrain surface with no protusion underneath. 


Neither (not exactly on the terrain surface) nor (no protusion underneath)? 

Hmm, I don't understand what you want to get. (See attached dwg). 

Can you explain more detailed or show us a sketch what you want ...

 

[EDI]: attachment updated

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 27 of 61
Anonymous
in reply to: teocruz105

Hi 

i would like to achieve number  2 with solid terrain. Can you send me the video of how you did also. As i will be working on bigger area afterwards. And is it possible to make polymeshes buildings also solid? This is not in this case, but i have buildings in polymeses in another model.

thank you

Message 28 of 61
j.palmeL29YX
in reply to: Anonymous

>>Video_1<<  (Create terrain Surface): 

To "convert" the Polyfacemesh into a surface object I do this: 

- Explode the polyfacemesh -> 3DFaces

- Convert the 3DFaces into planar surfaces (convtosurface command)

- merge all planar surfaces to one complex surface (union command)

Keep in mind: 

If you can not union all planar surfaces at once, you have to split this task in several parts. Always when you get an error message (I don't know why AutoCAD can't solve the issue at once), decrease the number of planar faces to add. In the video you can see this from 2:19 to 11:50 (I recorded the video in real time without snipping). 

At the end you get one surface which you need in the next steps. 

 

>>Video_2<< :

Here I show how you can (and must) convert the buildings into a solid 

- explode the block -> polyfacemeshes

- explode the meshes -> 3DFaces

- convert to surfaces (convtosurface)

- convert to solid (sculpt)

 

and then slice the volume underneath the terrain using the surface which was created above. 

 

>>Video_3<< : 

Here a possibility how you can create a terrain solid. 

Create a copy of the terrain surface in the whished distance, create box and slice the box twice. 

(My first thought was to thicken the terrain surface but that doesn't work). 

 

 

 

 

 

If my reply solves your problem, click the "accept as solution" button. This can help others find solutions faster

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 29 of 61
Anonymous
in reply to: teocruz105

hi thank you. Can you try to make solid both buildings and terrain in this model. If yes please send me the video as well. This is another model from sosi and is more real. 

Message 30 of 61
j.palmeL29YX
in reply to: Anonymous


@Anonymous wrote:

Can you try to make solid both buildings and terrain in this model. If yes please send me the video as well.  


 

In your "sosi new,dwg" I don't find any buildings. Only a terrain Polyfacemesh. 

And I don't understand what you expect or hope to see in a new video. If you follow the steps in Video_1 and Video_3 above you will get >>this result<< (an about 75 MByte dwg file). The only annoying: You need some patience, because AutoCAD (and my laptop) have hard to work with this huge file. 

What is your problem? 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 31 of 61
j.palmeL29YX
in reply to: DentonYoder


@DentonYoder wrote:

I wrote a lisp routine ...


 

Can we see this .lsp file? 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 32 of 61
DentonYoder
in reply to: teocruz105

I just uploaded the program  3dfcube.lsp  You will want to do the following steps before running it.

I wrote the program to make a 3d solid from a civil-3d surface.

1. Copy your drawing to a new file... or copy your surface, because I'm going to explode this one.

2. View your drawing in an isometric angle.  This turns the surface into a tin view

3. Explode the surface.  Now it will stay a 3d face view.

4. Explode it again.  Now it is individual 3dfaces.

5. Freeze all your layers except the 3dfaces.

6. create a new layer where you want the solid.

Run the program entering a base elevation and top elevation.

The program will make a solid triangular column from the base to the top, then slice it with the coordinates of the 3d face, keeping both top and bottom sides.  My student wanted to keep the top, but you can just as easily keep the bottom...

Turn your drawing to a section view and delete the half you don't want to keep... using a fence or crossing box.  You are free to union what is left if you want, or leave them individual.  For me, it depended on the size.

Message 33 of 61
DentonYoder
in reply to: teocruz105

I wrote that real quick about 10 years ago, and didn't put time into error handling or comments.  It was a one time use thing for a grad students who was modeling a terrain for a watershed project.  If you have a bunch of buildings and know their height, you could extrude them all over the place... if you want them to chop off exactly on the surface:

1. Union your surface.

2. Copy it, so you have two.

3. Subtract (select your buildings) enter, then select one of your surfaces.

This will chop the bottom off of all your buildings flush with the surface.  Has AutoCAD come up with a subtract but keep the original yet?  I hate having to copy everything before I can do a subtract!

Message 34 of 61
DentonYoder
in reply to: DentonYoder

you may want to add a line:
(setvar "cmdecho" 0)
near the top to turn off command echo; or you will watch all the text streaming by...
Message 35 of 61
j.palmeL29YX
in reply to: DentonYoder

Inspired by the LISP of @DentonYoder I've had another idea how to create a solid terrain. 

- Explode the Polyfacemesh into 3DFaces

- Extrude all faces, using the "Direction" option of the extrude command (this option was not available in older ACAD versions). As direction use a vector which describes the wanted thickness of the terrain.    

 

If that would work, we could create a solid terrain with very little effort. 

But unfortunately we often find some 3DFaces which can not be extruded. 

To discuss this problem I started a new thread >>here<<. If you're interested (until now we don't have a solution) follow there. 

 

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 36 of 61
j.palmeL29YX
in reply to: Anonymous


@Anonymous wrote:

Can you try to make solid both buildings and terrain in this model. If yes please send me the video as well. This is another model from sosi and is more real. 


 

Did my answer (Post #30) help you to solve your problem? If yes pick the "Accept solution" button please. 

If not: did you try what I suggested in Post #35. If you read the thread which I linked above ("Why can this 3DFace not be extruded") you will see, that the problem I mentioned in Post #35 is resolved. 

Again in short words: 

- Explode the Polyfacemesh  to 3DFaces

- Convert the 3DFaces to regions

- remove all regions which stay vertically to the XY-plane

- Extrude all remaining regions using the "Direction" option to a thickness of your choice. 

A result file is attached. 

- if you want, merge all 3DSolids to ONE 3DSolid. 

 

The error message during the extrude command is caused by only one of the regions. In the attached result dwg you find this corrupt region on the frozen layer "Failure". (To see it better I moved it 500000 along the X-axis). Remove this region from the selection set of the extrude command. 

 

If you need another thickness (I chosed 5000) you can use the attached "terrain_regions.dwg"  and launch the extrude command with another "Direction" value. (You will need some patience until you get the result).

 

HTH

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 37 of 61
j.palmeL29YX
in reply to: j.palmeL29YX

... and here still the 3DSolid dwg  (Upload failed above). 

 

 

HTH

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 38 of 61
Anonymous
in reply to: teocruz105

Hi, 

 

Thanks for your input but the previous model did not work for me and i had to drop my plans with that model. I am now working with the flat terrain and with the bigger area but not sure if it also works for me. Can you please try to make the terrain solid for this model as well. you can put around  1000 thickness or even less may be around 500. I tried to follow your video but could not follow it completely. And also please share me full video of what you did. So that next time i will try it myself.

Thank you so much

Message 39 of 61
j.palmeL29YX
in reply to: Anonymous


@Anonymous wrote:

 

Can you please try to make the terrain solid for this model as well.


 

Are you sure you posted the right dwg? 

In your "Downtown 1-0002 - 3D View - 3D View 1.dwg" you have a plain, flat terrain. If you need a solid terrain, you can draw a simple box. Even if I think a video for that is not necessary, here it is: 

>>video<<

 

 


the previous model did not work for me and i had to drop my plans with that model.

What did not work? What do you try finally to get? What do you plan with the models? What do you want to achieve? Maybe AutoCAD is an unsuitable software for your intentions?

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 40 of 61
j.palmeL29YX
in reply to: j.palmeL29YX

Maybe you need (now or later?) also the buildings as 3DSolid. (That would make sense for me). 

That's not so simple to do as to create a solid terrain. 

 In >>this video<< I show how this can be done. 

 

Some additional explaining words: 

- Explode the block reference -> a bunch of Polyfacemeshes
- Explode the Polyfacemeshes -> a bunch of 3DFaces. (To reduce the duration of the video I snipped some minutes while nothing happened because the computer/AutoCAD was busy).
- Convert the 3DFaces to regions (also snipped).
Unfortunately some of the 3DFaces were rejected and the regions were not created.
To solve this problem I wrote a small (quick and dirty) LISP-Routine.
- load the attached Lisp routine mreg-pa. (I'd suggest to use the compiled .fas file, it runs more quickly. Of course you also can use the .lsp as well, if you want to waste your time 😉 )
If you have questions about the LISP, ask.
- run the LISP- command mreg-pa. This needs a while - in the video are about 20 min snipped.
- The result: Based on the geometry of the remaining 3DFaces are new regions created.
- Delete the 3DFaces. (This also can be don in the LISP - I did not).
- Set the UCS back to the World-UCS (should also be done better in the LISP 😞 ).
- move the first created regions back to their initial position.
- Create the 3DSolid using the surfsculpt command. (5 min snipped).
- DONE. All buildings are one 3DSolid. 

 

Here the source code of the LISP: 

(defun c:mreg-pa (/ s n i p1 p2 p3 p4 en ed)
  (setvar "osmode" 0)
  (if (setq s (ssGet))
    (progn
      (setq i 0
	    n (sslength s)
      )
      (while (< i n)
	(setq en (ssName s i))
	(setq ed (entget en))
	(command "_ucs" "_ob" en)
	(setq p1 (trans (cdr (assoc 10 ed)) 0 1)
	      p2 (trans (cdr (assoc 11 ed)) 0 1)
	      p3 (trans (cdr (assoc 12 ed)) 0 1)
	      p4 (trans (cdr (assoc 13 ed)) 0 1)
	)
	(command "_pline" p1 p2 p3 p4 "c")
	(command "_region" "_l" "")
	(setq i (1+ i))
      )
    )
  )
  (princ)
)

 

 

HTH

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report