({{, (RefLink[CapForm, paclet:ref/CapForm])[type] 
is a graphics primitive that specifies what type of caps should be used at the ends of lines, tubes, and related primitives.}})

OpenersNotesSection(Spacer1)Details

The following types can be used in (RefLink[CapForm, paclet:ref/CapForm])[type]:

(RefLink[CapForm, paclet:ref/CapForm]) works in both 2D and 3D.

In 2D, the default is (RefLink[CapForm, paclet:ref/CapForm])["Square"]. In 3D, the default is (RefLink[CapForm, paclet:ref/CapForm])["Round"].

(RefLink[CapForm, paclet:ref/CapForm]) applies to (RefLink[Line, paclet:ref/Line]), (RefLink[Tube, paclet:ref/Tube]), (RefLink[Circle, paclet:ref/Circle]), and (RefLink[Arrow, paclet:ref/Arrow]).

(RefLink[CapForm, paclet:ref/CapForm]) specifications are ignored where an arrowhead appears.

(RefLink[CapForm, paclet:ref/CapForm])[(RefLink[None, paclet:ref/None])] leaves 3D shapes open at their end points.

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

A rounded line cap:

Graphics[{CapForm["Round"],Thickness[0.2],Line[{{-1,-1},{1,1}}]}]

A rounded tube cap:

Graphics3D[{CapForm["Round"],Tube[{{-1,-1,-1},{1,1,1}},0.2]}]

OpenersExampleSection1(Spacer1)Scope  (3)

2D and 3D line caps:

Table[Graphics[{CapForm[cap],Thickness[.2],Line[{{-1,-1},{1,1}}]},PlotRange->1.5,PlotLabel->cap],{cap,{"Butt","Round","Square"}}]

Table[Graphics3D[{CapForm[cap],Thickness[.1],Line[{{-1,-1,-1},{1,1,1}}]},PlotRange->1.5,PlotLabel->cap],{cap,{"Butt","Round","Square"}}]

Specify caps of circular arcs:

Table[Graphics[{CapForm[cap],Thickness[.2],Circle[{0,-1},1,{Pi/6,5Pi/6}]},PlotRange->1.5,PlotLabel->cap],{cap,{"Butt","Round","Square"}}]

Tube caps:

Table[Graphics3D[{CapForm[cap],Tube[{{-1,-1,-1},{1,1,1}},0.2]},PlotRange->1.5,PlotLabel->Row[{cap}]],{cap,{None,"Butt","Round","Square"}}]

OpenersExampleSection3(Spacer1)Neat Examples  (1)

Different line cap and join forms:

With[{points={{0,0.3},{-0.5,0},{0.5,0},{0.3,0.3}}},Graphics[{Thickness[0.1],{Blue,CapForm["Square"],JoinForm["Miter"],Line[points]},{Green,CapForm["Round"],JoinForm["Round"],Line[points]},{Red,CapForm["Butt"],JoinForm["Bevel"],Line[points]}},PlotRange->1]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[JoinForm, paclet:ref/JoinForm])  ▪  (RefLink[Disk, paclet:ref/Disk])  ▪  (RefLink[Arrowheads, paclet:ref/Arrowheads])  ▪  (RefLink[Thickness, paclet:ref/Thickness])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graphics Directives, paclet:guide/GraphicsDirectives])}})}})