Cancel
Showing results for 
Search instead for 
Did you mean: 

Procedural Modeling/Generative Design

Genius
Genius

I wrote a recursion algorithm in the Python/NX Open API to generate these Menger Cubes. No sketching or extrusions, just code.

 

The approach is similar to OpenSCAD and generative design programming languages like Processing http://www.openscad.org/gallery.html

https://processing.org/exhibition/

 

I will post the code later.

mengerlevel3.jpgMenger Cube level 3menger_cube_level2.jpgMenger Cube Level 2menger_cube_level1.jpgMenger Cube Level 1

1 REPLY

Re: Procedural Modeling/Generative Design

Genius
Genius

Note to future self:

 

Before running a dialog box file (.dlx)/python file, 

 

1. Add the following environment variable in Control panel\System

UGII_CUSTOM_DIRECTORY_FILE=<NX install directory>\ugii\menus\custom_dirs.dat

 

2. Add the following lines (or where ever you intend to place your application) to your custom_dirs.dat

 

${UGII_BASE_DIR}\ugopen\SampleNXOpenApplications\Python\BlockStyler\ColoredBlock
${UGII_BASE_DIR}\ugopen\SampleNXOpenApplications\Python\BlockStyler\MengerCube

 

3. Create a new folder called application. Place the dialog box file (.dlx) in the application folder.

ex: \ugopen\SampleNXOpenApplications\Python\BlockStyler\MengerCube\application