# ShapeIntersect¶

class ShapeIntersect : public feasst::Shape

Represents the intersection of two shapes. An intersection of two shapes is the region which is inside both shapes. This is implemented by returning the largest value of the nearest distance.

Subclassed by feasst::FiniteCylinder, feasst::Slab, feasst::SlabSine

Public Functions

ShapeIntersect(std::shared_ptr<Shape> shape1, std::shared_ptr<Shape> shape2)

Constructor.

bool is_inside(const Position &point) const

Return true if the point is inside of the shape.

bool is_inside(const Position &point, const double diameter) const

Return true if the sphere of given center point and diameter is entirely inside of the shape.

double nearest_distance(const Position &point) const

Return the distance from the point to the nearest point on the surface. The distance is negative if the point is inside of the shape and positive if it is outside.