Find closest match with current values, if it already fits cycle through next matches
The function should align the texture to the edge which is closest to the XY plane, and if there is more than one candidate, the lower one (thus always aligning to the edge which appears at the bottom). If the face's normal points straight up or down, use the edge which appears "down" to the user depending on camera orientation.
Fitting means aligning the texture to that edge, putting the origin at the left vertex of the edge, and scaling the texture so that it fits the width and height of the face. Of course, width and height is unclear for non-rectangular faces, and here we could use the largest width (parallel to the alignment edge) and the largest height (orthogonal to the alignment edge). In rectangular faces, this would give the expected results.
Also allow setting the texture repetition when fitting the texture, like in this screenshot:

Have both "Fit" and "Adjust" buttons - fit sets origin, scale, and rotation while adjust only sets origin and rotation.
Instead of having two buttons, allow the user to select which of the two texture axes should be scaled by the tool; this would be even more useful.
Also add a button "Reset" that resets scale, offset, and rotation. Finally add buttons "Paraxial" and "Parallel" which will set the texture projection axis to the closest coordinate system axis or the face normal, respectively (only available in Valve 220 and the likes).
Also add flip buttons to invert texture scale and a button to adjust texture rotation to the edges of the face, like the fit and adjust buttons but only for rotation.
Pushing this to TB 2.1.0.
Not sure about my previous ideas, but we need a way to:
Yes YES please.. At least I need an autofit texture to face button option as like in NetRadiant. I end up wasting so much time in TB2 trying to fit some texture(s) to some face(s). I was just working on an octagon shaped room and had a hell of a time getting textures to fit just right. Same map brought into NetRadiant and I'm done with that room in a few minutes using the Autofit to face(s) function in the Surface inspector. I want to stay in TrenchBroom, not have to rely on other map editors to fit textures efficiently or arbitrary scaling of some brushes when needed.

Same problem here. Cant fit textures when i scale my boxes. Also texture lock does not work in TrenchBroom 2.0.0 Release Candidate 4. Please add Fit function like in radiant.
I was about to ask for this feature too, it's just so invaluable!
Is this feature still planned for TB?
Sure, along with hundreds of other features. But yes, better support for texturing is rather high on my list.
Sorry if that came across pressuring, I realize this is mostly a one man
effort.
If it's any consolation, the reason most people are so adamant about these
feature requests is because Trenchbroom is such a great tool, and we all
just want to see it become even better :)
On Tue, Nov 7, 2017 at 8:35 PM, Kristian Duske notifications@github.com
wrote:
Sure, along with hundreds of other features. But yes, better support for
texturing is rather high on my list.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kduske/TrenchBroom/issues/143#issuecomment-342596705,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ae2N4y9MEssh6YKRmOEE6Lzqbq4rUDQ-ks5s0LD8gaJpZM4AM6Zc
.
--
Sincerely yours,
Dennis
Most helpful comment
Sorry if that came across pressuring, I realize this is mostly a one man
effort.
If it's any consolation, the reason most people are so adamant about these
feature requests is because Trenchbroom is such a great tool, and we all
just want to see it become even better :)
On Tue, Nov 7, 2017 at 8:35 PM, Kristian Duske notifications@github.com
wrote:
--
Sincerely yours,
Dennis