https://mooseframework.inl.gov
Triangle.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "Ball.h"
13 #include "GeometryBase.h"
14 #include "libmesh/point.h"
15 
16 class LineSegment;
17 
21 class Triangle : public GeometryBase
22 {
23 public:
24  Triangle() = default;
25  Triangle(const libMesh::Point & p0, const libMesh::Point & p1, const libMesh::Point & p2);
26 
27  ~Triangle() override = default;
28 
32  libMesh::Point normal() const;
33 
37  bool intersect(const LineSegment & l, libMesh::Point & intersect_p) const;
38 
42  bool intersect(const LineSegment & line_segment) const override;
43 
47  Ball computeBoundingBall() const override;
48 
49 private:
51 };
Ball primitive: a circle in 2D or a sphere in 3D.
Definition: Ball.h:34
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff...
Definition: LineSegment.h:30
Ball computeBoundingBall() const override
Compute a bounding ball for this triangle.
Definition: Triangle.C:88
Triangle()=default
libMesh::Point _p2
Definition: Triangle.h:50
Triangle geometry helper.
Definition: Triangle.h:21
bool intersect(const LineSegment &l, libMesh::Point &intersect_p) const
Check if a line segment intersects this triangle.
Definition: Triangle.C:35
libMesh::Point _p1
Definition: Triangle.h:50
libMesh::Point normal() const
Normal vector of the triangle.
Definition: Triangle.C:23
Base class for geometry primitives.
Definition: GeometryBase.h:18
libMesh::Point _p0
Definition: Triangle.h:50
~Triangle() override=default