These three stocks are fundamentally sound companies with excellent underlying growth prospects. However, shares in machine vision expert Cognex (CGNX -0.90%), advanced materials company Hexcel (HXL 0.03%), and Tesla (TSLA 3.46%) all declined in the first half of 2025. On balance, all three are worth buying, as their issues appear to be near term, and their long-term investment cases remain excellent.

Cognex's machine vision

It's been a difficult few years for the leading machine vision company, as its main end markets suffered cyclical weakness. Let's put it this way: If you are an automotive company, consumer electronics, or logistics company, and seeing slowing end markets due to relatively high interest rates, then the first thing you will cut is capital spending on new product development and expanding production lines.

That's what happened with Cognex over the last couple of years, and it's easily seen in a chart of its revenue over an extended period.

CGNX Revenue (TTM) Chart

CGNX Revenue (TTM) data by YCharts

Another thing you might notice is that, although Cognex's revenue does oscillate wildly, it does so about an upward trend line, and I think there's every reason to believe Cognex could get back to an aggressive growth phase in the near future.

It's not only that machine vision is an integral part of the fourth industrial revolution (the integration of the digital and physical worlds using the Internet of Things, and advanced data analytics), but it's also a technology whose relevance will increase with the growing adoption of artificial intelligence (AI) and deep learning.

Happy investors.

Image source: Getty Images.

Instead of rules-based machine vision (such as monitoring a product assembly line for a known defect), AI-infused machine vision can learn from masses of data and examples fed into it, and even learn to recognize defects that product engineers didn't previously understand.

With the underlying growth in the adoption of machine vision (with AI as an additional driver) and a return to cyclical growth in its key end markets (automakers and consumer electronics can't avoid developing new products forever), Cognex is positioned to achieve management's aim of 10% to 11% annual organic growth through the cycle.

Hexcel's near-term challenges and long-term opportunities

Selling advanced graphite composite materials to Boeing, Airbus, and their subcontractors presents a promising business opportunity, considering both companies' substantial backlogs of aircraft slated for delivery over the next decade (8,754 for Airbus, and over 5,900 for Boeing).

In addition, Hexcel also supplies materials for the electric vertical takeoff and landing (eVTOL) market (it's partnering with Archer Aviation), also sells to Embraer, and as CEO Tom Gentile noted on the recent earnings call, "the modern large cabin business jets now have extensive composite content, with ship set value between $200,000 and $500,000 per shipset."

Underpinning all of this is the positive trend in usage of composite materials, which increases with every new generation of aircraft, notably on wide-bodies such as the Airbus A350, which has a shipset of value of $4.5 million to $5 million for Hexcel.

The long-term outlook is excellent, but in the near term, Hexcel catches a cold when Airbus and Boeing start sneezing over supply chain issues that lower their production ramps.

Still, it's undoubtedly a question of when, not if, the commercial aircraft production ramp gets back on track, and there are already some very positive signs that supply chain issues with engines are being overcome. As such, investing in Hexcel could set you up for life.

Don't count out Tesla

Tesla's electric vehicle (EV) sales have declined this year, and CEO Elon Musk openly acknowledges the company could face a few rough quarters, not least due to the removal of EV tax credits. A combination of rivals releasing EVs and trying to establish market share, and ongoing relatively high interest rates, has pressured sales of Tesla's Model Y in particular.

At the same time, and on a more positive note, Tesla has begun its robotaxi rollout, and the key to the investment case for the stock is the potential growth in its robotaxi and unsupervised full self-driving (FSD) businesses. As previously discussed, it's not just the massive potential in the robotaxi business in itself; a successful rollout and the future release of unsupervised FSD to the public will add significant value to Tesla's EVs.

All the major automakers have either invested heavily in or explored robotaxis, and the reality is that Tesla remains best placed to succeed, provided it gets widespread regulatory approval. No other automaker has anything close to its market share in EVs in the U.S. It's far from clear when, and if ever, rivals like Alphabet's Waymo will be profitable, and Tesla's fleet of vehicles continues to rack up vast amounts of data to help improve its FSD.

As the rollout expands, and Tesla potentially deals with its flagging Model Y sales by releasing an affordable Model Y as planned in the fourth quarter, its stock price can appreciate through 2025. However, be aware that any significant issue with the rollout is likely to hurt the stock. Tesla is risky, but the risk comes with a potential reward in this case.