Bug/mirrored instances

Correct the exported vertex order (winding) for flipped instances. 
Thank you Thomas,

This looks like a method to compare the sketchup normal with the  'calculated' normal based on the meshes vertices.
What I would like to have is a method to read out the meshes for 2 two connected faces AS IF the were were connected without one of them being reversed.  In other words,  I want to read out out the geometry AS IF it were drawn as an orientable manifold mesh. If one of the faces were to be reversed with respect to the other in sketchUp, I would like a way to just detect that, so I can decide to interprete its polygon indices in reversed order.

Jeroen

Op 2-jul.-2014, om 14:48 heeft Thomas Thomassen <notifications@github.com> het volgende geschreven:

> In src/sketchup-stl/exporter.rb:
> 
> > @@ -208,6 +212,16 @@ def self.scale_factor(unit_key)
> >          factor
> >        end
> >  
> > +      def self.get_vertex_order(vertices, normal)
> > +        n = (vertices[1] - vertices[0]).cross( (vertices[2] - vertices[0]) )
> > +        n.normalize!
> > +        order = [0, 1, 2]
> > +        if n != normal
> > +          order = [0, 2, 1]
> Can we take this aside from this merge review? Just not to make things confusing.
> 
> —
> Reply to this email directly or view it on GitHub.
>