"Surfaces" in the SketchUp C API

I have started using the SketchUp C API to import SKP files into our standalone app.
Is there a way within the API to access what SketchUp considers a “Surface” which appears to be a set of connected faces.

For instance, when using the attached SKP file…

Faces and Surfaces.zip (7.8 MB)

…the webapp will report ‘info’ where some selections are faces:

and some are surfaces:

I don’t see a way in the API to get the surfaces - knowing that some faces are connected instead of all being independent would greatly increase our performance when making polygonal meshes from the faces.

Any ideas?

Thanks in advance.

The edges between “surface” faces are softened and/or smoothed.

A soft edge will cause the connected faces to be treated as a surface. This means that if you have Hidden Geometry off and select one face it will also select all faces connected with soft edges. A soft edge will also appear hidden.

The “surface” feature is a GUI feature and I do not think either API (Ruby nor C) has a “get surface” method / function.

So within any entities collection (model, group or component) you would need to filter the faces you get back. It might be easier to collect the edges, and filter out any that are not softened or smoothed. Then get the faces that share the remainder. You’ll need to decide whether you also need the unsoftened / unsmoothed border edges.

Another possibility is to go via the EdgeUse. If you have a face that is part of a surface, having a smoothed / softened edge, then you get the next connected edge from the edge’s EdgeUse object and from that the connected face. … And so on.


Thanks for verifying the issue regarding ‘surfaces’ and the API … and for the suggestions about how edges and “edgeuse” might help.


It was a second thought because any entities collection might have more than 1 independent “surface” feature. The 1st suggestion would treat them all as one, which might lead to an erroneous import.

Yea, no API for this. (You can log a ticket here: GitHub - SketchUp/api-issue-tracker: Public issue tracker for the SketchUp and LayOut's APIs)

Can you expand on this? I’d like to understand this scenario better.

I had to find the surfaces myself in the OBJ exporter for QuadFace Tools:

It’s tied deeply with the logic of dealing with QFT quads, but maybe the gist of the logic will help you out?

1 Like

Thanks for the snippet … I’ll investigate to see if that will help.
What I’m doing is trying to build individual mesh entities out of connected facets. Fortunately we have some tools here that can take a large set of triangular facets and build what I need, but its basically a post-processor that I need to invoke whereas if the SketchUp API were to tell me what faces connect to make what the webapp will report as surfaces, them I think I can manage it upstream instead of downstream.

I tried going to the issue tracker but got this:


… be gentle … its my first time…

Hm… I think that might be something to do with the policies of the GitHub Enterprise you are member of. Sounds like they added restraints to your account?

@PeteRimkus Any luck finding a solution to finding surfaces? I’m hoping to do the same, in order to export surfaces (instead of faces) to PDF.

I did not find a way in the SketchUp API to access a tessellation that matches the ‘surfaces’ shown in SketchUp. We do have some pretty strong mesh tools here internally and I ended up finding something that was able to do the job for me from a lot of random triangles.

Sorry I couldn’t help. I wasn’t successful in my attempt to log a ticket - maybe you can.
Good luck


Did you talk to the admins of your GitHub enterprise account?

You’d have to traverse the faces and collect the faces that are separated by soft/smooth edges.

Thanks. I understand this part. What I and a colleague haven’t figured out is how to export these traversed faces (i.e. surfaces) as a solid object to PDF.

(Thinking out loud.) To be a solid, would the surface need to be a closed manifold volume ?

Are you looking to repair non-manifolds?
Or is the question about generating PDF files?

About generating PDF files.

Okay then please begin a new topic rather than hijacking this one. You can link the 2 topics as related by clicking the Share button at the bottom of the thread (above the Bell notification button) and then click the +New Topic button on the Sharing popup.

The SketchUp C API doesn’t generate PDF files. You’d have to find a separate library for creating PDF files.