I’m a little stuck right now on this problem and I’m not seeing an easy or efficient solution to the problem.

I basically create a face and a path and use the followme method to extrude along the path. The original face remains and so I am able to grab that face from its original handle and manipulate its vertices as required.

The hard problem is how to acquire the vertices of the face at the other end of the solid (at the end of the extrusion). My proposed algorithm is to check all of the faces of the group and compare the area of each with the original face, if they match then it should be the opposite face however this method is not totally 100% bullet proof.

If you know (you should) the last segment of the path you can make an additional comparison if the face normal parallel to the last part of the path: # parallel? (vector2) ⇒ Boolean

The first check you suggested can be checked. An even more exact match can be obtained by using the samedirection method for vectors.

This does get me a bit closer, but again its still not 100%, there are cases where it will fail. The second test suggested won’t work as given but it does have me thinking.

Three other faces in the footing group meet the criteria however by choosing the last one in the narrowed down list of four it grabs the end face. I’m not sure how reliable this is but after a number of tests it does seem pretty reliable.

Is it always the case that their normal will be in the same direction?
You could do a compare on their area + the total length of the outer loop.

The only way to be 100% sure is in my opinion to not rely on SketchUp’s tools to create the extrusion but to calculate and create the geometry yourself.

You know the ‘line’ of the final path edge | or you know the final two vertices relating to the final path edge.
Either gives you a vector.
Iterate the group.entities and find all faces with a normal matching that vector.
From that limited set of faces use the point of the final vertex in the path and test for that point being on a face.plane >>> to hit
To further check… the area and the dimensions of the start face and final face should be the same ? [assuming the path starts perpendicularly to the start-face]

Does anyone see anything wrong with the code sample above? It seems to work 99.9% of the time. I’m not saying it won’t fail but so far it looks pretty solid.