OpenSCAD Candy Cane Ornament example

OpenSCAD examples
/

Candy Cane Ornament

Intermediate

Holiday

Lesson 27 of 28

Combine a straight shaft and a half-ring hook, then add stripes that follow both and a message along the shaft.

Try changing:

top_textsymbolbottom_texttext_relieflengthwidthhook_radiusstripesthicknessstripe_heightloop_hole

Low compile complexity. Flat 2D booleans and one line of text; compiles quickly.

How this model works

The cane outline is a rectangle for the shaft and half of a ring (two circles subtracted, cut in half by a square) for the hook, with round end caps. Slanted strips cover the shaft and rotated wedges continue around the hook, and intersecting them with the cane keeps them on its surface. A label area is removed from the stripes, and the message runs along it. The row size comes from the estimated length of both texts, so long names shrink instead of running off the label; the line is centered on that estimate, and the texts are anchored on either side of the symbol so they never overlap it. The stripes and letters start at the same height, so one filament change at that layer prints both in red.

Untitled project

main.scad

Loading draft

Ctrl/Cmd+Enter or F5: preview · F6: render · Ctrl/Cmd+F: search · Ctrl+Space: complete · Tab: leave editor

0 messages

Make it your own

Make a longer cane with more stripes and a smaller hook. Then try a single long name with symbol set to None and check that it still fits the label.

Change one parameter at a time and inspect the result. Use the workspace reset action to return to this lesson’s original model.

FAQ