After applying 3D effects I have now many extra lines. I want to leave only the contour lines and delete the rest. I've tried pathfinder options but no luck.
Illustator makes the extrusion in a way that the result is splintered. There's a seam (=a line in the wireframe) at least at every anchor point of your curve. Unfortunately there are many more, the process cannot be controlled via user interface.
If you want to get rid of the lines which point to the extrusion direction, you can simply forget the 3D effect and draw it in 2D. The needed watching projection can be achieved with effect Distort & Transform > Free distort. Make a shifted copy and add those lines that you want between the curves. An example:
Expand the appearance (it's in Object menu) after applying Free Distort. Otherwise it's very difficult to place the parts because the original curve rules.
If you add some lines between the curves, they snap easily only between anchor points. So, add anchor points before making a copy.
You can achieve arbitary perspective if you distort both curves separately or scale another of the curves after distortion. You can use 3D effect extrusion version as your model.
It's possible to remove the extrusion lines from the extruded wireframe. You must
- expand the appearance to fix the effect and make edits possible
- apply Ungroup as long as there's no groups. Then release the clipping mask.
- delete the unwanted parts.
The original strokes at the ends of the extrusion are closed curves, which are not splintered. They can be selected and locked. By selecting all after it you can delete nearly all unwanted objects:
Make the purple selection, goto Object > Lock > Selection
Select all, press DEL, most of the extras vanish
Unlock all, select the rest unwanted lines and press DEL, you have only the ending cap curves of the extrusion
You can split the closed curves and get usable single strokes.
The next image shows how much there's extras if you only want the single stroke curves (red and blue) at the ends of the extrusion
ADD due a comment: Freeware CAD (=DesignSpark Mechanical) makes easily wireframes where hidden lines are removed. It can be taken for edits to Illustrator as PDF print.
There's seams just where the extruded curve had joints line - curve - another curve. The curves are circular arcs. If the drawing was a single spline, there would be no seams.
ADD2 Illustrator's shape builder tool recombines areas to closed shapes. Read it's exact usage from Adobe's user guide or tutorials. An example:
In the left there's a wireframe and one wants to remove the hidden lines. In the right the whole shape is selected and one just drags with the shape builder tool over a line which should vanish. The result and the second line under the work:
The final result:
It consists 3 separate closed areas now.
Before using the shape builder one must set the forthcoming stroke and fill of the new closed shapes. The original curves vanish, so make spares if you need them.
Closed shapes have an advantage: You can color them as you like.
Of course a shaded extrusion also can have a good color and it comes with very low effort, but it is not allways as wanted.