CapsuleShape

CapsuleShape[{{x1,y1,z1},{x2,y2,z2}},r]

represents the filled capsule between points {xi,yi,zi} and radius r.

Details and Options

Examples

open allclose all

Basic Examples  (2)

The standard capsule centered at the origin:

Volume and centroid:

Scope  (19)

Graphics  (9)

Specification  (4)

The standard capsule:

Capsules with different endpoints:

Capsules with different radii:

Short form for a capsule at the origin:

Styling  (4)

Colored capsules:

Different properties can be specified for the front and back of faces using FaceForm:

Capsules with different specular exponents:

White capsule that glows red:

Opacity specifies the face opacity:

Coordinates  (1)

Points can be Dynamic:

Regions  (10)

Embedding dimension is the dimension of the space in which the capsule lives:

Geometric dimension is the dimension of the shape itself:

Membership testing:

Get conditions for point membership:

Volume:

Centroid:

Distance from a point:

Signed distance from a point:

Nearest point in the region:

Nearest points to an enclosing sphere:

A capsule is bounded:

Find its range:

Integrate over a capsule region:

Optimize over a capsule region:

Solve equations in a capsule region:

Applications  (6)

Visualize the Platonic solids using CapsuleShape for the edges:

Use CapsuleShape to render edges in a GraphPlot3D:

Use CapsuleShape to render edges in 3D for Graph objects:

Embed the graph in 3D and use CapsuleShape:

Use CapsuleShape to render edges in 3D BoundaryMeshRegion and MeshRegion objects:

Using a series of capsules (and a ball), you can create a stick figure:

Furthermore, you can use RotationTransform to make the stick figure's limbs pivot:

CO2 cartridges have many applications, ranging from sports to soda-making to life jackets. A 12g CO2 cartridge is about 18.6 mm in diameter and 82.5 mm long, with a neck about 12 mm long and 7.3 mm in diameter:

It can be approximated as a capsule and a cylinder:

Knowing that the ideal gas law states , where is the universal gas constant, find the volume of the gas within the cartridge at standard temperature and pressure (273.15 K and 1 bar):

Find the ratio of the normal to compressed volume:

Properties & Relations  (6)

The 2D version of CapsuleShape is StadiumShape:

Ball is the limit of CapsuleShape as p1 approaches p2:

A CapsuleShape formed from the RegionUnion of balls and a cylinder:

The volume is the sum of ball and cylinder volumes:

CapsuleShape is all points at most from a Line:

ImplicitRegion can represent any CapsuleShape:

A rounded Tube looks like a CapsuleShape:

Neat Examples  (3)

Random unit capsules:

Sweep a capsule around an axis:

Nested transparent capsules:

Wolfram Research (2015), CapsuleShape, Wolfram Language function, https://reference.wolfram.com/language/ref/CapsuleShape.html.

Text

Wolfram Research (2015), CapsuleShape, Wolfram Language function, https://reference.wolfram.com/language/ref/CapsuleShape.html.

CMS

Wolfram Language. 2015. "CapsuleShape." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CapsuleShape.html.

APA

Wolfram Language. (2015). CapsuleShape. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CapsuleShape.html

BibTeX

@misc{reference.wolfram_2024_capsuleshape, author="Wolfram Research", title="{CapsuleShape}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/CapsuleShape.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_capsuleshape, organization={Wolfram Research}, title={CapsuleShape}, year={2015}, url={https://reference.wolfram.com/language/ref/CapsuleShape.html}, note=[Accessed: 22-December-2024 ]}