https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16class LineSegment;
17
21class Triangle : public GeometryBase
22{
23public:
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
49private:
51};
Ball primitive: a circle in 2D or a sphere in 3D.
Definition Ball.h:35
Base class for geometry primitives.
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff.
Definition LineSegment.h:31
Triangle geometry helper.
Definition Triangle.h:22
libMesh::Point _p2
Definition Triangle.h:50
libMesh::Point _p0
Definition Triangle.h:50
libMesh::Point normal() const
Normal vector of the triangle.
Definition Triangle.C:24
~Triangle() override=default
bool intersect(const LineSegment &l, libMesh::Point &intersect_p) const
Check if a line segment intersects this triangle.
Definition Triangle.C:38
Ball computeBoundingBall() const override
Compute a bounding ball for this triangle.
Definition Triangle.C:91
Triangle()=default
libMesh::Point _p1
Definition Triangle.h:50