STL to IGES Mesh Conversion

From gtwiki

Jump to: navigation, search

Need to create a NURBS mesh from an STL file? This article shows a process using the STL workbench and MEL scripts.

«««(?)

Contents

NURBS Mesh Translation

Often meshes are used to generate geometry. The typical file format for meshes are STL, OBJ or DXF. However, DP users like to use surfaces rather than meshes for parametric assemblies. This article shows how to make clean, connex joined surfaces out of mesh configurations.

Requirements

First, a closed connex join surface must be created.
Second, this process requires the use of the application Maya. Third, this process requires a minimum of a Designer and STL license of DP.

Setting up the Mesh

The use of the STL workbench sets up the resolution of the mesh. The "Tessellate" command can produce a minimum edge length value for any closed join surface.


Closed Surface.
Enlarge
Closed Surface.





















STL Workbench "Tessellate" Command.
Enlarge
STL Workbench "Tessellate" Command.





















Desired Mesh Resolution.
Enlarge
Desired Mesh Resolution.





















Save this CATPart as a STL file.

Conversion Process

Open up the STL in Maya. Select this (and other pertinent meshes) and run the code below:

string $Objs[] = `ls-sl`;
int $Objscount = size($Objs);
if($Objscount == 0) {
	warning "Nothing Selected.  Select some Polygons and try re-running.";
}
else
{
	hide; 
	select -cl; 
	for($i=0;$i<size($Objs);$i++){
		string $CurObj = $Objs[$i]; 
		int $CurObjFaceCount[] = `polyEvaluate -f $CurObj`;
			
		for ($j=0;$j<$CurObjFaceCount[0];$j++) {
 			string $StrAttr[] = `listAttr ($CurObj+".f["+$j+"]")`;
			
			float $Pt1[] = `pointPosition ($CurObj+"."+$StrAttr[0])`;
			float $Pt2[] = `pointPosition ($CurObj+"."+$StrAttr[4])`;
			float $Pt3[] = `pointPosition ($CurObj+"."+$StrAttr[8])`;
			
		  	surface -du 1 -dv 1
			          -ku 0 -ku 1
			          -kv 0 -kv 1
			          -p $Pt1[0] $Pt1[1] $Pt1[2]     -p $Pt2[0] $Pt2[1] $Pt2[2]  
			          -p $Pt3[0] $Pt3[1] $Pt3[2]     -p $Pt2[0] $Pt2[1] $Pt2[2] -n NewGeomConv ;
			currentTime $j;
		}
		int $Perc = 100*$i/size($Objs);
		print ("Percentage Completed.  " + $Perc + "%\n");
	}
}
select -r "NewGeomConv*"
Maya Mesh Conversion.
Enlarge
Maya Mesh Conversion.

















Video File showing meshing.



Import Back to Digital Project

The last step in the conversion process it to export the newly created NURBS poly-surface from Maya as an IGES, and import it into Digital Project. Once brought in as datum surfaces, these can be "Joined" to make one complete surface-based mesh. All Geometry Workbench commands are available and will function on this new poly-surface.

Personal tools