Public Member Functions | Static Public Member Functions | List of all members
Mesh Class Reference

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)
 

Detailed Description

A mesh.

Since
42020

Constructor & Destructor Documentation

◆ Mesh()

Mesh ( )

Constructs an empty mesh.

Member Function Documentation

◆ addFacet()

addFacet ( Vector  a,
Vector  b,
Vector  c 
)

Adds facet. It is good convention to keep all facets CCW-wound (use the right hand rule).

Parameters
aVertex.
bVertex.
cVertex.

◆ clear()

clear ( )

Clears the mesh.

◆ getBoundingBox()

BoundingBox getBoundingBox ( )

Returns the bounding box of the mesh.

◆ getFacet()

Integer getFacet ( Integer  index,
Integer  node 
)

Returns the given facet vertex index for the returned node.

Parameters
indexThe index of the facet.
nodeThe node of the facet (0, 1, 2).

◆ getNumberOfFacets()

Integer getNumberOfFacets ( )

Returns the number of facets in the mesh.

◆ getNumberOfVertices()

Integer getNumberOfVertices ( )

Returns the number of vertices.

◆ getVertex()

Vector getVertex ( Integer  index)

Returns the given vertex.

◆ loadMesh()

static Mesh loadMesh ( String  path,
String  format 
)
static

Load mesh from file.

Parameters
pathThe file path.
formatThe file format. The format can be 'application/sla' or 'ascii-stl'.

◆ reserve()

reserve ( Integer  numberOfFacets)

Reserves memory for the given number of facets.

◆ saveMesh()

static saveMesh ( String  path,
String  format,
Mesh  mesh 
)
static

Save mesh to file.

Parameters
pathThe file path.
formatThe file format. The format can be 'application/sla' or 'ascii-stl'.
meshThe mesh.

◆ scale()

scale ( Number  factor)

Scales mesh.

Parameters
factorThe factor used to scale all vertices.

◆ transform()

transform ( Vector  translation,
Matrix  orientation 
)

Transforms mesh. new vertex = ORIENTATION * vertex + TRANSLATION

Parameters
translationThe translation for all vertices.
orientationThe orientation for all vertices.

◆ translate()

translate ( Vector  translation)

Translates mesh.

Parameters
translationThe translation for all vertices.


Generated by Autodesk, Inc. 19 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.