Closed jimfoltz closed 9 years ago
Oops. I've totally forgotten about this! I'll look at it tomorrow.
Is it tomorrow?
Man - I'm really sorry for dropping the ball on this one!
Code looks good, though I think the samedirection
change is worth making.
This is ready. Please, if there's just small changes go ahead and make them.
I found a model[1] where the exporter fails to catch some mirrored, nested instances.
In the following image taken from NetFabb Basic. Image 1 is the our current master branch (ceb6dcf). Image 2 is with the 1st attempt at mirroring detection (1bf7ad0), and Image 3 is with this latest pull request (5927099).
[1] https://3dwarehouse.sketchup.com/model.html?id=fd16cf692a4d8ec7697d7f9718010293
I found this helpful: http://math.stackexchange.com/a/184479
Hmm... so in the third, is it correct then?
Yes, the third. Netfabb colors back faces red. If you examine the sketchup model, the red areas in the first image correspond to instances in the model. The instances are likely flipped, but I am not sure how to tell that from Sketchup.
Maybe this helps? http://stackoverflow.com/a/17982272
It does, thanks. Could vertex order be used to find reversed faces in a model?
Not by themselves AFAIK - you need context. Someone contributed a really nice and fast algorithm to detect internal and reversed faces for Solid Inspector a couple of weeks ago - I've implemented it in SI 2.2. https://bitbucket.org/thomthom/solid-inspector/src/1aeb992d5087b96e8fcc148d40ed728ddb0d066d/src/tt_solid_inspector2/shell.rb?at=2.2
Though I'm not sure if that'll help for mirrored instances when we export - don't have just need to keep track of whether an instance if flipped?
Correct the exported vertex order (winding) for flipped instances.