Huh. Well. As it happens, it was much less painful adding in the transformation information than I thought: it works perfectly now.
For anyone interested, just as an fyi, if you want to recapture the correct geometry, you have to transform the mesh according to the value returned by Group.transform, not the inverse of Group.transform. In other words, you want something like:
t_matrix = Geom;;Tranformation.new
def output_entity(entity, t_matrix)
if entity.typename == "Group"
t_matrix = t_matrix * entity.transformation # <== *NOT* t_matrix * entity.transformation.inverse
entity.entities.each{|sub_entity| output_entity(sub_entity, t_matrix) }
elsif entity.typename == "Face"
mesh = entity.mesh 0
mesh = mesh.tranform! t_matrix
# [Add output code here]
end
end
Anyway, I'd still be curious if there's a more "internal" solution, but it seems like everything's working perfectly, and much less painfully than I'd expected.
Kevin