InStep Studio

INSTEP STUDIO 3D

Tutorial 5 - Modifying Body Data

Working with Mesh/Polygon data on a full-body level is where the InStep application is most comfortable. The most common scenarios are those where data has been created or imported by other applications such as constructive solid modelers or 3D scanners. These applications will frequently generate mesh data that contains a very large number of facets with either a solid or shell representation of the final part(s).
The Bodies Tab page provides some tools to make working with these shapes more appropriate for the final conversion steps. In this tutorial we will look at the following items:

  • Converting Shell bodies to Solids
  • Simplifying/Decimating Dense Solids
  • Modifying the Mesh of a body

Other options for Reading/Learning

Alternatively, you may want to
Download as PDF
Watch the YouTube Video

The model file of the Lady is originally found on GrabCAD and available here:
Example Lady File (STL)
A partial shell-mesh of this was obtained for the purpose of this Tutorial using Blender and is provided here:
Example (Shell) Lady File (STL)

Please click on the items below as we progress through this tutorial

Here we will use the partial, shelled (i.e. does not represent a closed volume) body given in the second link above. We process the import using these steps:

  1. File > Import File
  2. Select 'lady_shell_tutorial5.stl' and click 'Open'
  3. Click on Polygons Tab page
  4. Click the 'Issues' Tool to see the boundary/open edges
  5. Click on Bodies Tab page

Using the Issues tool, we have verified that there is one boundary but it does not form a perimeter that could be considered a hole (and therefore the hole closure tool would likely provide an unusable result... you may want to try this to see the results.
The import results in the surface-body shown in the figure below (Bodies Tab selected):

Shell body of Lady
Imported Shell Body of Lady

Though a number of CAD applications can work with shell (surface) bodies directly, we will proceed to convert this into a solid body at this point. The process we will use consists of these steps:

  1. Click the Thicken Tool, this will select the Thicken Options (active by default)
  2. We will use a Local thickening method with a parameter of 0.5
  3. For the perimeter, we want to create Quadrilateral surfaces so we will turn on the 'Use Quads' option.
  4. As there is only one Body, the 'All Bodies' option is the only option, otherwise we would select the body and use the 'Selected Bodies' option
  5. Click the 'Apply' button to process the data and update the display with the newly formed data

After a few seconds, the result is shown. With very thin sections, the visual representation sometimes 'bleeds' through and some surfaces look like they have a slight shadow or similar. This is only due to the limits of the graphical capabilities, when zooming in closer, those items will disappear.
With the option to use Quads, the result is that there is now a mixed set of facet types so we should no longer perform other task on this.
We will switch to the Features Tab and click the 'Triangles' tool. This option converts all non-triangular surfaces to a triangles-only representation. Of course, we could have skipped this part by not using Quads in the first place, but it is important to understand that some tools/options only work on data that consists of a purely triangular representation...
Clicking the 'Issues' tool from the Repair tab shows us that there are no open or invalid edges so this body is considered a solid at this time and can be exported for use by other applications.

A common case is one where data has been obtained from a 3D Scan but contains far more facets that necessary or desired. In this section we will use the same file as for the previous section, the 'lady_shell_tutorial5.stl', but this time, before thickening the surface, we will reduce the number of triangles. Follow these steps:

  1. Import through File > (Recent file): lady_shell_tutorial5.stl
  2. Switch to the Bodies tab
  3. Enable the Edge View (Alt+E) and review the level of detail.
  4. Click on the Simplify tool button
  5. Under Method, choose Absolute
  6. Target Size = 5000
  7. Click the Preview Button in the Apply group to see the result

After a few seconds, the display updates and shows the reduced detail surface body:

Reduced Surface Body
Reduced detail surface body ('lady_shell_tutorial5.stl', 5,000 facets)

if the level of detail is still too high for your purpose (or you simply require a very coarse mesh for reference), you can continue the process. Even at 1,000 facets, less than 4% of the original size, the features are still recognizable (!)
We could now continue (first click Apply to make the data permanent) with the same process as above and turn this into a solid (give it a try...) and use this in a number of CAD applications.
One item to point out is that the process of simplifying and thickening is best done in that order: 1) simplify to an acceptable level and 2) thicken to a solid body. The reverse order does generally work too, but it is far more likely that surfaces become collapsed or one side intersects the other as there is not constraint on the mesh to prevent it from doing so.

In the previous section we obtained a coarser mesh from the example file. In some cases, the result is one where the resultant triangles become quite elongated and, depending on later use, the surfaces are not as they were intended to be. For this purpose, it is possible to use the Remesh tool from the Bodies Tab.
We will start off with the same mesh as before:

  1. Import through File > (Recent file): lady_shell_tutorial5.stl
  2. Switch to the Bodies tab
  3. Enable the Edge View (Alt+E), review the state of the data
  4. Click on Simplify
  5. Select Absolute, Size = 5000 and click 'Apply' to make the changes permanent without first generating a preview
  6. Now Click on the Remesh tool (or simply change the tab in the Options section on the left side)

There are a few options here that need explaining. The 'Factor' defines how much movement is allowed per iteration of the mesh. This value needs to be greater than 0 and less than one. The number of 'Iterations' is simply how often the process is to be applied. Generally, it is better to use a smaller factor for each iteration with more iterations. They do not need to add up to any specific value, but the defaults are a good starting point. If the mesh is very large to start with, it is recommended to perform this one iteration at a time so that the mesh size can be observed (depending on the values more or less triangles remain after the completion so if it constantly increases, the mesh can become very large and potentially crash the computer).
The 'Len' option is to use a computed target edge length (edges longer than this are targeted for splitting, shorter ones are targeted for merging) such as the default Average Edge, Minimum or Maximum Edge Length. Note that, if you choose one of these computed values and then switch to the 'Value' option from the same drop down, the field will provide what this last value was set at. In this example you can first select 'Avg. Edge' and then select 'Value' to find out that the average edge length is 4.35499 (assuming mm for work and import units). Similarly, the Maximum Edge length is 24.33951 and the Minimum Edge is 0.90937.
As we want to keep the overall number of triangles (currently at 5,000) approximately the same, we will opt for the Avg. Edge length. All other options are kept at their defaults. Click Preview and you will see the resultant mesh:

Remeshed Surface Body
Re-meshed surface body

It should be noted that the remeshing moves away from the original shape of the object, it attempts to create 'better' shaped triangles in favor of keeping the locations and shapes close to where it started from. Whether or not this is a useful step in your process greatly depends on what you are working on. Please also see the Remesh Help Page for details on options.
We will look at a few more things we can do with this in the next sections...

We are continuing the previous section with a re-meshed surface of the lady_shell_tutorial5.stl file. If not yet done, create the previous, remeshed representation and the click the Apply button to generate the resultant body. Though this next application is quite special both in how it works and when you may need this, we are going to use the Triangle to Quadrilateral mesh conversion tool ('Tri-Quad').
From the Tri-Quad tool, there is only one option other than which bodies to apply this to (if there are multiple): The 'Option' Drop down box. The options given are:

Pure Tri
This generates triangles from any Quadrilaterals (essentially the same as the Triangles tool on the Features tab but only applicable to Quadrilateral shapes)
Quad Dominant
This option attempts to merge any triangles with a neighboring triangle if this does not cause issues. In general, a large percentage of triangles are merged into quadrilaterals but there will always be some remaining Triangles.
Split Quads
This performs a (guaranteed) conversion from Triangles to Quadrilaterals but generates a resulting mesh that has 3x the number of quadrilaterals compared to the number of triangles. Also, the shape generally looks more diamond-like, not a perfect square.
Pure Quad
The Pure Quad option is the most complicated option but is generally quite robust. It results in a purely quadrilateral mesh with 1/2 the number of quadrilateral surfaces compared to the original triangle mesh. The only downside is that the quality of the resultant mesh is often less than the original mesh and, in some cases, concave quadrilaterals may be generated as a compromise.

Go ahead and convert the (previously re-meshed) surface body to a Pure Quad:

Surface Mesh converted to a pure quadrilateral mesh
Priview of Triangle Surface Mesh converted to a Pure Quadrilateral mesh

As mentioned, this is a more specialized tool, but may find use in cases where the total number of surfaces is important (ray tracing for example) or where the aspect ratio of the mesh is important. In those cases, a quad dominant mesh may be the best option as it retains triangular mesh wherever it is more appropriate.

In this last section, we are going to use the original example file: bust_female_tutorial5.stl.
Start off by importing this file and then to reduce it to 5000 triangles:

Imported file reduced to 5000 facets
Imported file, reduced to 5000 facets

We are now going to take this mesh and refine it using the 'SubDivide' tool which uses a Catmull-Clark algorithm to insert additional triangles to make the surface smoother in appearance. Generally, this is not desirable for the use in STEP files, but it can be a useful tool for other processes (for example the NURBS Surfacing tool discussed later).
Click on the SubDivide tool or pick the SubDiv tab from the Options section. The application provides a estimate of the number of resultant triangles based on the number of iterations to use to smooth the mesh. You can see that a single iteration will result in approx. 30k facets from the original 5k facets but 2 iterations will already result in 120k facets... so be careful how smooth you want to make this.
We'll use 1 iteration and leave the 'Keep Quads' unchecked (with this turned on, the result becomes a pure quad mesh). Click the Preview option and you will get a smoother version of the original:

Subdivision smoothing, preview
SubDivide Preview of surface mesh, 30,000 facets

As this is a preview, we might as well see what this would look like if we used two iterations but with Keep Quads turned on:

Subdivision smoothing, 2 iterations, preview
SubDivided Preview of surface mesh, 60,000 quad facets

The option to keep quads results in a mesh that is of purely quadrilateral shape and thus not applicable to some other tools though it does result in a smaller number of facets compared to converting this directly back into a triangular form.

<< Editing and Repairing Data Reverse Engineering I >>