beam_ref_side_incidence_with_vector
- compas_timber.connections.beam_ref_side_incidence_with_vector(beam_a, vector, ignore_ends=True)[source]
Returns a map of ref_side indices of beam_b and the angle of their normal with a given vector.
This is used to find a cutting plane when joining two beams where one beam is represented by the normal of one of it’s reference sides.
- Parameters:
- beam_a
Beam The beam for which ref_side angles will be calculated.
- vector
Vector The vector to compare against the ref_sides’ normals.
- ignore_endsbool, optional
If True, only the first four ref_sides of beam_a are considered. Otherwise all ref_sides are considered.
- beam_a
- Returns:
- dict(int, float)
A map of ref_side indices of beam_a and their respective angle with the given vector.
Examples
>>> vector = Vector(1, 0, 0) >>> ref_side_angles = Joint.ref_side_incidence_with_vector(beam_a, vector) >>> closest_ref_side_index = min(ref_side_angles, key=ref_side_angles.get) >>> cutting_plane = beam_a.ref_sides[closest_ref_side_index]