Modern roller coasters must be designed so that the riders can't reach, touch or hit anything near them during the ride, for their own safety, and any realistic coaster made in NoLimits 2 needs to follow the same guidelines. Fortunately, NoLimits 2 gives us the same tools to do this that are used on real coasters.
First of all, the question that needs answering is what violates clearance. Most of these are obvious: Supports, footers, track, scenery, tunnels, and terrain always do. Handrails and station gates do not, as their position relative to the train can't be controlled. However that's OK, as wherever they're found the track will typically be straight and trains will usually be moving slowly. There is one thing that sometimes violates clearance: Other trains, and their clearance envelopes. These do not violate clearance if they're part of the same block of the same coaster, otherwise they do. For example, the entrance and exit of a vertical loop only need to be far enough apart that you won't be able to reach the other track, as you'll never have two trains going through the loop at once. But if different blocks of the same coaster or two different coasters come in close proximity, clearance between trains must be maintained. This is particularly important for dueling coasters.
NoLimits 2 gives us two methods of clearance testing: The rough method that was all we had in the original NoLimits, and the fine method that's used on real coasters.
Rough clearance testing: Tunnels
Rough clearance testing, otherwise known as tunnel testing, is quite simple. You simply apply tunnels to the entire coaster, and inspect the inside of them. If you see anything protruding into them, it's a potential clearance violation. Either move/remove it, or recheck it using the fine method. If two tunnels intersect, it's only a potential clearance violation if one of them is actually supposed to be a tunnel, if they're not on the same block of the same coaster, or if the track inside one tunnel protrudes into the other.
Save the park first, then unfreeze the coaster, select the entire thing, apply tunnels (under Style Settings) and freeze it.
Looks bizarre, doesn't it?
The supports and catwalk visible inside the tunnel are potential violations. The intersecting tunnels are no problem, as the tracks are on the same block, leading into a switch track.
Once you're done checking, the easiest way to remove the tunnels is to just close the park without saving. Adding tunnels can undesirably change track styles, so this is the easiest way to revert these changes.
Fine clearance testing: The Clearance Envelope Frame
A clearance envelope frame is a template, typically made of wood or metal, that is mounted to a coaster train and extends as far as a rider can reach in any direction, plus a safety margin. Before any real coaster opens, one of these is mounted to the train, and it's slowly pulled through the layout, with the engineers making sure nothing touches the template.
Here's an example, on Millennium Force:
NoLimits 2 has this very same thing available for all its coasters, and you can add it to any train and do a pull-through just like how it's done for real. This is extremely accurate, and allows for much closer clearance than tunnel testing does.
Open a park in the editor, and unfreeze the desired coaster. Go to the Scenery tab, and click "Choose..." then navigate to Library > Scene Objects > Various. Select the Clearance Envelope and click OK.
Place the clearance envelope "box" and move it so that it's close to the first train, typically the one in the station. Freeze the coaster.
Leave the editor and open the coaster in the simulator. Find that same train, it should have the clearance envelope frame on its last car. It'll look something like this:
Note that the frame clips into the railings on both sides, and the floor. This is perfectly fine in the station, as the train won't be moving fast.
Now you need to set things up for the pull-through. First, open the control panel with F4. Press Reset, Manual Block, then Full Manual. Go to the Trains tab, and enable Move Train for the train with the clearance envelope frame, typically train 1. To get the best view of the clearance, press E until you're in Fly-by View, press C until you're in the last car, then pull back with S until you can see the entire frame. Put the control panel in the middle of the screen, you'll need it. It should look something like this:
To do the pull-through, use the BWD/FWD knob next to Move Train to slowly move the train through the whole layout. Closely watch the edges of the frame, anything that touches it or the space inside it is a clearance violation and must be fixed. Once you're done, just delete the clearance envelope "box" in the editor.
Here's that same spot that failed the tunnel test, you can see that the supports and catwalk just barely clear the frame, so it passes clearance:
And here's the closest clearance you'll find during the ride:
Another example of very close clearance, on a Wild Mouse. This is what you'd call a headchopper:
Where this gets difficult is dueling coasters, different coasters, or different blocks of the same coaster in close proximity. Really, any situation where the clearance envelopes of different trains could intersect. In order to test these situations properly, just test both trains at the same time. Apply the clearance envelope frame to both trains, move them both to the spot where they come close to each other, and move them back and forth making sure the clearance envelope frames of the two trains can never touch each other.
The perfect example of a coaster requiring this sort of clearance testing is Dueling Dragons. This is the loop duel, and is actually just barely a violation:
Lastly, there's one thing you may be wondering... Is it ever OK to violate clearance? The modern clearance standards haven't always existed, so if you're recreating a coaster from before they existed, you may need to ignore them to make the coaster as accurate as possible. A perfect example is The Beast, its tunnels don't even come close to meeting modern clearance standards. While you obviously won't hit your head, you can't put your hands up in them at all. The only other exception I can think of is kiddie coasters that only allow kids to ride them, they have a shorter reach so the coaster can have a smaller clearance envelope.