Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

random mesh

a0985684202
Explorer

random mesh

a0985684202
Explorer
Explorer

how to draw a 2D mesh of random shapes in Autocad? An example of the desired output is shown below.

0 Me gusta
Responder
316 Vistas
5 Respuestas
Respuestas (5)

Patchy
Mentor
Mentor

draw random points, use C3D and make TIN surface.

0 Me gusta

j.palmeL29YX
Mentor
Mentor

With a little LISP this should be possible (AutoCAD). 

What I did (for testing): 

- Create a number of random placed points (using a random number generator LISP)

- draw lines between these points (triangulate LISP)  (see on the left side in the dwg)

(- because the result of the  triangulate.lsp I used are 3DFaces I converted the faces into lines using the flatten command)  

- put all the lines in a selection set

- delete randomly selected lines from the selection set .   => the result on the right side

 

I did not yet put this all in ONE LISP together, but I'm sure, if I repeat these steps I never will get the same result as shown in the attached example. 

You can refine this idea to your needs.

 

 

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

0 Me gusta

a0985684202
Explorer
Explorer
Could you please send your lisp code?
I know nothing about programming languages
0 Me gusta

Patchy
Mentor
Mentor
0 Me gusta

j.palmeL29YX
Mentor
Mentor

@a0985684202 wrote:
Could you please send your lisp code?
I know nothing about programming languages

If that is true, the LISPs will be nearly worthless for you. 

Nevertheless I post the 3 LISPs which I used in the attached zip.file. 

Perhaps you can "play" with these, following this steps: 

 

1.) load the mesh-test.lsp and run the command "test".

=> a number of randomly placed points in a 1x1 area are created

2.) load the triangulate-2.lsp and run the command "triangulate"

=> after selecting all in step 1 created points a bunch of 3dfaces is created

3.) run the command "flatten" (Express Tools) to convert the 3dfaces to lines.

4.) run the command "overkill" (Express Tools) to delete duplicate lines.

5.) load the del_lines.lsp

=> after selecting all lines (from step 4) a number of randomly selected lines are deleted.

6.) If necessary: Delete (manually) lines, which don't describe a closed area. (In the video were not such lines)

 

For demonstration a video: 

 

 

Again: This suggestion above is far away from a final solution. But perhaps it helps you to refine this idea to your needs.

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

0 Me gusta