MEDYAN.boundary_capsule

Tuple{}

boundary_capsule(
;
    radius,
    center,
    axis,
    stiffness,
    collision_layers,
    no_collide_mask
)

Return a capsule boundary.

A bead a distance d past the capsule surface has energy 1/2 * stiffness * d^2 and is pushed back toward the surface.

radius::Float64(nm): Radius of capsule, the full length of the capsule is norm(axis) + 2*abs(radius). If negative, the domain is the outside of the capsule, if positive the domain is the inside of the capsule.

center::SVector{3,Float64}=SA[0.0,0.0,0.0](nm): The center of the capsule.

axis::SVector{3,Float64}=SA[0.0,0.0,0.0](nm): The direction and length of the capsule spine. The spine line segment goes from center - axis/2 to center + axis/2. If zero the capsule is a sphere.

stiffness::Float64=1.0(pN/nm): How strong the boundary is.

collision_layers::UInt32=UInt32(1): Collision layers bitmask.

no_collide_mask::UInt32=UInt32(0): No-collide mask bitmask. Bits set = layers this capsule will not collide with. The default collides with everything. See the “Collision Layers and No-Collide Masks” explanation page.

Example

# inside a sphere of radius 400 nm
boundary_capsule(; radius=400.0, stiffness=100.0)

# outside a ball of radius 50 nm at z = 300 nm
boundary_capsule(; center=SA[0.0, 0.0, 300.0], radius=-50.0, stiffness=100.0)

See also Boundary, set_mech_boundary!