If you commit to investing in a couple of stocks for the long term, it's a good idea to put money in companies where you have a high degree of confidence that they will generate profits for years. Given that framework, I think advanced materials company Hexcel (HXL -0.03%) and machine vision company Cognex (CGNX 2.06%) are two stocks worth looking at. Here's why. 

1. Hexcel: More planes, more lightweight composite content

Hexcel manufactures and sells advanced lightweight composite materials and engineered materials. Its key end market is commercial aerospace (60% of sales), with space & defense also heavily represented (29%). The company also sells into industrial end markets (11%), most notably in the wind power industry.

A look at its key customers frames the case for buying into the stock. Key customers include Airbus (38% of 2022 sales), with Boeing (14%) coming in second. However, Hexcel's content on Airbus and Boeing planes also comes from selling to various aerospace suppliers, including General Electric, RTX, and Spirit AeroSystems, among many others. On the defense side, Lockheed Martin is a key customer, as is Vestas in wind energy

Everything points to the increased use of lightweight composites in Hexcel's key end markets. For example, Boeing's CEO Dave Calhoun has already told investors that composites will be a significant part of any new plane the company develops. That's driven by the cost and durability advantages of using advanced composites over traditional materials such as aluminum. Hexcel claims its carbon fiber is five times stronger than aluminum and 30% lighter. That reduces lifecycle costs and makes airplanes more fuel efficient. 

These qualities mean composite materials contribute an ever-increasing amount of content by weight. I've highlighted a few examples below comparing legacy with updated models by illustration. 

Composite Content by Weight

Legacy Airplane

Updated Model

Hexcel Shipset Value (Latest Models)

Boeing 737/Boeing 737 MAX

10%

15%

$0.2 million to $0.5 million

Airbus A320/Airbus A320 neo

10%

15%

$0.2 million to $0.5 million

Boeing 787

n/a

>50%

$1 million to $2 million

Boeing 777/Boeing 777X

11%

30%

$1 million to $2 million

Airbus A350

n/a

53%

$4.5 million to $5 million

Data source: Hexcel presentations.

Given the multi-year airplane backlogs at Airbus and Boeing and the increasing content on newer airplanes that Hexcel can expect to win, the company's long-term growth prospects look excellent.

2. Cognex's best days are ahead 

A quick look at the company's revenue and earnings before interest, taxation, depreciation, and amortization (EBITDA) growth over the years demonstrates how aggressively it can grow its top line. However, the peaks and troughs indicate how volatile growth can be. 

Along the way, Cognex has acquired some high-profile customers. The company didn't disclose its two major consumer electronics and logistics customers (each responsible for 11% of its revenue in 2022). Still, I'm willing to bet they are Apple (previously disclosed as its major customer) and Amazon

That's great news over the long term, but it's not so good in 2023. Declining smartphone sales (including sales of the iPhone) and other areas of weakness in consumer electronics have pressured the investment plans of companies in the industry. Moreover, Cognex's major end market in logistics (e-commerce fulfillment) has seen a significant retraction this year as Amazon and others cut back on spending after a few years of torrid growth accelerated by the pandemic.

Other companies with exposure to e-commerce warehouse capital spending, like Honeywell, are also seeing fragile conditions -- Honeywell's warehouse and workflow solutions sales were down 37% in the second quarter on a year-over-year basis.

In addition, Cognex's third primary market, automotive, is seeing some headwinds in internal combustion engine (ICE) models. Carmakers have a lot of inventory due to sluggish sales and aren't rushing to produce more cars. 

An investing thinking.

Image source: Getty Images.

It will get better for Cognex

But here's the thing: All of the issues mentioned above are cyclical and will likely turn positive when the interest rate cycle turns again. Consumers will purchase electronics and cars, and e-commerce spending isn't going away anytime soon. 

Meanwhile, the increasing adoption of automation, notably machine vision, is an excellent bet over the long term -- Cognex's machine vision solutions help improve quality control, are more accurate and faster than humans, and save costs because they can be run 24/7 in an automated environment. 

As such, Cognex is likely to return to a growth track and now could be a great time to buy into the stock.