How to p-a-r-s-e a model with Nested Component Information

sketchup
render
sdk
components
subcomponents

#1

Hey,
I was parsing a model with component and models. When I parse it, I get the information from ModelInfo i.e;


But since, it says there are no faces nor edges - I am not able to render it or create a Mesh ( since creating a mesh requires a face).
But when I check the Nested Component option i.e;

I get all the information about faces , edges, etc.
My question is how to parse this kind of model or how to get the information as given by checking the Nested component option. I have already referred to skp_to_xml sample in sketchup sdk -There is no information about the same in it ! ( I am using C++)


#2

SketchUp has more entity types than just faces. That means if you are looking only for faces, but not for component instances, you won’t find faces inside component instances.

You either have to get the instances (and groups) in the current entities collection:

  1. SUEntitiesGetInstances
  2. and then you get the definition for an instance SUComponentInstanceGetDefinition
  3. get its entities SUComponentDefinitionGetEntities
  4. and then its transformation and contained faces, (and again recursively all contained instances and groups as above!) SUEntitiesGetFaces

There might be a non-recursive alternative by just reading the definitions and where they are contained (kind of a nesting/dependency graph).

  1. Get the definitions: SUModelGetComponentDefinitions (analog for SUModelGetGroupDefinitions)
  2. and for each definition you get the contained geometry
  3. and for all instances (SUComponentDefinitionGetInstances) the transformation and the parent entities (I don’t know how in C API?).

#3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.