I’d make a plane for the new end face (see overview of Geom
module.)
Then use each edge object’s #line() method to get an array of lines to intersect with the plane.
See Geom::intersect_line_plane
module method.
Something like (untested):
# assume var "plane" was set using a point
# on the plane and it's normal vector,
# and var "edges" is an array of the horizontal edge objects
lines = edges.map {|e| e.line }
new_points = lines.map {|line| Geom.intersect_line_plane(line, plane) }
vecs = []
verts = []
new_points.each_with_index {|pt,i|
verts << edges[i].end
vecs << edges[i].end.position.vector_to(pt)
}
ents = edges[0].parent
ents.transform_by_vectors( verts, vecs )
Ref related topic in this category: