  Given a quasi-projective 3-fold X with only Gorenstein terminal
singularities, we prove that the flop functors beginning at X satisfy higher
degree braid relations, with the combinatorics controlled by a real hyperplane
arrangement H. This leads to a general theory, incorporating known special
cases with degree 3 braid relations, in which we show that higher degree
relations can occur even for two smooth rational curves meeting at a point.
This theory yields an action of the fundamental group of the complexified
complement of H on the derived category of X, for any such 3-fold that admits
individually floppable curves. We also construct such an action in the more
general case where individual curves may flop analytically, but not
algebraically, and furthermore we lift the action to a form of affine pure
braid group under the additional assumption that X is Q-factorial.
  Along the way, we produce two new types of derived autoequivalences. One uses
commutative deformations of the scheme-theoretic fibre of a flopping
contraction, and the other uses noncommutative deformations of the fibre with
reduced scheme structure, generalising constructions of Toda and the authors
which considered only the case when the flopping locus is irreducible. For type
A flops of irreducible curves, we show that the two autoequivalences are
related, but that in other cases they are very different, with the
noncommutative twist being linked to birational geometry via the
Bridgeland-Chen flop-flop functor.
