I’m importing skp files directly into Lightwave. I’ve manage to overcome the determinant issue however I still have problems with faces ending up facing the wrong direction. I’ve checked in Sketchup that the orientation is correct by viewing the surface in monochrome, I’m using models supplied with Sketchup, namely the bed. It doesn’t matter whether I apply transformations or not I always end up with one end of the bed headboard facing the wrong direction. Other models also have similar issues, the couch has one face on an arm which faces down instead of up.
I’ve tried looking and loops, edges and edgeuses and still can see how to get the face to orient correctly. I have seen that there is an SULoopWinding however I am unclear as to what vector should be used to get the direction. The face normal will always give counter clockwise. I’ve been basing my code on the skptoxml example.
Any pointers as to why I keep getting this face with the wrong orientation.
FaceWrite.txt (4.3 KB)
Most of those “sample components” were created with old versions of SketchUp.
The possibility exists that perhaps the files have issues.
The “bed.skp” file distributed with SU2016 was created with version 13.0.2734,
which was not even the M0 public release. (ie, 13.0.3688/3689)
Prior to that, the “bed.skp” distributed in the latest version of SU8M5 was created with version 7.0.8535.
(Which again was not the public M0 release. There were 4 more MRs in the v7 family, three were 7.1 releases which was a definite file format change.)
Here it is for comparison’s sake: Bed.7.0.8535.skp (88.5 KB)
I’d suggest creating your own test models, with the latest version of SketchUp.
Try to mimic what you see in the bed,
Run the internal checker before saving:
ModelInfo > Statistics > Fix Problems
Or copy the bed file, and open it directly. Check it six ways to Sunday with every possible utility plugin, then save yourself a new version with SketchUp v 16.1.
Isn’t the main mantra for testing to have a “known good control” ?
I was using the provided models as I would have thought they would have been a good control. I’ll go back and create new models that I know will be correct. I’ve been looking at the files with various utilities within Sketchup, going so far as to see what was available as an extension.
Any pointers on how to use SULoopWinding, specifically the vector parameter.
Just a guess here, but is the bed modeled in symmetrical halves where one half has been mirrored using SketchUp’s “flip along __ axis”?
You may need to do extra checking if this is the case. Search here and SketchUcation for something like “detecting flipped components.”
I had this or a similar issue in the STL exporter and it was due to flipped instances.
Thanks, didn’t know about the flip along axis. The bed isn’t modeled in symmetrical havles, it has components and instances but they’re using transformations to put the pieces together. As far as I can tell the headboard is one component.
I have a search using your suggestion.