I just want to clear up some misconceptions that have run throughout this thread. The design everyone is referring to as Ralph McQuarrie's really belongs to Ken Adams.
McQuarrie had finished his work on Star Wars (done throughout 1975 through 1976) when he was hired to work on Planet Of The Titans as a concept artist and production illustrator. McQuarrie's Enterprise illustrations are based on production designer Ken Adams' Enterprise design sketches shown above, directly below the heading "preliminary McQuarrie sketches".
To be clear, the black and white marker sketches shown above are Ken Adams' initial sketches as he worked to create a new Enterprise design. These sketches were supplied to Ralph McQuarrie who did the color renderings shown above.
It's possible that Adams arrived at this basic design on his own (considering the angular nature of his many set designs for James Bond, a triangular hull for the Enterprise does not seem out of place). Remember, Star Wars had not been released at the time that Planet Of The Titans was being designed. Planet Of The Titans was cancelled on May 8th, 1977.
It is also possible that McQuarrie had shown Adams some illustrations of the Star Destroyer but the Star Destroyer design was not McQuarrie's but with model-maker Grant McCune. McQuarrie would certainly have been aware of the Star Destroyer's triangular shape but it seems unethical to me that McQuarrie would have shared designs from the unreleased Star Wars with Ken Adams.
Due to a lack of script, McQuarrie had free reign to play with the design and place it in different environments. The Enterprise entering the asteroid is purely from McQuarrie's imagination and was not something from the script. McQuarrie liked the idea of a base built into an asteroid for many years and found the idea would work as a "blue sky" concept to present to the production staff.
BTW, this information was derived from various sources including The Art Of Ralph McQuarrie and The Art Of Ralph McQuarrie Archives, both published by Dreams and Vision Press.