Is there a function to know a group or a component is a solid group or a solid component?


#1

Hi Experts,

A Solid in SketchUp is a single Group or Component whose geometry meets certain conditions. When those conditions are met, Entity Info in SketchUp application indicates the model is a Solid Group or Solid Component.

In SketchUp SDK, is there a function to know a group or a component is a solid group or a solid component? Or Is there a function, its input is faces, then output is to tell you if these faces can be converted as a solid or not?

Thanks
Phenix


#2

Hi Experts,

In SKP SDK, there are two functions “SUComponentDefinitionOrientFacesConsistently()” and “SUModelOrientFacesConsistently” which can fix the face orientation issue. Could you please give more comments about their differences?

Thanks
Phenix


#3

In ruby the function is group.manifold?
It returns true if the group is a solid.


#4

how about C?


#5

In a roundabout way yes.

Firstly, groups would need to be cast to a ComponentInstance using …
SUGroupToComponentInstance

Secondly you would attempt to get the volume of the instance using …
SUComponentInstanceComputeVolume, and test the result for not SU_ERROR_NO_DATA
(which is returned if the instance is not manifold.)


Enhancement Issue logged:


#6

Thanks @DanRathbun .

There is another question. SKP SDK provides the API to fix the inconsistent face orientation issue for component and model. Why is there no API to fix the inconsistent face orientation issue on group?


#7

A group is just a “special” class of component instance (whose definition is hidden from the Component Browser panel, and when there are more than 1 instance manually opening the instance for edit creates a new unique clone definition for the instance being edited.)

So groups, component instances and images all are instances of a “mother” definition.

The solution with the C API is like that given above. When you need functionality from related classes of objects you will need to cast your object to that other class. (So cast your SUGroupRef to an SUComponentInstanceRef and then call the desired function.)