question

David Chan avatar image
0 Likes"
David Chan asked Marian C commented

Sketchup import faced distortion

Hi

I am trying to import a skp file in 2014 format. The imported shape is distorted.

tree18.skp

Will Developers start to upgrade the Sketchup version that we can import? Currently, the oldest version is already 2014. In due time, I guess they will remove it too.

Regards

David

FlexSim 19.0.0
sketchup import
tree18.skp (3.3 MiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Marian C avatar image Marian C commented ·

Hello David,

I had a lot of trouble with importing 2d/3d CAD files into Sketchup. I hope that my experience will help you.

1. You need to set your Sketchup model units to "meters" and save the file to Sketchup 2015 (Flexsim 2019) or 2014 (Flexsim 2018) format. This way you can import very complex files no matter how many instances or component references you have.

Important : there is a limit though in the number of faces that Flexsim can import ... so you will need to break down your model into smaller chunks and import them 1 by 1.

2. The same thing happens with .dwg files . You need to set them to "meters" and then import.

Important : when you import Autocad / Sketchup...applications must be closed!

Thanks.

1 Like 1 ·

1 Answer

Phil BoBo avatar image
3 Likes"
Phil BoBo answered Phil BoBo edited

Sketchup doesn't give you much control over the data in your model or how that data is exported.

The issue with this shape is that the leaves are instances of the "leaf44" component, and that component uses the default material.

The leaf texture is being applied to the parent group "leaveslevel2".

If you drag out a "leaf44" component into the model, you will see that it doesn't have the leaf texture material.

The problem is that when the Sketchup SDK is importing this shape, it isn't giving these leaf faces texture coordinates because it thinks they don't have a texture. It is also not unloading the leaf12.png texture from the file (because it thinks it is unused I guess).

That trouble is all happening in the 3rd party Sketchup SDK before it even gets to FlexSim code.

Because of that, when FlexSim loads the data it is given by the Sketchup SDK, the leaves were assigned the default material:

Because the faces don't have texture coordinates, you cannot even use FlexSim's Customize Meshes feature to explicitly assign the leaf texture to the leaves. If you try, then the leaves disappear because they are using the top-left corner pixel of the texture (which is invisible) because they have no texture coordinates:

When you export to another format from Sketchup, such as collada or 3ds, it isn't exporting the texture coordinates correctly, so the leaves are all rendered incorrectly:

None of the errors with loading this file are happening in FlexSim code, so there's little we can do about this from a development perspective.

From a modeler's perspective, you can edit the component in Sketchup so that the component itself is assigned the material. This causes the SKP importer to unload the texture correctly and assign those faces texture coordinates correctly.

To do this, you can drag a new instance of the component into the model. Then right-click that component and select Edit Component. Then select the faces in the 3D view and assign them the leaf material in the Entity Info view. You can then delete the extra component that you used to edit the component.

Following these steps, the shape comes into FlexSim correctly:

Attached is the file with these steps taken (and the Steve person deleted): 17463-tree18-pb5.skp

> Will Developers start to upgrade the Sketchup version that we can import? Currently, the oldest version is already 2014.

It is on the dev list to upgrade to a newer version of the Sketchup SDK to support newer versions than 2014.

> In due time, I guess they will remove it too.

Sketchup can still export as far back as version 3.

It is irritating that the free Sketchup For Web online app only supports exporting to the newer skp formats (that change every year and are incompatible with previous versions of their SDK), but that's a Trimble business decision. Not much we can do about that.


leaves1.png (1008.9 KiB)
leaves2.png (589.5 KiB)
leaves5.png (301.7 KiB)
leaves6.png (336.0 KiB)
leaves7.png (372.2 KiB)
leaves3.png (2.1 MiB)
leaves4.png (1.1 MiB)
leaves8.png (14.7 KiB)
leaves9.png (44.1 KiB)
leaves10.png (1.3 MiB)
skp-formats.png (81.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.