Mesh Generation Basics

From IncendiaWiki
Jump to: navigation, search

Introduction

This tutorial is a tentative start for exporting meshes using Incendia Expanded. Consider the fact that this version of Incendia is experimental and probably some elements of the tutorial will change on the future.

First Steps

EX Mesh Tutorial 1 - First Steps.jpg

This tutorial requires a parameter file that you can download from here:IFS Shell

  1. Use the Load Parameter Button to load the provided parameter file (any fractal can work for this tutorial, but the results can vary).
  2. Go to the Extra tab



The Volume Generator Panel

EX Mesh Tutorial 1 - The Volume Generator.jpg

Let's see an overview of the basic controls:

  1. The Volumetric Resolution, This control defines the resolution of the volumetric matrix. For this tutorial, select the first option (200x200x200x voxels).
  2. The Start Volumetric Render button, here is on where the volume calculation starts. Also, several other options will become visible once you start the calculation.
  3. Fill Hollow Baseshapes when possible, This option is not covered by this tutorial, but its used for filling baseshapes that are simple shells, such as the sphere. This lowers drastically the triangle counts of the output meshes.

Press the Start Volumetric Render button to continue with the tutorial.

Overview of the Volume and Mesh Export Controls

EX Mesh Tutorial 1 - The Volume Generator and The Mesh Generation panel.jpg

Let's see a more complete overview of the Volume and Mesh generation options:

  1. The Close the Volumetric Mode, this button stops the volume generator and returns Incendia to the standard mode.
  2. The Mesh Algorithm control, This control shows three different mesh generations algorithms that you can use for exporting meshes. All three vary in quality and in speed.
  3. The Density Threshold slider. This slider let you define how thin or thick the mesh walls will be, later in the tutorial you will see the effects of this option.
  4. The Export Volume as STL Mesh button, Here is on where the actual mesh export happens, once you press this button, Incendia will ask for a filename and a directory and will begin to export the mesh from the volumetric matrix.
  5. The Render Wheel, If you have pressed the Start Volumetric Render button, this wheel will be turning meaning that the volumetric calculation is in process, it only stops if you start a mesh export or close the volumetric mode.
  6. The Preview Panel. Still I haven't devised a way to produce a real-time preview of the volumetric generation, so please, just ignore this. Generating a fractal volume will take less than a minute, so actually you didn't need it. I will try to make a realtime preview for the next iteration of Incendia Expanded.



The Box Algorithm

EX Mesh Tutorial 1 - The Box Algorithm.jpg

  1. Select the Boxes option in the Mesh Algorithm. The Boxes algorithm is the simplest and fastest of the three presented algorithm, it basically checks if a voxel is occupied or not and the mesh is generated without any interpolation (by using the Marching Cubes Algorithm).
  2. Press the Export Volume as STL Mesh button to start the the mesh output. Incendia will ask for a filename and for a directory. Use "Tut1.stl" as a filename.



The Exporting process

EX Mesh Tutorial 1 - Mesh Exporting.jpg

  1. When Incendia is exporting the mesh, a percent counter becomes visible and begins to fill, wait it to be full.



The Density Algorithm

EX Mesh Tutorial 1 - The Density Algorithm.jpg

  1. Once the mesh export is finished, select the Density option in the Mesh Algorithm control. The Density algorithm performs a simple averaging for every empty voxel from the surrounding voxels. The speed is slower than the Boxes algorithm but the quality of the resulting meshes is very good.
  2. Press the Export Volume as STL Mesh button to start the the mesh output. Incendia will ask for a filename and for a directory. Please use another filename "Tut2.stl", so later you can see differences between the algorithms. Is important to note the fact that you didn't need to recalculate the volume for every mesh export that you execute.
  3. Wait for the percent counter until it is filled.



The Gaussian Density Algorithm

EX Mesh Tutorial 1 - The Gaussian Density Algorithm.jpg

  1. Once the mesh export is finished, select the Gaussian Density option in the Mesh Algorithm control. The Gaussian Density algorithm performs a complex gaussian averaging for every empty voxel from the surrounding voxels. The speed is very slo but the cuality of the meshes is very good.
  2. Press the Export Volume as STL Mesh button to start the the mesh output. Incendia will ask for a filename and for a directory. Please use another filename (Tut3.stl for example).
  3. Wait for the percent counter until it is filled.



The Density Threshold parameter

EX Mesh Tutorial 1 - The Density Threshold parameter.jpg

You can skip this section tutorial unless you want the effects of the Density Threshold parameter over the mesh generation algorithm.

  1. Change the Density Threshold parameter to a lower value.
  2. Select the Boxes option.
  3. Export the meshes (use different filenames than the previous "Tut1.stl", "Tut2.stl" and "Tut3.stl" since these are are alredy used for the tutorial) and wait for it to finish, once its done, repeat with the Density and the Gaussian Density options.



Closing the Volume Generator

EX Mesh Tutorial 1 - Close the Volumetric Mode button.jpg

  1. Press this button in order to return to Incendia normal render mode. This also erases the content of the volumetric matrix.



Using Meshlab with the generated meshes

MeshLab is an open source program dedicated to the operation of complex 3D meshes. Since it is also very easy to use, I have selected it for this 3D mesh tutorial. You can download MeshLab from Sourceforge.
Once you have downloaded and installed MeshLab, you can open the three stl files that you have created with this tutorial. Here is a preview of the three files:


As you already noticed, there are big differences between the three mesh generation algorithms.

The Laplacian Smooth filter on Meshlab

In MeshLab, theres a wide array of filters for operating with meshes. One of these filters is the Laplacian Smooth Filter, that is used for smoothing some very noisy meshes:

On Incendia Mesh Export algorithms, the Box algorithm produces the most noisy meshes, since its stores the actual content of the volumetric matrix. By using MeshLab Laplacian filter, you can get very good results from these meshes.
EX Mesh Tutorial 1 - Selecting Meshlab Laplacian Filter.jpg

  1. Select the Filter Tab on MeshLab.
  2. On the Filter Tab, select the Smoothing, Fairing and Deformation option.
  3. And then select the Laplacian Smooth option.

Now you get the Laplacian Smooth windows:

EX Mesh Tutorial 1 - Meshlab Laplacian Filter.jpg

  1. Use the default values, higher the number of steps, smoother the details. Press the Apply button.

Once MeshLab finish the filter, your mesh will looks like:

EX Mesh Tutorial 1 - Meshlab Laplacian Filter Result.jpg

Lowering the face counts with Meshlab Quadric Egde Collapse Decimation Filter

Fractal Meshes tend to the very large, since most fractals are infinitely detailed. Most 3D programs can't handle very big meshes and in many cases is necessary to reduce the triangle counts. MeshLab has a filter called "Quadric Egde Collapse Decimation" that I have found useful for reducing the face count of large meshes.
This tutorial uses the mesh produced by the Gaussian Density filter "Tut3.stl"

EX Mesh Tutorial 1 -Selecting Meshlab Quadric Egde Collapse Decimation filter.jpg

  1. Select the Filter tab.
  2. On the Filter tab, select the Remeshing, Simplification and Reconstruction option.
  3. Then, select the Quadric Egde Collapse Decimation option.

Now you get the Quadric Egde Collapse Decimation windows:

EX Mesh Tutorial 1 - Meshlab Quadric Egde Collapse Decimation filter.jpg

  1. Change the Target Number of Faces to 7000 and press the Apply button.



EX Mesh Tutorial 1 - Meshlab Quadric Egde Collapse Decimation result.jpg

Exporting the result as OBJ

Some 3D programs, such as Bryce, didn't support STL files. You can use MeshLab to export the mesh as a OBJ file (Bryce works with that type of meshes).

EX Mesh Tutorial 1 - Meshlab Save As.jpg

  1. In the File Tab, select the Save As option and in the file type, select the Alias Wavefront Object (.OBJ)



The Final result

Here is how the result mesh looks in Bryce:

EX Mesh Tutorial 1 - Bryce Rendered Mesh.jpg