Textures upon group made from Import to sketchup


#1

Hi

I am having a import and export system to Sketchup and I discovered a bug which occurs when I

  1. import a group to sketchup from my system and
  2. adding texures to it then it does not provide the expected UV coordinates when I export it to my system.

but if I create the group in sketchup, then it works with the UV coordinates. Hence I start to wonder that my import of grouping to sketchup is missing something. I looked into the tutorials and it seems sound from my perspective. Is there anything I am missing.

What I do at the import is as following:

SUGroupRef suSpatialType = SU_INVALID;
SU_CALL(SUGroupCreate(&suSpatialType));
SU_CALL(SUGroupSetName(suSpatialType, spatialTypeTag.c_str()));
SU_CALL(SUEntitiesAddGroup(entities, suSpatialType));

There is no transformation matrix involved hence, I do not set it since it is identity.

TexturingUponNovapointExportedGroup.skp (151.2 KB)


#2

Search the official public issue tracker to see if your issue is listed …


#3

No, I do not see anything which covers the issue.


#4

Can you elaborate a bit more? What do you observe and what do you expect? (Sample data?)

From the attached model it looks like you have materials applied to the instances. In such scenario you have little control over the UV position and size. It’ll all be relative to the instances’s origin and transformation.

If you have a screenshot of the source geometry side by side with what you see in the SKP file you generate, that would help.


#5

Hi

I found a work around, which fixed my problem with textures at grouping.

What I did was:
If material upon group but not upon face, then I add material upon the group, that way I manage to get texture coordinates from the group and it works for my system. This is an ok solution for my system since we do not have any support for texture upon grouping.

Regarding the volumn not been calculated for case where you have several groups, I am still looking into it. I do believe that some of it is related to rotation of the faces, which is is not uniform in my import to sketchup.

Anders


#6

Almost forgot. Thank you both for the help


#7

Do you have an example model? (If you do, can you create a new thread for this?)


#8

Sorry for the late reply. I will have to get back to you about test dataset.

Another question:

SU_RESULT SUTextureGetDimensions(SUTextureRef texture,
size_t* width, size_t* height,
double* s_scale, double* t_scale);

If I multiply the number of pixels (width) with its scale factor (s_scale), the result value is then the model coordinates of that texture.

The term model coordinates (from header file in the code) is that length in feet or length based on a unitless system where 1 == the whole texture in that direction and larger than 1 means repeating the texture immage?