Inherits ScriptObject.
Public Member Functions | |
| Mesh () | |
| reserve (Integer numberOfFacets) | |
| Integer | getNumberOfVertices () |
| Vector | getVertex (Integer index) |
| Integer | getNumberOfFacets () |
| Integer | getFacet (Integer index, Integer node) |
| clear () | |
| addFacet (Vector a, Vector b, Vector c) | |
| scale (Number factor) | |
| translate (Vector translation) | |
| transform (Vector translation, Matrix orientation) | |
| BoundingBox | getBoundingBox () |
Static Public Member Functions | |
| static Mesh | loadMesh (String path, String format) |
| static | saveMesh (String path, String format, Mesh mesh) |
A mesh.
| Mesh | ( | ) |
Constructs an empty mesh.
Adds facet. It is good convention to keep all facets CCW-wound (use the right hand rule).
| a | Vertex. |
| b | Vertex. |
| c | Vertex. |
| clear | ( | ) |
Clears the mesh.
| BoundingBox getBoundingBox | ( | ) |
Returns the bounding box of the mesh.
Returns the given facet vertex index for the returned node.
| index | The index of the facet. |
| node | The node of the facet (0, 1, 2). |
| Integer getNumberOfFacets | ( | ) |
Returns the number of facets in the mesh.
| Integer getNumberOfVertices | ( | ) |
Returns the number of vertices.
Load mesh from file.
| path | The file path. |
| format | The file format. The format can be 'application/sla' or 'ascii-stl'. |
| reserve | ( | Integer | numberOfFacets | ) |
Reserves memory for the given number of facets.
Save mesh to file.
| path | The file path. |
| format | The file format. The format can be 'application/sla' or 'ascii-stl'. |
| mesh | The mesh. |
| scale | ( | Number | factor | ) |
Scales mesh.
| factor | The factor used to scale all vertices. |
Transforms mesh. new vertex = ORIENTATION * vertex + TRANSLATION
| translation | The translation for all vertices. |
| orientation | The orientation for all vertices. |
| translate | ( | Vector | translation | ) |
Translates mesh.
| translation | The translation for all vertices. |