Sex itself is not obscene, it's the circumstances involved that can push it over the edge. My own view is that as long as the act involves consenting adults ONLY, then it is not obscene. Start involving children, animals or anyone who is being forced into something they don't want to do and it is.
There are grey areas, of course. Is an "entertainment" film, showing an acted, simulated rape more or less acceptable than a hard-hitting documentary showing a real one? Is it OK as long as the film-maker's sympathies are with the victim and trying to make you feel angry, rather than with the perpetrators and trying to titillate?
With scenes of violence (including rape), there seems to be an unwritten rule that the more realistic it is, the closer to "obscene" it gets. So an indestructible, chainsaw-wielding, mask-wearing psycho can carve his way through as many hapless teens (and hopeless sequels) as he likes, but a scene of a football hooligan kicking seven bells out of a rival may fall foul of the censors.
If I were to offer a definition of obscene - again, just my view - perhaps it's along the lines of "that which seeks to titillate and potentially corrupt the viewer, by depicting the real or realistic abuse or suffering of others".