Towards a 'Robust' Sketchup Exporter

Hi,

It’s 2023. Both Rhino and Sketchup have been around for more than 20 years.

Anyone that uses both programs knows that still, after 2 decades, Rhino’s Sketchup Exporter is no good. Sure, it gets geometry to the other side, hence the ‘robust’ adjective in title. I am sure we can raise the bar just a little bit.

Probably the person who wrote the exporter some time ago didn’t use Sketchup. I don’t blame him, it’s a pain. I almost don’t either and try to avoid it whenever possible.

But if you are going to write an exporter there is probably some basic understanding you want to take into account.

In Sketchup, possibly for the worse, things are organized a little bit different than in Rhino. There is this ‘Untagged’ tag/layer which works as Rhino’s Default layer. Except you cannot delete it.
A golden rule is that All raw geometry should remain as Untagged.

There are 2 types of geometry in Sketchup. Edges and Faces. Don’t ask me why.

All these geometry always goes to Untagged. You can either choose to group or block geometry, and these groups/blocks is what gets organized in other tags/layers.

You know how in Rhino when you create a Block, that Block also has a layer? And sometimes you turn off layers and parts of a Block disappear because it has elements on those layers that you just turned off? Well, Sketchup kinda takes care of that by forcing all your elements to be inside the same layer, always.

So all elements go to Untagged layer and Blocks and Groups go to other layers.

Let’s see Rhino’s exporter in action:
Export settings:
image

An array of prisms:

Looks good… from a far… and that’s it.

1)) Right off we can see some errors in faces.

2)) Faces cannot be extruded further. (Yes I did check the ‘export planar regions as polygons’ option.

3)) Whole objects get exploded in Sketchup. So when I go select my cube, instead of selecting the whole, it selects one face. You might not think this is a big deal but see what’s next.

4)) When two distinct polysurfaces that are adjacent to each other in Rhino, even though they have different GUID, layer and material, when brought into Sketchup, as all the faces are exploded, its impossible to isolate one object from the other. What’s worse, adjacent superimposed faces will merge into one, so you no longer have 2 cubes.

You might say, ‘select by layer’. Yes I can do that, but when I move my red faces I get this.

5)) No, this is not wireframe display. Rhino exporter ‘correctly’ places faces on the layer they had in Rhino, but the edges are left behind and automatically places on Untagged.
I say ‘correctly’ because placing raw geometry in any layer that is not the ‘Untagged layer’ is a big no-no in Sketchup.

How exporter should work:

  1. Planar faces should be a single ngon inside Sketchup that you can extrude.
  2. Both faces and edges should be places on Untagged layer independently of their current layer in Rhino.
  3. Faces will get no materials assigned to them inside Sketchup. (see point 4 and 5)
  4. Each individual object in Rhino (be it a surface, a polysurface or mesh) should come up as a Group in Sketchup. And this group should be placed on a layer the same as it is in the Rhino document.
  5. These groups will inherit the material the rhino object had, whether it is by layer or by object. Sketchup layers cannot have materials assigned to them, so instead the group (that groups the object’s edges and faces) will inherit the material.

This should have been like this from Day 1. I am tired of trying workarounds with little to no success. Making blocks out of each object inside Rhino… Exportings to 3ds and trying all settings, exporting to DWG/DXF with 2007 Solid Export scheme. etc etc. Why do we even have a Skechup exporter I wonder?

Please, if someone is willing to develop a paid plug-in I will gladly buy it. I don’t expect much from McNeel at this point, but I least I have done my part.

2 Likes

I know this is tangential to the issue in your original post but can I ask what your workflow is with SketchUp? Or better yet, what can you do in SketchUp that you can’t in Rhino? I know you said you avoid it when possible but you still need to get into it every now and again.

I’m in a similar position. A lot of people in the climbing wall industry use Sketchup. Models can be viewed by almost anyone and dragged around relatively easily. Sketchup based wall designs often reflect the poor modeling skills of their creators. But that’s a different story.

I’m usually exporting geometry that should be separate in blocks which are imported into SU as components.

Attached is a block I created in Rhino, exported as Sketchup 2017 file.

box.skp (8.3 KB)

Once imported, the component is on Layer0. The box surfaces can be switched off by unchecking Layer 05.

A wireframe box remains visible. It consists of the edges of the box, however there were no separate lines or edges in my Rhino file.

The duplicate edge problem isn’t a huge problem for me as I do not have to work with the files exported but I’m still wondering why the edges get duplicated and I don’t think it’s necessary.

1 Like

I don’t do anything is Sketchup. People at work place use mainly Sketchup, hence the export. Usually because Sketchup can’t do Rhino or Grasshopper, we need to model in Rhino and export to Sketchup, combining already existing model in Sketchup with bits from Rhino model. At the end it all gets rendered in Sketchup with Enscape.

I know Enscape is also available for Rhino, the issue is people at work place are not willing to use/learn Rhino.

Sometimes I am the one doing the renering. Or sometimes I need stuff from other people who only work in Sketchup and then I do my work and I need to sent it back to them, again in Sketchup. So we are constantly importing stuff and exchanging files but the end goal is Sketchup. Visualization guys work in Sketchup so they need everthing in Sketchup, tidy and organized to be able to make modifications.

Edges are not being duplicated. Those are the edges of your faces. If you delete those edges, the face will be deleted too. Things is face and edge are in two different layers. Do not ask me why this is possible in Sketchup, edges should not be a type of geometry you can change its layer.

The edges of your faces are actually in Layer0, while the face itself is in Layer05. So when you hide Layer05 the edges remain visible.

Well then they are created in Sketchup. All I’m saying I did not export edges as separate curves.

1 Like

Hi @martinsiegrist,
Thanks for the simple file & steps to repeat.
I will get this logged and post the YT here soon.

Thanks again for letting us know.
Sincerely,
Mary Ann Fugier

Hi @martinsiegrist and All
We cannot control the way that Sketchup Imports a SKP that Rhino exports.
And we believe we are just experiencing the way Sketchup works.
So there is no Rhino bug that I can extract from this.

We made a box in Rhino 8 and saved the 3DM.
Then we use SaveAs and save it as a SKP 2021 with the default options.
When we open the SKP in Rhino, can import as a mesh or trimmed planes.
we do not get any curves unless I extract the edges.

When we open the same SKP in Sketchup 2021, we get Faces and Edges. This is how Sketchup works and this relationship is basic to its geometry. Here is an older video on “Edges and Faces”. I don’t see how we can avoid this.

And like @martinsiegrist said, it is not too much work to delete them, but you risk deleting the whole face depending on your settings. When you import a box into SU, you get 18 objects, 6 faces and 12 edges.
You can also turn off the display of edges or faces.
Sketchup Edges Display

If you have Sketchup support, you may want to ask if there is a command, setting or procedure to prevent this from happening.
If someone gets a solution from Trimble, please let us know.

Sincerely,
Mary Ann Fugier

Hi @mary , thanks for the updates!

This discussion contains some other items than just the edges, but maybe we can discuss those some other time.

Regarding the edges issue specifically, the issue is not so much that we get curves, but rather than edges and faces end up in different ‘Tags’ inside sketchup.

Example:
I made this export from Rhino.

Everything looks fine right?

But notice what happens when I turn off the ‘tag/layer’ the geometry is on.
image

I am left only with the edges. Why? Because Edges are in ‘Untagged’ layer, while faces are in ‘Addtional Slabs’ layer.

Why does this happen? Sketchup can place mesh ‘faces’ in one layer, and ‘edges’ in another layer.
The exporter should place both edges and faces in the same tag/layer.

From numerous discussions with Sketchup staff, the best practice is to place all geometry (faces and edges) in Untagged layer, or otherwise place both in the ‘Additional Slabs’ layer, but just make sure to deal with both edges and faces of the mesh.

Hi @ShynnSup,
Thanks for the additional details.

It would help a lot if we could get:

  • a Rhino file as the source.
  • And a SKP that is your target or desired result.
    Make it as simple as possible, with only the objects required to see this issue.

Sincerely,
Mary Ann Fugier

1 Like

Sure thing! Here the files @mary.

  • I have 16 rotated prisms in Rhino. (polysurface)
  • In layer ‘Rotated Boxes’
  • With Red color
  • With Material by Layer set to ‘BLUE MATERIAL’

Now I Sketchup, best practice should get me:

  • 16 ‘sketchup groups’, one per each polysurface.
  • Each group in tag ‘Rotated Boxes’
  • Inside each group, the edges and faces (you can think of them as sub objects) should be in Untagged layer.
  • Groups should have material named ‘BLUE MATERIAL’ assigned and display as blue because Sketchup displays material color.
  • Faces and Edges (the objects inside the groups) should have no material assigned.

See here: When I enter a sketchup group and select the faces and edges inside (6 faces + 12 edges = 18 entities) The layer is Untagged and It has no material assigned. This is the correct way.

Here the models:
Test Model_3DM.3dm (454.0 KB)
Test Model_SKP .skp (92.7 KB)

1 Like

Thanks for the testing.

I kind of gave up with Sketchup…. Also the unit issue with exporting block so they can be used as components in the correct unit system is just a pain.

I don’t have sketchup pro to test this but does a simple mesh box exported from rhino as *.dxf also create additional edges when imported into sketchup?

I talked to someone from mcneel about importing SKP and it was implemented in correct way in V8. The same principles should be applied for export likewise. All geometry in rhino should be exported to layer0 and polysurfaces should become groups with corresponding layer.

1 Like

Hi @ShynnSup,
Thank you for the details and files.
This is very helpful.

I will work to see the issues here on my computer and get them logged for the developer.
When I have the YTs I will post them for you.

Sincerely,
Mary Ann Fugier

1 Like

Also, though it’s been a while since I worked on it, I seem to remember Exporting geo as a DXF SOLIDS 2007 and then Importing that into Skp gives you solid groupings (as opposed to the separate faces, etc)

-Alan

Yeah, this is my usual workflow - unfortunately doesn’t bring materials in but it is helpful in bringing in (poly)surfaces as usable geometry.

1 Like