NetDEM v1.0
Loading...
Searching...
No Matches
shape_point_sphere.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "shape.hpp"
4#include <iostream>
5
6namespace netdem {
7
19class PointSphere : public Shape {
20public:
27 double node_area_corrector{0.01};
28
33
39 PointSphere(double d);
40
48 Shape *Clone() const override;
49
58 nlohmann::json PackJson() override;
59
68 void InitFromJson(nlohmann::json const &js) override;
69
76 void Init();
77
84 void UpdateSurfaceNodes() override;
85
92 void UpdateShapeProperties() override;
93
104 STLModel GetSTLModel(int num_nodes = 200) override;
105
118 Vec3d SupportPoint(Vec3d const &dir) override;
119
132 VecXT<Vec3d> SupportPoints(Vec3d const &dir) override;
133
145 double SignedDistance(Vec3d const &pos) const override;
146
159 Vec3d SurfacePoint(Vec3d const &pos) override;
160
167 void Print() override;
168};
169
170} // namespace netdem
A class representing a point sphere with a given diameter.
Definition shape_point_sphere.hpp:19
double node_area_corrector
A factor to be multiplied with the node area, to make the contact behavior be equivalent to that of r...
Definition shape_point_sphere.hpp:27
void UpdateSurfaceNodes() override
Update the surface nodes of the PointSphere object.
Definition shape_point_sphere.cpp:48
Vec3d SurfacePoint(Vec3d const &pos) override
Compute the surface point on the PointSphere object closest to a given position.
Definition shape_point_sphere.cpp:112
Vec3d SupportPoint(Vec3d const &dir) override
Compute the support point of the PointSphere object in a given direction.
Definition shape_point_sphere.cpp:99
void InitFromJson(nlohmann::json const &js) override
Initialize the PointSphere object from a JSON structure.
Definition shape_point_sphere.cpp:33
Shape * Clone() const override
Clone the PointSphere object.
Definition shape_point_sphere.cpp:29
PointSphere()
Default constructor.
Definition shape_point_sphere.cpp:11
STLModel GetSTLModel(int num_nodes=200) override
Generate an STL model of the PointSphere object.
Definition shape_point_sphere.cpp:83
nlohmann::json PackJson() override
Pack the PointSphere object into a JSON structure.
Definition shape_point_sphere.cpp:31
double SignedDistance(Vec3d const &pos) const override
Compute the signed distance from a given position to the surface of the PointSphere object.
Definition shape_point_sphere.cpp:107
void UpdateShapeProperties() override
Update the shape properties of the PointSphere object.
Definition shape_point_sphere.cpp:56
void Init()
Initialize the PointSphere object.
Definition shape_point_sphere.cpp:41
void Print() override
Print information about the PointSphere object.
Definition shape_point_sphere.cpp:117
VecXT< Vec3d > SupportPoints(Vec3d const &dir) override
Compute the support points of the PointSphere object in a given direction.
Definition shape_point_sphere.cpp:101
Class for working with STL models.
Definition stl_model.hpp:17
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18