Regular API function

simImportShape / sim.importShape

Description Imports a shape from a file (first imports meshes, then groups/merges them into a shape). See also sim.importMesh.
C synopsis simInt simImportShape(simInt fileformat,const simChar* pathAndFilename,simInt options,simFloat identicalVerticeTolerance,simFloat scalingFactor)
C parameters
fileformat: the fileformat to import from. 0 for OBJ format, 1 for DXF format, 2 for 3DS format, 3 for ASCII STL format, 4 for BINARY STL format and 5 for COLLADA format (in that case, make sure the collada plugin is available and correctly loaded).
pathAndFilename: the location of the file to import.
options: bit-coded:
bit0 set (1): keep identical vertices
bit1 set (2): keep identical triangles
bit2 set (4): reserved. keep at 0.
bit3 set (8): do not preserve colors (only for COLLADA format for now)
bit4 set (16): tries to preserve textures (OBJ format only). When this bit is set and several shapes are imported, they will be grouped. If the bit is not set and several shapes are imported, they will be merged.
identicalVerticeTolerance: the distance from which two distinct vertices will be merged. Bit0 of options should be cleared for this to have an effect
scalingFactor: the scaling factor to apply to the imported vertices
C return value
The handle of the imported shape, or -1 if the operation was not successful
Lua synopsis number shapeHandle=sim.importShape(number fileformat,string pathAndFilename,number options,number identicalVerticeTolerance,number scalingFactor)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page