I want to align face normal to an edge

ruby

#1

I have a face and I want to transform the face so that the face normal is aligned with start vertex for another edge using ruby .


#2

Should work if you create a transformation like this:

Assuming the face is drawn on the ground plane (z = 0)

origin = edge.start.position
axis = origin.vector_to(edge.end.position)
trans = Geom::Transformation.new(origin, axis)
entities.transform_entities(trans, [face])

I haven’t tested this but it will hopefully get you on the right track!


#3

this doesnt work. it will move only the face in the direction of the vector.