Importing a .stl file from script

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 4
Joined: 11 Sep 2018, 16:25

Importing a .stl file from script

Post by darkPaladin » 13 Sep 2018, 14:18

Hi there,

I've been trying to import an .stl file to V-rep by using scripts in Lua with no success. The function that I'm using is the following one:


After I run my simulation the imported shape from the .stl file appears in the 'Scene hierarchy' as 'Shape' but it's not shown in the graphics window. Whenever I try to change the position of it the initial position in x, y and z is set to 'nan'. I have tried by changing those values to any other coordinates and still is not showing.

Just for your information I'm using V-rep pro edu 3.5 in Ubuntu 18

I was wondering if anyone of you could help me with this issue please.


Site Admin
Posts: 7190
Joined: 14 Dec 2012, 00:25

Re: Importing a .stl file from script

Post by coppelia » 21 Sep 2018, 10:16


this can happen if your STL file is ill-defined. Often an imported shape is also not visible if the scale of the shape is very large or very small. Did you try to convert to STL file to another format (e.g. OBJ) and import it again?
What happens if you import the STL shape via the menu and not programmatically? Are you sure your STL is binary STL and not ASCII STL?


Post Reply