Navigation

Domains provide a way to describe regions of space in Lepton. These regions can
be used for things like collision detection or to constrain the initial values
for attributes of new particles created via a ParticleEmitter.

Return the closest point in the domain to the given point
and a normal vector at that point.

The point returned is always the domain point.

The normal returned for a point domain is a unit vector parallel to
the line formed between the supplied point and the domain point,
facing outward from the domain. This effectively treats the point
domain like a zero-radius sphere.

apex – End point of cone axis at the apex where it tapers to zero radius.
base – End point of cone axis at the base of the cone.
outer_radius – The outer radius of the cone volume.
inner_radius – The inner radius of the cone, must be <= outer_radius.
Describes the radius of a smaller cone that is subtracted from the larger
cone described by the outer_radius. defaults to 0, which creates a solid volume

end_point0 – End point of cylinder axis
end_point1 – End point of cylinder axis
outer_radius – The outer radius of the cylinder volume.
inner_radius – The inner radius of the cylinder, must be <= outer_radius.
defaults to 0, which creates a solid volume

center – The center point of the disc (3-number sequence)
normal – Normal vector perpendicular to the disc. This need not
be a unit vector.
outer_radius – The outer radius of the disc.
inner_radius – The inner radius of the disc, must be <= outer_radius.
defaults to 0, which creates a solid circle

point – Any point in the plane (3-number sequence)
normal – Normal vector perpendicular to the plane. This need not
be a unit vector. The half-space contained by the plane is opposite
the direction of the normal.

Intersect the line segment with the plane return the intersection
point and normal vector pointing into space on the same side of the
plane as the start point.

If the line does not intersect, or lies completely in the plane
return (None, None)

class lepton.domain.Point(point)

Simple single point domain

closest_point_to(point)

Return the closest point in the domain to the given point
and a normal vector at that point.

The point returned is always the domain point.

The normal returned for a point domain is a unit vector parallel to
the line formed between the supplied point and the domain point,
facing outward from the domain. This effectively treats the point
domain like a zero-radius sphere.

Intersect the line segment with the sphere and return the first
intersection point and normal vector pointing into space from
the sphere intersection point. If the sphere has an inner radius,
the intersection can occur on the inner or outer shell surface.

For the line segment defined by the start and end point specified
(coordinate 3-tuples), return the point closest to the start point
where the line segment intersects surface of the domain, and the
surface normal unit vector at that point as a 2-tuple. If the line
segment does not intersect the domain, return the 2-tuple (None,
None).

Only 2 or 3 dimensional domains may be intersected.

Note performance is more important than absolute accuracy with this
method, so approximations are acceptable.