Converts a mesh to a manifold representation for compatibility with a 3D printer. A manifold mesh has no holes, border edges, inverted triangles, or intersecting and interior polygons. Not all meshes can be cleaned in a single operation. Prior application of parameters in the Optimize function may be necessary to successfully clean a mesh.
If true the mesh will be cleaned, if false, the mesh will only be analyzed, with results returned in the promise.
This is an asynchronous method that returns a Promise as follows:
Promise .then(data) .catch (err: ReturnCode )
callbackFunc(err: ReturnCode , data)
Where data is:
data.err - An error ReturnCode .
data.numBorders - The number of border edges.
data.numFlippedTriangles - The number of inverted triangles.
data.numHoles - The number of holes in the mesh.
data.numNonManifold - The number of non-manifold edges.
All data fields must be 0 for the mesh to be fully cleaned. Multiple cleaning passes may be performed.
Clears the current texture map.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Generate vertex colors for the polygon context, resulting in a colorized object.
rendering engine that will perform the rendering operation.
true if using Volume Rendering (VR) colorization or false for Transfer Function (TF) colorization.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Converts a mesh from a vertex buffer represtentation to an index buffer representation. This operation can result in a large reduction in the number of vertices needed to define the mesh. This will also reduce the amount of memory required to store the mesh data. This funciton is called internally on meshes processed with the cleanMesh() and optimizeMesh() functions.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Setting to determine if the polygon rendering should be affected by the cut planes.
true if polygons should be clipped by cut planes, false otherwise.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Turns lighting on/off for texture mapped objects. Default is off. Generally, lighting should be on for mesh objects like implants and surgical guides. Lighting should be off for render-to-texture objects like VOI slices.
true if texture lighting is to be enabled, false otherwise.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
This method determines if shading is enabled for the whole polygon object.
true if the entire polygon context should have shading enabled, false otherwise.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Get the current polygon mesh details and return this from the promise.
This is an asynchronous method that returns a Promise as follows:
Promise .then(data).catch (err: ReturnCode )
callbackFunc(err: ReturnCode , data)
Where data is:
data.err - An error ReturnCode .
data.numVerticies - The number of vertices in the mesh object.
data.numPolygons - The number of polygons in the mesh object.
data.numIndicies - The number of indices in the mesh object.
Return the polygon context ID associated with this object
Gets the current 4x4 transformation matrix that is multiplied to each polygon object vertex before being displayed.
This is an asynchronous method that returns a Promise as follows:
Promise .then(matrix: Matrix ) .catch (err: ReturnCode )
callbackFunc(err: ReturnCode , matrix: Matrix )
Inverts mesh lighting calculations so that the inside of the mesh is illuminated.
true if gradient lighting should be inverted, false for normal lighting.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Executes a set of mesh optimization algorithms such as polygon decimation, connected set limitation, and vertex smoothing. This method can perfom all of these operations, or a subset of them.
Determins if the connected set reduction operation is run.
Value between 0 and 100 that sets the connected set size percentage threshold. For example, if a mesh has 100 polygons and islandPercentage is set to 10, then all sets containing 10 or fewer polygons are deleted.
Determins if the decimate operation is run.
Value between 0 and 100 that determines the percentage of polygons that will be removed. For example, if set to 75, then 75 percent of the polygons will be removed.
Determines if the smoothing operation is run before the decimate operation.
Determines if the smoothing operation is run after the decimate operation.
Value between 0 and 1 that determines how aggressively the mesh is smoothed. Higher values equate to more smoothing.
Determines if the polygon flip operation is applied.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Releases server side memory associated with this PolygonContext object.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
When rendeirng polygons on MPR views, you typically render as an outline that intersects with the curent view. The width of the line (in pixels) is specified by this method. This is NOT used when setType is set to lines.
Width of the line (in pixels) when rendering an outline.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Saves the polygon context to the specifieid file on the server, in either OBJ, STL, or PLY format.
The file name to save the polygon object to.
A member of the PolygonFileType enumeration specifying the ouput file format.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Sets the backface culling mode.
A member of the CullMode enumeration specifying the cull mode.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Sets the texture mapping source to the specified image file on disk.
The name of the image file to load.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Sets the texture mapping source to the specified rendering engine.
The RenderEngineContext3D object to use as the texture mapping source.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Sets a 4x4 matrix for each of the vertices to be multiplied by before being displayed
The transformation matrix to be applied to this polygon object.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
Sets if polygon rendering mode should be lines (as an outline) or triangles.
A member of the PolygonType enumeration specifying the polygon type.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
This method sets the color for the entire polygon context.
Color to be applied to the entire polygon context.
This is an asynchronous method that returns a Promise as follows:
Promise .then() .catch (err: ReturnCode )
callbackFunc(err: ReturnCode )
This object represents a collection of triangles to be rendered using the integrated CPU based polygon rendering engine. An arbitrary number of polygon objects can be assigned to a render engine. PolygonContext objects are allocated with a number of utiity functions from the Fovia.ServerContext class.