Error Stl import

Asked by Luis Barbosa

Hi,

I'm trying to import a STL file but the following error occurs:

ERROR /data/trunk/pkg/dem/STLImporter

It seems to be everything ok with the file and script.
have you ever see something similar?

Thank you,
Luis

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luis Barbosa
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Luis,
could you please post the script you use, the stl file and complete error?
thanks
Jan

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#2

Hi,

________script______________

#!/usr/bin/python
# -*- coding: utf-8 -*-

# F.T. Silva <email address hidden>
# Script to define a numerical model for shear box

from yade.pack import *
from yade import pack,export,qt
from yade import plot
from yade import ymport

#Def of the material which will be used

rod1 = O.bodies.append(ymport.stl('caixasuperior.stl'))

sp=pack.SpherePack()

sp.makeCloud((-35,-45,-35),(35,250,35),rMean=10,periodic=False,porosity=0.8,distributeMass=False,seed=0)
sp.toSimulation()

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()],

 ),
 NewtonIntegrator(damping=0.7, gravity=[0,-9.81,0]),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 ]

qt.Controller()

qt.View()

_____STL FILE______

[1] https://drive.google.com/open?id=0B9LhrwAf_vasS2VJLUZBakZzMTA

_______ERROR MESSAGE____________
Welcome to Yade 2017.01a-11-11c276f~xenial
TCP python prompt on localhost:9000, auth cookie `skuacd'
XMLRPC info provider on http://localhost:21000
Running script teste3_strain.py
ERROR /data/trunk/pkg/dem/STLImporter.cpp:23 import: Can't open file: caixasuperior.stl
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for showing help), F10 both, F9 generator, F8 plot. ]]

Thank you,
Luis

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Hello,
Your first error report was missing the main point:
"Can't open file: caixasuperior.stl"

Try ./caixasuperior.stl maybe (assuming it is in current path where yade is executed, else set path accordingly).
Or insert the complete path, even.
Also, make sure that the file is not read-protected.

Bruno

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#4

Hi Bruno,

The file is in the same path where yade is being executed.
And the file is not read-protected.

Still not working :(
Thanks,
Luis

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

Did you try with ./ and complete path?
What happens with the example scripts? You may find one which imports an stl and see if it gives the same problem.
If not your .stl is probably corrupted somehow.

B

Revision history for this message
Jan Stránský (honzik) said :
#6

Hi Luis,
just tried it the script without the file you have sent and everything worked well.. I used yade-1.20.0 on Ubuntu 16.04.
What version of Yade and system do you use?
cheers
Jan

Revision history for this message
Felipe (felipetthadeu) said :
#7

Hello Jan,

I am supporting Luis's questions to provide feedback on this issue. Regarding your questions, we are using on Ubuntu 16.04 LTS too and Yade 2017.01a-11-11c276f~xenial .

Hello Bruno,

Regarding your question, we have already tried with ./ and complete path.
I will model a new stl to verify your point.

On more comments to both of you guys,

Just in case, I have opened either file and script on Ubuntu 14.10 on my personnal computer and it worked. Moreover, in the past, we had opened a similiar questions when the last update was to reinstall either ubuntu and yade programs.

https://answers.launchpad.net/yade/+question/446239 (Felipe)

After that, we decided to open a new question to this issue.

Really thanks for advance support.

Cheeres,

Felipe

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#8

Dear Bruno/Jan,

We tried other stl files and it didn't work, either. Even with complete path (as sugested by Bruno).

Do you think this is more software related?
We are in Ubuntu 16.04.2LTS and YADE 2017.01a-11-11c276f~xenial (as Felipe infomed).

Thank you.
Luis

Revision history for this message
Jan Stránský (honzik) said :
#9

Hi Luis,

see [1], the same problem with the same version of Yade, so it seems to be " more software related"..
Could you use "standard" 1.20.0 version (sudo apt-get install yade), or you need something from the newer version?

cheers
Jan

[1] https://answers.launchpad.net/yade/+question/497350

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#10

Dear Jan, it is the version of yade.
On 1.20 it worked well.

Thank you for the attention.

Luis

Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#11

Hi there, it has been quite a while that I wrote something here :)

I can confirm the error.
Importing arbitrary .stl files in Yade 2018.02b-201447edfd~xenial rises ERROR /data/trunk/pkg/dem/STLImporter.cpp:23 import: Can't open file: ...
Using the packaged yade (version 1.2) it works well.
I am using Ubuntu 16.04 in a virtual box with windows 7 host.

The bad thing is that I need the daily built version.

How can I help solving this problem?
Cheers
Alex

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#12

Hi Alex,
I would try basic/stupid things around STLImporter.cpp:23 to see what's going on, e.g. check file existence, check if it is can be opened , etc.
Did you guys try to run a debug build?
Bruno

Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#13

Hi,
I solved the problem. I inspected the changes between the packaged version 1.2 and the current master by:
git diff remotes/upstream/1.20 master ./pkg/dem/STLImporter.hpp

Afterwards in pkg/dem/STLImporter.hpp line 174 I changed the return statement back to the state of branch 1.2:
return true;
instead of
return (r>0);

I will prepare a pull request if you like.

Cheers
Alex