Octane Sketchup Exporter - 1025-02

Forums: Octane Sketchup Exporter - 1025-02
SketchUp Integrated Plugin (Integrated Plugin maintained by OTOY)

Re: Octane Sketchup Exporter - 1025-02

Postby abstrax » Fri Oct 05, 2012 10:38 am

abstrax Fri Oct 05, 2012 10:38 am
Hi TIG and Smicha

The problem is that the OBJ files contain n-gons, i.e. polygons with more than 3 or 4 vertices. The OBJ importer tries to triangulate them, but expects them to be triangle fans, which is usually not the case, when you have concave n-gons. I received a scene from Smicha, and the very first face (polygon) in the file is:

Code: Select all
f 1/1/1 2/2/1 3/3/1 4/4/1 5/5/1 6/6/1 7/7/1 8/8/1 9/9/1 10/10/1 11/11/1 12/12/1 13/13/1 14/14/1 15/15/1 16/16/1 17/17/1 18/18/1 19/19/1 20/20/1 21/21/1 22/22/1 23/23/1 24/24/1 25/25/1 26/26/1 27/27/1 28/28/1 29/29/1 30/30/1 31/31/1 32/32/1 33/33/1 34/34/1 35/35/1 36/36/1 37/37/1 38/38/1 39/39/1 40/40/1 41/41/1 42/42/1 43/43/1 44/44/1 45/45/1 46/46/1 47/47/1 48/48/1 49/49/1 50/50/1 51/51/1 52/52/1 53/53/1 54/54/1 55/55/1 56/56/1 57/57/1 58/58/1 59/59/1 60/60/1 61/61/1 62/62/1 63/63/1 64/64/1 65/65/1 66/66/1 67/67/1 68/68/1 69/69/1 70/70/1 71/71/1 72/72/1 73/73/1 74/74/1 75/75/1 76/76/1 77/77/1 78/78/1 79/79/1 80/80/1 81/81/1 82/82/1 83/83/1 84/84/1 85/85/1 86/86/1 87/87/1 88/88/1 89/89/1 90/90/1 91/91/1 92/92/1 93/93/1 94/94/1 95/95/1 96/96/1 97/97/1 98/98/1 99/99/1 100/100/1 101/101/1 102/102/1 103/103/1 104/104/1 105/105/1 106/106/1 107/107/1 108/108/1 109/109/1 110/110/1 111/111/1 112/112/1 113/113/1 114/114/1 115/115/1 116/116/1 117/117/1 118/118/1 119/119/1 120/120/1 121/121/1 122/122/1 123/123/1 124/124/1 125/125/1 126/126/1 127/127/1 128/128/1 129/129/1 130/130/1 131/131/1 132/132/1 133/133/1 134/134/1 135/135/1 136/136/1 137/137/1 138/138/1 139/139/1 140/140/1 141/141/1 142/142/1 143/143/1 144/144/1 145/145/1 146/146/1 147/147/1 148/148/1 149/149/1 150/150/1 151/151/1 152/152/1 153/153/1 154/154/1 155/155/1 156/156/1 157/157/1 158/158/1 159/159/1 160/160/1 161/161/1 162/162/1 163/163/1 164/164/1 165/165/1 166/166/1 167/167/1 168/168/1 169/169/1 170/170/1 171/171/1 172/172/1 173/173/1 174/174/1 175/175/1 176/176/1 177/177/1 178/178/1 179/179/1 180/180/1 181/181/1 182/182/1 183/183/1 184/184/1 185/185/1 186/186/1 187/187/1 188/188/1 189/189/1 190/190/1 191/191/1 192/192/1 193/193/1 194/194/1 195/195/1 196/196/1 197/197/1 198/198/1 199/199/1 200/200/1 201/201/1 202/202/1 203/203/1 204/204/1 205/205/1 206/206/1 207/207/1 208/208/1 209/209/1 210/210/1 211/211/1 212/212/1 213/213/1 214/214/1 215/215/1 216/216/1 217/217/1 218/218/1 219/219/1 220/220/1 221/221/1 222/222/1 223/223/1 224/224/1 225/225/1 226/226/1 227/227/1


That doesn't work currently in Octane. The exporter should split these n-gons into triangles or quadrangles.

Cheers,
Marcus
In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
User avatar
abstrax
OctaneRender Team
OctaneRender Team
 
Posts: 5484
Joined: Tue May 18, 2010 11:01 am
Location: Auckland, New Zealand

Re: Octane Sketchup Exporter - 1025-02

Postby smicha » Fri Oct 05, 2012 10:52 am

smicha Fri Oct 05, 2012 10:52 am
Marcus,
I did extra triangulation and this is not working. Please see my new post at
http://render.otoy.com/forum/viewtopic.php?f=23&t=24080.

If you wish I can send you the ocs.

smicha
3090, Titan, Quadro, Xeon Scalable Supermicro, 768GB RAM; Sketchup Pro, Classical Architecture.
Custom alloy powder coated laser cut cases, Autodesk metal-sheet 3D modelling.
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3151
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Octane Sketchup Exporter - 1025-02

Postby smicha » Fri Oct 05, 2012 3:35 pm

smicha Fri Oct 05, 2012 3:35 pm
TIG,
I think that this is very important and sheds new light on the 'holes' problem

1. Something is wrong (with exporter?, sketchup? or octane?). When I place a group/object at origin (Chris Fullmer Tools, Center on Origin) and export it into octane there are no cracks and a model is just perfect. Even at high zoom all edges are perfectly clear. When I slightly move an object from origin (in Sketchup) and then export it as obj, it looks almost good. Almost - at high zoom on edges cracks are visible. And finally if the object is placed far from origin after exporting into octane it is full of cracks. So what could be the reason that any nonzero displacement of an object causes cracks?

Please download all necessary files (skp, obj, ocs) for testing from the link below - Octane 3.03 is required for OCS!

2. The exporter does not export anything if Layer0 is invisible and an object is on a different layer - please find a file for testing also attached.
Attachments
problem with exporter when Layer0 is invisible.rar
(964.1 KiB) Downloaded 257 times
slightly from origin - cracks at high zoom.rar
(2.87 MiB) Downloaded 230 times
far from origin - wrong.rar
(2.88 MiB) Downloaded 243 times
at origin - perfect no cracks.rar
(1.94 MiB) Downloaded 268 times
3090, Titan, Quadro, Xeon Scalable Supermicro, 768GB RAM; Sketchup Pro, Classical Architecture.
Custom alloy powder coated laser cut cases, Autodesk metal-sheet 3D modelling.
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3151
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Octane Sketchup Exporter - 1025-02

Postby TIG » Fri Oct 05, 2012 4:20 pm

TIG Fri Oct 05, 2012 4:20 pm
abstrax wrote:Hi TIG and Smicha

The problem is that the OBJ files contain n-gons, i.e. polygons with more than 3 or 4 vertices. The OBJ importer tries to triangulate them, but expects them to be triangle fans, which is usually not the case, when you have concave n-gons. I received a scene from Smicha, and the very first face (polygon) in the file is... The exporter should split these n-gons into triangles or quadrangles.

Marcus
The OBJ file that Smicha posted is from Sketchup Pro's own OJ exporter. If only gives 'meter' coordinates to 4 d.p.12.3456, so any triangulation coordinates are only accurate to say 1/2 mm !
Even when the 'triangulate faces' option is checked this can lead to co-linear edges and therefore n-gons > 3 !
This can lead to faces getting made they don't work in Octane.
My OBJ exporter is different - it exports meters to 6 d.p. e.g. 12.345678, so it's far less likely to end up with such small 'slivers'...
However, I have exported the same SKP to my OBJ file with ALL triangulated faces - i.e. only three coordinates for each 'f', so there are no n-gons > 3 - BUT perhaps some are in effect so slim they are not regarded as triangles but straight lines - i.e. not a face - this might then cause the rendering issues... I note that there are one or two -0.000000 values which suggests that it was a very tiny number, perhaps this then results in three co-linear points - which of course can never form a face !

I shall write an alternative exporter code trial with more d.p. in the coords, and PM it to Smicha for testing... asap...
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Octane Sketchup Exporter - 1025-02

Postby TIG » Fri Oct 05, 2012 5:30 pm

TIG Fri Oct 05, 2012 5:30 pm
smicha wrote:TIG,
I think that this is very important and sheds new light on the 'holes' problem

1. Something is wrong (with exporter?, sketchup? or octane?). When I place a group/object at origin (Chris Fullmer Tools, Center on Origin) and export it into octane there are no cracks and a model is just perfect. Even at high zoom all edges are perfectly clear. When I slightly move an object from origin (in Sketchup) and then export it as obj, it looks almost good. Almost - at high zoom on edges cracks are visible. And finally if the object is placed far from origin after exporting into octane it is full of cracks. So what could be the reason that any nonzero displacement of an object causes cracks?

Please download all necessary files (skp, obj, ocs) for testing from the link below - Octane 3.03 is required for OCS!

2. The exporter does not export anything if Layer0 is invisible and an object is on a different layer - please find a file for testing also attached.
See my last post...
The 0,0,0 location of the object might well result in sufficient differences in the coords for all faces to become triangles.
The exporter only includes visible faces - by both layer 'on' and hidden 'off' - so if an object's internal contents are on a layer and that layer is off then that geometry won't show, even if the object is on another layer.
How can you see the object if it's contents are 'off' anyway ?
Well Layer0 behaves differently from other layers - try it and see. Although Layer0 is 'off' it still displays if the object's layer is 'on'.
It's a peculiarity of Layer0, which should be used to model all raw geometry and always be the active-layer - other layers are used to control the 'container's' visibility - so if some geometry is on Layer0 [which is on and you can see it!] it exports, if that geometry on Layer0 is inside a group/instance and that is on LayerX [which is also also 'on'] then you see it and it exports; if the geometry is on Layer0 inside a group/instance that is on LayerX and that layer is off, then you can't see the object at all and it's not exported. In your 'exceptional' case LayerX is on and Layer0 is off then you can still see the geometry although its layer is off [a foible of SketchUp!] - BUT because that layer is 'off' it is NOT exported.
It is good practice to ALWAYS have Layer0 as your active-layer, and then you can never switch it 'off' anyway... Layer0 should NEVER be OFF !
Use Layer0 for raw geometry [always on] and 'containers' on other layers to control the geometry...

I'll PM you a beta of my exporter using more d.p. in the coordinates - see if that helps and report back...
If it's good I'll reissue an update asap...
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Octane Sketchup Exporter - 1025-02

Postby smicha » Fri Oct 05, 2012 6:07 pm

smicha Fri Oct 05, 2012 6:07 pm
TIG,
Again your help is invaluable! Thank you so much. As soon as I get the beta exporter I'll test it and let you know how it works.
3090, Titan, Quadro, Xeon Scalable Supermicro, 768GB RAM; Sketchup Pro, Classical Architecture.
Custom alloy powder coated laser cut cases, Autodesk metal-sheet 3D modelling.
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3151
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Octane Sketchup Exporter - 1025-02

Postby TIG » Fri Oct 05, 2012 7:32 pm

TIG Fri Oct 05, 2012 7:32 pm
Sadly... the more d.p's [up to 12 !] did reduce the issue slightly... BUT it still occurs noticeably...
Is this actually a limitation of Octane to render extremely thin triangular faces ?
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Octane Sketchup Exporter - 1025-02

Postby bomastudio » Sat Oct 06, 2012 9:15 am

bomastudio Sat Oct 06, 2012 9:15 am
Hi TIG, thank you for the exporter (and the other plugins you wrote)!!!!! I would like to expose a suggestion: as I use SU in my Ubuntu 12.04 and as the webdialog doesn't work well, I think that it could be a trick to use the wxSU library. I use this library (with satisfaction) for my plugins TECLA. It work well in Windows, Unix, OSX as it is based on the GTK. Can I modify the code of your exporter in order to get it working on my Ubuntu?
Thanks!
bomastudio
Licensed Customer
Licensed Customer
 
Posts: 14
Joined: Thu Mar 08, 2012 9:17 am

Re: Octane Sketchup Exporter - 1025-02

Postby TIG » Sat Oct 06, 2012 10:07 am

TIG Sat Oct 06, 2012 10:07 am
Provided your changes to the tool's code are for your own 'private use' and not 'for profit' or even wider 'free' distribution, then how am I or Otoy ever going to know what you are doing ?
Obviously you must not post your own OS specific version of it here [or anywhere else for that matter] without clear prior approval of Otoy etc...

Because it'll be 'your baby' I can't offer support or advice on it to you or others.

A word of warning 'wxSU' has been implicated in clashes with some other legit SketchUp tools, and few developers use it any more [I think it's development' has also stalled ?] - so be prepared for such potential issues if you go down this path... :?
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Octane Sketchup Exporter - 1025-02

Postby bomastudio » Sat Oct 06, 2012 10:21 am

bomastudio Sat Oct 06, 2012 10:21 am
TIG wrote:Provided your changes to the tool's code are for your own 'private use' and not 'for profit' or even wider 'free' distribution, then how am I or Otoy ever going to know what you are doing ?
Obviously you must not post your own OS specific version of it here [or anywhere else for that matter] without clear prior approval of Otoy etc...

Because it'll be 'your baby' I can't offer support or advice on it to you or others.


:oops: ok!

TIG wrote:A word of warning 'wxSU' has been implicated in clashes with some other legit SketchUp tools, and few developers use it any more [I think it's development' has also stalled ?] - so be prepared for such potential issues if you go down this path... :?


Could you link me more about this clashes? I need to understand ..... thank you
bomastudio
Licensed Customer
Licensed Customer
 
Posts: 14
Joined: Thu Mar 08, 2012 9:17 am
Previous

Return to SketchUp


Who is online

Users browsing this forum: No registered users and 12 guests

Fri Apr 19, 2024 2:06 pm [ UTC ]