Problem importing stl cet has coincident vertices

Asked by JOHN

Hello all,
One quick question
I have a proven program that works with stl import. However, when i try to import this file [1] i get the following error

FATAL /build/yade-KKgSmd/yade-1.20.0/pkg/common/Facet.cpp:26 postLoad: Facet has coincident vertices 0 (0 0 0) and 1 (0 0 0)!
FATAL /build/yade-KKgSmd/yade-1.20.0/pkg/common/Facet.cpp:26 postLoad: Facet has coincident vertices 0 (0 0 0) and 1 (0 0 0)!
FATAL /build/yade-KKgSmd/yade-1.20.0/pkg/common/Facet.cpp:26 postLoad: Facet has coincident vertices 2 (0 0 0) and 0 (0 0 0)!

What i dont understand is why. The same file without one tiny shape covering 2 holes passes just fine.

The code i use to import the stl is the following

facets = ymport.stl(name)

  rod1 = O.bodies.append(facets)

  # converts facets to gts (see the other question)

  s = gts.Surface()

  for facet in facets:

     vs = [facet.state.pos + facet.state.ori*v for v in facet.shape.vertices]

     vs = [gts.Vertex(v[0],v[1],v[2]) for v in vs]

     es = [gts.Edge(vs[i],vs[j]) for i,j in ((0,1),(1,2),(2,0))]

     f = gts.Face(es[0],es[1],es[2])

     s.add(f)

  print s.is_closed()

  threshold = 1e-3

  s.cleanup(threshold)

  print s.is_closed()

  assert s.is_closed()

  # use gts to filter spheres

  pred = inGtsSurface(s)

  print "r = ", r

I really appreciate any suggestions
[1] http://dropmefiles.com/hOWA1

Question information

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

Hello,

as the error syas, there is a facet with coinciding vertices.. Probably it is not a problem from topology point of view (it is valid stl file), but there is a check in Yade to prevent creating a facet being line/point..
you can:
1) somehow delete the problematic facets
2) modify the source code to your needs

The link you provided has been deleted..

cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask JOHN for more information if necessary.

To post a message you must log in.