Share

Analysis

Methods

Name Syntax Description
calculatehausdorffdistanceto mesh:calculatehausdorffdistanceto(mesh2:string) Returns the Hausdorff distance
checksanity mesh:checksanity(mesh2:string) Returns TRUE if the mesh is sane
comparewith mesh:comparewith(mesh2:mesh, hausdorffdistancethreshold:number, distancethreshold:number, fraction:number in %) Checks whether the mesh is different to mesh2. This is done in two steps: If the Haussdorff distance is larger than hausdorffdistancethreshold, or a given fraction of the measured distances is larger than distancethreshold, the tests fails
comparegetdistances mesh:comparegetdistances (mesh2:mesh, distances1:array, distances2:array) Compares current mesh to mesh2. Signed distances to opposite mesh are stored in given distance arrays.
getnodepositionofface mesh:getnodepositionofface(index: number; node1info1, node1info2, node1info3 :LuaVector3) Index gives the index of the face. The x,y,z positions of the three nodes are written into the LuaVector3 nodeinfo1, nodeinfo2, nodeinfo3.
gettrianglenodeindices mesh:gettrianglenodeindices(indices:array) Get node indices for all triangles. Store indices in given array. Indices of n-th triangle are stored in array at positions n×3, n×3+1 and n×3+2
createanalyzer TLUAPartAnalysis analysis = mesh: createanalyzer () Creates a new Partanalysis object which enables to run different analyses and stores their results
createalignment TLUAAlignment alignment = mesh:createalignment(mesh2:meshobject, matrix1, matrix2: luamatrix) Creates a new Alignment object which stores the principal axes and the resulting matrix. mesh2: the mesh that can be transformed with the resulting matrix to overlap the given mesh. Matrix1, matrix2: optional parameters, used as modeltoword matrices when set
fastwallthicknesstest Boolean result = mesh:fastwallthicknesstest(criticaldistance: number, criticalsurface:number in %;colormesh: Boolean) Checks the wall thickness of a mesh, as above, but stops as soon as a failure condition is recognized. If colormesh is true, the results of the wall thickness test are written into the color information of the mesh.
featuredetection Boolean result = mesh:featuredetection (criticaldistance:number, criticalsurface:number in %; colormesh:Boolean; Multicore:Boolean; Array: TLuaArray) Detects features that are smaller than the given critical distance. Returns true if the detected areas are not smaller than the criticalsurface area. If colormesh is true, the detected areas are written into the color information of the mesh. If Multicore is true, multithreading is used. If array is assigned, the values of the faces are written into it.
getbuildvolume mesh:getBuildVolume(offset:number) Returns the value of the inner buildvolume in mm³. The parameter offset gives the thickness of the surface. If the calculation fails, -1 is returned.
getcenterofgravity Center = mesh:getcenterofgravity() Returns the center of gravity of the mesh as LUAVector3.
getdownskinarea Areasum = mesh:getdownskinarea(downskinangle: number) Calculates the downskin area. Downskinangle is given in degree (90 - support angle as specified in the Analysis/Up-/Downskin analysis dialog). Units are mm²
getsupportvolume mesh:getsupportvolume(criticleangle:number) Returns the volume of support in mm³. The area that needs support is calculated using the parameter criticalangle. The normal of a triangle with respect to the z-axis defines the critical angle, i.e. a small critical angle means that only a small area needs support. If the calculation fails, -1 is returned.
gettotalcontourlength mesh:gettotalcontourlength(layersize) Returns the value of the length of all outer contourlengths in mm. The parameter layersize gives the thickness of the layersize. If the calculation fails, -1 is returned.
getupskinarea Areasum = mesh:getupskinarea(downskinangle: number) Calculates the upskin area
calculatevertexnormal mesh:calculatevertexnormal(maxcurvaturedegree) Calculates normals for all vertices. Use smoothed normals for triangles with lower curvature than specified maximal curvature
trappedpowderanalysis result = mesh:trappedpowderanalysis(holesize:number; mesh:TLuaMesh) Returns true if powder would be trapped. Holesize gives the sizes of holes which are not large enough to remove the powder, e.g. all holes smaller than this size are ignored. The default value is 0. If mesh (optional) is specified, any shells with trapped powder are copied into it. The original mesh is not changed either way.
wallthicknesstest Boolean result = mesh:wallthicknesstest(criticaldistance:number, criticalsurface:number in %; colormesh:Boolean; Multicore:Boolean) Checks wall thickness of a mesh. Returns true if the wall thickness is not smaller than criticaldistance for more than the criticalsurface area. If colormesh is true, the results of the wallthickness are written into the color information of the mesh. If Multicore is true, multithreading is used.
wallthicknesstestwithoutput TLuaXML result = mesh:wallthicknesstestwithoutput (criticaldistance:number, criticalsurface:number in %; colormesh:Boolean; Multicore:Boolean; Array:TLuaArray) The parameters are the same as in wallthicknesstest. Returns an XML with keys: 'testpassed', 'totalarea', 'testprob', 'areabelowthreshold', 'numberofclusters', 'areaoflargestcluster'. If array is assigned, the values of the faces are written into it.

Back to top

Examples

wallThicknessPassed = mesh:wallthicknesstest(0.4, 20)

Returns true if the area which has a wall thinner than 0.4 mm is less than 20 % of the total area.

testresult = mesh:comparewith(mesh2, 0.4, 0.1, 10)

For each point of mesh the closest distance to mesh2 is calculated. This distribution of distances is analyzed. The distribution is used for two tests.

Test 1: If Hausdorff distance is greater than 0.4 mm, test 1 fails. Test 2: If more than 10 % of points are further than 0.1 mm apart, test2 fails.

Returns 0 if meshes are equal, 2 if test 1 failed, 4 if test2 failed, and 6 if both tests failed.

hausdorffdistance = mesh:calculatehausdorffdistanceto(mesh2)

For each point of the mesh the closest distance to mesh2 is calculated. The maximum of these distances, called Hausdorffdistance, is returned.

Back to top

Was this information helpful?